draw: improve numerical stability in clipper
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 13 Aug 2021 12:08:58 +0000 (14:08 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 20 Aug 2021 09:26:41 +0000 (09:26 +0000)
commitb74c7aae793863162dc43b0548a9219d9d6a4ecc
tree0511564fd1daba496aab03e92cf216fabea65aa6
parenta51678ffce6c8429234f7b7d9376d85a70dd77aa
draw: improve numerical stability in clipper

Floats have much better precision close to zero than close to one, so
let's make sure we compute an interpolation factor that goes in the
direction that discards the fewest bits.

This makes a big difference when interpolating from very small to very
large values for screen-space positions.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12355>
src/gallium/auxiliary/draw/draw_pipe_clip.c
src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
src/gallium/drivers/i915/ci/traces-i915.yml
src/gallium/drivers/llvmpipe/ci/deqp-llvmpipe-fails.txt
src/gallium/drivers/llvmpipe/ci/traces-llvmpipe.yml
src/gallium/drivers/softpipe/ci/deqp-softpipe-fails.txt
src/gallium/drivers/virgl/ci/deqp-virgl-gl-fails.txt
src/gallium/drivers/virgl/ci/deqp-virgl-gles-fails.txt
src/gallium/drivers/virgl/ci/traces-virgl.yml
src/gallium/drivers/zink/ci/deqp-zink-lvp-fails.txt