diff --git a/.pick_status.json b/.pick_status.json index 6b69f9358e3..11cc4f272f6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1464,7 +1464,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 diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 7a7540c2682..77b60828366 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -138,7 +138,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])); diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 1001d5751aa..4034713cbde 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -835,6 +835,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) { diff --git a/src/gallium/drivers/zink/zink_program.h b/src/gallium/drivers/zink/zink_program.h index 2f0a70526df..b4b2bd21bcd 100644 --- a/src/gallium/drivers/zink/zink_program.h +++ b/src/gallium/drivers/zink/zink_program.h @@ -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)