Mesa (main): zink: flag all cached descriptors as needing update on program change

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 1 02:33:39 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri May 27 15:37:20 2022 -0400

zink: flag all cached descriptors as needing update on program change

programs have different usages of descriptors, so forcing a recalc on program
change ensures that the right hash values are always set, especially for compact
sets where there's more descriptors going into each hash value

this can (ideally) be optimized later to check for matching interfaces between old
program and new program to avoid recalc if both programs have identical descriptor
usage for a given set

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

---

 src/gallium/drivers/zink/zink_descriptors.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c
index 6e88f2bfb2e..c7a1b495291 100644
--- a/src/gallium/drivers/zink/zink_descriptors.c
+++ b/src/gallium/drivers/zink/zink_descriptors.c
@@ -1474,6 +1474,11 @@ zink_descriptors_update(struct zink_context *ctx, bool is_compute)
       for (int h = 0; h < ZINK_DESCRIPTOR_TYPES; h++) {
          if (pg->dd->real_binding_usage & BITFIELD_BIT(h))
             ctx->dd->changed[is_compute][h] = true;
+         ctx->dd->descriptor_states[is_compute].valid[h] = false;
+         if (!is_compute) {
+            for (unsigned i = 0; i < ZINK_SHADER_COUNT; i++)
+               ctx->dd->gfx_descriptor_states[i].valid[h] = false;
+         }
       }
    }
    zink_context_update_descriptor_states(ctx, pg);



More information about the mesa-commit mailing list