diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2025-02-22 23:44:39 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2025-03-17 20:46:24 -0500 |
| commit | 561aee7707d4ace0d987deed6c8084178c653c3d (patch) | |
| tree | bb31738662f9ad98ae6029b7daacb52d80dafad5 /Source/Core/VideoCommon | |
| parent | 4b711e1e0aaa4c112a5815b6b7aa560014fda6de (diff) | |
Config: Expose Default and 1x Anisotropic Filtering setting.
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.h | 12 |
3 files changed, 16 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 3f237dcb99..303a5f5b44 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -20,6 +20,7 @@ #include "Common/Assert.h" #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" +#include "Common/EnumUtils.h" #include "Common/FileUtil.h" #include "Common/Hash.h" #include "Common/Logging/Log.h" @@ -1038,7 +1039,8 @@ SamplerState TextureCacheBase::GetSamplerState(u32 index, float custom_tex_scale state.tm1.max_lod = 255; // Anisotropic filtering option. - if (g_ActiveConfig.iMaxAnisotropy != 0 && IsAnisostropicEnhancementSafe(tm0)) + if (g_ActiveConfig.iMaxAnisotropy != AnisotropicFilteringMode::Default && + IsAnisostropicEnhancementSafe(tm0)) { // https://www.opengl.org/registry/specs/EXT/texture_filter_anisotropic.txt // For predictable results on all hardware/drivers, only use one of: @@ -1051,7 +1053,7 @@ SamplerState TextureCacheBase::GetSamplerState(u32 index, float custom_tex_scale state.tm0.mag_filter = FilterMode::Linear; if (tm0.mipmap_filter != MipMode::None) state.tm0.mipmap_filter = FilterMode::Linear; - state.tm0.anisotropic_filtering = g_ActiveConfig.iMaxAnisotropy; + state.tm0.anisotropic_filtering = Common::ToUnderlying(g_ActiveConfig.iMaxAnisotropy); } if (has_arbitrary_mips && tm0.mipmap_filter != MipMode::None) diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 678541931e..b540358fb1 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -265,7 +265,7 @@ void CheckForConfigChanges() const ShaderHostConfig old_shader_host_config = ShaderHostConfig::GetCurrent(); const StereoMode old_stereo = g_ActiveConfig.stereo_mode; const u32 old_multisamples = g_ActiveConfig.iMultisamples; - const int old_anisotropy = g_ActiveConfig.iMaxAnisotropy; + const auto old_anisotropy = g_ActiveConfig.iMaxAnisotropy; const int old_efb_access_tile_size = g_ActiveConfig.iEFBAccessTileSize; const auto old_texture_filtering_mode = g_ActiveConfig.texture_filtering_mode; const bool old_vsync = g_ActiveConfig.bVSyncActive; diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 53b51a81e4..4caa48bd7c 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -55,6 +55,16 @@ enum class TextureFilteringMode : int Linear, }; +enum class AnisotropicFilteringMode : int +{ + Default = -1, + Force1x = 0, + Force2x = 1, + Force4x = 2, + Force8x = 3, + Force16x = 4, +}; + enum class OutputResamplingMode : int { Default, @@ -202,7 +212,7 @@ struct VideoConfig final int iEFBScale = 0; TextureFilteringMode texture_filtering_mode = TextureFilteringMode::Default; OutputResamplingMode output_resampling_mode = OutputResamplingMode::Default; - int iMaxAnisotropy = 0; + AnisotropicFilteringMode iMaxAnisotropy = AnisotropicFilteringMode::Default; std::string sPostProcessingShader; bool bForceTrueColor = false; bool bDisableCopyFilter = false; |
