From 1a849c8b1cacb94bcde7a14da1f64726be7926ae Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Mon, 19 Apr 2021 21:08:09 +0100 Subject: [PATCH] Minor optimisation --- GL/draw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GL/draw.c b/GL/draw.c index 7cb184e..b55c0a7 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -922,8 +922,10 @@ GL_FORCE_INLINE void divide(SubmissionTarget* target) { float f = MATH_Fast_Invert(vertex->w); 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), PVR_MIN_Z); + vertex->xyz[2] = MAX( + 1.0f - fmaf(vertex->xyz[2] * f, 0.5f, 0.5f), + PVR_MIN_Z + ); ++vertex; } }