summaryrefslogtreecommitdiff
path: root/ir_print_visitor.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-26 11:13:43 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-26 14:43:11 -0700
commitd811d47609323f99f3718a2c5fb75ce47032f380 (patch)
treeef3e1d993cc3022f4ed57080b0d74f1986a7ec53 /ir_print_visitor.cpp
parentcef3baecf636a30b62cd7a1e8de57c7650f7003e (diff)
Add glsl_type::components to query total number of components in a type
Diffstat (limited to 'ir_print_visitor.cpp')
-rw-r--r--ir_print_visitor.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp
index 1696be69b5..682a553249 100644
--- a/ir_print_visitor.cpp
+++ b/ir_print_visitor.cpp
@@ -177,12 +177,8 @@ void ir_print_visitor::visit(ir_constant *ir)
print_type(base_type);
printf(") ");
- const unsigned num_values = 1
- * ((ir->type->vector_elements > 0) ? ir->type->vector_elements : 1)
- * ((ir->type->matrix_columns > 0) ? ir->type->matrix_columns : 1);
-
- printf("(%d) (", num_values);
- for (unsigned i = 0; i < num_values; i++) {
+ printf("(%d) (", ir->type->components());
+ for (unsigned i = 0; i < ir->type->components(); i++) {
if (i != 0)
printf(", ");