i965: Fix primitive restart on Haswell.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 25 Aug 2012 01:40:40 +0000 (18:40 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 6 Sep 2012 23:39:48 +0000 (16:39 -0700)
commit815d9d405c69bb07d550ae9f79283dcdc7466e2c
treecdb548669e17907c613ad5e66cf86805851eaed4
parent058fb0071639d076a850dd29120a232fe7fdbce6
i965: Fix primitive restart on Haswell.

Haswell moved the "Cut Index Enable" bit from the INDEX_BUFFER packet to
a new 3DSTATE_VF packet, so we need to emit that.  Also, it requires us
to specify the cut index rather than assuming it's 0xffffffff.

This adds a new Haswell-specific tracked state atom to gen7_atoms.
Normally, we would create a new generation-specific atom list, but since
there's only one difference over Ivybridge so far, I chose to simply
make it return without doing any work on non-Haswell systems.

Fixes five piglit tests:
- general/primitive-restart-DISABLE_VBO
- general/primitive-restart-VBO_COMBINED_VERTEX_AND_INDEX
- general/primitive-restart-VBO_INDEX_ONLY
- general/primitive-restart-VBO_SEPARATE_VERTEX_AND_INDEX
- general/primitive-restart-VBO_VERTEX_ONLY

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/brw_draw_upload.c
src/mesa/drivers/dri/i965/brw_primitive_restart.c
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_upload.c