diff --git a/Core/Config.cpp b/Core/Config.cpp index da59ee4a19..a3dd67f2ff 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -660,6 +660,7 @@ static ConfigSetting graphicsSettings[] = { ReportedConfigSetting("TexScalingType", &g_Config.iTexScalingType, 0, true, true), ReportedConfigSetting("TexDeposterize", &g_Config.bTexDeposterize, false, true, true), ReportedConfigSetting("TexRealtime", &g_Config.bRealtimeTexScaling, false, true, true), + ConfigSetting("UnlockCachedScaling", &g_Config.bUnlockCachedScaling, false, true, true), ConfigSetting("VSyncInterval", &g_Config.bVSync, true, true, true), ReportedConfigSetting("BloomHack", &g_Config.iBloomHack, 2, true, true), diff --git a/Core/Config.h b/Core/Config.h index 6c79fe5c1d..5e78b1804b 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -184,6 +184,7 @@ public: int iTexScalingType; // 0 = xBRZ, 1 = Hybrid bool bRealtimeTexScaling; bool bTexDeposterize; + bool bUnlockCachedScaling; int iFpsLimit1; int iFpsLimit2; int iMaxRecent; diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 8f04fc4db2..bcf1723d47 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -443,7 +443,7 @@ void TextureCacheCommon::SetTexture(bool force) { } } - if (match && (entry->status & TexCacheEntry::STATUS_TO_SCALE) && standardScaleFactor_ != 1 && texelsScaledThisFrame_ < TEXCACHE_MAX_TEXELS_SCALED) { + if (match && (entry->status & TexCacheEntry::STATUS_TO_SCALE) && standardScaleFactor_ != 1 && (g_Config.bUnlockCachedScaling || texelsScaledThisFrame_ < TEXCACHE_MAX_TEXELS_SCALED)) { if ((entry->status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) { // INFO_LOG(G3D, "Reloading texture to do the scaling we skipped.."); match = false; @@ -636,7 +636,7 @@ void TextureCacheCommon::HandleTextureChange(TexCacheEntry *const entry, const c } entry->status |= TexCacheEntry::STATUS_UNRELIABLE; - if (entry->numFrames < TEXCACHE_FRAME_CHANGE_FREQUENT) { + if (!g_Config.bUnlockCachedScaling && entry->numFrames < TEXCACHE_FRAME_CHANGE_FREQUENT) { if (entry->status & TexCacheEntry::STATUS_FREE_CHANGE) { entry->status &= ~TexCacheEntry::STATUS_FREE_CHANGE; } else { diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 4b66e6a583..e399aa84ec 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -511,7 +511,7 @@ void TextureCacheD3D11::BuildTexture(TexCacheEntry *const entry) { } if (scaleFactor != 1) { - if (texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { + if (!g_Config.bUnlockCachedScaling && texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { entry->status |= TexCacheEntry::STATUS_TO_SCALE; scaleFactor = 1; } else { diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 13032603d8..b3adff05cd 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -559,7 +559,7 @@ void TextureCacheDX9::BuildTexture(TexCacheEntry *const entry) { } if (scaleFactor != 1) { - if (texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { + if (!g_Config.bUnlockCachedScaling && texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { entry->status |= TexCacheEntry::STATUS_TO_SCALE; scaleFactor = 1; } else { diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 83d29c9df1..6a27c205ec 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -631,7 +631,7 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) { } if (scaleFactor != 1) { - if (texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { + if (!g_Config.bUnlockCachedScaling && texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { entry->status |= TexCacheEntry::STATUS_TO_SCALE; scaleFactor = 1; } else { diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index c191127bc7..942e8b1d5a 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -582,7 +582,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { } if (scaleFactor != 1) { - if (texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { + if (!g_Config.bUnlockCachedScaling && texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { entry->status |= TexCacheEntry::STATUS_TO_SCALE; scaleFactor = 1; } else { diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 79a3c86ea4..0c3ded057e 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1494,6 +1494,7 @@ void OtherSettingsScreen::CreateViews() { list->Add(new CheckBox(&g_Config.bSimpleFrameStats, gr->T("Display simple frame stats(heavy!)"))); list->Add(new CheckBox(&g_Config.bSavestateScreenshotResLimit, gr->T("Limit resolution of savestates screenshots"))); list->Add(new CheckBox(&g_Config.bDiscordPresence, n->T("Send Discord(3rd party software) Presence information"))); + list->Add(new CheckBox(&g_Config.bUnlockCachedScaling, n->T("Disable texture scaling limiters. Only for testing, this WILL cause stutter even at max FPS! Strongly recommend real time scaling instead!)"))); #if defined(USING_WIN_UI) list->Add(new CheckBox(&g_Config.bDisableWinMenu, n->T("Disable Windows menu bar")))->OnClick.Handle(this, &OtherSettingsScreen::OnDisableWinBorders); list->Add(new CheckBox(&g_Config.bDisableWinBorders, n->T("Disable Windows borders")))->OnClick.Handle(this, &OtherSettingsScreen::OnDisableWinBorders);