GPU: Respect depth clamp in bounding box check.

Although, logically, this feels reversed - it rejects the point if it's
outside positive Z, which would clamp.  This matches PSP tests.
This commit is contained in:
Unknown W. Brackets 2022-10-22 10:29:47 -07:00
parent 8b80c5fb28
commit 93ee82d84f

View file

@ -295,7 +295,9 @@ bool DrawEngineCommon::TestBoundingBox(const void *control_points, const void *i
Matrix4ByMatrix4(worldview, world, view);
Matrix4ByMatrix4(worldviewproj, worldview, gstate.projMatrix);
PlanesFromMatrix(worldviewproj, planes);
for (int plane = 0; plane < 6; plane++) {
// Note: near/far are not checked without clamp/clip enabled, so we skip those planes.
int totalPlanes = gstate.isDepthClampEnabled() ? 6 : 4;
for (int plane = 0; plane < totalPlanes; plane++) {
int inside = 0;
int out = 0;
for (int i = 0; i < vertexCount; i++) {