Out of performance paranoia, limit the Mali workaround to known affected games

This commit is contained in:
Henrik Rydgård 2022-04-16 23:47:05 +02:00
parent d0ea3b3284
commit 8922be2015
4 changed files with 21 additions and 1 deletions

View file

@ -81,6 +81,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "MpegAvcWarmUp", &flags_.MpegAvcWarmUp); CheckSetting(iniFile, gameID, "MpegAvcWarmUp", &flags_.MpegAvcWarmUp);
CheckSetting(iniFile, gameID, "BlueToAlpha", &flags_.BlueToAlpha); CheckSetting(iniFile, gameID, "BlueToAlpha", &flags_.BlueToAlpha);
CheckSetting(iniFile, gameID, "CenteredLines", &flags_.CenteredLines); 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) { void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {

View file

@ -80,6 +80,7 @@ struct CompatFlags {
bool MpegAvcWarmUp; bool MpegAvcWarmUp;
bool BlueToAlpha; bool BlueToAlpha;
bool CenteredLines; bool CenteredLines;
bool MaliDepthStencilBugWorkaround;
}; };
class IniFile; class IniFile;

View file

@ -3,6 +3,7 @@
#include "Common/GPU/thin3d.h" #include "Common/GPU/thin3d.h"
#include "Common/StringUtils.h" #include "Common/StringUtils.h"
#include "Core/System.h"
#include "Core/Config.h" #include "Core/Config.h"
#include "GPU/ge_constants.h" #include "GPU/ge_constants.h"
@ -341,7 +342,7 @@ void ComputeFragmentShaderID(FShaderID *id_out, const Draw::Bugs &bugs) {
if (g_Config.bVendorBugChecksEnabled) { if (g_Config.bVendorBugChecksEnabled) {
if (bugs.Has(Draw::Bugs::NO_DEPTH_CANNOT_DISCARD_STENCIL)) { if (bugs.Has(Draw::Bugs::NO_DEPTH_CANNOT_DISCARD_STENCIL)) {
id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, !IsStencilTestOutputDisabled() && !gstate.isDepthWriteEnabled()); 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!) // 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. // Keeping the conditions separate since it can probably be made tighter.
id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, !IsStencilTestOutputDisabled() && !gstate.isDepthWriteEnabled()); id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, !IsStencilTestOutputDisabled() && !gstate.isDepthWriteEnabled());

View file

@ -586,6 +586,23 @@ NPJH50304 = true
ULES00703 = true ULES00703 = true
ULAS42095 = 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] [RequireDefaultCPUClock]
# GOW : Ghost of Sparta # GOW : Ghost of Sparta
UCUS98737 = true UCUS98737 = true