summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-05-04 20:23:57 +1200
committerChris Forbes <[email protected]>2014-06-04 19:35:57 +1200
commitf17428a276a0b76c3e940d341cced32931297d85 (patch)
treec739677060ff04fbae3f0e5721801c5aa16597bb /src
parenta78c663c2291d9f5acd7367766a2712038db2e78 (diff)
glsl: Pass parse state to can_implicitly_convert_to()
Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_function.cpp4
-rw-r--r--src/glsl/glsl_types.cpp3
-rw-r--r--src/glsl/glsl_types.h3
-rw-r--r--src/glsl/ir_function.cpp4
4 files changed, 8 insertions, 6 deletions
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index a8bf27df7b5..8e91a1e67f6 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 849a79af45c..eb03a663290 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 dca5492ac06..35a4e6acc8c 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 4f0d9daa3c4..0ea8895f297 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;