zink: remove use_local_size from compute pipeline state

this is redundant since pipeline state gets flagged on bind

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:25:08 -04:00
committed by Marge Bot
parent bbd58d1703
commit ad96d21239
3 changed files with 15 additions and 11 deletions
+1 -1
View File
@@ -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];
+14 -9
View File
@@ -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;
}
-1
View File
@@ -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;