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)
Checking the "discard" option sets VkPipelineRasterizationStateCreateInfo.rasterizerDiscardEnable to _VKTRUE but this not enough: fragment shader should be excluded from the pipeline (re)creation: