Skip to content

Fix support for VK_KHR_pipeline_binary#2634

Open
marius-pelegrin-arm wants to merge 1 commit intoLunarG:devfrom
marius-pelegrin-arm:support-khr-pipeline-binary
Open

Fix support for VK_KHR_pipeline_binary#2634
marius-pelegrin-arm wants to merge 1 commit intoLunarG:devfrom
marius-pelegrin-arm:support-khr-pipeline-binary

Conversation

@marius-pelegrin-arm
Copy link
Copy Markdown
Contributor

VkPipelineCreateInfoKHR is a particular structure as it can take any kind of PipelineCreateInfo in its pNext chain, in addition to being required to have a non-null pNext member.

This was not correctly handled by the generated code because Vk*PipelineCreateInfo structures don't have the structextends flag set in the Vulkan registry. This commit aims at fixing that by blacklisting this structure and writing the encoder/decoders manually.

Ideally, this should be solved in the codegen by not considering only structs with the structextends flag as possible encounters in a pNext chain

@marius-pelegrin-arm marius-pelegrin-arm requested a review from a team as a code owner January 27, 2026 12:19
`VkPipelineCreateInfoKHR` is a particular structure as it can
take any kind of `PipelineCreateInfo` in its `pNext` chain,
in addition to being required to have a non-null `pNext` member.

This was not correctly handled by the generated code, this commit
aims at fixing the situation.

Change-Id: Ie363804058867af5ff57ee32b062001c73f6368a
@marius-pelegrin-arm marius-pelegrin-arm force-pushed the support-khr-pipeline-binary branch from 23ba2a6 to 4ad1a79 Compare January 27, 2026 12:34
@ci-tester-lunarg
Copy link
Copy Markdown
Collaborator

CI gfxreconstruct build queued with queue ID 633685.

@ci-tester-lunarg
Copy link
Copy Markdown
Collaborator

CI gfxreconstruct build # 8717 running.

@ci-tester-lunarg
Copy link
Copy Markdown
Collaborator

CI gfxreconstruct build # 8717 passed.

Comment thread framework/generated/generated_vulkan_replay_consumer.cpp
@MarkY-LunarG
Copy link
Copy Markdown
Contributor

This seems similar to the way OpenXR handles parent/child classes (for example look at XrEventDataBaseHeader and it's derivatives including how Decoded_XrEventDataBaseHeader performs a lot of work for allocations). Additionally, we have hooks in place to handle the proper look-ahead required and handling for static and dynamic arrays. For example, decoding with DecodeBaseHeader instead of the standard decode.

Honestly, this really does seem like something the Vulkan registry is missing as well. In OpenXR, the registry has field tags indicating when a structure has a parent structure (parentstruct="<parent-struct-name>"). For example, in this case, all the other "CreateInfos" would be listed with parentstruct="VkPipelineCreateInfoKHR".
But we can focus on that later and do "custom" functionality for now here.

@MarkY-LunarG
Copy link
Copy Markdown
Contributor

I made a change in PR #2668, try that out.

@bradgrantham-lunarg bradgrantham-lunarg added the approved-to-run-ci Can run CI check on internal LunarG machines label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-to-run-ci Can run CI check on internal LunarG machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants