scripts: Fix logic for ignoring pipe state

This commit is contained in:
spencer-lunarg 2024-04-30 17:01:35 +09:00 committed by Spencer Fricke
parent 68780d9b8c
commit ad7f699a7b

View file

@ -345,11 +345,15 @@ safe_VkGraphicsPipelineCreateInfo::safe_VkGraphicsPipelineCreateInfo(const VkGra
else else
pInputAssemblyState = nullptr; pInputAssemblyState = nullptr;
bool has_tessellation_stage = false; bool has_tessellation_stage = false;
if (stageCount && pStages) bool has_fragment_stage = false;
for (uint32_t i = 0; i < stageCount && !has_tessellation_stage; ++i) if (stageCount && pStages) {
for (uint32_t i = 0; i < stageCount; ++i) {
if (pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT || if (pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT ||
pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)
has_tessellation_stage = true; has_tessellation_stage = true;
if (pStages[i].stage == VK_SHADER_STAGE_FRAGMENT_BIT) has_fragment_stage = true;
}
}
if (in_struct->pTessellationState && has_tessellation_stage) if (in_struct->pTessellationState && has_tessellation_stage)
pTessellationState = new safe_VkPipelineTessellationStateCreateInfo(in_struct->pTessellationState); pTessellationState = new safe_VkPipelineTessellationStateCreateInfo(in_struct->pTessellationState);
else else
@ -379,7 +383,8 @@ safe_VkGraphicsPipelineCreateInfo::safe_VkGraphicsPipelineCreateInfo(const VkGra
pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(in_struct->pRasterizationState); pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(in_struct->pRasterizationState);
else else
pRasterizationState = nullptr; pRasterizationState = nullptr;
if (in_struct->pMultisampleState && (renderPass != VK_NULL_HANDLE || has_rasterization || is_graphics_library)) if (in_struct->pMultisampleState &&
((has_rasterization && (renderPass != VK_NULL_HANDLE || has_fragment_stage)) || is_graphics_library))
pMultisampleState = new safe_VkPipelineMultisampleStateCreateInfo(in_struct->pMultisampleState); pMultisampleState = new safe_VkPipelineMultisampleStateCreateInfo(in_struct->pMultisampleState);
else else
pMultisampleState = nullptr; // original pMultisampleState pointer ignored pMultisampleState = nullptr; // original pMultisampleState pointer ignored
@ -661,11 +666,15 @@ void safe_VkGraphicsPipelineCreateInfo::initialize(const VkGraphicsPipelineCreat
else else
pInputAssemblyState = nullptr; pInputAssemblyState = nullptr;
bool has_tessellation_stage = false; bool has_tessellation_stage = false;
if (stageCount && pStages) bool has_fragment_stage = false;
for (uint32_t i = 0; i < stageCount && !has_tessellation_stage; ++i) if (stageCount && pStages) {
for (uint32_t i = 0; i < stageCount; ++i) {
if (pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT || if (pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT ||
pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)
has_tessellation_stage = true; has_tessellation_stage = true;
if (pStages[i].stage == VK_SHADER_STAGE_FRAGMENT_BIT) has_fragment_stage = true;
}
}
if (in_struct->pTessellationState && has_tessellation_stage) if (in_struct->pTessellationState && has_tessellation_stage)
pTessellationState = new safe_VkPipelineTessellationStateCreateInfo(in_struct->pTessellationState); pTessellationState = new safe_VkPipelineTessellationStateCreateInfo(in_struct->pTessellationState);
else else
@ -695,7 +704,8 @@ void safe_VkGraphicsPipelineCreateInfo::initialize(const VkGraphicsPipelineCreat
pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(in_struct->pRasterizationState); pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(in_struct->pRasterizationState);
else else
pRasterizationState = nullptr; pRasterizationState = nullptr;
if (in_struct->pMultisampleState && (renderPass != VK_NULL_HANDLE || has_rasterization || is_graphics_library)) if (in_struct->pMultisampleState &&
((has_rasterization && (renderPass != VK_NULL_HANDLE || has_fragment_stage)) || is_graphics_library))
pMultisampleState = new safe_VkPipelineMultisampleStateCreateInfo(in_struct->pMultisampleState); pMultisampleState = new safe_VkPipelineMultisampleStateCreateInfo(in_struct->pMultisampleState);
else else
pMultisampleState = nullptr; // original pMultisampleState pointer ignored pMultisampleState = nullptr; // original pMultisampleState pointer ignored