Mesa (main): zink: use the patch_vertices value from the shader key, not the context
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 14 19:34:38 UTC 2022
Module: Mesa
Branch: main
Commit: c36c5ff057aa6c65e0beb75810c91aea1499634a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c36c5ff057aa6c65e0beb75810c91aea1499634a
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Tue Jun 7 14:23:45 2022 -0400
zink: use the patch_vertices value from the shader key, not the context
ctx shouldn't be used here unless necessary
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
---
src/gallium/drivers/zink/zink_program.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c
index c86a2e4c1e6..4dc4eebd1b3 100644
--- a/src/gallium/drivers/zink/zink_program.c
+++ b/src/gallium/drivers/zink/zink_program.c
@@ -128,9 +128,10 @@ get_shader_module_for_stage(struct zink_context *ctx, struct zink_screen *screen
if (!zm) {
return NULL;
}
+ unsigned patch_vertices = state->shader_keys.key[PIPE_SHADER_TESS_CTRL ].key.tcs.patch_vertices;
if (pstage == PIPE_SHADER_TESS_CTRL && zs->is_generated && zs->spirv) {
assert(ctx); //TODO async
- mod = zink_shader_tcs_compile(screen, zs, zink_get_tcs_key(ctx)->patch_vertices);
+ mod = zink_shader_tcs_compile(screen, zs, patch_vertices);
} else {
mod = zink_shader_compile(screen, zs, prog->nir[stage], key);
}
@@ -156,7 +157,7 @@ get_shader_module_for_stage(struct zink_context *ctx, struct zink_screen *screen
if (inline_size)
memcpy(zm->key + key->size + nonseamless_size, key->base.inlined_uniform_values, inline_size * sizeof(uint32_t));
if (pstage == PIPE_SHADER_TESS_CTRL && zs->is_generated)
- zm->hash = zink_get_tcs_key(ctx)->patch_vertices;
+ zm->hash = patch_vertices;
else
zm->hash = shader_module_hash(zm);
zm->default_variant = !inline_size && list_is_empty(&prog->shader_cache[pstage][0][0]);
More information about the mesa-commit
mailing list