diff options
| author | 2021-11-16 18:52:11 -0800 | |
|---|---|---|
| committer | 2021-11-16 18:52:11 -0800 | |
| commit | 71313509f75aeafe425e531824d1faa9e7c0a40b (patch) | |
| tree | cb1df371d288677fcede6a3409eb079e0d278163 /src/video_core/textures/texture.cpp | |
| parent | Merge pull request #7347 from lioncash/catch (diff) | |
| parent | TextureCache: Fix Automatic Anisotropic. (diff) | |
| download | yuzu-71313509f75aeafe425e531824d1faa9e7c0a40b.tar.gz yuzu-71313509f75aeafe425e531824d1faa9e7c0a40b.tar.xz yuzu-71313509f75aeafe425e531824d1faa9e7c0a40b.zip | |
Merge pull request #7219 from FernandoS27/aristotles-right-testicle
Project A.R.T. Advanced Rendering Techniques
Diffstat (limited to 'src/video_core/textures/texture.cpp')
| -rw-r--r-- | src/video_core/textures/texture.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp index a552543ed..06954963d 100644 --- a/src/video_core/textures/texture.cpp +++ b/src/video_core/textures/texture.cpp | |||
| @@ -51,22 +51,6 @@ constexpr std::array<float, 256> SRGB_CONVERSION_LUT = { | |||
| 51 | 0.917104f, 0.929242f, 0.941493f, 0.953859f, 0.966338f, 1.000000f, 1.000000f, 1.000000f, | 51 | 0.917104f, 0.929242f, 0.941493f, 0.953859f, 0.966338f, 1.000000f, 1.000000f, 1.000000f, |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | unsigned SettingsMinimumAnisotropy() noexcept { | ||
| 55 | switch (static_cast<Anisotropy>(Settings::values.max_anisotropy.GetValue())) { | ||
| 56 | default: | ||
| 57 | case Anisotropy::Default: | ||
| 58 | return 1U; | ||
| 59 | case Anisotropy::Filter2x: | ||
| 60 | return 2U; | ||
| 61 | case Anisotropy::Filter4x: | ||
| 62 | return 4U; | ||
| 63 | case Anisotropy::Filter8x: | ||
| 64 | return 8U; | ||
| 65 | case Anisotropy::Filter16x: | ||
| 66 | return 16U; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | } // Anonymous namespace | 54 | } // Anonymous namespace |
| 71 | 55 | ||
| 72 | std::array<float, 4> TSCEntry::BorderColor() const noexcept { | 56 | std::array<float, 4> TSCEntry::BorderColor() const noexcept { |
| @@ -78,7 +62,18 @@ std::array<float, 4> TSCEntry::BorderColor() const noexcept { | |||
| 78 | } | 62 | } |
| 79 | 63 | ||
| 80 | float TSCEntry::MaxAnisotropy() const noexcept { | 64 | float TSCEntry::MaxAnisotropy() const noexcept { |
| 81 | return static_cast<float>(std::max(1U << max_anisotropy, SettingsMinimumAnisotropy())); | 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 added_anisotropic{}; | ||
| 70 | if (anisotropic_settings == 0) { | ||
| 71 | added_anisotropic = Settings::values.resolution_info.up_scale >> | ||
| 72 | Settings::values.resolution_info.down_shift; | ||
| 73 | } else { | ||
| 74 | added_anisotropic = Settings::values.max_anisotropy.GetValue() - 1U; | ||
| 75 | } | ||
| 76 | return static_cast<float>(1U << (max_anisotropy + added_anisotropic)); | ||
| 82 | } | 77 | } |
| 83 | 78 | ||
| 84 | } // namespace Tegra::Texture | 79 | } // namespace Tegra::Texture |