summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2025-03-23 15:17:24 -0400
committerGitHub <noreply@github.com>2025-03-23 15:17:24 -0400
commit9b0471532ce8f715c2c681cb7fb7173e75708104 (patch)
tree426ee98d5c5616aad80a7da1870d2ca288be423c /Source/Core/VideoCommon/TextureCacheBase.cpp
parent2da255d8cdb2da67123296f5f091f808c696d021 (diff)
parent561aee7707d4ace0d987deed6c8084178c653c3d (diff)
Merge pull request #13368 from jordan-woyak/anisotropic-filtering
Use Game Requested Anisotropic Filtering
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index bbecc6437c..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,11 +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 = true;
- }
- else
- {
- state.tm0.anisotropic_filtering = false;
+ state.tm0.anisotropic_filtering = Common::ToUnderlying(g_ActiveConfig.iMaxAnisotropy);
}
if (has_arbitrary_mips && tm0.mipmap_filter != MipMode::None)
@@ -1068,7 +1066,7 @@ SamplerState TextureCacheBase::GetSamplerState(u32 index, float custom_tex_scale
state.tm0.lod_bias = std::clamp<s32>(state.tm0.lod_bias + lod_offset, -32768, 32767);
// Anisotropic also pushes mips farther away so it cannot be used either
- state.tm0.anisotropic_filtering = false;
+ state.tm0.anisotropic_filtering = 0;
}
return state;