Mesa (staging/21.3): zink: don't check rebind count outside of buffer/image rebind function

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 26 17:27:15 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: 338ac91f7b50bd0c2e6cbf854a0c39ee5c5758db
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=338ac91f7b50bd0c2e6cbf854a0c39ee5c5758db

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Oct 22 14:33:29 2021 -0400

zink: don't check rebind count outside of buffer/image rebind function

zink_resource_has_binds() only checks descriptor binds, and this doesn't
include streamout or fb bindings, so call these functions from the specific
rebind points to ensure those cases are also checked

fixes #5541

cc: mesa-stable

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

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/zink/zink_context.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 409354ec800..0a278a39003 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -31,7 +31,7 @@
         "description": "zink: don't check rebind count outside of buffer/image rebind function",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index f1027ae8430..476507f6212 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -3768,6 +3768,9 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi
    unsigned num_rebinds = 0;
    bool has_write = false;
 
+   if (!zink_resource_has_binds(res))
+      return 0;
+
    assert(!res->bindless[1]); //TODO
    if ((rebind_mask & BITFIELD_BIT(TC_BINDING_STREAMOUT_BUFFER)) || (!rebind_mask && res->so_bind_count && ctx->num_so_targets)) {
       for (unsigned i = 0; i < ctx->num_so_targets; i++) {
@@ -3919,8 +3922,6 @@ rebind_image(struct zink_context *ctx, struct zink_resource *res)
 bool
 zink_resource_rebind(struct zink_context *ctx, struct zink_resource *res)
 {
-   if (!zink_resource_has_binds(res))
-      return 0;
    if (res->base.b.target == PIPE_BUFFER) {
       /* force counter buffer reset */
       res->so_valid = false;



More information about the mesa-commit mailing list