[Mesa-dev] [Bug 97231] GL_DEPTH_CLAMP doesn't clamp to the far plane

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Aug 8 11:15:08 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=97231

--- Comment #4 from Roland Scheidegger <sroland at vmware.com> ---
(In reply to Jules Blok from comment #3)
> Created attachment 125589 [details]
> apitrace file version 2
> 
> That's a rounding error, 16777215 / 16777216 is being rounded to 1 in the
> apitrace GUI.
> 
> I've attached another apitrace that's more representative of the current PR.
> The difference being that we've reversed the depth range to gain more depth
> precision.

Oh I could see why it might not work with llvmpipe if you do reverse depth
range.
lp_setup_set_viewports() will set the min/max depth (they actually get
"reverse-calculated" from viewport), but it will not take the potential
reversing into account, so assuming near <= far. These values are then later
used for clamping (in generate_fs_loop). Thus with min = 1.0, max = 0.0 it will
first do the min against max (so the value will end up negative or 0.0) and
then the max against min from the result (therefore, any value would end up as
1.0).
Just a theory though...

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160808/b0c16c5b/attachment.html>


More information about the mesa-dev mailing list