Fix wrong logic causing excessive software transform fallback if cull planes are missing. Minor cleanup.

This commit is contained in:
Henrik Rydgård committed 2026-05-31 13:31:16 +02:00
1 parent 702088c2d0
commit 847953fd31
5 files changed
+25 -19

No files matched your search

+3 -2
View File
@@ -416,9 +416,10 @@ static bool TestBoundingBoxFast(const float *worldViewProj, const void *vdata, i
}
}
if (AnyCompareBitsSet(anyOutsideMaskZ) || !gstate_c.Use(GPU_USE_CULL_DISTANCE)) {
if (AnyCompareBitsSet(anyOutsideMaskZ)) {
// 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.
// 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.
flags |= ClipInfoFlags::SoftClipCull;
}