From d30024cc88ccf52cb795e731319c27c4afdfb0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 1 May 2022 00:52:37 +0200 Subject: [PATCH] Vulkan: Follow sampler best practices with auto max quality. --- GPU/Vulkan/TextureCacheVulkan.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 58d20e970e..a53ef9618f 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -133,7 +133,12 @@ VkSampler SamplerCache::GetOrCreateSampler(const SamplerCacheKey &key) { samp.maxAnisotropy = 1.0f; samp.anisotropyEnable = false; } - samp.maxLod = (float)(int32_t)key.maxLevel * (1.0f / 256.0f); + if (key.maxLevel == 9 * 256) { + // No max level needed. + samp.maxLod = VK_LOD_CLAMP_NONE; + } else { + samp.maxLod = (float)(int32_t)key.maxLevel * (1.0f / 256.0f); + } samp.minLod = (float)(int32_t)key.minLevel * (1.0f / 256.0f); samp.mipLodBias = (float)(int32_t)key.lodBias * (1.0f / 256.0f);