Vulkan: Set USES_DEPTH_STENCIL/USES_BLEND_CONSTANT before creating the pipeline

They were OR-ed into pipelineFlags just after the CreateGraphicsPipeline call that
consumes them, so the render manager's "don't compile a pipeline that requires
depth for a non-depth renderpass type" check could never fire for game pipelines.
thin3d_vulkan.cpp sets the flag before its call, which is the intended order.

Note this can now legitimately skip some variants when loading the shader cache -
those were invalid combinations that the check was written to reject.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01SGz54K3ZXa2Qzyc3aMEYyY
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-09-04 12:10:03 -06:00
1 parent 38d5ab657e
commit 41d69e61e1
1 file changed
+6 -3
+6 -3
View File
@@ -329,15 +329,18 @@ static VulkanPipeline *CreateVulkanPipeline(VulkanRenderManager *renderManager,
tag = fs->GetID().Description() + " VS " + vs->GetID().Description();
#endif
VKRGraphicsPipeline *pipeline = renderManager->CreateGraphicsPipeline(desc, pipelineFlags, variantBitmask, sampleCount, cacheLoad, tag.c_str());
vulkanPipeline->pipeline = pipeline;
// These need to be set before creating the pipeline - the render manager checks the flags against
// the render pass type of the pipeline's variants.
if (useBlendConstant) {
pipelineFlags |= PipelineFlags::USES_BLEND_CONSTANT;
}
if (dss.depthTestEnable || dss.stencilTestEnable) {
pipelineFlags |= PipelineFlags::USES_DEPTH_STENCIL;
}
VKRGraphicsPipeline *pipeline = renderManager->CreateGraphicsPipeline(desc, pipelineFlags, variantBitmask, sampleCount, cacheLoad, tag.c_str());
vulkanPipeline->pipeline = pipeline;
vulkanPipeline->pipelineFlags = pipelineFlags;
return vulkanPipeline;
}