glsl: include streamId when reading/printing ir_variable IR.
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 10 Jun 2014 06:45:44 +0000 (08:45 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 30 Jun 2014 06:08:50 +0000 (08:08 +0200)
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ir_print_visitor.cpp
src/glsl/ir_reader.cpp

index dcb53b30f654e89bd5454143c8ec76595bc0ad58..72ad4223f562405adff814980f3b6aba01541c16 100644 (file)
@@ -169,11 +169,14 @@ void ir_print_visitor::visit(ir_variable *ir)
                                 "in ", "out ", "inout ",
                                "const_in ", "sys ", "temporary " };
    STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);
+   const char *const stream [] = {"", "stream1 ", "stream2 ", "stream3 "};
    const char *const interp[] = { "", "smooth", "flat", "noperspective" };
    STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT);
 
-   fprintf(f, "(%s%s%s%s%s) ",
-         cent, samp, inv, mode[ir->data.mode], interp[ir->data.interpolation]);
+   fprintf(f, "(%s%s%s%s%s%s) ",
+           cent, samp, inv, mode[ir->data.mode],
+           stream[ir->data.stream],
+           interp[ir->data.interpolation]);
 
    print_type(f, ir->type);
    fprintf(f, " %s)", unique_name(ir));
index ba166ebc4a817f0917efc649600cea114e75e826..a178c82b536b5a8dd35b51a51f4cc0f350aa14aa 100644 (file)
@@ -437,6 +437,12 @@ ir_reader::read_declaration(s_expression *expr)
         var->data.mode = ir_var_function_inout;
       } else if (strcmp(qualifier->value(), "temporary") == 0) {
         var->data.mode = ir_var_temporary;
+      } else if (strcmp(qualifier->value(), "stream1") == 0) {
+        var->data.stream = 1;
+      } else if (strcmp(qualifier->value(), "stream2") == 0) {
+        var->data.stream = 2;
+      } else if (strcmp(qualifier->value(), "stream3") == 0) {
+        var->data.stream = 3;
       } else if (strcmp(qualifier->value(), "smooth") == 0) {
         var->data.interpolation = INTERP_QUALIFIER_SMOOTH;
       } else if (strcmp(qualifier->value(), "flat") == 0) {