[Mesa-dev] [PATCH] draw: fix clipping with linear interpolated values and gl_ClipVertex
jfonseca at vmware.com
Thu Dec 10 08:06:27 PST 2015
On 10/12/15 15:53, Roland Scheidegger wrote:
> Am 10.12.2015 um 15:44 schrieb Jose Fonseca:
>> On 10/12/15 08:09, Dave Airlie wrote:
>>> On 10 December 2015 at 14:31, <sroland at vmware.com> wrote:
>>>> From: Roland Scheidegger <sroland at vmware.com>
>>>> 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).
>>>> Use the pre-clip-pos values when determining the interpolation factor to
>>>> fix this.
>>>> Unfortunately I have no idea what I'm doing here really, but it fixes
>>>> these failures in piglit (all interpolation-noperspective-XXX-vertex, 10
>>>> tests in total). Albeit piglit coverage of clipping isn't great, so
>>>> someone can confirm this actually makes sense, and wouldn't cause
>>> This makes sense to me, in that interpolating should definitely happen
>>> on pre-clipped coordinates.
>> The code was added in
>> then revised in
>> The 2nd change of Brian seems (if I read correctly) to do precisely the
>> I wonder if "clip" and "pre_clip_pos".
> What do you wonder?
Ah, if these things are really what they sounds like.
> I'm thinking there could be a mismatch what softpipe and llvmpipe do
> here (rather, the llvm vs. non-llvm path). In particular, draw_llvm will
> always write to both clip pos and pre-clip-pos, if there wasn't a a
> clip_user it will just write the same (look at invocation of store_clip).
Right. The key point here is to check that those tests don't regress
More information about the mesa-dev