Module: Mesa
Branch: staging/23.0
Commit: ec2d274d04d2f4403760233230dc676a37b03109
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec2d274d04d2f4403760233230dc676a37b03109

Author: Mike Blumenkrantz <[email protected]>
Date:   Sat Mar 18 08:41:00 2023 -0400

zink: double check layouts for possible feedback loop images

if a feedback loop hasn't yet been added for an image with both
descriptor and fb binds, queue a check for that to avoid mismatch

affects godot-tps-gles3-high.trace

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
(cherry picked from commit 63f425c7d256e2931581bb983fee63eee67fb081)

---

 .pick_status.json                       |  6 +++---
 src/gallium/drivers/zink/zink_context.c | 13 +++++++++----
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index e639fa95ab1..414541a3561 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -6151,7 +6151,7 @@
         "description": "zink: double check layouts for possible feedback loop 
images",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
@@ -6718,7 +6718,7 @@
         "description": "aux/tc: fix renderpass splitting on flush",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "07017aa137b9fa48ec25ef5d1e3fd2d137beb651"
     },
@@ -6736,7 +6736,7 @@
         "description": "aux/tc: flag late zs clears as partial clears",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "07017aa137b9fa48ec25ef5d1e3fd2d137beb651"
     },
diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index 5d18ba287d3..2877397e297 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1625,10 +1625,15 @@ check_for_layout_update(struct zink_context *ctx, 
struct zink_resource *res, boo
 {
    VkImageLayout layout = res->bind_count[is_compute] ? 
zink_descriptor_util_image_layout_eval(ctx, res, is_compute) : 
VK_IMAGE_LAYOUT_UNDEFINED;
    VkImageLayout other_layout = res->bind_count[!is_compute] ? 
zink_descriptor_util_image_layout_eval(ctx, res, !is_compute) : 
VK_IMAGE_LAYOUT_UNDEFINED;
-   if (res->bind_count[is_compute] && layout && res->layout != layout)
-      _mesa_set_add(ctx->need_barriers[is_compute], res);
-   if (res->bind_count[!is_compute] && other_layout && (layout != other_layout 
|| res->layout != other_layout))
-      _mesa_set_add(ctx->need_barriers[!is_compute], res);
+   if (!is_compute && res->fb_binds && !(ctx->feedback_loops & res->fb_binds)) 
{
+      /* always double check feedback loops */
+      _mesa_set_add(ctx->need_barriers[0], res);
+   } else {
+      if (res->bind_count[is_compute] && layout && res->layout != layout)
+         _mesa_set_add(ctx->need_barriers[is_compute], res);
+      if (res->bind_count[!is_compute] && other_layout && (layout != 
other_layout || res->layout != other_layout))
+         _mesa_set_add(ctx->need_barriers[!is_compute], res);
+   }
 }
 
 static void

Reply via email to