Vulkan: Follow sampler best practices with auto max quality.

This commit is contained in:
Henrik Rydgård committed 2022-05-01 10:20:11 +02:00
1 parent 30fdbb8db8
commit d30024cc88
1 file changed
+6 -1
+6 -1
View File
@@ -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);