summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2019-08-04 23:17:20 +0200
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2019-08-07 02:13:07 +0200
commita171a6663d779da4e685e028336f817d855dd4d8 (patch)
tree1967589f366c374d52d77a6fe83b12c046e18bdd /src
parenta5b9394b8758e2869c4074f7e2682b6e16b9697a (diff)
downloadmesa-a171a6663d779da4e685e028336f817d855dd4d8.tar.gz
radv: Add render loop detection in renderpass.
VK spec 7.3: "Applications must ensure that all accesses to memory that backs image subresources used as attachments in a given renderpass instance either happen-before the load operations for those attachments, or happen-after the store operations for those attachments." So the only renderloops we can have is with input attachments. Detect these. Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_pass.c18
-rw-r--r--src/amd/vulkan/radv_private.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pass.c b/src/amd/vulkan/radv_pass.c
index 688a17919bd..2b60a25535a 100644
--- a/src/amd/vulkan/radv_pass.c
+++ b/src/amd/vulkan/radv_pass.c
@@ -148,6 +148,24 @@ radv_render_pass_compile(struct radv_render_pass *pass)
subpass->has_color_resolve = true;
}
}
+
+ for (uint32_t j = 0; j < subpass->input_count; ++j) {
+ if (subpass->input_attachments[j].attachment == VK_ATTACHMENT_UNUSED)
+ continue;
+
+ for (uint32_t k = 0; k < subpass->color_count; ++k) {
+ if (subpass->color_attachments[k].attachment == subpass->input_attachments[j].attachment) {
+ subpass->input_attachments[j].in_render_loop = true;
+ subpass->color_attachments[k].in_render_loop = true;
+ }
+ }
+
+ if (subpass->depth_stencil_attachment &&
+ subpass->depth_stencil_attachment->attachment == subpass->input_attachments[j].attachment) {
+ subpass->input_attachments[j].in_render_loop = true;
+ subpass->depth_stencil_attachment->in_render_loop = true;
+ }
+ }
}
}
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index c0d30d747f4..ac5945cab57 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1971,6 +1971,7 @@ void radv_subpass_barrier(struct radv_cmd_buffer *cmd_buffer,
struct radv_subpass_attachment {
uint32_t attachment;
VkImageLayout layout;
+ bool in_render_loop;
};
struct radv_subpass {