diff options
author | Samuel Pitoiset <[email protected]> | 2019-01-29 22:18:53 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-02-04 13:17:59 +0100 |
commit | 5699ac0078520396ce003b2482bf17942e157322 (patch) | |
tree | 0b6a8123d3704a82b9813078d766d51feb02ff5a /src/amd | |
parent | e1a0a268c63f2beb4b88586e8060c3f98e37a654 (diff) |
radv: determine the last subpass id for every attachments
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_pass.c | 12 | ||||
-rw-r--r-- | src/amd/vulkan/radv_private.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pass.c b/src/amd/vulkan/radv_pass.c index 1102ef689b2..ac9f9381216 100644 --- a/src/amd/vulkan/radv_pass.c +++ b/src/amd/vulkan/radv_pass.c @@ -42,6 +42,18 @@ radv_render_pass_compile(struct radv_render_pass *pass) if (subpass->depth_stencil_attachment && subpass->depth_stencil_attachment->attachment == VK_ATTACHMENT_UNUSED) subpass->depth_stencil_attachment = NULL; + + for (uint32_t j = 0; j < subpass->attachment_count; j++) { + struct radv_subpass_attachment *subpass_att = + &subpass->attachments[j]; + if (subpass_att->attachment == VK_ATTACHMENT_UNUSED) + continue; + + struct radv_render_pass_attachment *pass_att = + &pass->attachments[subpass_att->attachment]; + + pass_att->last_subpass_idx = i; + } } } diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 4863841a0ac..3d1782b559d 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -1841,6 +1841,9 @@ struct radv_render_pass_attachment { VkAttachmentLoadOp stencil_load_op; VkImageLayout initial_layout; VkImageLayout final_layout; + + /* The subpass id in which the attachment will be used last. */ + uint32_t last_subpass_idx; }; struct radv_render_pass { |