summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2014-06-08 13:16:26 +0200
committerIago Toral Quiroga <[email protected]>2014-06-30 08:08:50 +0200
commita16043ba57501d3d91d50291135775e6650818fa (patch)
tree313bd0048b70d621cccc5ff977bdb7bd743ae5db /src/glsl
parent5d562588a5a1067cf80148ddad3815fdba816151 (diff)
glsl: include streamId when reading/printing emit-vertex and end-primitive IR.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir_print_visitor.cpp13
-rw-r--r--src/glsl/ir_reader.cpp22
2 files changed, 27 insertions, 8 deletions
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;