diff --git a/.pick_status.json b/.pick_status.json index 321381f2ac9..0ee808f2c61 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index d58293109ac..d759045b873 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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])); diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 58f480e8774..cb6cdbfb753 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -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) { diff --git a/src/gallium/drivers/zink/zink_program.h b/src/gallium/drivers/zink/zink_program.h index c5ecf99d8b3..6f372923135 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)