zink: allow multiple gpl libraries in zink_create_gfx_pipeline_combined()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
This commit is contained in:
Mike Blumenkrantz
2023-02-06 14:15:34 -05:00
committed by Marge Bot
parent 7efec7fb61
commit 4f8a548af1
4 changed files with 11 additions and 7 deletions
+8 -3
View File
@@ -771,16 +771,21 @@ 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, bool optimized)
zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_program *prog, VkPipeline input, VkPipeline *library, unsigned libcount, VkPipeline output, bool optimized)
{
VkPipeline libraries[] = {input, library, output};
VkPipeline libraries[4];
libraries[0] = input;
libraries[2] = libraries[3] = output;
for (unsigned i = 0; i < libcount; i++)
libraries[1 + i] = library[i];
VkPipelineLibraryCreateInfoKHR libstate = {0};
libstate.sType = VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR;
libstate.libraryCount = 3;
libstate.libraryCount = 2 + libcount;
libstate.pLibraries = libraries;
VkGraphicsPipelineCreateInfo pci = {0};
pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
pci.layout = prog->base.layout;
if (optimized)
pci.flags = VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT;
else
+1 -2
View File
@@ -53,8 +53,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, bool optimized);
zink_create_gfx_pipeline_combined(struct zink_screen *screen, struct zink_gfx_program *prog, VkPipeline input, VkPipeline *library, unsigned libcount, VkPipeline output, bool optimized);
#ifdef __cplusplus
}
#endif
+1 -1
View File
@@ -715,7 +715,7 @@ optimized_compile_job(void *data, void *gdata, int thread_index)
struct zink_screen *screen = gdata;
VkPipeline pipeline;
if (pc_entry->gkey)
pipeline = zink_create_gfx_pipeline_combined(screen, pc_entry->prog, pc_entry->ikey->pipeline, pc_entry->gkey->pipeline, pc_entry->okey->pipeline, true);
pipeline = zink_create_gfx_pipeline_combined(screen, pc_entry->prog, pc_entry->ikey->pipeline, &pc_entry->gkey->pipeline, 1, pc_entry->okey->pipeline, true);
else
pipeline = zink_create_gfx_pipeline(screen, pc_entry->prog, &pc_entry->state, pc_entry->state.element_state->binding_map, zink_primitive_topology(pc_entry->state.gfx_prim_mode), true);
if (pipeline) {
@@ -270,7 +270,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx,
pc_entry->gkey = gkey;
pc_entry->okey = okey;
/* create the non-optimized pipeline first using fast-linking to avoid stuttering */
pipeline = zink_create_gfx_pipeline_combined(screen, prog, ikey->pipeline, gkey->pipeline, okey->pipeline, false);
pipeline = zink_create_gfx_pipeline_combined(screen, prog, ikey->pipeline, &gkey->pipeline, 1, okey->pipeline, false);
} else {
/* optimize by default only when expecting precompiles in order to reduce stuttering */
pipeline = zink_create_gfx_pipeline(screen, prog, state, state->element_state->binding_map, vkmode, !HAVE_LIB);