From 4045de8d565d215e7dd1e399040bad1e51397c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 18 Sep 2022 10:34:43 +0200 Subject: [PATCH] Consider the Adreno and Mali stencil-discard bugs the same. Use the better check from the Mali bug. Should fix #11980 --- Common/GPU/Vulkan/thin3d_vulkan.cpp | 4 +-- Common/GPU/thin3d.cpp | 1 - Common/GPU/thin3d.h | 7 ++-- GPU/Common/ShaderId.cpp | 11 +++--- assets/compat.ini | 53 ----------------------------- 5 files changed, 9 insertions(+), 67 deletions(-) diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index d276ba9868e0..d64fd7ae7d3a 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -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) { diff --git a/Common/GPU/thin3d.cpp b/Common/GPU/thin3d.cpp index 2560765f43ce..acaa3dac0b3c 100644 --- a/Common/GPU/thin3d.cpp +++ b/Common/GPU/thin3d.cpp @@ -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"; diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index 389640ec9eb3..b4eca9d0bc65 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -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, }; diff --git a/GPU/Common/ShaderId.cpp b/GPU/Common/ShaderId.cpp index 7ca42ccba619..6345816604fb 100644 --- a/GPU/Common/ShaderId.cpp +++ b/GPU/Common/ShaderId.cpp @@ -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); } } } diff --git a/assets/compat.ini b/assets/compat.ini index c4986ae888a3..f153b9393371 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -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