Mesa (master): glsl: Pass parse state to can_implicitly_convert_to()

Chris Forbes chrisf at kemper.freedesktop.org
Wed Jun 4 07:43:27 UTC 2014


Module: Mesa
Branch: master
Commit: f17428a276a0b76c3e940d341cced32931297d85
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f17428a276a0b76c3e940d341cced32931297d85

Author: Chris Forbes <chrisf at ijw.co.nz>
Date:   Sun May  4 20:23:57 2014 +1200

glsl: Pass parse state to can_implicitly_convert_to()

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/glsl/ast_function.cpp |    4 ++--
 src/glsl/glsl_types.cpp   |    3 ++-
 src/glsl/glsl_types.h     |    3 ++-
 src/glsl/ir_function.cpp  |    4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index a8bf27d..8e91a1e 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -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
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 849a79a..eb03a66 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -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;
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index dca5492..35a4e6a 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -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).
diff --git a/src/glsl/ir_function.cpp b/src/glsl/ir_function.cpp
index 4f0d9da..0ea8895 100644
--- a/src/glsl/ir_function.cpp
+++ b/src/glsl/ir_function.cpp
@@ -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;
 




More information about the mesa-commit mailing list