Mesa (staging/22.0): zink: adds refs to user index buffers when tc is not active

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 13 20:02:01 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 1d60d29486de2bbcb4e47f3efa4c7bb569ebbbb1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d60d29486de2bbcb4e47f3efa4c7bb569ebbbb1

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Apr  7 17:01:00 2022 -0400

zink: adds refs to user index buffers when tc is not active

there are no ref tricks to abuse in this case, so add our own ref

fixes #6273

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15807>
(cherry picked from commit fde2c1db88b0d221c67de2b510222abd483859ab)

---

 .pick_status.json                      | 2 +-
 src/gallium/drivers/zink/zink_draw.cpp | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index f12a2b90cef..0d9254d3b04 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1948,7 +1948,7 @@
         "description": "zink: adds refs to user index buffers when tc is not active",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": null
     },
     {
diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index 14149b3265a..51d80a66844 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -532,7 +532,11 @@ zink_draw(struct pipe_context *pctx,
             debug_printf("util_upload_index_buffer() failed\n");
             return;
          }
-         zink_batch_reference_resource_move(batch, zink_resource(index_buffer));
+         /* this will have extra refs from tc */
+         if (screen->threaded)
+            zink_batch_reference_resource_move(batch, zink_resource(index_buffer));
+         else
+            zink_batch_reference_resource(batch, zink_resource(index_buffer));
       } else {
          index_buffer = dinfo->index.resource;
          zink_batch_reference_resource_rw(batch, zink_resource(index_buffer), false);



More information about the mesa-commit mailing list