Module: Mesa
Branch: staging/23.3
Commit: 5aab597ecb019e841cf14b6775991a7ff4fd1530
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5aab597ecb019e841cf14b6775991a7ff4fd1530

Author: Mike Blumenkrantz <michael.blumenkra...@gmail.com>
Date:   Tue Jan  9 15:10:51 2024 -0500

zink: ignore tc buffer replacement info

without tc tracking cross-context buffer usage, this is intensely broken

Fixes: 96cf4531e11 ("Revert "gallium/u_threaded: buffer sharedness tracking"")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26959>
(cherry picked from commit 0444d057ae6b0765cefa760845bed488396f9fde)

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/zink/zink_context.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 40f3634c46d..590e516c0a9 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1384,7 +1384,7 @@
         "description": "zink: ignore tc buffer replacement info",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "96cf4531e11eac8175671be990a02c7b5d17fb60",
         "notes": null
diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index 28afec232eb..1a11042c388 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -4932,6 +4932,11 @@ zink_context_replace_buffer_storage(struct pipe_context 
*pctx, struct pipe_resou
    zink_resource_copies_reset(d);
    /* force counter buffer reset */
    d->so_valid = false;
+   /* FIXME: tc buffer sharedness tracking */
+   if (!num_rebinds) {
+      num_rebinds = d->bind_count[0] + d->bind_count[1];
+      rebind_mask = 0;
+   }
    if (num_rebinds && rebind_buffer(ctx, d, rebind_mask, num_rebinds) < 
num_rebinds)
       ctx->buffer_rebind_counter = 
p_atomic_inc_return(&screen->buffer_rebind_counter);
 }

Reply via email to