glsl: print constant initializers
authorMarek Olšák <marek.olsak@amd.com>
Sat, 4 Jul 2020 21:13:27 +0000 (17:13 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 8 Jul 2020 02:02:06 +0000 (22:02 -0400)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

src/compiler/glsl/ir_print_visitor.cpp

index 8914c6e2d0251d39f3f88c46f9380c9e8bc34b86..034ee163cf9f3c2f2cfa7695f8da0174ec8c8659 100644 (file)
@@ -226,6 +226,16 @@ void ir_print_visitor::visit(ir_variable *ir)
 
    ir_print_type(f, ir->type);
    fprintf(f, " %s)", unique_name(ir));
+
+   if (ir->constant_initializer) {
+      fprintf(f, " ");
+      visit(ir->constant_initializer);
+   }
+
+   if (ir->constant_value) {
+      fprintf(f, " ");
+      visit(ir->constant_value);
+   }
 }