diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index ad0059ca6d..dc19c65817 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -23,6 +23,8 @@ const Info GFX_WIDESCREEN_HACK{{System::GFX, "Settings", "wideScreenHack"} const Info GFX_ASPECT_RATIO{{System::GFX, "Settings", "AspectRatio"}, AspectMode::Auto}; const Info GFX_SUGGESTED_ASPECT_RATIO{{System::GFX, "Settings", "SuggestedAspectRatio"}, AspectMode::Auto}; +const Info GFX_WIDESCREEN_HEURISTIC_TRANSITION_THRESHOLD{ + {System::GFX, "Settings", "WidescreenHeuristicTransitionThreshold"}, 3}; const Info GFX_CROP{{System::GFX, "Settings", "Crop"}, false}; const Info GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES{ {System::GFX, "Settings", "SafeTextureCacheColorSamples"}, 128}; diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index 165114e419..98c4031cf5 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -29,6 +29,7 @@ extern const Info GFX_ADAPTER; extern const Info GFX_WIDESCREEN_HACK; extern const Info GFX_ASPECT_RATIO; extern const Info GFX_SUGGESTED_ASPECT_RATIO; +extern const Info GFX_WIDESCREEN_HEURISTIC_TRANSITION_THRESHOLD; extern const Info GFX_CROP; extern const Info GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES; extern const Info GFX_SHOW_FPS; diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index d9a35b727e..a5a6d77728 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -86,6 +86,8 @@ void VideoConfig::Refresh() bWidescreenHack = Config::Get(Config::GFX_WIDESCREEN_HACK); aspect_mode = Config::Get(Config::GFX_ASPECT_RATIO); suggested_aspect_mode = Config::Get(Config::GFX_SUGGESTED_ASPECT_RATIO); + widescreen_heuristic_transition_threshold = + Config::Get(Config::GFX_WIDESCREEN_HEURISTIC_TRANSITION_THRESHOLD); bCrop = Config::Get(Config::GFX_CROP); iSafeTextureCache_ColorSamples = Config::Get(Config::GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES); bShowFPS = Config::Get(Config::GFX_SHOW_FPS); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 6e34a43934..4a6c1bb811 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -106,6 +106,7 @@ struct VideoConfig final bool bWidescreenHack = false; AspectMode aspect_mode{}; AspectMode suggested_aspect_mode{}; + u32 widescreen_heuristic_transition_threshold = 0; bool bCrop = false; // Aspect ratio controls. bool bShaderCache = false; diff --git a/Source/Core/VideoCommon/Widescreen.cpp b/Source/Core/VideoCommon/Widescreen.cpp index dd1393d309..4ca1ac3ccd 100644 --- a/Source/Core/VideoCommon/Widescreen.cpp +++ b/Source/Core/VideoCommon/Widescreen.cpp @@ -70,13 +70,13 @@ void WidescreenManager::UpdateWidescreenHeuristic() // Modify the threshold based on which aspect ratio we're already using: // If the game's in 4:3, it probably won't switch to anamorphic, and vice-versa. - static constexpr u32 TRANSITION_THRESHOLD = 3; + const u32 transition_threshold = g_ActiveConfig.widescreen_heuristic_transition_threshold; - const auto looks_normal = [](auto& counts) { - return counts.normal_vertex_count > counts.anamorphic_vertex_count * TRANSITION_THRESHOLD; + const auto looks_normal = [transition_threshold](auto& counts) { + return counts.normal_vertex_count > counts.anamorphic_vertex_count * transition_threshold; }; - const auto looks_anamorphic = [](auto& counts) { - return counts.anamorphic_vertex_count > counts.normal_vertex_count * TRANSITION_THRESHOLD; + const auto looks_anamorphic = [transition_threshold](auto& counts) { + return counts.anamorphic_vertex_count > counts.normal_vertex_count * transition_threshold; }; const auto& persp = flush_statistics.perspective;