KhronosGroup / Vulkan-Docs

The Vulkan API Specification and related tools
Other
2.77k stars 465 forks source link

clarification on VK_EXT_graphics_pipeline_library interaction with VkGraphicsPipelineCreateInfo.layout #2168

Open AlexRouSg opened 1 year ago

AlexRouSg commented 1 year ago

When trying to link my graphics pipeline libraries into an executable pipeline I get the following validation error:

Validation Error: [ VUID-VkGraphicsPipelineCreateInfo-None-07826 ] Object 0: handle = 0x14d507a15b0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xd3855fbc | vkCreateGraphicsPipelines(): pCreateInfos[0] defines a complete set of state, but pCreateInfos[0].layout is not a valid VkPipelineLayout. The Vulkan spec states: If the pipeline includes a complete set of state, VkPipelineLayout must be a valid pipeline layout (https://vulkan.lunarg.com/doc/view/1.3.250.1/windows/1.3-extensions/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-None-07826)

However from the extension's proposal page, blog, video, and spec wording below, it seems that you can leave VkGraphicsPipelineCreateInfo.layout blank on linking. So I am confused on what I should be doing here.

If different subsets are linked together with pipeline layouts created with VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, the final effective pipeline layout is effectively the union of the linked pipeline layouts. ... This pipeline layout can be overridden ... by providing a VkPipelineLayout that is compatible with this union

spencer-lunarg commented 1 year ago

(for notes) internal discussion of this https://gitlab.khronos.org/vulkan/vulkan/-/issues/3334

spencer-lunarg commented 1 year ago

To add some clarification:

If you're linking "fast link" pipelines with the independent sets bit, you can omit the final layout. If you're doing an optimized link without independent sets bit, you can't omit it.

will purpose a fix

AlexRouSg commented 1 year ago

Just thought I'd get some clarification on the last statement,

If you're linking "fast link" pipelines with the independent sets bit, you can omit the final layout. If you're doing an optimized link without independent sets bit, you can't omit it.

This means optimized link with independent sets bit is also allowed to omit the final layout, yes?

oddhack commented 1 year ago

This is addressed in the 1.3.266 spec update. @spencer-lunarg there was a followon comment that may have postdated your MR - should we close this now?