From: Ian Romanick Date: Thu, 25 Mar 2010 00:45:14 +0000 (-0700) Subject: Use glsl_type::get_instance instead of symbol table look-up X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d2b6bc651a23cf45e36c39efd34532ec78d51928;p=mesa.git Use glsl_type::get_instance instead of symbol table look-up --- diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index 1d9df36143e..5fe44ec4697 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