anv: Add anv_subpass::has_resolve
authorChad Versace <chad.versace@intel.com>
Thu, 28 Jan 2016 02:03:34 +0000 (18:03 -0800)
committerChad Versace <chad.versace@intel.com>
Thu, 28 Jan 2016 18:03:00 +0000 (10:03 -0800)
Indicates that the subpass has at least one resolve attachment.

src/vulkan/anv_pass.c
src/vulkan/anv_private.h

index ccd8cedf561419b06d50c038b5e34e9a50309d2d..a8e85664d48b95aa67ad1c1fe700170d59cf1ae9 100644 (file)
@@ -118,8 +118,10 @@ VkResult anv_CreateRenderPass(
          p += desc->colorAttachmentCount;
 
          for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
-            subpass->resolve_attachments[j]
-               = desc->pResolveAttachments[j].attachment;
+            uint32_t a = desc->pResolveAttachments[j].attachment;
+            subpass->resolve_attachments[j] = a;
+            if (a != VK_ATTACHMENT_UNUSED)
+               subpass->has_resolve = true;
          }
       }
 
index 6e44e88e10c932c13b93748e13af4044d993f9ff..cad1e1fd5ff5e64f862c08dd19c7b38309dd27cd 100644 (file)
@@ -1712,6 +1712,9 @@ struct anv_subpass {
    uint32_t *                                   color_attachments;
    uint32_t *                                   resolve_attachments;
    uint32_t                                     depth_stencil_attachment;
+
+   /** Subpass has at least one resolve attachment */
+   bool                                         has_resolve;
 };
 
 struct anv_render_pass_attachment {