[Mesa-dev] [PATCH 09/11] nir: add lowering stage for user-clip-planes / clipdist

Erik Faye-Lund kusmabite at gmail.com
Tue Sep 15 10:20:03 PDT 2015


On Tue, Sep 15, 2015 at 7:12 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Tue, Sep 15, 2015 at 1:09 PM, Erik Faye-Lund <kusmabite at gmail.com> wrote:
>> On Tue, Sep 15, 2015 at 6:49 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>>> However having a piglit test that covers this would be neat... I guess
>>> you could clip a pixel in half and make sure that the resolved result
>>> is some in-between color? Lots of implementation-dependent stuff going
>>> on in there though.
>>
>> I think this would simply be a matter of drawing a white triangle on a
>> black background both with clipping and pre-clipped, and verify that
>> the result is the same. Perhaps even using a few differently sub-pixel
>> jittered triangles.
>
> Right, but sample positions are implementation-defined. Although I
> guess you could retrieve those positions and pre-clip yourself...

No need to do that, I think. Clipping happens earlier in the OpenGL
pipeline than rasterization, so a user-clipped triangle and a
pre-clipped triangle should produce exactly the same result.

There is of course a chance of some variance in the calculations,
though. So perhaps it'd be better to do a user-clipped triangle vs a
near-plane clipped triangle one. Those are defined to be clipped in
the same pipeline-stage, and should yield the same result.

> However the resolve is also implementation-defined I think, so there's
> no good way to know what the resulting color would be. However you
> could ensure that it was neither white nor black.

Yeah, that's why I'm suggesting comparing two renderings that should
give the same result instead.


More information about the mesa-dev mailing list