From 5aeea1683cbb26c6a55bd2a2635aaaf7494ee15a Mon Sep 17 00:00:00 2001 From: Wei Hao Date: Sun, 8 Dec 2024 08:30:56 +0000 Subject: [PATCH] radeonsi: fix threaded shader compilation finishing after context is destroyed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák (cherry picked from commit ec6d0773517bd083c494530a25c47f9fcce4b8ca) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/radeonsi/si_pipe.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 8661a1c7c52..a5c23271a08 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -344,7 +344,7 @@ "description": "radeonsi: fix threaded shader compilation finishing after context is destroyed", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 3e07b4e2d4c..a21b3337dca 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -208,6 +208,9 @@ static void si_destroy_context(struct pipe_context *context) { struct si_context *sctx = (struct si_context *)context; + util_queue_finish(&sctx->screen->shader_compiler_queue); + util_queue_finish(&sctx->screen->shader_compiler_queue_opt_variants); + if (context->set_debug_callback) context->set_debug_callback(context, NULL);