From a16043ba57501d3d91d50291135775e6650818fa Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Sun, 8 Jun 2014 13:16:26 +0200 Subject: glsl: include streamId when reading/printing emit-vertex and end-primitive IR. Reviewed-by: Ian Romanick --- src/glsl/ir_print_visitor.cpp | 13 +++++++++---- src/glsl/ir_reader.cpp | 22 ++++++++++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) (limited to 'src/glsl') diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index c4a6f9c9f1c..dcb53b30f65 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -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"); + } diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp index 28923f3b8c0..ba166ebc4a8 100644 --- a/src/glsl/ir_reader.cpp +++ b/src/glsl/ir_reader.cpp @@ -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; -- cgit v1.2.3