mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
zink: fully wait on all program fences during ctx destroy
optimized pipeline compile jobs may still be ongoing during ctx
destroy, and these must complete too or else crashes will occur
fixes shutdown crash with dEQP-EGL.functional.sharing.gles2.multithread.simple.images.texture_source.teximage2d_render
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28900>
(cherry picked from commit bd1a3921d1)
This commit is contained in:
parent
4af94a8214
commit
0a174bb629
4 changed files with 21 additions and 2 deletions
|
|
@ -1744,7 +1744,7 @@
|
|||
"description": "zink: fully wait on all program fences during ctx destroy",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ zink_context_destroy(struct pipe_context *pctx)
|
|||
simple_mtx_lock((&ctx->program_lock[i]));
|
||||
hash_table_foreach(&ctx->program_cache[i], entry) {
|
||||
struct zink_program *pg = entry->data;
|
||||
util_queue_fence_wait(&pg->cache_fence);
|
||||
zink_program_finish(ctx, pg);
|
||||
pg->removed = true;
|
||||
}
|
||||
simple_mtx_unlock((&ctx->program_lock[i]));
|
||||
|
|
|
|||
|
|
@ -830,6 +830,23 @@ zink_gfx_program_compile_queue(struct zink_context *ctx, struct zink_gfx_pipelin
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
zink_program_finish(struct zink_context *ctx, struct zink_program *pg)
|
||||
{
|
||||
util_queue_fence_wait(&pg->cache_fence);
|
||||
if (pg->is_compute)
|
||||
return;
|
||||
struct zink_gfx_program *prog = (struct zink_gfx_program*)pg;
|
||||
for (int r = 0; r < ARRAY_SIZE(prog->pipelines); ++r) {
|
||||
for (int i = 0; i < ARRAY_SIZE(prog->pipelines[0]); ++i) {
|
||||
hash_table_foreach(&prog->pipelines[r][i], entry) {
|
||||
struct zink_gfx_pipeline_cache_entry *pc_entry = entry->data;
|
||||
util_queue_fence_wait(&pc_entry->fence);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_cs_shader_module(struct zink_context *ctx, struct zink_compute_program *comp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -133,6 +133,8 @@ uint32_t hash_gfx_input_dynamic(const void *key);
|
|||
|
||||
void
|
||||
zink_gfx_program_compile_queue(struct zink_context *ctx, struct zink_gfx_pipeline_cache_entry *pc_entry);
|
||||
void
|
||||
zink_program_finish(struct zink_context *ctx, struct zink_program *pg);
|
||||
|
||||
static inline unsigned
|
||||
get_primtype_idx(enum mesa_prim mode)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue