From 8e9acff6aa0442e5e38f4f5d3d7deb4c054fcac4 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 20 Mar 2016 14:33:37 +0100 Subject: [PATCH] Always specify depthstencil state in pipelines. Turns out it's only OK to leave out if rendering only to color, otherwise behaviour is undefined - which means it may still be enabled. --- GPU/Vulkan/PipelineManagerVulkan.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/GPU/Vulkan/PipelineManagerVulkan.cpp b/GPU/Vulkan/PipelineManagerVulkan.cpp index 13f228b142..9f9fd679f2 100644 --- a/GPU/Vulkan/PipelineManagerVulkan.cpp +++ b/GPU/Vulkan/PipelineManagerVulkan.cpp @@ -49,7 +49,7 @@ static const DeclTypeInfo VComp[] = { { VK_FORMAT_R16G16_UNORM, "R16G16_UNORM" }, // DEC_U16_2, { VK_FORMAT_R16G16B16A16_UNORM, "R16G16B16A16_UNORM " }, // DEC_U16_3, { VK_FORMAT_R16G16B16A16_UNORM, "R16G16B16A16_UNORM " }, // DEC_U16_4, - // Not supported in regular DX9 so faking, will cause graphics bugs until worked around + { VK_FORMAT_R8G8_UINT, "R8G8_UINT" }, // DEC_U8A_2, { VK_FORMAT_R16G16_UINT, "R16G16_UINT" }, // DEC_U16A_2, }; @@ -235,11 +235,7 @@ static VulkanPipeline *CreateVulkanPipeline(VkDevice device, VkPipelineCache pip pipe.basePipelineIndex = 0; pipe.pColorBlendState = &cbs; - if (key.depthTestEnable || key.stencilTestEnable) { - pipe.pDepthStencilState = &dss; - } else { - pipe.pDepthStencilState = nullptr; - } + pipe.pDepthStencilState = &dss; pipe.pRasterizationState = &rs; // We will use dynamic viewport state. @@ -278,7 +274,7 @@ VulkanPipeline *PipelineManagerVulkan::GetOrCreatePipeline(VkPipelineLayout layo key.useHWTransform = useHwTransform; key.vShader = vs->GetModule(); key.fShader = fs->GetModule(); - key.vtxDec = vtxDec; + key.vtxDec = useHwTransform ? vtxDec : nullptr; auto iter = pipelines_.find(key); if (iter != pipelines_.end()) { return iter->second;