[Mesa-dev] Re mesa/st: add tgsi-lowering code for depth-clamp

Ilia Mirkin imirkin at alum.mit.edu
Thu Aug 1 11:22:36 UTC 2019


Hey Gert,

I'm looking at https://cgit.freedesktop.org/mesa/mesa/commit/?id=b048d8bf8f056759d1845a799d4ba2ac84bce30f
, which attempts to implement depth clamping (rather than clipping)
with shader tricks.

You're forcing the final vertex stage's position's depth to 0, and
then making up for it in the frag shader with an extra varying.
However won't this screw up the barycentric coordinates for
perspective interpolation? i.e. won't you effectively always just get
noperspective interp everywhere as a result?

  -ilia


More information about the mesa-dev mailing list