From b7acf538af24ddab72a5cbd5975f089a747b68e4 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 2 Dec 2010 10:11:49 -0800 Subject: [PATCH] ir_print_visitor: Print out constant structure values. In the form (constant type ((field1 value) (field2 value) ...)) --- src/glsl/ir_print_visitor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index 55188ee4527..0aa0b0a5d32 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -318,6 +318,15 @@ void ir_print_visitor::visit(ir_constant *ir) if (ir->type->is_array()) { for (unsigned i = 0; i < ir->type->length; i++) ir->get_array_element(i)->accept(this); + } else if (ir->type->is_record()) { + ir_constant *value = (ir_constant *) ir->components.get_head(); + for (unsigned i = 0; i < ir->type->length; i++) { + printf("(%s ", ir->type->fields.structure->name); + value->accept(this); + printf(")"); + + value = (ir_constant *) value->next; + } } else { for (unsigned i = 0; i < ir->type->components(); i++) { if (i != 0) -- 2.30.2