v3dv: fix incorrect attachment reference
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 6 Apr 2020 08:19:53 +0000 (10:19 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:29 +0000 (21:21 +0000)
We were using the subpass render target index to index into the framebuffer,
which is not correct, since the framebuffer is defined for the render pass.
We should use the attachment index instead, which we were already computing
but that we were not actually using for indexing by mistake.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>

src/broadcom/vulkan/v3dv_device.c

index 6dbf38a..6a25e23 100644 (file)
@@ -1739,7 +1739,7 @@ v3dv_framebuffer_compute_internal_bpp(const struct v3dv_framebuffer *framebuffer
          if (att_idx == VK_ATTACHMENT_UNUSED)
             continue;
 
-         const struct v3dv_image_view *att = framebuffer->attachments[i];
+         const struct v3dv_image_view *att = framebuffer->attachments[att_idx];
          assert(att);
 
          if (att->aspects & VK_IMAGE_ASPECT_COLOR_BIT)