* the header in the URB write operation we are allocating the handle for.
*/
GS_OPCODE_FF_SYNC,
+
+ /**
+ * Move r0.1 (which holds PrimitiveID information in gen6) to a separate
+ * register.
+ *
+ * - dst is the GRF where PrimitiveID information will be moved.
+ */
+ GS_OPCODE_SET_PRIMITIVE_ID,
};
enum brw_derivative_quality {
return "get_instance_id";
case GS_OPCODE_FF_SYNC:
return "ff_sync";
+ case GS_OPCODE_SET_PRIMITIVE_ID:
+ return "set_primitive_id";
default:
/* Yes, this leaks. It's in debug code, it should never occur, and if
void generate_gs_ff_sync(vec4_instruction *inst,
struct brw_reg dst,
struct brw_reg src0);
+ void generate_gs_set_primitive_id(struct brw_reg dst);
void generate_oword_dual_block_offsets(struct brw_reg m1,
struct brw_reg index);
void generate_scratch_write(vec4_instruction *inst,
}
void
+vec4_generator::generate_gs_set_primitive_id(struct brw_reg dst)
+{
+ /* In gen6, PrimitiveID is delivered in R0.1 of the payload */
+ struct brw_reg src = brw_vec8_grf(0, 0);
+ brw_push_insn_state(p);
+ brw_set_default_mask_control(p, BRW_MASK_DISABLE);
+ brw_set_default_access_mode(p, BRW_ALIGN_1);
+ brw_MOV(p, get_element_ud(dst, 0), get_element_ud(src, 1));
+ brw_pop_insn_state(p);
+}
+
+void
vec4_generator::generate_oword_dual_block_offsets(struct brw_reg m1,
struct brw_reg index)
{
generate_gs_ff_sync(inst, dst, src[0]);
break;
+ case GS_OPCODE_SET_PRIMITIVE_ID:
+ generate_gs_set_primitive_id(dst);
+ break;
+
case GS_OPCODE_SET_DWORD_2:
generate_gs_set_dword_2(dst, src[0]);
break;