diff options
| author | lizzie <lizzie@eden-emu.dev> | 2025-11-26 02:16:37 +0100 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-11-26 02:16:37 +0100 |
| commit | 91b043259110967f78a3316be4e163623e33cf32 (patch) | |
| tree | 428dc01b3f2192dbad08b4243fb3cc3c54c09a86 /src/video_core/textures/texture.cpp | |
| parent | 46239dafa179da5d9b4ef338037a936c974e84a9 (diff) | |
[video_core, settings] Allow to turn of aniso levels completely, provide levels of aniso upto x64 (#3019)
Never in my lifetime will I ever need to revise anisotropy levels; I hope :)
Signed-off-by: lizzie lizzie@eden-emu.dev
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3019
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/video_core/textures/texture.cpp')
| -rw-r--r-- | src/video_core/textures/texture.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp index b51441bdfe..d32872e35d 100644 --- a/src/video_core/textures/texture.cpp +++ b/src/video_core/textures/texture.cpp @@ -69,20 +69,29 @@ float TSCEntry::MaxAnisotropy() const noexcept { const bool has_regular_lods = min_lod_clamp == 0 && max_lod_clamp >= 256; const bool is_bilinear_filter = min_filter == TextureFilter::Linear && reduction_filter == SamplerReduction::WeightedAverage; - if (max_anisotropy == 0 && (!is_suitable_mipmap_filter || !has_regular_lods || - !is_bilinear_filter || depth_compare_enabled)) { + if (max_anisotropy == 0 && (!is_suitable_mipmap_filter || !has_regular_lods || !is_bilinear_filter || depth_compare_enabled)) return 1.0f; - } - const auto anisotropic_settings = Settings::values.max_anisotropy.GetValue(); + s32 added_anisotropic{}; - if (anisotropic_settings == Settings::AnisotropyMode::Automatic) { - added_anisotropic = Settings::values.resolution_info.up_scale >> - Settings::values.resolution_info.down_shift; - added_anisotropic = (std::max)(added_anisotropic - 1, 0); - } else { - added_anisotropic = static_cast<u32>(Settings::values.max_anisotropy.GetValue()) - 1U; + auto const anisotropic_settings = Settings::values.max_anisotropy.GetValue(); + switch (anisotropic_settings) { + case Settings::AnisotropyMode::Default: + case Settings::AnisotropyMode::X2: + case Settings::AnisotropyMode::X4: + case Settings::AnisotropyMode::X8: + case Settings::AnisotropyMode::X16: + case Settings::AnisotropyMode::X32: + case Settings::AnisotropyMode::X64: + added_anisotropic = u32(anisotropic_settings) - 1U; + break; + case Settings::AnisotropyMode::Automatic: + added_anisotropic = Settings::values.resolution_info.up_scale >> Settings::values.resolution_info.down_shift; + added_anisotropic = (std::max)(added_anisotropic - 1U, 0U); + break; + case Settings::AnisotropyMode::None: + return 1.0f; //No use of anisotropy } - return static_cast<float>(1U << (max_anisotropy + added_anisotropic)); + return float(1U << (max_anisotropy + added_anisotropic)); } } // namespace Tegra::Texture |
