diff options
author | Ian Romanick <[email protected]> | 2010-04-02 11:45:06 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-04-02 11:45:06 -0700 |
commit | fe1c7ff6c62ffc985035c83a1ffadf1daad4b4ff (patch) | |
tree | ad5dc34af2609f891fbf09cb1f85f9a0d1da28e2 /ir_function.cpp | |
parent | c2cb84e17b2f7a5db146faa9c9c2a2ffac4b6c19 (diff) |
Fix matching of integer function parameters
This causes the following tests to pass:
glslparsertest/shaders/function10.frag
Diffstat (limited to 'ir_function.cpp')
-rw-r--r-- | ir_function.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ir_function.cpp b/ir_function.cpp index b6139c4a9fe..4d246392ad7 100644 --- a/ir_function.cpp +++ b/ir_function.cpp @@ -35,16 +35,18 @@ type_compare(const glsl_type *a, const glsl_type *b) switch (a->base_type) { case GLSL_TYPE_UINT: case GLSL_TYPE_INT: - case GLSL_TYPE_FLOAT: case GLSL_TYPE_BOOL: - if ((a->vector_elements != b->vector_elements) - || (a->matrix_columns != b->matrix_columns)) + /* There is no implicit conversion to or from integer types or bool. + */ + if ((a->is_integer() != b->is_integer()) + || (a->is_boolean() != b->is_boolean())) return -1; - /* There is no implicit conversion to or from bool. - */ - if ((a->base_type == GLSL_TYPE_BOOL) - || (b->base_type == GLSL_TYPE_BOOL)) + /* FALLTHROUGH */ + + case GLSL_TYPE_FLOAT: + if ((a->vector_elements != b->vector_elements) + || (a->matrix_columns != b->matrix_columns)) return -1; return 1; |