X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fresolve.cpp;h=fbe60d79def36ee514e9598541a2ab99f05b4539;hp=3aeab30bd703711d28909cea07b15adc4fc1318d;hb=33e2d239d0e473a585243de9d9db36e49edf184b;hpb=89f26eba675defb38542faacacde6b9d4a2248c5 diff --git a/source/glsl/resolve.cpp b/source/glsl/resolve.cpp index 3aeab30b..fbe60d79 100644 --- a/source/glsl/resolve.cpp +++ b/source/glsl/resolve.cpp @@ -1084,7 +1084,24 @@ void ExpressionResolver::visit(FunctionCall &call) TraversingVisitor::visit(call); if(call.declaration) + { + for(unsigned i=0; itype; + TypeDeclaration *param_type = call.declaration->parameters[i]->type_declaration; + BasicTypeDeclaration *arg_basic = dynamic_cast(arg_type); + BasicTypeDeclaration *param_basic = dynamic_cast(param_type); + if(arg_basic && param_basic) + { + Compatibility compat = get_compatibility(*param_basic, *arg_basic); + if(compat==RIGHT_CONVERTIBLE) + convert_to(call.arguments[i], *param_basic); + } + else if(!arg_type || !param_type || arg_type!=param_type) + return; + } resolve(call, call.declaration->return_type_declaration, false); + } else if(call.constructor) visit_constructor(call); }