virtual void emit_urb_write_header(int mrf) = 0;
virtual vec4_instruction *emit_urb_write_opcode(bool complete) = 0;
virtual int compute_array_stride(ir_dereference_array *ir);
+ virtual void gs_emit_vertex(int stream_id);
+ virtual void gs_end_primitive();
private:
/**
}
void
-vec4_gs_visitor::visit(ir_emit_vertex *ir)
+vec4_gs_visitor::gs_emit_vertex(int stream_id)
{
this->current_annotation = "emit vertex: safety check";
* be recorded by transform feedback, we can simply discard all geometry
* bound to these streams when transform feedback is disabled.
*/
- if (ir->stream_id() > 0 && shader_prog->TransformFeedback.NumVarying == 0)
+ if (stream_id > 0 && shader_prog->TransformFeedback.NumVarying == 0)
return;
/* To ensure that we don't output more vertices than the shader specified
c->prog_data.control_data_format ==
GEN7_GS_CONTROL_DATA_FORMAT_GSCTL_SID) {
this->current_annotation = "emit vertex: Stream control data bits";
- set_stream_control_data_bits(ir->stream_id());
+ set_stream_control_data_bits(stream_id);
}
this->current_annotation = "emit vertex: increment vertex count";
}
void
-vec4_gs_visitor::visit(ir_end_primitive *)
+vec4_gs_visitor::visit(ir_emit_vertex *ir)
+{
+ gs_emit_vertex(ir->stream_id());
+}
+
+void
+vec4_gs_visitor::gs_end_primitive()
{
/* We can only do EndPrimitive() functionality when the control data
* consists of cut bits. Fortunately, the only time it isn't is when the
emit(OR(dst_reg(this->control_data_bits), this->control_data_bits, mask));
}
+void
+vec4_gs_visitor::visit(ir_end_primitive *)
+{
+ gs_end_primitive();
+}
+
static const unsigned *
generate_assembly(struct brw_context *brw,
struct gl_shader_program *shader_prog,
virtual int compute_array_stride(ir_dereference_array *ir);
virtual void visit(ir_emit_vertex *);
virtual void visit(ir_end_primitive *);
+ virtual void gs_emit_vertex(int stream_id);
+ virtual void gs_end_primitive();
protected:
int setup_varying_inputs(int payload_reg, int *attribute_map,
emit(BRW_OPCODE_ENDIF);
}
+void
+vec4_visitor::gs_emit_vertex(int stream_id)
+{
+ unreachable("not reached");
+}
+
void
vec4_visitor::visit(ir_emit_vertex *)
{
unreachable("not reached");
}
+void
+vec4_visitor::gs_end_primitive()
+{
+ unreachable("not reached");
+}
+
+
void
vec4_visitor::visit(ir_end_primitive *)
{