llvmpipe: fix depth clamping wrt reversed near/far values
authorRoland Scheidegger <sroland@vmware.com>
Mon, 15 Aug 2016 03:22:30 +0000 (05:22 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 20 Aug 2016 02:05:33 +0000 (04:05 +0200)
commitb0a647f284b24ca4e0ee1f70c4839d8ec3d1a4e6
treefd4f504644b10b7056e963ff989b044475c39ab7
parenta73116ecc60414ade89802150b707b3336d8d50f
llvmpipe: fix depth clamping wrt reversed near/far values

This wasn't handled before (the result was that no matter what value got
clamped, it always ended up as the near value in this case) (if clamping
actually happened).
Fix this by using the util helper for that (the math is otherwise "mostly"
the same, mostly because there could actually be differences due to float
rounding, but I don't even know which one would be more correct).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_setup.c