zink: add param to disable optimization when combining pipeline libraries

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18911>
This commit is contained in:
Mike Blumenkrantz
2022-09-22 22:24:49 -04:00
committed by Marge Bot
parent 203daf97c6
commit dd9e5fea20
3 changed files with 7 additions and 3 deletions

View File

@@ -760,7 +760,7 @@ zink_create_gfx_pipeline_library(struct zink_screen *screen, struct zink_gfx_pro
} }
VkPipeline 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}; VkPipeline libraries[] = {input, library, output};
VkPipelineLibraryCreateInfoKHR libstate = {0}; VkPipelineLibraryCreateInfoKHR libstate = {0};
@@ -770,6 +770,10 @@ zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_pr
VkGraphicsPipelineCreateInfo pci = {0}; VkGraphicsPipelineCreateInfo pci = {0};
pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; 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; pci.pNext = &libstate;
VkPipeline pipeline; VkPipeline pipeline;

View File

@@ -52,7 +52,7 @@ zink_create_gfx_pipeline_library(struct zink_screen *screen, struct zink_gfx_pro
VkPipeline VkPipeline
zink_create_gfx_pipeline_output(struct zink_screen *screen, struct zink_gfx_pipeline_state *state); zink_create_gfx_pipeline_output(struct zink_screen *screen, struct zink_gfx_pipeline_state *state);
VkPipeline 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 #ifdef __cplusplus
} }

View File

@@ -245,7 +245,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx,
pc_entry->ikey = ikey; pc_entry->ikey = ikey;
pc_entry->gkey = gkey; pc_entry->gkey = gkey;
pc_entry->okey = okey; 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 { } else {
pipeline = zink_create_gfx_pipeline(screen, prog, state, ctx->element_state->binding_map, vkmode); pipeline = zink_create_gfx_pipeline(screen, prog, state, ctx->element_state->binding_map, vkmode);
} }