diff options
author | bunnei <bunneidev@gmail.com> | 2020-03-08 21:28:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 21:28:07 +0100 |
commit | c281173df6878bad5a157302560b42aedf623267 (patch) | |
tree | cec07c355b7334539d84b32f24dccba31a77d76c | |
parent | Merge pull request #3452 from Morph1984/anisotropic-filtering (diff) | |
parent | textures: Fix anisotropy hack (diff) | |
download | yuzu-c281173df6878bad5a157302560b42aedf623267.tar yuzu-c281173df6878bad5a157302560b42aedf623267.tar.gz yuzu-c281173df6878bad5a157302560b42aedf623267.tar.bz2 yuzu-c281173df6878bad5a157302560b42aedf623267.tar.lz yuzu-c281173df6878bad5a157302560b42aedf623267.tar.xz yuzu-c281173df6878bad5a157302560b42aedf623267.tar.zst yuzu-c281173df6878bad5a157302560b42aedf623267.zip |
-rw-r--r-- | src/video_core/textures/texture.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index 07098c70d..7edc4abe1 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h @@ -337,20 +337,22 @@ struct TSCEntry { }; float GetMaxAnisotropy() const { - switch (static_cast<Anisotropy>(Settings::values.max_anisotropy)) { - case Anisotropy::Default: - return static_cast<float>(1U << max_anisotropy); - case Anisotropy::Filter2x: - return static_cast<float>(2U << max_anisotropy); - case Anisotropy::Filter4x: - return static_cast<float>(4U << max_anisotropy); - case Anisotropy::Filter8x: - return static_cast<float>(8U << max_anisotropy); - case Anisotropy::Filter16x: - return static_cast<float>(16U << max_anisotropy); - default: - return static_cast<float>(1U << max_anisotropy); - } + const u32 min_value = [] { + switch (static_cast<Anisotropy>(Settings::values.max_anisotropy)) { + default: + case Anisotropy::Default: + return 1U; + case Anisotropy::Filter2x: + return 2U; + case Anisotropy::Filter4x: + return 4U; + case Anisotropy::Filter8x: + return 8U; + case Anisotropy::Filter16x: + return 16U; + } + }(); + return static_cast<float>(std::max(1U << max_anisotropy, min_value)); } float GetMinLod() const { |