When brw->prim_restart.enable_cut_index is set, the cut index
will be enabled when uploading index_buffer commands.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
}
brw->prim_restart.in_progress = false;
+ brw->prim_restart.enable_cut_index = false;
brw_init_state( brw );
/* PrimitiveRestart */
struct {
bool in_progress;
+ bool enable_cut_index;
} prim_restart;
};
#define BRW_SPRITE_POINT_ENABLE 16
+#define BRW_CUT_INDEX_ENABLE (1 << 10)
+
#define BRW_INDEX_BYTE 0
#define BRW_INDEX_WORD 1
#define BRW_INDEX_DWORD 2
{
struct intel_context *intel = &brw->intel;
const struct _mesa_index_buffer *index_buffer = brw->ib.ib;
+ GLuint cut_index_setting;
if (index_buffer == NULL)
return;
+ if (brw->prim_restart.enable_cut_index) {
+ cut_index_setting = BRW_CUT_INDEX_ENABLE;
+ } else {
+ cut_index_setting = 0;
+ }
+
BEGIN_BATCH(3);
OUT_BATCH(CMD_INDEX_BUFFER << 16 |
- /* cut index enable << 10 */
+ cut_index_setting |
get_index_type(index_buffer->type) << 8 |
1);
OUT_RELOC(brw->ib.bo,