zink: only set compute module info on dispatch (after compile fence)

this otherwise can attempt to access thread data

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37139>
(cherry picked from commit 3fecf68784)
This commit is contained in:
Mike Blumenkrantz 2025-09-09 07:25:29 -04:00 committed by Eric Engestrom
parent 91f3af81f4
commit c99a6f8470
2 changed files with 4 additions and 5 deletions

View file

@ -6804,7 +6804,7 @@
"description": "zink: only set compute module info on dispatch (after compile fence)",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -1749,6 +1749,9 @@ zink_get_compute_pipeline(struct zink_screen *screen,
state->pipeline = comp->base_pipeline;
return state->pipeline;
}
state->module_hash = comp->curr->hash;
state->module = comp->curr->obj.mod;
state->final_hash ^= state->module_hash;
entry = _mesa_hash_table_search_pre_hashed(&comp->pipelines, state->final_hash, state);
if (!entry) {
@ -2101,10 +2104,6 @@ zink_bind_cs_state(struct pipe_context *pctx,
ctx->compute_pipeline_state.dirty = true;
ctx->curr_compute = comp;
if (comp && comp != ctx->curr_compute) {
ctx->compute_pipeline_state.module_hash = ctx->curr_compute->curr->hash;
if (util_queue_fence_is_signalled(&comp->base.cache_fence))
ctx->compute_pipeline_state.module = ctx->curr_compute->curr->obj.mod;
ctx->compute_pipeline_state.final_hash ^= ctx->compute_pipeline_state.module_hash;
if (ctx->compute_pipeline_state.key.base.nonseamless_cube_mask)
ctx->compute_dirty = true;
}