zink: assert compute descriptor key is valid before hashing it
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 12 Oct 2021 19:16:14 +0000 (15:16 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 Oct 2021 00:51:50 +0000 (00:51 +0000)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13350>

src/gallium/drivers/zink/zink_descriptors.c

index f1e1ac6..dc83c0a 100644 (file)
@@ -723,8 +723,10 @@ populate_zds_key(struct zink_context *ctx, enum zink_descriptor_type type, bool
       key->exists[0] = true;
       if (type == ZINK_DESCRIPTOR_TYPES)
          key->state[0] = ctx->dd->push_state[is_compute];
-      else
+      else {
+         assert(ctx->dd->descriptor_states[is_compute].valid[type]);
          key->state[0] = ctx->dd->descriptor_states[is_compute].state[type];
+      }
    } else if (type == ZINK_DESCRIPTOR_TYPES) {
       /* gfx only */
       for (unsigned i = 0; i < ZINK_SHADER_COUNT; i++) {