draw: fix clipping with linear interpolated values and gl_ClipVertex
authorRoland Scheidegger <sroland@vmware.com>
Fri, 11 Dec 2015 01:21:17 +0000 (02:21 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 11 Dec 2015 01:21:39 +0000 (02:21 +0100)
commit64c59b06244fc34f015f1f75b8205ac597ab0105
treedf97c0eb6e98864e87847224e4d65cc870c9e06b
parent5362e53a068d5718b303dfad88bb623df22662e1
draw: fix clipping with linear interpolated values and gl_ClipVertex

Discovered this when working on other clip code, apparently didn't work
correctly - the combination of linear interpolated values and using
gl_ClipVertex produced wrong values (failing all such combinations
in piglits glsl-1.30 interpolation tests, named
interpolation-noperspective-XXX-vertex).
Use the pre-clip-pos values when determining the interpolation factor to
fix this.
Noone really understands this code well, but everybody agrees this looks
sane... This fixes all those failing tests (10 in total) both with
the llvm and non-llvm draw paths, with no piglit regressions.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/draw/draw_pipe_clip.c