On 9 September 2013 09:18, Ian Romanick <i...@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.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev