From 997e5cf440ccc0d27fa0367e0ab20fcc97302fdf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 14 May 2021 18:30:58 -0400 Subject: [PATCH] zink: store the default variant hash for a program the first created pipeline with a program is the default variants, and this is likely to be the most common, so we can store the hash to avoid needing to recalc it later Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_program.c | 1 + src/gallium/drivers/zink/zink_program.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 52d85f987d6..e5e736c72df 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -447,6 +447,7 @@ zink_create_gfx_program(struct zink_context *ctx, assign_io(prog, prog->shaders); update_shader_modules(ctx, prog->shaders, prog, false); + prog->default_variant_hash = ctx->gfx_pipeline_state.module_hash; for (int i = 0; i < ARRAY_SIZE(prog->pipelines); ++i) { prog->pipelines[i] = _mesa_hash_table_create(NULL, diff --git a/src/gallium/drivers/zink/zink_program.h b/src/gallium/drivers/zink/zink_program.h index a406002288b..be4cd6cb68f 100644 --- a/src/gallium/drivers/zink/zink_program.h +++ b/src/gallium/drivers/zink/zink_program.h @@ -101,6 +101,7 @@ struct zink_gfx_program { struct zink_shader *shaders[ZINK_SHADER_COUNT]; struct hash_table *pipelines[11]; // number of draw modes we support + uint32_t default_variant_hash; }; struct zink_compute_program {