From cea35007ae827e5364b70d5049a3d6afeb48640e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 13 Sep 2020 15:41:51 +0200 Subject: [PATCH] Always use a linear filter for video, unless forcing NEAREST filtering. --- Core/Config.cpp | 1 + Core/Config.h | 1 + GPU/Common/TextureCacheCommon.cpp | 6 +++--- GPU/Common/TextureCacheCommon.h | 5 ++--- GPU/Software/Rasterizer.cpp | 4 ++-- UI/GameSettingsScreen.cpp | 2 +- Windows/MainWindowMenu.cpp | 11 ++++------- Windows/ppsspp.rc | 1 - Windows/resource.h | 1 - 9 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index a3c7be9017..0764f7b6c2 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -821,6 +821,7 @@ static ConfigSetting graphicsSettings[] = { ConfigSetting("ClearFramebuffersOnFirstUseHack", &g_Config.bClearFramebuffersOnFirstUseHack, false, true, true), + ConfigSetting(false), }; diff --git a/Core/Config.h b/Core/Config.h index 5a1a6b57b7..cfa071a878 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -186,6 +186,7 @@ public: bool bFullScreenMulti; int iInternalResolution; // 0 = Auto (native), 1 = 1x (480x272), 2 = 2x, 3 = 3x, 4 = 4x and so on. int iAnisotropyLevel; // 0 - 5, powers of 2: 0 = 1x = no aniso + int iMipmapMode; // 0 = default, 1 = performance, 2 = quality int bHighQualityDepth; bool bReplaceTextures; bool bSaveNewTextures; diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 3925c09840..f65a8e4333 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -175,7 +175,7 @@ void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sCl lodBias = 0.0f; } - if (!(magFilt & 1) && addr != 0 && g_Config.iTexFiltering == TEX_FILTER_LINEAR_VIDEO) { + if (!(magFilt & 1) && addr != 0 && g_Config.iTexFiltering != TEX_FILTER_FORCE_NEAREST) { if (videos_.find(addr & 0x3FFFFFFF) != videos_.end()) { magFilt |= 1; minFilt |= 1; @@ -183,14 +183,14 @@ void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sCl } // Filtering overrides - if (g_Config.iTexFiltering == TEX_FILTER_LINEAR) { + if (g_Config.iTexFiltering == TEX_FILTER_FORCE_LINEAR) { // Only override to linear filtering if there's no alpha or color testing going on. if ((!gstate.isColorTestEnabled() || IsColorTestTriviallyTrue()) && (!gstate.isAlphaTestEnabled() || IsAlphaTestTriviallyTrue())) { magFilt |= 1; minFilt |= 1; } - } else if (g_Config.iTexFiltering == TEX_FILTER_NEAREST || + } else if (g_Config.iTexFiltering == TEX_FILTER_FORCE_NEAREST || (gstate.isModeThrough() && g_Config.iInternalResolution != 1 && gstate.isColorTestEnabled() && !IsColorTestTriviallyTrue() && gstate.getColorTestRef() != 0)) { // Force Nearest when override is on, or color test enabled and rendering resolution greater than 480x272 diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 609693521c..a59ef9771d 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -30,9 +30,8 @@ enum TextureFiltering { TEX_FILTER_AUTO = 1, - TEX_FILTER_NEAREST = 2, - TEX_FILTER_LINEAR = 3, - TEX_FILTER_LINEAR_VIDEO = 4, + TEX_FILTER_FORCE_NEAREST = 2, + TEX_FILTER_FORCE_LINEAR = 3, }; enum FramebufferNotification { diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index 9933fac43e..545de958d1 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -1036,9 +1036,9 @@ static inline void CalculateSamplingParams(const float ds, const float dt, const levelFrac = 0; } - if (g_Config.iTexFiltering == TEX_FILTER_LINEAR) { + if (g_Config.iTexFiltering == TEX_FILTER_FORCE_LINEAR) { filt = true; - } else if (g_Config.iTexFiltering == TEX_FILTER_NEAREST) { + } else if (g_Config.iTexFiltering == TEX_FILTER_FORCE_NEAREST) { filt = false; } else { filt = detail > 0 ? gstate.isMinifyFilteringEnabled() : gstate.isMagnifyFilteringEnabled(); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 60d2757f41..99888d9e3a 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -512,7 +512,7 @@ void GameSettingsScreen::CreateViews() { PopupMultiChoice *anisoFiltering = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iAnisotropyLevel, gr->T("Anisotropic Filtering"), anisoLevels, 0, ARRAY_SIZE(anisoLevels), gr->GetName(), screenManager())); anisoFiltering->SetDisabledPtr(&g_Config.bSoftwareRendering); - static const char *texFilters[] = { "Auto", "Nearest", "Linear", "Linear on FMV", }; + static const char *texFilters[] = { "Auto", "Nearest", "Linear" }; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexFiltering, gr->T("Texture Filter"), texFilters, 1, ARRAY_SIZE(texFilters), gr->GetName(), screenManager())); static const char *bufFilters[] = { "Linear", "Nearest", }; diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index 858a4e919f..50ad9881e6 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -313,7 +313,6 @@ namespace MainWindow { TranslateMenuItem(menu, ID_OPTIONS_TEXTUREFILTERING_AUTO); TranslateMenuItem(menu, ID_OPTIONS_NEARESTFILTERING); TranslateMenuItem(menu, ID_OPTIONS_LINEARFILTERING); - TranslateMenuItem(menu, ID_OPTIONS_LINEARFILTERING_CG); TranslateMenuItem(menu, ID_OPTIONS_SCREENFILTER_MENU); TranslateMenuItem(menu, ID_OPTIONS_BUFLINEARFILTER); TranslateMenuItem(menu, ID_OPTIONS_BUFNEARESTFILTER); @@ -979,9 +978,8 @@ namespace MainWindow { break; case ID_OPTIONS_TEXTUREFILTERING_AUTO: setTexFiltering(TEX_FILTER_AUTO); break; - case ID_OPTIONS_NEARESTFILTERING: setTexFiltering(TEX_FILTER_NEAREST); break; - case ID_OPTIONS_LINEARFILTERING: setTexFiltering(TEX_FILTER_LINEAR); break; - case ID_OPTIONS_LINEARFILTERING_CG: setTexFiltering(TEX_FILTER_LINEAR_VIDEO); break; + case ID_OPTIONS_NEARESTFILTERING: setTexFiltering(TEX_FILTER_FORCE_NEAREST); break; + case ID_OPTIONS_LINEARFILTERING: setTexFiltering(TEX_FILTER_FORCE_LINEAR); break; case ID_OPTIONS_BUFLINEARFILTER: setBufFilter(SCALE_LINEAR); break; case ID_OPTIONS_BUFNEARESTFILTER: setBufFilter(SCALE_NEAREST); break; @@ -1221,12 +1219,11 @@ namespace MainWindow { ID_OPTIONS_TEXTUREFILTERING_AUTO, ID_OPTIONS_NEARESTFILTERING, ID_OPTIONS_LINEARFILTERING, - ID_OPTIONS_LINEARFILTERING_CG, }; if (g_Config.iTexFiltering < TEX_FILTER_AUTO) g_Config.iTexFiltering = TEX_FILTER_AUTO; - else if (g_Config.iTexFiltering > TEX_FILTER_LINEAR_VIDEO) - g_Config.iTexFiltering = TEX_FILTER_LINEAR_VIDEO; + else if (g_Config.iTexFiltering > TEX_FILTER_FORCE_LINEAR) + g_Config.iTexFiltering = TEX_FILTER_FORCE_LINEAR; for (int i = 0; i < ARRAY_SIZE(texfilteringitems); i++) { CheckMenuItem(menu, texfilteringitems[i], MF_BYCOMMAND | ((i + 1) == g_Config.iTexFiltering ? MF_CHECKED : MF_UNCHECKED)); diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 5dcb0806a8..966cd1e3b8 100644 --- a/Windows/ppsspp.rc +++ b/Windows/ppsspp.rc @@ -629,7 +629,6 @@ BEGIN MENUITEM "Auto", ID_OPTIONS_TEXTUREFILTERING_AUTO MENUITEM "Nearest", ID_OPTIONS_NEARESTFILTERING MENUITEM "Linear", ID_OPTIONS_LINEARFILTERING - MENUITEM "Linear on FMV", ID_OPTIONS_LINEARFILTERING_CG END POPUP "Screen Scaling Filter", ID_OPTIONS_SCREENFILTER_MENU BEGIN diff --git a/Windows/resource.h b/Windows/resource.h index adb597eab7..914629f889 100644 --- a/Windows/resource.h +++ b/Windows/resource.h @@ -242,7 +242,6 @@ #define ID_OPTIONS_TEXTUREFILTERING_AUTO 40067 #define ID_OPTIONS_NEARESTFILTERING 40068 #define ID_DISASM_DISASSEMBLETOFILE 40069 -#define ID_OPTIONS_LINEARFILTERING_CG 40070 #define ID_DISASM_DISABLEBREAKPOINT 40071 #define ID_DISASM_THREAD_FORCERUN 40072 #define ID_DISASM_THREAD_KILL 40073