Skip to content

zink: Zero-initialize VkPipelineRenderingCreateInfo

zink: Zero-initialize VkPipelineRenderingCreateInfo

This workaround fixes a crash in libVkLayer_gfxreconstruct.so.

gfxreconstruct does not serialize the VkGraphicsPipelineCreateInfo pNext chain correctly when VK_EXT_graphics_pipeline_library is in use. Other projects and layers likely contain a similar bug because correctly interpreting VkGraphicsPipelineCreateInfo requires maintaining a small (but ambiguously defined) state machine for pipeline libraries. The Vulkan spec is incredibly difficult to interpret there, and is even incorrect in places.

The crash happens because gfxreconstruct serializes each struct member in the VkGraphicsPipelineCreateInfo even when the Vulkan spec states that, due to pipeline library state, the implementation must ignore the member. In these cases, the spec implicitly allows the member to have an invalid value (invalid pointer, invalid Vulkan handle, invalid enum, etc). The offending member here was VkPipelineRenderingCreateInfo:: pColorAttachmentFormats; it was an invalid pointer.

Merge request reports