Don't set a zero zclip value

This commit is contained in:
Luke Benstead 2021-04-19 20:51:22 +01:00
parent 8977fbf6e2
commit a3c4aaac8f
3 changed files with 5 additions and 5 deletions

View File

@ -912,9 +912,6 @@ static void light(SubmissionTarget* target) {
_glPerformLighting(vertex, ES, target->count);
}
#define GPU_MIN_Z 0.2f
#define GPU_MAX_Z 1.0 + GPU_MIN_Z
GL_FORCE_INLINE void divide(SubmissionTarget* target) {
TRACE();
@ -926,7 +923,7 @@ GL_FORCE_INLINE void divide(SubmissionTarget* target) {
vertex->xyz[0] *= f;
vertex->xyz[1] *= f;
vertex->xyz[2] *= f;
vertex->xyz[2] = MAX(1.0f - (vertex->xyz[2] * 0.5f + 0.5f), 0.0001f);
vertex->xyz[2] = MAX(1.0f - (vertex->xyz[2] * 0.5f + 0.5f), PVR_MIN_Z);
++vertex;
}
}

View File

@ -363,6 +363,9 @@ void _glApplyScissor(bool force);
#define MAX_TEXTURE_UNITS 2
#define MAX_LIGHTS 8
/* This is from KOS pvr_buffers.c */
#define PVR_MIN_Z 0.0001f
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define CLAMP( X, _MIN, _MAX ) ( (X)<(_MIN) ? (_MIN) : ((X)>(_MAX) ? (_MAX) : (X)) )

View File

@ -456,7 +456,7 @@ GLAPI void APIENTRY glClearDepthf(GLfloat depth) {
GLAPI void APIENTRY glClearDepth(GLfloat depth) {
/* We reverse because using invW means that farther Z == lower number */
GPUSetClearDepth(1.0f - depth);
GPUSetClearDepth(MIN(1.0f - depth, PVR_MIN_Z));
}
GLAPI void APIENTRY glDrawBuffer(GLenum mode) {