* "Slot {0,1} Offset" fields in the message header.
*/
GS_OPCODE_URB_WRITE,
+
+ /**
+ * Terminate the geometry shader thread by doing an empty URB write.
+ *
+ * This opcode doesn't do an implied move from R0 to the first MRF. This
+ * allows the geometry shader to override the "GS Number of Output Vertices
+ * for Slot {0,1}" fields in the message header.
+ */
+ GS_OPCODE_THREAD_END,
};
#define BRW_PREDICATE_NONE 0
case GS_OPCODE_URB_WRITE:
return "gs_urb_write";
+ case GS_OPCODE_THREAD_END:
+ return "gs_thread_end";
default:
/* Yes, this leaks. It's in debug code, it should never occur, and if
case VS_OPCODE_SCRATCH_WRITE:
return 3;
case GS_OPCODE_URB_WRITE:
+ case GS_OPCODE_THREAD_END:
return 0;
case SHADER_OPCODE_SHADER_TIME_ADD:
return 0;
void generate_vs_urb_write(vec4_instruction *inst);
void generate_gs_urb_write(vec4_instruction *inst);
+ void generate_gs_thread_end(vec4_instruction *inst);
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_thread_end(vec4_instruction *inst)
+{
+ struct brw_reg src = brw_message_reg(inst->base_mrf);
+ brw_urb_WRITE(p,
+ brw_null_reg(), /* dest */
+ inst->base_mrf, /* starting mrf reg nr */
+ src,
+ BRW_URB_WRITE_EOT,
+ 1, /* message len */
+ 0, /* response len */
+ 0, /* urb destination offset */
+ BRW_URB_SWIZZLE_INTERLEAVE);
+}
+
+void
vec4_generator::generate_oword_dual_block_offsets(struct brw_reg m1,
struct brw_reg index)
{
generate_gs_urb_write(inst);
break;
+ case GS_OPCODE_THREAD_END:
+ generate_gs_thread_end(inst);
+ break;
+
case SHADER_OPCODE_SHADER_TIME_ADD:
brw_shader_time_add(p, src[0], SURF_INDEX_VS_SHADER_TIME);
mark_surface_used(SURF_INDEX_VS_SHADER_TIME);