From dd9e5fea20640b7a2ab4f70d68e0305f18747067 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 22 Sep 2022 22:24:49 -0400 Subject: [PATCH] zink: add param to disable optimization when combining pipeline libraries Reviewed-by: Adam Jackson Part-of: --- src/gallium/drivers/zink/zink_pipeline.c | 6 +++++- src/gallium/drivers/zink/zink_pipeline.h | 2 +- src/gallium/drivers/zink/zink_program_state.hpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index 9312ea1..04f29cb 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -760,7 +760,7 @@ zink_create_gfx_pipeline_library(struct zink_screen *screen, struct zink_gfx_pro } VkPipeline -zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_program *prog, VkPipeline input, VkPipeline library, VkPipeline output) +zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_program *prog, VkPipeline input, VkPipeline library, VkPipeline output, bool optimized) { VkPipeline libraries[] = {input, library, output}; VkPipelineLibraryCreateInfoKHR libstate = {0}; @@ -770,6 +770,10 @@ zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_pr VkGraphicsPipelineCreateInfo pci = {0}; pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; + if (optimized) + pci.flags = VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT; + else + pci.flags = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT; pci.pNext = &libstate; VkPipeline pipeline; diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index e19111f..01d2be4 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -52,7 +52,7 @@ zink_create_gfx_pipeline_library(struct zink_screen *screen, struct zink_gfx_pro VkPipeline zink_create_gfx_pipeline_output(struct zink_screen *screen, struct zink_gfx_pipeline_state *state); VkPipeline -zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_program *prog, VkPipeline input, VkPipeline library, VkPipeline output); +zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_program *prog, VkPipeline input, VkPipeline library, VkPipeline output, bool optimized); #ifdef __cplusplus } diff --git a/src/gallium/drivers/zink/zink_program_state.hpp b/src/gallium/drivers/zink/zink_program_state.hpp index 311c26c..f736406 100644 --- a/src/gallium/drivers/zink/zink_program_state.hpp +++ b/src/gallium/drivers/zink/zink_program_state.hpp @@ -245,7 +245,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx, pc_entry->ikey = ikey; pc_entry->gkey = gkey; pc_entry->okey = okey; - pipeline = zink_create_gfx_pipeline_combined(screen, prog, ikey->pipeline, gkey->pipeline, okey->pipeline); + pipeline = zink_create_gfx_pipeline_combined(screen, prog, ikey->pipeline, gkey->pipeline, okey->pipeline, true); } else { pipeline = zink_create_gfx_pipeline(screen, prog, state, ctx->element_state->binding_map, vkmode); } -- 2.7.4