Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Common/GPU/OpenGL/thin3d_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,11 @@ OpenGLContext::OpenGLContext() {
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)
// For some reason, this bug does not appear on M1.
if (caps_.vendor == GPUVendor::VENDOR_APPLE) {
Expand Down
2 changes: 2 additions & 0 deletions Common/GPU/thin3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ const char *Bugs::GetBugName(uint32_t bug) {
case RASPBERRY_SHADER_COMP_HANG: return "RASPBERRY_SHADER_COMP_HANG";
case MALI_CONSTANT_LOAD_BUG: return "MALI_CONSTANT_LOAD_BUG";
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)";
}
}
Expand Down
1 change: 1 addition & 0 deletions Common/GPU/thin3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ class Bugs {
MALI_CONSTANT_LOAD_BUG = 9,
SUBPASS_FEEDBACK_BROKEN = 10,
GEOMETRY_SHADERS_SLOW_OR_BROKEN = 11,
ADRENO_RESOURCE_DEADLOCK = 12,
MAX_BUG,
};

Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "NearestFilteringOnFramebufferCreate", &flags_.NearestFilteringOnFramebufferCreate);
CheckSetting(iniFile, gameID, "SecondaryTextureCache", &flags_.SecondaryTextureCache);
CheckSetting(iniFile, gameID, "EnglishOrJapaneseOnly", &flags_.EnglishOrJapaneseOnly);
CheckSetting(iniFile, gameID, "OldAdrenoPixelDepthRoundingGL", &flags_.OldAdrenoPixelDepthRoundingGL);
}

void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct CompatFlags {
bool NearestFilteringOnFramebufferCreate;
bool SecondaryTextureCache;
bool EnglishOrJapaneseOnly;
bool OldAdrenoPixelDepthRoundingGL;
};

struct VRCompat {
Expand Down
6 changes: 6 additions & 0 deletions GPU/GLES/GPU_GLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ u32 GPU_GLES::CheckGPUFeatures() const {

features = CheckGPUFeaturesLate(features);

if (draw_->GetBugs().Has(Draw::Bugs::ADRENO_RESOURCE_DEADLOCK) && g_Config.bVendorBugChecksEnabled) {
if (PSP_CoreParameter().compat.flags().OldAdrenoPixelDepthRoundingGL) {
features |= GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckGPUFeaturesLate() might add another flag (like GPU_ROUND_DEPTH_TO_16BIT or GPU_SCALE_DEPTH_FROM_24BIT_TO_16BIT), not sure if this is really a problem or not, though. In theory those flags can coexist...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I'll re-order it to do it after CheckGPUFeatureLate, and also check for vendor workarounds.

}
}

// This is a bit ugly, but lets us reuse most of the depth logic in GPUCommon.
if (features & GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT) {
if (gl_extensions.IsGLES && !gl_extensions.GLES3) {
Expand Down
65 changes: 64 additions & 1 deletion assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1269,4 +1269,67 @@ NPJH50408 = true
# Twinbee Portable, see issue #16382
ULAS42089 = 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

# Hack/Link
ULJS00266 = true
ULJS00279 = true
ULJS19058 = true

# Midnight Club: LA Remix
ULUS10383 = true
ULES01144 = true
ULJS00180 = true
ULJS00267 = true
ULJM05904 = true
NPJH50440 = true

# ModNation Racers
UCES01327 = true
UCUS98741 = true
UCAS40306 = true
UCJS10112 = true
NPJG00116 = true
NPUG70097 = true # Demo