The layouts now are vk_playout(arrays). They are 32 at most, one for each value of the five bits of arrays. Set
N is g_vk_dslayout[bit N][N], by shader_vk_set: set 0 vertex (and compute), set 1 fragment, sets 2 to 4
tessellation control, tessellation evaluation and geometry. There is one push constant range of 128 bytes for
VK_PUSH_STAGES.
A link with a PR part and an FS part must use layouts that agree. Without VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT,
both libraries must use the same layout (VUID-VkGraphicsPipelineCreateInfo-pLibraries-06681 and layout-07827).
That would put bit 1 (the indexed textures of the fragment program) into the PR key, and the vertex bits into the FS
key. A 1.7 MB vertex program would then compile two times, once for each kind of fragment program that it meets. The
startup compile could not know which.
So the GPL path makes every graphics layout with INDEPENDENT_SETS:
VK_NULL_HANDLE. The graphicsPipelineLibrary feature allows null set layouts
(VUID-VkPipelineLayoutCreateInfo-graphicsPipelineLibrary-06753).vk_playout(arrays), made with the same flag
(VUID-VkGraphicsPipelineCreateInfo-flags-06729 and 06730).All three have the same push constant range, as the push constant VUIDs (06620, 06621) need. The null-set layouts
come from a second table beside g_pipeline.playouts, keyed by the part (PR or FS) and the bits of the part. That is 16 PR
layouts and 2 FS layouts at most. A part is a library, so a device without pipeline libraries makes none, and every
draw compiles whole there: ship_warm returns before it queues one.
Vulkan calls two layouts compatible for set N only when both or neither have INDEPENDENT_SETS. Thus the binds of
graphics descriptor sets must use the same family as the pipeline. They do: render.c binds with
vk_playout(k->arrays), and vk_playout makes the flagged family when GPL is on. Push constants go through
g_vk_playout. Push constant compatibility looks only at the ranges, so g_vk_playout stays good for that.
Compute must keep a layout without the flag. Now g_vk.cs_playout is g_vk_playout when there are no descriptor
buffers (vk_pipeline_init). With GPL on, vk_pipeline_init makes g_vk.cs_playout apart, from
g_vk.cs_dslayout without the flag, as it does now for descriptor buffers. The bind in compute.c:1890 already
uses g_vk.cs_playout.
Descriptor buffers: the set layouts keep VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT. Every part,
the link and the optimized pipeline get VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT. The offsets of the bindings
in a set do not change with INDEPENDENT_SETS, because the set layouts are the same objects. The descriptor buffer
code in descriptors.c needs no change, but the commit must check it under the validation layer.
Made from docs/layers/gpu/pipeline-libraries.md at 69237645142c. GPL-3.0-or-later.