summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-12-02 10:11:49 -0800
committerKenneth Graunke <kenneth@whitecape.org>2010-12-03 13:59:21 -0800
commitb7acf538af24ddab72a5cbd5975f089a747b68e4 (patch)
treef0ca911db609559b3f41472d74404bbf97dde9b0 /src/glsl
parent8d6a0dc7f35995018b29f24b59e3386531f49592 (diff)
downloadexternal_mesa3d-b7acf538af24ddab72a5cbd5975f089a747b68e4.zip
external_mesa3d-b7acf538af24ddab72a5cbd5975f089a747b68e4.tar.gz
external_mesa3d-b7acf538af24ddab72a5cbd5975f089a747b68e4.tar.bz2
ir_print_visitor: Print out constant structure values.
In the form (constant type ((field1 value) (field2 value) ...))
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir_print_visitor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index 55188ee..0aa0b0a 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)