SaschaWillems / Vulkan

C++ examples for the Vulkan graphics API
MIT License
10.34k stars 2.03k forks source link

Pipelinestatistics: Discard option #1101

Closed kyamant closed 6 months ago

kyamant commented 9 months ago

Checking the "discard" option sets VkPipelineRasterizationStateCreateInfo.rasterizerDiscardEnable to _VKTRUE but this not enough: fragment shader should be excluded from the pipeline (re)creation:

ERROR: [-540185279][VUID-VkGraphicsPipelineCreateInfo-pStages-06894] : Validation Error: [ VUID-VkGraphicsPipelineCreateInfo-pStages-06894 ] | MessageID = 0xdfcd6d41 | vkCreateGraphicsPipelines(): pCreateInfos[0] does not have fragment shader state, but stages (VK_SHADER_STAGE_VERTEX_BIT|VK_SHADER_STAGE_FRAGMENT_BIT) contains VK_SHADER_STAGE_FRAGMENT_BIT. The Vulkan spec states: If the pipeline requires pre-rasterization shader state but not fragment shader state, elements of pStages must not have stage set to VK_SHADER_STAGE_FRAGMENT_BIT (https://vulkan.lunarg.com/doc/view/1.3.268.0/windows/1.3-extensions/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-pStages-06894)

SaschaWillems commented 6 months ago

Thank you very much for bringing this up. Will fix :)