summaryrefslogtreecommitdiff
path: root/src/video_core/textures/texture.cpp
diff options
context:
space:
mode:
authorGravatar Wollnashorn2023-06-15 18:19:32 +0200
committerGravatar Wollnashorn2023-06-15 18:19:32 +0200
commit42c944b250d8d5c8147b24b3a453cba29968d46c (patch)
tree6d156e8247219bf373edd848bd3a89bbd32eb546 /src/video_core/textures/texture.cpp
parentvideo_core: Apply AF only to samplers with normal LOD range [0, 1+x] (diff)
downloadyuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.gz
yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.xz
yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.zip
video_core: Add per-image anisotropy heuristics (format & mip count)
Diffstat (limited to 'src/video_core/textures/texture.cpp')
-rw-r--r--src/video_core/textures/texture.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp
index 560b3af8a..cb24d0399 100644
--- a/src/video_core/textures/texture.cpp
+++ b/src/video_core/textures/texture.cpp
@@ -62,12 +62,14 @@ std::array<float, 4> TSCEntry::BorderColor() const noexcept {
62} 62}
63 63
64float TSCEntry::MaxAnisotropy() const noexcept { 64float TSCEntry::MaxAnisotropy() const noexcept {
65 const bool is_unsupported_mipmap_filter = Settings::values.use_aggressive_anisotropic_filtering 65 const bool is_suitable_mipmap_filter = Settings::values.use_aggressive_anisotropic_filtering
66 ? mipmap_filter == TextureMipmapFilter::None 66 ? mipmap_filter != TextureMipmapFilter::None
67 : mipmap_filter != TextureMipmapFilter::Linear; 67 : mipmap_filter == TextureMipmapFilter::Linear;
68 const bool has_regular_lods = min_lod_clamp == 0 && max_lod_clamp >= 256; 68 const bool has_regular_lods = min_lod_clamp == 0 && max_lod_clamp >= 256;
69 if (max_anisotropy == 0 && 69 const bool is_bilinear_filter = min_filter == TextureFilter::Linear &&
70 (depth_compare_enabled.Value() || !has_regular_lods || is_unsupported_mipmap_filter)) { 70 reduction_filter == SamplerReduction::WeightedAverage;
71 if (max_anisotropy == 0 && (depth_compare_enabled.Value() || !has_regular_lods ||
72 !is_bilinear_filter || !is_suitable_mipmap_filter)) {
71 return 1.0f; 73 return 1.0f;
72 } 74 }
73 const auto anisotropic_settings = Settings::values.max_anisotropy.GetValue(); 75 const auto anisotropic_settings = Settings::values.max_anisotropy.GetValue();