Browse Source

vulkan: fix depth texture compare mode setting.

Sasha Szpakowski 1 year ago
parent
commit
6acdd5f01f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/graphics/vulkan/Graphics.cpp

+ 2 - 2
src/modules/graphics/vulkan/Graphics.cpp

@@ -2598,14 +2598,14 @@ VkSampler Graphics::createSampler(const SamplerState &samplerState)
 	if (samplerState.depthSampleMode.hasValue)
 	if (samplerState.depthSampleMode.hasValue)
 	{
 	{
 		samplerInfo.compareEnable = VK_TRUE;
 		samplerInfo.compareEnable = VK_TRUE;
-		samplerInfo.compareOp = Vulkan::getCompareOp(samplerState.depthSampleMode.value);
+		// See the comment in renderstate.h
+		samplerInfo.compareOp = Vulkan::getCompareOp(getReversedCompareMode(samplerState.depthSampleMode.value));
 	}
 	}
 	else
 	else
 	{
 	{
 		samplerInfo.compareEnable = VK_FALSE;
 		samplerInfo.compareEnable = VK_FALSE;
 		samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS;
 		samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS;
 	}
 	}
-	samplerInfo.compareEnable = VK_FALSE;
 	samplerInfo.mipmapMode = Vulkan::getMipMapMode(samplerState.mipmapFilter);
 	samplerInfo.mipmapMode = Vulkan::getMipMapMode(samplerState.mipmapFilter);
 	samplerInfo.mipLodBias = samplerState.lodBias;
 	samplerInfo.mipLodBias = samplerState.lodBias;
 	samplerInfo.minLod = static_cast<float>(samplerState.minLod);
 	samplerInfo.minLod = static_cast<float>(samplerState.minLod);