i965/gs/gen6: Refactor ir_emit_vertex and ir_end_primitive for gen6
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Mon, 13 Jul 2015 13:51:17 +0000 (15:51 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 3 Aug 2015 16:40:50 +0000 (09:40 -0700)
So the implementation is independent of GLSL IR and the visit methods of the
gen6 GS visitor. This way we will be able to reuse that implementation directly
from the NIR vec4 backend.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
src/mesa/drivers/dri/i965/gen6_gs_visitor.h

index 782687aac57516842da1940b444c6ab8dce8cc5f..68e443d38a5399ceb55b67805e9eb31efaf4110d 100644 (file)
@@ -147,7 +147,12 @@ gen6_gs_visitor::emit_prolog()
 }
 
 void
-gen6_gs_visitor::visit(ir_emit_vertex *)
+gen6_gs_visitor::visit(ir_emit_vertex *ir)
+{
+   gs_emit_vertex(ir->stream_id());
+}
+void
+gen6_gs_visitor::gs_emit_vertex(int stream_id)
 {
    this->current_annotation = "gen6 emit vertex";
    /* Honor max_vertex layout indication in geometry shader by ignoring any
@@ -223,6 +228,12 @@ gen6_gs_visitor::visit(ir_emit_vertex *)
 
 void
 gen6_gs_visitor::visit(ir_end_primitive *)
+{
+   gs_end_primitive();
+}
+
+void
+gen6_gs_visitor::gs_end_primitive()
 {
    this->current_annotation = "gen6 end primitive";
    /* Calling EndPrimitive() is optional for point output. In this case we set
index 862d0eaacf06afb2c9fe3534cfc540fb35bbfdda..4cf948932614a606a1b94b9183f10b60e4904878 100644 (file)
@@ -51,6 +51,8 @@ protected:
    virtual void emit_thread_end();
    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();
    virtual void emit_urb_write_header(int mrf);
    virtual void emit_urb_write_opcode(bool complete,
                                       int base_mrf,