Add compat flag / bug check for games on old Adreno/GL affected by #16015

See #16015

Partly derived from https://github.com/hrydgard/ppsspp/compare/master...unknownbrackets:ppsspp:adreno-deadlock

But this one surgically activates it only for the known affected games, to avoid any additional
performance regressions in the release.

Entirely untested.
This commit is contained in:
Henrik Rydgård 2022-11-23 17:32:32 +01:00
parent d6cfff00f4
commit 39f2ddd128
7 changed files with 59 additions and 1 deletions

View file

@ -645,6 +645,11 @@ OpenGLContext::OpenGLContext() {
bugs_.Infest(Bugs::PVR_GENMIPMAP_HEIGHT_GREATER); bugs_.Infest(Bugs::PVR_GENMIPMAP_HEIGHT_GREATER);
} }
if (caps_.vendor == GPUVendor::VENDOR_QUALCOMM) {
if (gl_extensions.modelNumber < 600)
bugs_.Infest(Bugs::ADRENO_RESOURCE_DEADLOCK);
}
#if PPSSPP_PLATFORM(IOS) #if PPSSPP_PLATFORM(IOS)
// For some reason, this bug does not appear on M1. // For some reason, this bug does not appear on M1.
if (caps_.vendor == GPUVendor::VENDOR_APPLE) { if (caps_.vendor == GPUVendor::VENDOR_APPLE) {

View file

@ -733,6 +733,8 @@ const char *Bugs::GetBugName(uint32_t bug) {
case RASPBERRY_SHADER_COMP_HANG: return "RASPBERRY_SHADER_COMP_HANG"; case RASPBERRY_SHADER_COMP_HANG: return "RASPBERRY_SHADER_COMP_HANG";
case MALI_CONSTANT_LOAD_BUG: return "MALI_CONSTANT_LOAD_BUG"; case MALI_CONSTANT_LOAD_BUG: return "MALI_CONSTANT_LOAD_BUG";
case SUBPASS_FEEDBACK_BROKEN: return "SUBPASS_FEEDBACK_BROKEN"; case SUBPASS_FEEDBACK_BROKEN: return "SUBPASS_FEEDBACK_BROKEN";
case GEOMETRY_SHADERS_SLOW_OR_BROKEN: return "GEOMETRY_SHADERS_SLOW_OR_BROKEN";
case ADRENO_RESOURCE_DEADLOCK: return "ADRENO_RESOURCE_DEADLOCK";
default: return "(N/A)"; default: return "(N/A)";
} }
} }

View file

@ -339,6 +339,7 @@ public:
MALI_CONSTANT_LOAD_BUG = 9, MALI_CONSTANT_LOAD_BUG = 9,
SUBPASS_FEEDBACK_BROKEN = 10, SUBPASS_FEEDBACK_BROKEN = 10,
GEOMETRY_SHADERS_SLOW_OR_BROKEN = 11, GEOMETRY_SHADERS_SLOW_OR_BROKEN = 11,
ADRENO_RESOURCE_DEADLOCK = 12,
MAX_BUG, MAX_BUG,
}; };

View file

@ -120,6 +120,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "NearestFilteringOnFramebufferCreate", &flags_.NearestFilteringOnFramebufferCreate); CheckSetting(iniFile, gameID, "NearestFilteringOnFramebufferCreate", &flags_.NearestFilteringOnFramebufferCreate);
CheckSetting(iniFile, gameID, "SecondaryTextureCache", &flags_.SecondaryTextureCache); CheckSetting(iniFile, gameID, "SecondaryTextureCache", &flags_.SecondaryTextureCache);
CheckSetting(iniFile, gameID, "EnglishOrJapaneseOnly", &flags_.EnglishOrJapaneseOnly); CheckSetting(iniFile, gameID, "EnglishOrJapaneseOnly", &flags_.EnglishOrJapaneseOnly);
CheckSetting(iniFile, gameID, "OldAdrenoPixelDepthRoundingGL", &flags_.OldAdrenoPixelDepthRoundingGL);
} }
void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) { void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {

View file

@ -91,6 +91,7 @@ struct CompatFlags {
bool NearestFilteringOnFramebufferCreate; bool NearestFilteringOnFramebufferCreate;
bool SecondaryTextureCache; bool SecondaryTextureCache;
bool EnglishOrJapaneseOnly; bool EnglishOrJapaneseOnly;
bool OldAdrenoPixelDepthRoundingGL;
}; };
struct VRCompat { struct VRCompat {

View file

@ -189,6 +189,12 @@ u32 GPU_GLES::CheckGPUFeatures() const {
features |= GPU_USE_SINGLE_PASS_STEREO; features |= GPU_USE_SINGLE_PASS_STEREO;
} }
if (draw_->GetBugs().Has(Draw::Bugs::ADRENO_RESOURCE_DEADLOCK)) {
if (PSP_CoreParameter().compat.flags().OldAdrenoPixelDepthRoundingGL) {
features |= GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT;
}
}
features = CheckGPUFeaturesLate(features); features = CheckGPUFeaturesLate(features);
// This is a bit ugly, but lets us reuse most of the depth logic in GPUCommon. // This is a bit ugly, but lets us reuse most of the depth logic in GPUCommon.

View file

@ -1269,4 +1269,46 @@ NPJH50408 = true
# Twinbee Portable, see issue #16382 # Twinbee Portable, see issue #16382
ULAS42089 = true ULAS42089 = true
ULJM05221 = true ULJM05221 = true
ULJM05323 = true ULJM05323 = true
[OldAdrenoPixelDepthRoundingGL]
# See #16015
# Naruto Shippuden: Ultimate Ninja Impact
ULUS10582 = true
ULES01537 = true
ULJS00390 = true
ULAS42297 = true
ULJS19071 = true
NPJH50435 = true
NPJH50435 = true
# Kingdom Hearts - Birth By Sleep
ULES01441 = true
ULJM05600 = true
ULUS10505 = true
ULJM05775 = true # Final MIX
PSPJ30012 = true
UCAS40295 = true
UCKS45143 = true
UCAS40317 = true
UCAS40326 = true
UCKS45168 = true
ULJM06213 = true
ULJM06214 = true
# Monster Hunter Portable 3rd
NPJB40001 = true
NPJH55800 = true
ULJM05800 = true
ULJM08058 = true
# Persona 3 Portable
ULES01523 = true
ULUS10512 = true
UCAS40288 = true
ULJM05489 = true
UCKS45140 = true
ULJM08044 = true
NPJH50040 = true
UCKS45175 = true