Mesa (main): tu: Consider depth/stencil for implicit dependencies

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 17 19:18:51 UTC 2021


Module: Mesa
Branch: main
Commit: 2df5387e385bd332c24ad7376c8363db21897610
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2df5387e385bd332c24ad7376c8363db21897610

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Mon Aug 16 12:04:47 2021 +0200

tu: Consider depth/stencil for implicit dependencies

Noticed by inspection.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12386>

---

 src/freedreno/vulkan/tu_pass.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c
index f29d8054258..feef006c3cd 100644
--- a/src/freedreno/vulkan/tu_pass.c
+++ b/src/freedreno/vulkan/tu_pass.c
@@ -235,6 +235,15 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass,
          att_used[a] = true;
       }
 
+      if (subpass->pDepthStencilAttachment &&
+          subpass->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
+         uint32_t a = subpass->pDepthStencilAttachment->attachment;
+         if (att[a].initialLayout != subpass->pDepthStencilAttachment->layout &&
+             !att_used[a] && !has_external_src[i])
+            src_implicit_dep = true;
+         att_used[a] = true;
+      }
+
       if (subpass->pResolveAttachments) {
          for (unsigned j = 0; j < subpass->colorAttachmentCount; j++) {
             uint32_t a = subpass->pResolveAttachments[j].attachment;
@@ -247,6 +256,18 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass,
          }
       }
 
+      const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
+         vk_find_struct_const(subpass->pNext, SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);
+
+      if (ds_resolve && ds_resolve->pDepthStencilResolveAttachment &&
+          ds_resolve->pDepthStencilResolveAttachment->attachment != VK_ATTACHMENT_UNUSED) {
+            uint32_t a = ds_resolve->pDepthStencilResolveAttachment->attachment;
+            if (att[a].initialLayout != subpass->pDepthStencilAttachment->layout &&
+               !att_used[a] && !has_external_src[i])
+               src_implicit_dep = true;
+            att_used[a] = true;
+      }
+
       if (src_implicit_dep) {
          tu_render_pass_add_subpass_dep(pass, &(VkSubpassDependency2KHR) {
             .srcSubpass = VK_SUBPASS_EXTERNAL,
@@ -290,6 +311,15 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass,
          att_used[a] = true;
       }
 
+      if (subpass->pDepthStencilAttachment &&
+          subpass->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
+         uint32_t a = subpass->pDepthStencilAttachment->attachment;
+         if (att[a].finalLayout != subpass->pDepthStencilAttachment->layout &&
+             !att_used[a] && !has_external_dst[i])
+            dst_implicit_dep = true;
+         att_used[a] = true;
+      }
+
       if (subpass->pResolveAttachments) {
          for (unsigned j = 0; j < subpass->colorAttachmentCount; j++) {
             uint32_t a = subpass->pResolveAttachments[j].attachment;
@@ -302,6 +332,18 @@ tu_render_pass_add_implicit_deps(struct tu_render_pass *pass,
          }
       }
 
+      const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
+         vk_find_struct_const(subpass->pNext, SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);
+
+      if (ds_resolve && ds_resolve->pDepthStencilResolveAttachment &&
+          ds_resolve->pDepthStencilResolveAttachment->attachment != VK_ATTACHMENT_UNUSED) {
+            uint32_t a = ds_resolve->pDepthStencilResolveAttachment->attachment;
+            if (att[a].finalLayout != subpass->pDepthStencilAttachment->layout &&
+               !att_used[a] && !has_external_dst[i])
+               dst_implicit_dep = true;
+            att_used[a] = true;
+      }
+
       if (dst_implicit_dep) {
          tu_render_pass_add_subpass_dep(pass, &(VkSubpassDependency2KHR) {
             .srcSubpass = i,



More information about the mesa-commit mailing list