From 905264f27dd94971542a38ca603cc57e3e3a183b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 20 Apr 2023 15:49:00 -0400 Subject: [PATCH] zink: add a driver workaround to disable background compiles it's stupid to do optimized background compiles if the driver is going to create the exact same pipeline, so add a workaround to disable this behavior should improve ci runtimes on lavapipe by some amount Part-of: --- src/gallium/drivers/zink/zink_program.c | 5 ++++- src/gallium/drivers/zink/zink_screen.c | 9 +++++++++ src/gallium/drivers/zink/zink_types.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 5abca2f..be7b361 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -786,7 +786,10 @@ optimized_compile_job(void *data, void *gdata, int thread_index) void zink_gfx_program_compile_queue(struct zink_context *ctx, struct zink_gfx_pipeline_cache_entry *pc_entry) { - util_queue_add_job(&zink_screen(ctx->base.screen)->cache_get_thread, pc_entry, &pc_entry->fence, optimized_compile_job, NULL, 0); + struct zink_screen *screen = zink_screen(ctx->base.screen); + if (screen->driver_workarounds.disable_optimized_compile) + return; + util_queue_add_job(&screen->cache_get_thread, pc_entry, &pc_entry->fence, optimized_compile_job, NULL, 0); } static void diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index dec19dc..f736452 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -2582,6 +2582,15 @@ init_driver_workarounds(struct zink_screen *screen) default: break; } + + /* these drivers have no difference between unoptimized and optimized shader compilation */ + switch (screen->info.driver_props.driverID) { + case VK_DRIVER_ID_MESA_LLVMPIPE: + screen->driver_workarounds.disable_optimized_compile = true; + break; + default: + break; + } } static struct disk_cache * diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index e182efd..a528e30 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -1458,6 +1458,7 @@ struct zink_screen { */ bool broken_cache_semantics; bool implicit_sync; + bool disable_optimized_compile; bool always_feedback_loop; bool always_feedback_loop_zs; bool needs_sanitised_layer; -- 2.7.4