From b24b5b9049e889ee4eb39b565bcc8d48bd45ab48 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 24 Feb 2022 01:57:18 +0000 Subject: Import Mesa 21.3.7 --- lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c') diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c index 08d47f005..87db9cdda 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c @@ -97,7 +97,7 @@ static void do_offset_tri( struct draw_stage *stage, if (stage->draw->floating_point_depth) { float bias; union fi maxz; - maxz.f = MAX3(v0[2], v1[2], v2[2]); + maxz.f = MAX3(fabs(v0[2]), fabs(v1[2]), fabs(v2[2])); /* just do the math directly on shifted number */ maxz.ui &= 0xff << 23; maxz.i -= 23 << 23; @@ -187,7 +187,7 @@ static void offset_first_tri( struct draw_stage *stage, if (stage->draw->floating_point_depth) { offset->units = (float) rast->offset_units; } else { - offset->units = (float) (rast->offset_units * stage->draw->mrd); + offset->units = (float) (rast->offset_units * stage->draw->mrd * 2); } } else { -- cgit v1.2.3