[Mesa-dev] [PATCH 2/2] radeonsi: fix gl_ClipDistance and gl_ClipVertex for points

Ilia Mirkin imirkin at alum.mit.edu
Thu Dec 15 16:58:08 UTC 2016


On Thu, Dec 15, 2016 at 11:45 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 15.12.2016 17:19, Ilia Mirkin wrote:
>>
>> Perhaps this is a point-specific function, but if this is applying to
>> all primitives, won't this end up culling primitives that have *any*
>> clip distance value < 0?
>
>
> Setting the cull bit here just enables the normal gl_CullDistance logic for
> whatever the current primitive type happens to be.
>
> Cull distance logic is a subset of clip distance logic: when there's some
> distance value which is < 0 for all vertices, cull the primitive. Clipping
> also does that (+ of course it does more complicated things when only a
> subset of of the vertices have < 0 for a distance value). Just that for
> whatever reason, the hardware folks decided that clipping should just do
> nothing at all for points.

Just to close the loop - I had misremembered how culling worked. I
thought if any vertex touched the cull space, the primitive was gone.
But it's actually if the whole primitive is in the cull space, it's
culled out (which, tbh, makes more sense...). So other than doing a
teensy bit of extra work, which is most likely ~free since it's all
hw, this change should work as advertised. Thanks for taking the time
to explain it to me :)

And I sympathize with the hw folks - clip distances on points is
nonsense - it's not like they can be interpolated with a point sprite
type of thing.

Cheers,

  -ilia


More information about the mesa-dev mailing list