summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2021-11-16 23:07:17 +0100
committerGravatar Fernando Sahmkow2021-11-16 23:14:51 +0100
commit282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6 (patch)
tree6be46996d65e1799fa45e2f2bd6b81945b97af70 /src/video_core/renderer_vulkan
parentTextureCache: Make a better Anisotropic setter. (diff)
downloadyuzu-282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6.tar.gz
yuzu-282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6.tar.xz
yuzu-282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6.zip
TextureCache: Add automatic anisotropic filtering and refactor code.
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 7db561ca0..daf26f380 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -1448,13 +1448,7 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
1448 LOG_WARNING(Render_Vulkan, "VK_EXT_sampler_filter_minmax is required"); 1448 LOG_WARNING(Render_Vulkan, "VK_EXT_sampler_filter_minmax is required");
1449 } 1449 }
1450 // Some games have samplers with garbage. Sanitize them here. 1450 // Some games have samplers with garbage. Sanitize them here.
1451 const f32 setting_anisotropic = 1451 const f32 max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
1452 static_cast<f32>(1U << Settings::values.max_anisotropy.GetValue());
1453 const f32 game_anisotropic = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
1454 const bool aument_anisotropic =
1455 game_anisotropic > 1.0f || tsc.mipmap_filter == TextureMipmapFilter::Linear;
1456 const f32 max_anisotropy =
1457 aument_anisotropic ? std::max(game_anisotropic, setting_anisotropic) : game_anisotropic;
1458 1452
1459 sampler = device.GetLogical().CreateSampler(VkSamplerCreateInfo{ 1453 sampler = device.GetLogical().CreateSampler(VkSamplerCreateInfo{
1460 .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, 1454 .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,