diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 01:57:18 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 01:57:18 +0000 |
commit | b24b5b9049e889ee4eb39b565bcc8d48bd45ab48 (patch) | |
tree | 658ca4e6b41655f49463c85edbaeda48979c394c /lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c | |
parent | 57768bbb154c2879d34ec20e401b19472e77aaf7 (diff) |
Import Mesa 21.3.7
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/draw/draw_pipe_offset.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 { |