aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_pass.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-05-30 14:10:42 +0200
committerSamuel Pitoiset <[email protected]>2019-06-07 13:11:08 +0200
commitd0d41e58c3c614f7a3191e94a5327916d23f0142 (patch)
treebbce819e92932c248db0b137d534bd5f6bebffcb /src/amd/vulkan/radv_pass.c
parentf58e9f6d696288297b3e9012ae625dda59735a21 (diff)
radv: determine the first subpass id for every attachments
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-By: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pass.c')
-rw-r--r--src/amd/vulkan/radv_pass.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pass.c b/src/amd/vulkan/radv_pass.c
index 4d1e38a780e..8fa098eaac8 100644
--- a/src/amd/vulkan/radv_pass.c
+++ b/src/amd/vulkan/radv_pass.c
@@ -64,6 +64,22 @@ radv_render_pass_compile(struct radv_render_pass *pass)
{
for (uint32_t i = 0; i < pass->subpass_count; i++) {
struct radv_subpass *subpass = &pass->subpasses[i];
+
+ 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->first_subpass_idx = UINT32_MAX;
+ }
+ }
+
+ for (uint32_t i = 0; i < pass->subpass_count; i++) {
+ struct radv_subpass *subpass = &pass->subpasses[i];
uint32_t color_sample_count = 1, depth_sample_count = 1;
/* We don't allow depth_stencil_attachment to be non-NULL and
@@ -84,6 +100,8 @@ radv_render_pass_compile(struct radv_render_pass *pass)
struct radv_render_pass_attachment *pass_att =
&pass->attachments[subpass_att->attachment];
+ if (i < pass_att->first_subpass_idx)
+ pass_att->first_subpass_idx = i;
pass_att->last_subpass_idx = i;
}