draw/llvmpipe: correct exponent calculation for negative z
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 18 Aug 2021 09:40:51 +0000 (11:40 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 25 Aug 2021 19:12:12 +0000 (19:12 +0000)
commite26fd607cab20715bf03d5ec221165171e0d0d1e
tree4c4addb8b6dbd18c111865cfaeb8a145c3f2fbfe
parent0f05c84bbaa733b0640b5ed052e2a6cbf4480aca
draw/llvmpipe: correct exponent calculation for negative z

If the z components here contain negative values, we'll end up with the
wrong maximum value.

This updated equation is taken from the D3D11 functional spec (section
15.10 Depth Bias), which is a bit more clear than the OpenGL spec.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12443>
src/gallium/auxiliary/draw/draw_pipe_offset.c
src/gallium/drivers/llvmpipe/lp_state_setup.c