summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-10-30 01:52:11 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:33 +0100
commit5230378709470da56927e85c50d0524f9ce3f81b (patch)
tree6f17ba41ea5a1f60ecea9fff4bf2b25b441c0392 /src/video_core/renderer_vulkan
parentTexture Cache: revert Image changes. (diff)
downloadyuzu-5230378709470da56927e85c50d0524f9ce3f81b.tar
yuzu-5230378709470da56927e85c50d0524f9ce3f81b.tar.gz
yuzu-5230378709470da56927e85c50d0524f9ce3f81b.tar.bz2
yuzu-5230378709470da56927e85c50d0524f9ce3f81b.tar.lz
yuzu-5230378709470da56927e85c50d0524f9ce3f81b.tar.xz
yuzu-5230378709470da56927e85c50d0524f9ce3f81b.tar.zst
yuzu-5230378709470da56927e85c50d0524f9ce3f81b.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 1c0741250..7db561ca0 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -1448,7 +1448,14 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
LOG_WARNING(Render_Vulkan, "VK_EXT_sampler_filter_minmax is required");
}
// Some games have samplers with garbage. Sanitize them here.
- const float max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
+ const f32 setting_anisotropic =
+ static_cast<f32>(1U << Settings::values.max_anisotropy.GetValue());
+ const f32 game_anisotropic = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
+ const bool aument_anisotropic =
+ game_anisotropic > 1.0f || tsc.mipmap_filter == TextureMipmapFilter::Linear;
+ const f32 max_anisotropy =
+ aument_anisotropic ? std::max(game_anisotropic, setting_anisotropic) : game_anisotropic;
+
sampler = device.GetLogical().CreateSampler(VkSamplerCreateInfo{
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
.pNext = pnext,