zink: be more consistent about applying module hash for gfx pipeline

this was a little spaghetti-ish: the module hash was sometimes being applied
during module update, sometimes in draw during program create, and then also
it was removed when a shader unbind would cause the program to no longer be reachable

now things are more consistent:
* keep removing module hash when program becomes unreachable
* only apply module hash in draw during updates there

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>
This commit is contained in:
Mike Blumenkrantz
2021-11-09 19:42:16 -05:00
committed by Marge Bot
parent 937a841b57
commit bfa81c1e8c
2 changed files with 4 additions and 4 deletions
+4
View File
@@ -207,7 +207,11 @@ update_gfx_program(struct zink_context *ctx)
ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash;
ctx->gfx_dirty = false;
} else if (ctx->dirty_shader_stages & bits) {
/* remove old hash */
ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash;
zink_update_gfx_program(ctx, ctx->curr_program);
/* apply new hash */
ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash;
}
ctx->dirty_shader_stages &= ~bits;
}
-4
View File
@@ -179,9 +179,6 @@ update_gfx_shader_modules(struct zink_context *ctx,
}
if (hash_changed && state) {
if (!first && likely(state->pipeline)) //avoid on first hash
state->final_hash ^= prog->last_variant_hash;
if (default_variants && !first)
prog->last_variant_hash = prog->default_variant_hash;
else {
@@ -192,7 +189,6 @@ update_gfx_shader_modules(struct zink_context *ctx,
}
}
state->final_hash ^= prog->last_variant_hash;
state->modules_changed = true;
}
}