diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index 893bbf1235..98a5c13bcf 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -109,6 +109,8 @@ const ConfigInfo GFX_ENHANCE_DISABLE_COPY_FILTER{ {System::GFX, "Enhancements", "DisableCopyFilter"}, true}; const ConfigInfo GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION{ {System::GFX, "Enhancements", "ArbitraryMipmapDetection"}, true}; +const ConfigInfo GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD{ + {System::GFX, "Enhancements", "ArbitraryMipmapDetectionThreshold"}, 4.5f}; // Graphics.Stereoscopy diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index 34f518f5d5..3e87298f85 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -86,6 +86,7 @@ extern const ConfigInfo GFX_ENHANCE_POST_SHADER; extern const ConfigInfo GFX_ENHANCE_FORCE_TRUE_COLOR; extern const ConfigInfo GFX_ENHANCE_DISABLE_COPY_FILTER; extern const ConfigInfo GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION; +extern const ConfigInfo GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD; // Graphics.Stereoscopy diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 00d65c953d..370bdd836b 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -507,7 +507,7 @@ public: // expect a normal blurred mipmap to look like and what we actually received // 4.5% was chosen because it's just below the lowest clearly-arbitrary texture // I found in my tests, the background clouds in Mario Galaxy's Observatory lobby. - constexpr auto THRESHOLD_PERCENT = 4.5f; + const auto threshold = g_ActiveConfig.fArbitraryMipmapDetectionThreshold; auto* src = downsample_buffer; auto* dst = downsample_buffer + levels[1].shape.row_length * levels[1].shape.height * 4; @@ -533,7 +533,7 @@ public: } auto all_levels = total_diff / (levels.size() - 1); - return all_levels > THRESHOLD_PERCENT; + return all_levels > threshold; } private: diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index c7ab81d82b..a0029df1e7 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -121,6 +121,8 @@ void VideoConfig::Refresh() bForceTrueColor = Config::Get(Config::GFX_ENHANCE_FORCE_TRUE_COLOR); bDisableCopyFilter = Config::Get(Config::GFX_ENHANCE_DISABLE_COPY_FILTER); bArbitraryMipmapDetection = Config::Get(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION); + fArbitraryMipmapDetectionThreshold = + Config::Get(Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD); stereo_mode = Config::Get(Config::GFX_STEREO_MODE); iStereoDepth = Config::Get(Config::GFX_STEREO_DEPTH); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index faebb31f70..97d6429133 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -75,6 +75,7 @@ struct VideoConfig final bool bForceTrueColor; bool bDisableCopyFilter; bool bArbitraryMipmapDetection; + float fArbitraryMipmapDetectionThreshold; // Information bool bShowFPS;