Merge pull request #21783 from hrydgard/clipping-compat-flag

Avoid soft-transform-and-clip if the near plane matches the final clip plane, and a new compat flag isn't set
This commit is contained in:
Henrik Rydgård
2026-06-04 15:55:23 +02:00
committed by GitHub
4 changed files with 15 additions and 1 deletions
+1
View File
@@ -161,6 +161,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "PersistentFramebuffers", &flags_.PersistentFramebuffers);
CheckSetting(iniFile, gameID, "FileCreatedTimeHack", &flags_.FileCreatedTimeHack);
CheckSetting(iniFile, gameID, "FastEmulatedGPU", &flags_.FastEmulatedGPU);
CheckSetting(iniFile, gameID, "CorrectCullAfterClip", &flags_.CorrectCullAfterClip);
}
void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {
+1
View File
@@ -120,6 +120,7 @@ struct CompatFlags {
bool PersistentFramebuffers;
bool FileCreatedTimeHack;
bool FastEmulatedGPU;
bool CorrectCullAfterClip;
};
struct VRCompat {
+1 -1
View File
@@ -454,7 +454,7 @@ static bool TestBoundingBoxFast(const float *cullMatrix, const void *vdata, cons
}
}
if (AnyCompareBitsSet(anyOutsideMaskZ)) {
if (AnyCompareBitsSet(anyOutsideMaskZ) && (!gstate_c.viewportNearPlaneMatchesOutput || PSP_CoreParameter().compat.flags().CorrectCullAfterClip)) {
// Some vertices were outside the Z clipping planes. Clip againt Z=-W in software (and do culling, too).
// TODO: With a compat flag for Flatout/Sengoku, we'll be able to avoid this in many cases, unless
// GPU_USE_CULL_DISTANCE is missing, in which case we need it for culling.
+12
View File
@@ -2071,3 +2071,15 @@ NPJH50148 = true
ULES00262 = true
ULUS10064 = true
ULKS46087 = true
[CorrectCullAfterClip]
# Only two known games need culling to happen accurately *after* clipping: Sengoku Cannon and Flatout.
# Sengoku Cannon
UCAS40019 = true
ULJM05021 = true
# Flatout
ULUS10328 = true
ULES00968 = true
ULES00969 = true