Don't serialise vertex input structs if using mesh shaders

This commit is contained in:
baldurk
2023-11-29 12:18:06 +00:00
parent 55c18e4868
commit 06ac6298dc
+15 -2
View File
@@ -3492,8 +3492,21 @@ void DoSerialise(SerialiserType &ser, VkGraphicsPipelineCreateInfo &el)
hasTess |= (el.pStages[i].stage & (VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT |
VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)) != 0;
SERIALISE_MEMBER_OPT(pVertexInputState);
SERIALISE_MEMBER_OPT(pInputAssemblyState);
bool hasMesh = false;
for(uint32_t i = 0; i < el.stageCount; i++)
hasMesh |= (el.pStages[i].stage & VK_SHADER_STAGE_MESH_BIT_EXT) != 0;
// if we have mesh shaders, fixed function vertex input is ignored and may be garbage
if(hasMesh)
{
SERIALISE_MEMBER_OPT_EMPTY(pVertexInputState);
SERIALISE_MEMBER_OPT_EMPTY(pInputAssemblyState);
}
else
{
SERIALISE_MEMBER_OPT(pVertexInputState);
SERIALISE_MEMBER_OPT(pInputAssemblyState);
}
// if we don't have tessellation shaders, pTessellationState is ignored and may be garbage
if(hasTess)