[Mesa-dev] [PATCH 9/9] i965/gs: implement EndPrimitive() functionality in the visitor.

Paul Berry stereotype441 at gmail.com
Mon Sep 9 09:31:34 PDT 2013


On 9 September 2013 09:18, Ian Romanick <idr at freedesktop.org> wrote:

> On 09/09/2013 10:20 AM, Paul Berry wrote:
> > According to GLSL, the shader may call EndPrimitive() at any point
> > during its execution, causing the line or triangle strip currently
> > being output to be terminated and a new strip to be begun.
> >
> > This is implemented in gen7 hardware by using one control data bit per
> > vertex, to indicate whether EndPrimitive() was called after that
> > vertex was emitted.
> >
> > In order to make this work without sacrificing too much efficiency, we
> > accumulate 32 control data bits at a time in a GRF.  When we have
> > accumulated 32 bits (or when the shader terminates), we output them to
> > the appropriate DWORD in the control data header and reset the
> > accumulator to 0.
> >
> > We have to take special care to make sure that EndPrimitive() calls
> > that occur prior to the first vertex have no effect.
>
> Does this cover the general case of EndPrimitive without a preceeding
> EmitVertex?  Something like:
>
>      EmitVertex();
>      EndPrimitive();
>      EndPrimitive();
>
> And... do we have a test for that? :)
>

Yes, that should work fine.  What we do in EndPrimitive() is set the
appropriate bit in the bitfield, so calling EndPrimitive() again should
just redundantly set a bit that's already set.

I don't think we have a test for it.  I'll add that to my list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130909/32f7d762/attachment.html>


More information about the mesa-dev mailing list