freedreno: Wait for async compile jobs to finish
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Sun, 19 Jun 2022 12:36:08 +0000 (14:36 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Jun 2022 07:18:56 +0000 (07:18 +0000)
initial_variants_synchronous(..) allows initial shader variant
compilation asynchronously if debug.debug_message == NULL. If the
debug callback gets changed it seems like a good idea to wait until
all async shader compiles are done.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17124>

src/gallium/drivers/freedreno/freedreno_context.c

index c88ed69..4335de1 100644 (file)
@@ -405,6 +405,9 @@ fd_set_debug_callback(struct pipe_context *pctx,
                       const struct util_debug_callback *cb)
 {
    struct fd_context *ctx = fd_context(pctx);
+   struct fd_screen *screen = ctx->screen;
+
+   util_queue_finish(&screen->compile_queue);
 
    if (cb)
       ctx->debug = *cb;