Mesa (main): zink: use descriptor set index indirection in cache state updates

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 25 04:15:05 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon May 16 17:27:56 2022 -0400

zink: use descriptor set index indirection in cache state updates

no functional changes

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16645>

---

 src/gallium/drivers/zink/zink_descriptors.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c
index 8db4ec0880b..a60e2dc8ff0 100644
--- a/src/gallium/drivers/zink/zink_descriptors.c
+++ b/src/gallium/drivers/zink/zink_descriptors.c
@@ -1672,6 +1672,7 @@ update_descriptor_state(struct zink_context *ctx, enum zink_descriptor_type type
 static void
 zink_context_update_descriptor_states(struct zink_context *ctx, struct zink_program *pg)
 {
+   struct zink_screen *screen = zink_screen(ctx->base.screen);
    if (pg->dd->push_usage && (!ctx->dd->push_valid[pg->is_compute] ||
                                            pg->dd->push_usage != ctx->dd->last_push_usage[pg->is_compute])) {
       uint32_t hash = 0;
@@ -1698,7 +1699,7 @@ zink_context_update_descriptor_states(struct zink_context *ctx, struct zink_prog
       ctx->dd->last_push_usage[pg->is_compute] = pg->dd->push_usage;
    }
    for (unsigned i = 0; i < ZINK_DESCRIPTOR_TYPES; i++) {
-      if (pdd_cached(pg)->pool[i] && pdd_cached(pg)->cache_misses[i] < MAX_CACHE_MISSES &&
+      if (pdd_cached(pg)->pool[screen->desc_set_id[i] - 1] && pdd_cached(pg)->cache_misses[i] < MAX_CACHE_MISSES &&
           !ctx->dd->descriptor_states[pg->is_compute].valid[i])
          update_descriptor_state(ctx, i, pg->is_compute);
    }



More information about the mesa-commit mailing list