glsl: Pass parse state to can_implicitly_convert_to()
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 4 May 2014 08:23:57 +0000 (20:23 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Wed, 4 Jun 2014 07:35:57 +0000 (19:35 +1200)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ast_function.cpp
src/glsl/glsl_types.cpp
src/glsl/glsl_types.h
src/glsl/ir_function.cpp

index a8bf27df7b5c89f5140b316b5e58d738baa41e7e..8e91a1e67f672752a8da371e72640a9ae7e1b567 100644 (file)
@@ -701,7 +701,7 @@ process_vec_mat_constructor(exec_list *instructions,
             glsl_type::get_instance(GLSL_TYPE_FLOAT,
                                     ir->type->vector_elements,
                                     ir->type->matrix_columns);
-         if (result->type->can_implicitly_convert_to(desired_type)) {
+         if (result->type->can_implicitly_convert_to(desired_type, state)) {
             /* Even though convert_component() implements the constructor
              * conversion rules (not the implicit conversion rules), its safe
              * to use it here because we already checked that the implicit
@@ -830,7 +830,7 @@ process_array_constructor(exec_list *instructions,
            glsl_type::get_instance(GLSL_TYPE_FLOAT,
                                    ir->type->vector_elements,
                                    ir->type->matrix_columns);
-        if (result->type->can_implicitly_convert_to(desired_type)) {
+        if (result->type->can_implicitly_convert_to(desired_type, state)) {
            /* Even though convert_component() implements the constructor
             * conversion rules (not the implicit conversion rules), its safe
             * to use it here because we already checked that the implicit
index 849a79af45cd991ba136ac3c91f1462c9e985390..eb03a663290152c8e8414d46b875cbb11d5db477 100644 (file)
@@ -678,7 +678,8 @@ glsl_type::component_slots() const
 }
 
 bool
-glsl_type::can_implicitly_convert_to(const glsl_type *desired) const
+glsl_type::can_implicitly_convert_to(const glsl_type *desired,
+                                     _mesa_glsl_parse_state *state) const
 {
    if (this == desired)
       return true;
index dca5492ac06b188b4cfee7d646f6cac665a3ac00..35a4e6acc8c867aadb94b02ce97806e5d74f2cf7 100644 (file)
@@ -314,7 +314,8 @@ struct glsl_type {
     *     integers.
     * \endverbatim
     */
-   bool can_implicitly_convert_to(const glsl_type *desired) const;
+   bool can_implicitly_convert_to(const glsl_type *desired,
+                                  _mesa_glsl_parse_state *state) const;
 
    /**
     * Query whether or not a type is a scalar (non-vector and non-matrix).
index 4f0d9daa3c4bc04e31bfac50819e96fcf7fda23c..0ea8895f2971915e39b5045fdfa266e139239c88 100644 (file)
@@ -80,12 +80,12 @@ parameter_lists_match(_mesa_glsl_parse_state *state,
 
       case ir_var_const_in:
       case ir_var_function_in:
-        if (!actual->type->can_implicitly_convert_to(param->type))
+        if (!actual->type->can_implicitly_convert_to(param->type, state))
            return PARAMETER_LIST_NO_MATCH;
         break;
 
       case ir_var_function_out:
-        if (!param->type->can_implicitly_convert_to(actual->type))
+        if (!param->type->can_implicitly_convert_to(actual->type, state))
            return PARAMETER_LIST_NO_MATCH;
         break;