zink: add a pipeline shortcut for basic compute programs

if there are no inline uniforms, nonseamless cubes, or local size use,
then this is the "base" pipeline object that can be reused without checking
the hash table

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
This commit is contained in:
Mike Blumenkrantz
2022-08-12 10:49:07 -04:00
committed by Marge Bot
parent 8cdb227fe7
commit 3e9a108c78
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -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;
+2
View File
@@ -813,6 +813,8 @@ struct zink_compute_program {
struct zink_shader *shader;
struct hash_table *pipelines;
VkPipeline base_pipeline;
};