]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/resolve.cpp
Preparatory refactoring of the texelFetch implementation
[libs/gl.git] / source / glsl / resolve.cpp
index 115624c496639e5413077779e28aabd9c2321ce6..7c58bc6b0fe309b3137e2e10b239601cf5797e8e 100644 (file)
@@ -1089,6 +1089,11 @@ void ExpressionResolver::visit(FunctionCall &call)
                {
                        TypeDeclaration *arg_type = call.arguments[i]->type;
                        TypeDeclaration *param_type = call.declaration->parameters[i]->type_declaration;
+                       if(arg_type==param_type)
+                               continue;
+                       else if(!arg_type || !param_type)
+                               return;
+
                        BasicTypeDeclaration *arg_basic = dynamic_cast<BasicTypeDeclaration *>(arg_type);
                        BasicTypeDeclaration *param_basic = dynamic_cast<BasicTypeDeclaration *>(param_type);
                        if(arg_basic && param_basic)
@@ -1096,9 +1101,9 @@ void ExpressionResolver::visit(FunctionCall &call)
                                Compatibility compat = get_compatibility(*param_basic, *arg_basic);
                                if(compat==RIGHT_CONVERTIBLE)
                                        convert_to(call.arguments[i], *param_basic);
+                               else if(compat!=SAME_TYPE)
+                                       return;
                        }
-                       else if(!arg_type || !param_type || arg_type!=param_type)
-                               return;
                }
                resolve(call, call.declaration->return_type_declaration, false);
        }