[Mesa-dev] [PATCH] i965: Mask the cut index based on the index buffer type in 3DSTATE_VF.

Kenneth Graunke kenneth at whitecape.org
Fri May 24 09:34:34 PDT 2013


On 05/23/2013 04:14 PM, Jordan Justen wrote:
> On Thu, May 23, 2013 at 3:46 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> According to the documentation: "The Cut Index is compared to the
>> fetched (and possibly-sign-extended) vertex index, and if these values
>> are equal, the current primitive topology is terminated.  Note that,
>> for index buffers <32bpp, it is possible to set the Cut Index to a
>> (large) value that will never match a sign-extended vertex index."
>>
>> This suggests that we should not set the value to 0xFFFFFFFF for
>> unsigned byte or short index buffers, but rather 0xFF or 0xFFFF.
>
> I was wondering what the GL spec had to say about this situation. For
> example, what should happen if the index is 0x100, and bytes are used.
> Should it effectively disable prim-restart? Should it use 0xff, or
> 0x00? Unfortunately, I didn't find anything concrete.
>
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

You raise a good point.  If I set the cut index to 0x31337 and 
DrawElements with GL_UNSIGNED_BYTE, should it reset when it sees 37 or not?

I'll have to write Piglit tests and find out what other implementations do.

Thanks for the excellent review!


More information about the mesa-dev mailing list