From 09e0b29bb63f60231b26b4c8f02eadb68e51b623 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 16 Aug 2021 11:59:03 +0200 Subject: [PATCH] tu: Fix logic errors with subpass implicit dependencies We were adding them if there was an external dep instead of if there wasn't, and we were skipping the entire subpass which would've resulted in attachments not getting marked as used. Part-of: --- .../ci/deqp-freedreno-a630-bypass-fails.txt | 4 ---- src/freedreno/vulkan/tu_pass.c | 24 +++++++++---------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/freedreno/ci/deqp-freedreno-a630-bypass-fails.txt b/src/freedreno/ci/deqp-freedreno-a630-bypass-fails.txt index 7c294084124..61587ebade3 100644 --- a/src/freedreno/ci/deqp-freedreno-a630-bypass-fails.txt +++ b/src/freedreno/ci/deqp-freedreno-a630-bypass-fails.txt @@ -3,7 +3,3 @@ dEQP-GLES31.functional.blend_equation_advanced.msaa.exclusion,Fail dEQP-GLES31.functional.blend_equation_advanced.msaa.hardlight,Fail dEQP-GLES31.functional.blend_equation_advanced.msaa.multiply,Fail dEQP-GLES31.functional.blend_equation_advanced.msaa.overlay,Fail -dEQP-VK.renderpass.dedicated_allocation.attachment_allocation.input_output.7,Fail -dEQP-VK.renderpass.suballocation.attachment_allocation.input_output.7,Fail -dEQP-VK.renderpass.suballocation.subpass_dependencies.implicit_dependencies.render_passes_5,Fail -dEQP-VK.renderpass2.suballocation.subpass_dependencies.implicit_dependencies.render_passes_3,Fail diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c index c67b3e6f1e1..f29d8054258 100644 --- a/src/freedreno/vulkan/tu_pass.c +++ b/src/freedreno/vulkan/tu_pass.c @@ -212,9 +212,6 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, memset(att_used, 0, sizeof(att_used)); for (unsigned i = 0; i < info->subpassCount; i++) { - if (!has_external_src[i]) - continue; - const VkSubpassDescription2 *subpass = &info->pSubpasses[i]; bool src_implicit_dep = false; @@ -222,7 +219,8 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, uint32_t a = subpass->pInputAttachments[j].attachment; if (a == VK_ATTACHMENT_UNUSED) continue; - if (att[a].initialLayout != subpass->pInputAttachments[j].layout && !att_used[a]) + if (att[a].initialLayout != subpass->pInputAttachments[j].layout && + !att_used[a] && !has_external_src[i]) src_implicit_dep = true; att_used[a] = true; } @@ -231,7 +229,8 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, uint32_t a = subpass->pColorAttachments[j].attachment; if (a == VK_ATTACHMENT_UNUSED) continue; - if (att[a].initialLayout != subpass->pColorAttachments[j].layout && !att_used[a]) + if (att[a].initialLayout != subpass->pColorAttachments[j].layout && + !att_used[a] && !has_external_src[i]) src_implicit_dep = true; att_used[a] = true; } @@ -241,7 +240,8 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, uint32_t a = subpass->pResolveAttachments[j].attachment; if (a == VK_ATTACHMENT_UNUSED) continue; - if (att[a].initialLayout != subpass->pResolveAttachments[j].layout && !att_used[a]) + if (att[a].initialLayout != subpass->pResolveAttachments[j].layout && + !att_used[a] && !has_external_src[i]) src_implicit_dep = true; att_used[a] = true; } @@ -267,9 +267,6 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, memset(att_used, 0, sizeof(att_used)); for (int i = info->subpassCount - 1; i >= 0; i--) { - if (!has_external_dst[i]) - continue; - const VkSubpassDescription2 *subpass = &info->pSubpasses[i]; bool dst_implicit_dep = false; @@ -277,7 +274,8 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, uint32_t a = subpass->pInputAttachments[j].attachment; if (a == VK_ATTACHMENT_UNUSED) continue; - if (att[a].finalLayout != subpass->pInputAttachments[j].layout && !att_used[a]) + if (att[a].finalLayout != subpass->pInputAttachments[j].layout && + !att_used[a] && !has_external_dst[i]) dst_implicit_dep = true; att_used[a] = true; } @@ -286,7 +284,8 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, uint32_t a = subpass->pColorAttachments[j].attachment; if (a == VK_ATTACHMENT_UNUSED) continue; - if (att[a].finalLayout != subpass->pColorAttachments[j].layout && !att_used[a]) + if (att[a].finalLayout != subpass->pColorAttachments[j].layout && + !att_used[a] && !has_external_dst[i]) dst_implicit_dep = true; att_used[a] = true; } @@ -296,7 +295,8 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass, uint32_t a = subpass->pResolveAttachments[j].attachment; if (a == VK_ATTACHMENT_UNUSED) continue; - if (att[a].finalLayout != subpass->pResolveAttachments[j].layout && !att_used[a]) + if (att[a].finalLayout != subpass->pResolveAttachments[j].layout && + !att_used[a] && !has_external_dst[i]) dst_implicit_dep = true; att_used[a] = true; }