diff options
| author | 2020-04-07 20:47:31 -0300 | |
|---|---|---|
| committer | 2020-04-07 20:47:31 -0300 | |
| commit | a209d464f913d743f644461e1c82634ec97f1e3e (patch) | |
| tree | 1209ecf01c8fb3e676756c7c82a42f65ee6e490c /src/video_core/textures/texture.cpp | |
| parent | video_core/texture: Use a LUT to convert sRGB texture borders (diff) | |
| download | yuzu-a209d464f913d743f644461e1c82634ec97f1e3e.tar.gz yuzu-a209d464f913d743f644461e1c82634ec97f1e3e.tar.xz yuzu-a209d464f913d743f644461e1c82634ec97f1e3e.zip | |
video_core/textures: Move GetMaxAnisotropy to cpp file
Diffstat (limited to 'src/video_core/textures/texture.cpp')
| -rw-r--r-- | src/video_core/textures/texture.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp index b1417db1e..d1939d744 100644 --- a/src/video_core/textures/texture.cpp +++ b/src/video_core/textures/texture.cpp | |||
| @@ -2,8 +2,10 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <array> | 6 | #include <array> |
| 6 | 7 | ||
| 8 | #include "core/settings.h" | ||
| 7 | #include "video_core/textures/texture.h" | 9 | #include "video_core/textures/texture.h" |
| 8 | 10 | ||
| 9 | namespace Tegra::Texture { | 11 | namespace Tegra::Texture { |
| @@ -45,6 +47,22 @@ constexpr std::array<float, 256> SRGB_CONVERSION_LUT = { | |||
| 45 | 0.917104f, 0.929242f, 0.941493f, 0.953859f, 0.966338f, 1.000000f, 1.000000f, 1.000000f, | 47 | 0.917104f, 0.929242f, 0.941493f, 0.953859f, 0.966338f, 1.000000f, 1.000000f, 1.000000f, |
| 46 | }; | 48 | }; |
| 47 | 49 | ||
| 50 | unsigned SettingsMinimumAnisotropy() noexcept { | ||
| 51 | switch (static_cast<Anisotropy>(Settings::values.max_anisotropy)) { | ||
| 52 | default: | ||
| 53 | case Anisotropy::Default: | ||
| 54 | return 1U; | ||
| 55 | case Anisotropy::Filter2x: | ||
| 56 | return 2U; | ||
| 57 | case Anisotropy::Filter4x: | ||
| 58 | return 4U; | ||
| 59 | case Anisotropy::Filter8x: | ||
| 60 | return 8U; | ||
| 61 | case Anisotropy::Filter16x: | ||
| 62 | return 16U; | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 48 | } // Anonymous namespace | 66 | } // Anonymous namespace |
| 49 | 67 | ||
| 50 | std::array<float, 4> TSCEntry::GetBorderColor() const noexcept { | 68 | std::array<float, 4> TSCEntry::GetBorderColor() const noexcept { |
| @@ -55,4 +73,8 @@ std::array<float, 4> TSCEntry::GetBorderColor() const noexcept { | |||
| 55 | SRGB_CONVERSION_LUT[srgb_border_color_b], border_color[3]}; | 73 | SRGB_CONVERSION_LUT[srgb_border_color_b], border_color[3]}; |
| 56 | } | 74 | } |
| 57 | 75 | ||
| 76 | float TSCEntry::GetMaxAnisotropy() const noexcept { | ||
| 77 | return static_cast<float>(std::max(1U << max_anisotropy, SettingsMinimumAnisotropy())); | ||
| 78 | } | ||
| 79 | |||
| 58 | } // namespace Tegra::Texture | 80 | } // namespace Tegra::Texture |