Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: Fix logic for ignoring pipe state #207

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/vulkan/vk_safe_struct_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,15 @@ safe_VkGraphicsPipelineCreateInfo::safe_VkGraphicsPipelineCreateInfo(const VkGra
else
pInputAssemblyState = nullptr;
bool has_tessellation_stage = false;
if (stageCount && pStages)
for (uint32_t i = 0; i < stageCount && !has_tessellation_stage; ++i)
bool has_fragment_stage = false;
if (stageCount && pStages) {
for (uint32_t i = 0; i < stageCount; ++i) {
if (pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT ||
pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)
has_tessellation_stage = true;
if (pStages[i].stage == VK_SHADER_STAGE_FRAGMENT_BIT) has_fragment_stage = true;
}
}
if (in_struct->pTessellationState && has_tessellation_stage)
pTessellationState = new safe_VkPipelineTessellationStateCreateInfo(in_struct->pTessellationState);
else
Expand Down Expand Up @@ -379,7 +383,8 @@ safe_VkGraphicsPipelineCreateInfo::safe_VkGraphicsPipelineCreateInfo(const VkGra
pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(in_struct->pRasterizationState);
else
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);
else
pMultisampleState = nullptr; // original pMultisampleState pointer ignored
Expand Down Expand Up @@ -661,11 +666,15 @@ void safe_VkGraphicsPipelineCreateInfo::initialize(const VkGraphicsPipelineCreat
else
pInputAssemblyState = nullptr;
bool has_tessellation_stage = false;
if (stageCount && pStages)
for (uint32_t i = 0; i < stageCount && !has_tessellation_stage; ++i)
bool has_fragment_stage = false;
if (stageCount && pStages) {
for (uint32_t i = 0; i < stageCount; ++i) {
if (pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT ||
pStages[i].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)
has_tessellation_stage = true;
if (pStages[i].stage == VK_SHADER_STAGE_FRAGMENT_BIT) has_fragment_stage = true;
}
}
if (in_struct->pTessellationState && has_tessellation_stage)
pTessellationState = new safe_VkPipelineTessellationStateCreateInfo(in_struct->pTessellationState);
else
Expand Down Expand Up @@ -695,7 +704,8 @@ void safe_VkGraphicsPipelineCreateInfo::initialize(const VkGraphicsPipelineCreat
pRasterizationState = new safe_VkPipelineRasterizationStateCreateInfo(in_struct->pRasterizationState);
else
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);
else
pMultisampleState = nullptr; // original pMultisampleState pointer ignored
Expand Down
Loading