anv/pass: Fix size of anv_render_pass:subpass_attachments
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 27 Feb 2017 17:38:25 +0000 (09:38 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Thu, 2 Mar 2017 21:17:55 +0000 (13:17 -0800)
Don't allocate space for resolve attachments if the subpass has none.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_pass.c

index 399ccb3970ff17cf33bd0eb6418d7c5b12811509..5bd205d2f030438faf86c4e4a8437ae42729aeea 100644 (file)
@@ -88,8 +88,7 @@ VkResult anv_CreateRenderPass(
       subpass_attachment_count +=
          desc->inputAttachmentCount +
          desc->colorAttachmentCount +
-         /* Count colorAttachmentCount again for resolve_attachments */
-         desc->colorAttachmentCount;
+         (desc->pResolveAttachments ? desc->colorAttachmentCount : 0);
    }
 
    pass->subpass_attachments =