[Mesa-dev,14/18] glsl: include streamId when reading/printing emit-vertex and end-primitive IR.

Submitted by Iago Toral Quiroga on June 11, 2014, 7:49 a.m.

Details

Message ID 1402472981-22428-15-git-send-email-itoral@igalia.com
State Superseded
Headers show

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga June 11, 2014, 7:49 a.m.
---
 src/glsl/ir_print_visitor.cpp |  8 ++++----
 src/glsl/ir_reader.cpp        | 18 ++++++++++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index c4a6f9c..23960e0 100644
--- a/src/glsl/ir_print_visitor.cpp
+++ b/src/glsl/ir_print_visitor.cpp
@@ -560,13 +560,13 @@  ir_print_visitor::visit(ir_loop_jump *ir)
 }
 
 void
-ir_print_visitor::visit(ir_emit_vertex *)
+ir_print_visitor::visit(ir_emit_vertex *e)
 {
-   fprintf(f, "(emit-vertex)");
+   fprintf(f, "(emit-vertex %d)", e->stream);
 }
 
 void
-ir_print_visitor::visit(ir_end_primitive *)
+ir_print_visitor::visit(ir_end_primitive *e)
 {
-   fprintf(f, "(end-primitive)");
+   fprintf(f, "(end-primitive %d)", e->stream);
 }
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index 28923f3..e1982f2 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -1109,10 +1109,15 @@  ir_reader::read_texture(s_expression *expr)
 ir_emit_vertex *
 ir_reader::read_emit_vertex(s_expression *expr)
 {
-   s_pattern pat[] = { "emit-vertex" };
+   s_int *s_stream = NULL;
+
+   s_pattern pat[] = { "emit-vertex", s_stream };
+   s_pattern pat_no_stream[] = { "emit-vertex" };
 
    if (MATCH(expr, pat)) {
-      return new(mem_ctx) ir_emit_vertex();
+      return new(mem_ctx) ir_emit_vertex(s_stream->value());
+   } else if (MATCH(expr, pat_no_stream)) {
+      return new(mem_ctx) ir_emit_vertex(0);
    }
    ir_read_error(NULL, "when reading emit-vertex");
    return NULL;
@@ -1121,10 +1126,15 @@  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_int *s_stream = NULL;
+
+   s_pattern pat[] = { "end-primitive", s_stream };
+   s_pattern pat_no_stream[] = { "end-primitive" };
 
    if (MATCH(expr, pat)) {
-      return new(mem_ctx) ir_end_primitive();
+      return new(mem_ctx) ir_end_primitive(s_stream->value());
+   } else if (MATCH(expr, pat_no_stream)) {
+      return new(mem_ctx) ir_end_primitive(0);
    }
    ir_read_error(NULL, "when reading end-primitive");
    return NULL;