diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index fed90be3be2..1cdc78b8786 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -390,7 +390,7 @@ zink_create_compute_pipeline(struct zink_screen *screen, struct zink_compute_pro VkSpecializationInfo sinfo = {0}; VkSpecializationMapEntry me[3]; - if (state->use_local_size) { + if (comp->use_local_size) { stage.pSpecializationInfo = &sinfo; sinfo.mapEntryCount = 3; sinfo.pMapEntries = &me[0]; diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 165c98f53d4..7e016bd971b 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -686,23 +686,25 @@ fail: } static uint32_t -hash_compute_pipeline_state(const void *key) +hash_compute_pipeline_state_local_size(const void *key) { const struct zink_compute_pipeline_state *state = key; uint32_t hash = _mesa_hash_data(state, offsetof(struct zink_compute_pipeline_state, hash)); - if (state->use_local_size) - hash = XXH32(&state->local_size[0], sizeof(state->local_size), hash); + hash = XXH32(&state->local_size[0], sizeof(state->local_size), hash); return hash; } +static uint32_t +hash_compute_pipeline_state(const void *key) +{ + const struct zink_compute_pipeline_state *state = key; + return _mesa_hash_data(state, offsetof(struct zink_compute_pipeline_state, hash)); +} + void zink_program_update_compute_pipeline_state(struct zink_context *ctx, struct zink_compute_program *comp, const uint block[3]) { - if (ctx->compute_pipeline_state.use_local_size != comp->use_local_size) - ctx->compute_pipeline_state.dirty = true; - ctx->compute_pipeline_state.use_local_size = comp->use_local_size; - - if (ctx->compute_pipeline_state.use_local_size) { + if (comp->use_local_size) { for (int i = 0; i < ARRAY_SIZE(ctx->compute_pipeline_state.local_size); i++) { if (ctx->compute_pipeline_state.local_size[i] != block[i]) ctx->compute_pipeline_state.dirty = true; @@ -962,7 +964,10 @@ zink_get_compute_pipeline(struct zink_screen *screen, if (state->dirty) { if (state->pipeline) //avoid on first hash state->final_hash ^= state->hash; - state->hash = hash_compute_pipeline_state(state); + if (comp->use_local_size) + state->hash = hash_compute_pipeline_state_local_size(state); + else + state->hash = hash_compute_pipeline_state(state); state->dirty = false; state->final_hash ^= state->hash; } diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index 8156eef5349..ef6ee8bc280 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -684,7 +684,6 @@ struct zink_compute_pipeline_state { uint32_t hash; uint32_t final_hash; bool dirty; - bool use_local_size; uint32_t local_size[3]; uint32_t module_hash;