From 29b7e33c1466a07db07e796ce9492ee384d4da2c Mon Sep 17 00:00:00 2001 From: Jonathan Hamilton Date: Wed, 16 May 2018 17:12:56 -0700 Subject: [PATCH] Make arbitrary mipmap detection a config option Under GFX::Enhancements::ArbitraryMipmapDetection - default enabled --- Source/Core/Core/Config/GraphicsSettings.cpp | 2 ++ Source/Core/Core/Config/GraphicsSettings.h | 1 + Source/Core/VideoCommon/TextureCacheBase.cpp | 3 +++ Source/Core/VideoCommon/VideoConfig.cpp | 1 + Source/Core/VideoCommon/VideoConfig.h | 1 + 5 files changed, 8 insertions(+) diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index 6646cff79e..893bbf1235 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -107,6 +107,8 @@ const ConfigInfo GFX_ENHANCE_FORCE_TRUE_COLOR{{System::GFX, "Enhancements" true}; const ConfigInfo GFX_ENHANCE_DISABLE_COPY_FILTER{ {System::GFX, "Enhancements", "DisableCopyFilter"}, true}; +const ConfigInfo GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION{ + {System::GFX, "Enhancements", "ArbitraryMipmapDetection"}, true}; // Graphics.Stereoscopy diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index c0113ae83e..34f518f5d5 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -85,6 +85,7 @@ extern const ConfigInfo GFX_ENHANCE_MAX_ANISOTROPY; // NOTE - this is x in 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; // Graphics.Stereoscopy diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index bf9dc98b9d..00d65c953d 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -500,6 +500,9 @@ public: if (levels.size() < 2) return false; + if (!g_ActiveConfig.bArbitraryMipmapDetection) + return false; + // This is the average per-pixel, per-channel difference in percent between what we // 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 diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 2d7f958d8f..c7ab81d82b 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -120,6 +120,7 @@ void VideoConfig::Refresh() sPostProcessingShader = Config::Get(Config::GFX_ENHANCE_POST_SHADER); 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); 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 03ccfca3ba..faebb31f70 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -74,6 +74,7 @@ struct VideoConfig final std::string sPostProcessingShader; bool bForceTrueColor; bool bDisableCopyFilter; + bool bArbitraryMipmapDetection; // Information bool bShowFPS;