Skip to content

Commit

Permalink
Consider the Adreno and Mali stencil-discard bugs the same. Use the b…
Browse files Browse the repository at this point in the history
…etter check from the Mali bug.

Should fix #11980
  • Loading branch information
hrydgard committed Sep 18, 2022
1 parent 915b734 commit 4045de8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 67 deletions.
4 changes: 2 additions & 2 deletions Common/GPU/Vulkan/thin3d_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,9 @@ VKContext::VKContext(VulkanContext *vulkan)
// is detected. See: https://github.com/hrydgard/ppsspp/issues/11937
bugs_.Infest(Bugs::EQUAL_WZ_CORRUPTS_DEPTH);

// Similar to the Adreno bug, see #13833 (Midnight Club map broken) and other issues.
// Nearly identical to the the Adreno bug, see #13833 (Midnight Club map broken) and other issues.
// Reported fixed in major version 40 - let's add a check once confirmed.
bugs_.Infest(Bugs::MALI_STENCIL_DISCARD_BUG);
bugs_.Infest(Bugs::NO_DEPTH_CANNOT_DISCARD_STENCIL);

// This started in driver 31 or 32, fixed in 40 - let's add a check once confirmed.
if (majorVersion >= 32) {
Expand Down
1 change: 0 additions & 1 deletion Common/GPU/thin3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ const char *Bugs::GetBugName(uint32_t bug) {
case COLORWRITEMASK_BROKEN_WITH_DEPTHTEST: return "COLORWRITEMASK_BROKEN_WITH_DEPTHTEST";
case BROKEN_FLAT_IN_SHADER: return "BROKEN_FLAT_IN_SHADER";
case EQUAL_WZ_CORRUPTS_DEPTH: return "EQUAL_WZ_CORRUPTS_DEPTH";
case MALI_STENCIL_DISCARD_BUG: return "MALI_STENCIL_DISCARD_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";
Expand Down
7 changes: 3 additions & 4 deletions Common/GPU/thin3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,9 @@ class Bugs {
COLORWRITEMASK_BROKEN_WITH_DEPTHTEST = 5,
BROKEN_FLAT_IN_SHADER = 6,
EQUAL_WZ_CORRUPTS_DEPTH = 7,
MALI_STENCIL_DISCARD_BUG = 8,
RASPBERRY_SHADER_COMP_HANG = 9,
MALI_CONSTANT_LOAD_BUG = 10,
SUBPASS_FEEDBACK_BROKEN = 11,
RASPBERRY_SHADER_COMP_HANG = 8,
MALI_CONSTANT_LOAD_BUG = 9,
SUBPASS_FEEDBACK_BROKEN = 10,
MAX_BUG,
};

Expand Down
11 changes: 4 additions & 7 deletions GPU/Common/ShaderId.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,10 @@ void ComputeFragmentShaderID(FShaderID *id_out, const ComputedPipelineState &pip

id.SetBit(FS_BIT_COLOR_WRITEMASK, colorWriteMask);

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) && 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.isDepthTestEnabled() || !gstate.isDepthWriteEnabled()));
if (g_Config.bVendorBugChecksEnabled && bugs.Has(Draw::Bugs::NO_DEPTH_CANNOT_DISCARD_STENCIL)) {
bool stencilWithoutDepth = !IsStencilTestOutputDisabled() && (!gstate.isDepthTestEnabled() || !gstate.isDepthWriteEnabled());
if (stencilWithoutDepth) {
id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, stencilWithoutDepth);
}
}
}
Expand Down
53 changes: 0 additions & 53 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -584,59 +584,6 @@ 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

# The Simpsons Game - issue #9830
ULUS10295 = true
ULES00975 = true
ULES00979 = true
ULES00978 = true
ULES00977 = true
ULES00976 = true

# Surf's Up - see issue #15016
ULES00816 = true
ULES00817 = true
ULUS10262 = true

# Kenka Bancho - Badass Rumble - see issue #15016
ULUS10442 = true
ULJS00166 = true
UCAS40231 = true
ULJS19030 = true
NPJH50223 = true
ULJS19082 = true

# Nanoha Magical Girl - see issue #15016
ULJS00384 = true
ULJS00385 = true
ULJS19078 = true

# Suikoden Woven Web of The Centuries / Genso Suikoden: Tsumugareshi Hyakunen no Toki
ULJM05886 = true
ULJM08063 = true
NPJH50535 = true

# Outrun 2006: Coast to Coast - water
ULES00262 = true
ULUS10064 = true
ULKS46087 = true

[RequireDefaultCPUClock]
# GOW : Ghost of Sparta
UCUS98737 = true
Expand Down

0 comments on commit 4045de8

Please sign in to comment.