From e4bca6adf1ad4466f2c9703cfc984c8c56944985 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 6 Sep 2023 10:33:04 -0400 Subject: [PATCH] zink: use FAIL_ON_PIPELINE_COMPILE_REQUIRED for GPL path it should be low-cost to check for a cached+optimized pipeline on first compile, so do that to avoid unnecessary pipeline compiles Part-of: --- src/gallium/drivers/zink/zink_program_state.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_program_state.hpp b/src/gallium/drivers/zink/zink_program_state.hpp index de1142f..eb2af70 100644 --- a/src/gallium/drivers/zink/zink_program_state.hpp +++ b/src/gallium/drivers/zink/zink_program_state.hpp @@ -213,11 +213,16 @@ zink_get_gfx_pipeline(struct zink_context *ctx, pc_entry->gpl.ikey = ikey; pc_entry->gpl.gkey = gkey; pc_entry->gpl.okey = okey; - /* create the non-optimized pipeline first using fast-linking to avoid stuttering */ - pc_entry->pipeline = zink_create_gfx_pipeline_combined(screen, prog, ikey->pipeline, &gkey->pipeline, 1, okey->pipeline, false, false); + /* try to hit optimized compile cache first if possible */ if (!prog->is_separable) - /* trigger async optimized pipeline compile if this was the fast-linked unoptimized pipeline */ - zink_gfx_program_compile_queue(ctx, pc_entry); + pc_entry->pipeline = zink_create_gfx_pipeline_combined(screen, prog, ikey->pipeline, &gkey->pipeline, 1, okey->pipeline, true, true); + if (!pc_entry->pipeline) { + /* create the non-optimized pipeline first using fast-linking to avoid stuttering */ + pc_entry->pipeline = zink_create_gfx_pipeline_combined(screen, prog, ikey->pipeline, &gkey->pipeline, 1, okey->pipeline, false, false); + if (!prog->is_separable) + /* trigger async optimized pipeline compile if this was the fast-linked unoptimized pipeline */ + zink_gfx_program_compile_queue(ctx, pc_entry); + } } else { /* optimize by default only when expecting precompiles in order to reduce stuttering */ if (DYNAMIC_STATE != ZINK_DYNAMIC_VERTEX_INPUT2 && DYNAMIC_STATE != ZINK_DYNAMIC_VERTEX_INPUT) -- 2.7.4