glsl: fixed printing of structure constants.
authorPaul Berry <stereotype441@gmail.com>
Fri, 3 Jun 2011 18:23:31 +0000 (11:23 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 3 Jun 2011 18:48:49 +0000 (12:48 -0600)
ir_print_visitor::visit(ir_constant *) was failing to index properly
into ir->type->fields.structure, so the first field name was being
reprinted for every field in the structure.

Signed-off-by: Brian Paul <brianp@vmware.com>
src/glsl/ir_print_visitor.cpp

index 02f3d8149260bc971724266dc21de8d4d35a6804..5b5409daa222a3a3cc83e6718b4648f74ff841ad 100644 (file)
@@ -370,7 +370,7 @@ void ir_print_visitor::visit(ir_constant *ir)
    } 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);
+        printf("(%s ", ir->type->fields.structure[i].name);
         value->accept(this);
         printf(")");