anv: Prepare for transitioning to the requested final layout
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 9 Jan 2017 18:44:36 +0000 (10:44 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Fri, 13 Jan 2017 04:52:20 +0000 (20:52 -0800)
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_pass.c
src/intel/vulkan/anv_private.h

index ea86fa9ff282ff96fe80bcf85772630573064be7..5df6330c6af635a15cf647684e5de11c2855f7bb 100644 (file)
@@ -118,6 +118,7 @@ VkResult anv_CreateRenderPass(
             subpass->input_attachments[j] = a;
             pass->attachments[a].usage |= VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
             pass->attachments[a].subpass_usage[i] |= ANV_SUBPASS_USAGE_INPUT;
+            pass->attachments[a].last_subpass_idx = i;
 
             if (desc->pDepthStencilAttachment &&
                 a == desc->pDepthStencilAttachment->attachment)
@@ -134,6 +135,7 @@ VkResult anv_CreateRenderPass(
             subpass->color_attachments[j] = a;
             pass->attachments[a].usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
             pass->attachments[a].subpass_usage[i] |= ANV_SUBPASS_USAGE_DRAW;
+            pass->attachments[a].last_subpass_idx = i;
          }
       }
 
@@ -156,6 +158,7 @@ VkResult anv_CreateRenderPass(
                   ANV_SUBPASS_USAGE_RESOLVE_SRC;
                pass->attachments[a].subpass_usage[i] |=
                   ANV_SUBPASS_USAGE_RESOLVE_DST;
+               pass->attachments[a].last_subpass_idx = i;
             }
          }
       }
index a4e6cb282b844f71ef8be093c7bd089bff430572..a3a958f7bd3f8719ee9fba2c52d93c021f997fa6 100644 (file)
@@ -1770,6 +1770,9 @@ struct anv_render_pass_attachment {
 
    /* An array, indexed by subpass id, of how the attachment will be used. */
    enum anv_subpass_usage *                     subpass_usage;
+
+   /* The subpass id in which the attachment will be used last. */
+   uint32_t                                     last_subpass_idx;
 };
 
 struct anv_render_pass {