diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index f1be3b94fe..db48c4f4c9 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -81,6 +81,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "MpegAvcWarmUp", &flags_.MpegAvcWarmUp); CheckSetting(iniFile, gameID, "BlueToAlpha", &flags_.BlueToAlpha); CheckSetting(iniFile, gameID, "CenteredLines", &flags_.CenteredLines); + CheckSetting(iniFile, gameID, "MaliDepthStencilBugWorkaround", &flags_.MaliDepthStencilBugWorkaround); } void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) { diff --git a/Core/Compatibility.h b/Core/Compatibility.h index 37173adc6d..9340c36411 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -80,6 +80,7 @@ struct CompatFlags { bool MpegAvcWarmUp; bool BlueToAlpha; bool CenteredLines; + bool MaliDepthStencilBugWorkaround; }; class IniFile; diff --git a/GPU/Common/ShaderId.cpp b/GPU/Common/ShaderId.cpp index 230de66e65..cbfbeeffa3 100644 --- a/GPU/Common/ShaderId.cpp +++ b/GPU/Common/ShaderId.cpp @@ -3,6 +3,7 @@ #include "Common/GPU/thin3d.h" #include "Common/StringUtils.h" +#include "Core/System.h" #include "Core/Config.h" #include "GPU/ge_constants.h" @@ -341,7 +342,7 @@ void ComputeFragmentShaderID(FShaderID *id_out, const Draw::Bugs &bugs) { if (g_Config.bVendorBugChecksEnabled) { if (bugs.Has(Draw::Bugs::NO_DEPTH_CANNOT_DISCARD_STENCIL)) { id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, !IsStencilTestOutputDisabled() && !gstate.isDepthWriteEnabled()); - } else if (bugs.Has(Draw::Bugs::MALI_STENCIL_DISCARD_BUG)) { + } else if (bugs.Has(Draw::Bugs::MALI_STENCIL_DISCARD_BUG) && PSP_CoreParameter().compat.flags().MaliDepthStencilBugWorkaround) { // Very similar driver bug to the Adreno one, with the same workaround (though might look into if there are cheaper ones!) // Keeping the conditions separate since it can probably be made tighter. id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, !IsStencilTestOutputDisabled() && !gstate.isDepthWriteEnabled()); diff --git a/assets/compat.ini b/assets/compat.ini index 1f0e2b2178..5b6cfadeed 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -586,6 +586,23 @@ NPJH50304 = true ULES00703 = true ULAS42095 = true +[MaliDepthStencilBugWorkaround] +# See issue #13833 where the map is supposed to be round but is not. + +# Midnight Club: LA Remix +ULUS10383 = true +ULES01144 = true +ULJS00180 = true +ULJS00267 = true +ULJM05904 = true +NPJH50440 = true +# Midnight Club 3 : DUB edition +ULUS10021 = true +ULES00108 = true + +# Tales of Phantasia - Narikiri Dungeon X. See #15526 +ULJS00293 = true + [RequireDefaultCPUClock] # GOW : Ghost of Sparta UCUS98737 = true