summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-24 17:45:14 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-24 17:45:14 -0700
commitd2b6bc651a23cf45e36c39efd34532ec78d51928 (patch)
treeeb1e1c8a6c542dc301fda08d4ad395ab4693578a /ast_to_hir.cpp
parente4fca97afd27f72d056e245aaa5761579ee78850 (diff)
Use glsl_type::get_instance instead of symbol table look-up
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 1d9df36143..5fe44ec469 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -192,25 +192,9 @@ arithmetic_result_type(const struct glsl_type *type_a,
} else {
if (type_a->is_matrix() && type_b->is_matrix()) {
if (type_a->vector_elements == type_b->matrix_rows) {
- char type_name[7];
- const struct glsl_type *t;
-
- type_name[0] = 'm';
- type_name[1] = 'a';
- type_name[2] = 't';
-
- if (type_a->matrix_rows == type_b->vector_elements) {
- type_name[3] = '0' + type_a->matrix_rows;
- type_name[4] = '\0';
- } else {
- type_name[3] = '0' + type_a->matrix_rows;
- type_name[4] = 'x';
- type_name[5] = '0' + type_b->vector_elements;
- type_name[6] = '\0';
- }
-
- t = state->symbols->get_type(type_name);
- return (t != NULL) ? t : glsl_error_type;
+ return glsl_type::get_instance(type_a->base_type,
+ type_b->matrix_rows,
+ type_a->vector_elements);
}
} else if (type_a->is_matrix()) {
/* A is a matrix and B is a column vector. Columns of A must match