diff options
Diffstat (limited to 'src/video_core/textures/texture.cpp')
| -rw-r--r-- | src/video_core/textures/texture.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp index b2d5bb03e..ba066f98f 100644 --- a/src/video_core/textures/texture.cpp +++ b/src/video_core/textures/texture.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <array> | 6 | #include <array> |
| 7 | 7 | ||
| 8 | #include "common/cityhash.h" | 8 | #include "common/cityhash.h" |
| 9 | #include "common/settings.h" | ||
| 9 | #include "video_core/textures/texture.h" | 10 | #include "video_core/textures/texture.h" |
| 10 | 11 | ||
| 11 | using Tegra::Texture::TICEntry; | 12 | using Tegra::Texture::TICEntry; |
| @@ -61,7 +62,19 @@ std::array<float, 4> TSCEntry::BorderColor() const noexcept { | |||
| 61 | } | 62 | } |
| 62 | 63 | ||
| 63 | float TSCEntry::MaxAnisotropy() const noexcept { | 64 | float TSCEntry::MaxAnisotropy() const noexcept { |
| 64 | return static_cast<float>(1U << max_anisotropy); | 65 | if (max_anisotropy == 0 && mipmap_filter != TextureMipmapFilter::Linear) { |
| 66 | return 1.0f; | ||
| 67 | } | ||
| 68 | const auto anisotropic_settings = Settings::values.max_anisotropy.GetValue(); | ||
| 69 | u32 new_max_anisotropic{}; | ||
| 70 | if (anisotropic_settings == 0) { | ||
| 71 | const auto anisotropic_based_onscale = Settings::values.resolution_info.up_scale >> | ||
| 72 | Settings::values.resolution_info.down_shift; | ||
| 73 | new_max_anisotropic = std::max(anisotropic_based_onscale + 1U, 1U); | ||
| 74 | } else { | ||
| 75 | new_max_anisotropic = Settings::values.max_anisotropy.GetValue(); | ||
| 76 | } | ||
| 77 | return static_cast<float>(1U << std::min(max_anisotropy + anisotropic_settings - 1, 31U)); | ||
| 65 | } | 78 | } |
| 66 | 79 | ||
| 67 | } // namespace Tegra::Texture | 80 | } // namespace Tegra::Texture |