glsl: include streamId when reading/printing emit-vertex and end-primitive IR.
authorIago Toral Quiroga <itoral@igalia.com>
Sun, 8 Jun 2014 11:16:26 +0000 (13:16 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 30 Jun 2014 06:08:50 +0000 (08:08 +0200)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ir_print_visitor.cpp
src/glsl/ir_reader.cpp

index c4a6f9c9f1c2c5c87cb75e8697cde561399a669f..dcb53b30f654e89bd5454143c8ec76595bc0ad58 100644 (file)
@@ -560,13 +560,18 @@ ir_print_visitor::visit(ir_loop_jump *ir)
 }
 
 void
-ir_print_visitor::visit(ir_emit_vertex *)
+ir_print_visitor::visit(ir_emit_vertex *ir)
 {
-   fprintf(f, "(emit-vertex)");
+   fprintf(f, "(emit-vertex ");
+   ir->stream->accept(this);
+   fprintf(f, ")\n");
 }
 
 void
-ir_print_visitor::visit(ir_end_primitive *)
+ir_print_visitor::visit(ir_end_primitive *ir)
 {
-   fprintf(f, "(end-primitive)");
+   fprintf(f, "(end-primitive ");
+   ir->stream->accept(this);
+   fprintf(f, ")\n");
+
 }
index 28923f3b8c0bd2400e1d69c836dda55fc1296892..ba166ebc4a817f0917efc649600cea114e75e826 100644 (file)
@@ -1109,10 +1109,17 @@ ir_reader::read_texture(s_expression *expr)
 ir_emit_vertex *
 ir_reader::read_emit_vertex(s_expression *expr)
 {
-   s_pattern pat[] = { "emit-vertex" };
+   s_expression *s_stream = NULL;
+
+   s_pattern pat[] = { "emit-vertex", s_stream };
 
    if (MATCH(expr, pat)) {
-      return new(mem_ctx) ir_emit_vertex();
+      ir_rvalue *stream = read_dereference(s_stream);
+      if (stream == NULL) {
+         ir_read_error(NULL, "when reading stream info in emit-vertex");
+         return NULL;
+      }
+      return new(mem_ctx) ir_emit_vertex(stream);
    }
    ir_read_error(NULL, "when reading emit-vertex");
    return NULL;
@@ -1121,10 +1128,17 @@ ir_reader::read_emit_vertex(s_expression *expr)
 ir_end_primitive *
 ir_reader::read_end_primitive(s_expression *expr)
 {
-   s_pattern pat[] = { "end-primitive" };
+   s_expression *s_stream = NULL;
+
+   s_pattern pat[] = { "end-primitive", s_stream };
 
    if (MATCH(expr, pat)) {
-      return new(mem_ctx) ir_end_primitive();
+      ir_rvalue *stream = read_dereference(s_stream);
+      if (stream == NULL) {
+         ir_read_error(NULL, "when reading stream info in end-primitive");
+         return NULL;
+      }
+      return new(mem_ctx) ir_end_primitive(stream);
    }
    ir_read_error(NULL, "when reading end-primitive");
    return NULL;