diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index cb0b7b73ff0..8e83099eaf5 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -967,6 +967,10 @@ zink_get_compute_pipeline(struct zink_screen *screen, state->dirty = false; state->final_hash ^= state->hash; } + if (!comp->use_local_size && !comp->curr->num_uniforms && !comp->curr->has_nonseamless && comp->base_pipeline) { + state->pipeline = comp->base_pipeline; + return state->pipeline; + } entry = _mesa_hash_table_search_pre_hashed(comp->pipelines, state->final_hash, state); if (!entry) { @@ -985,6 +989,8 @@ zink_get_compute_pipeline(struct zink_screen *screen, entry = _mesa_hash_table_insert_pre_hashed(comp->pipelines, state->final_hash, pc_entry, pc_entry); assert(entry); + if (!comp->use_local_size && !comp->curr->num_uniforms && !comp->curr->has_nonseamless) + comp->base_pipeline = pipeline; } struct compute_pipeline_cache_entry *cache_entry = entry->data; diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index 1d53b5351e9..cb322de6156 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -813,6 +813,8 @@ struct zink_compute_program { struct zink_shader *shader; struct hash_table *pipelines; + + VkPipeline base_pipeline; };