X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fresolve.cpp;h=7c58bc6b0fe309b3137e2e10b239601cf5797e8e;hb=c585c065b7831eb6ae05e48edc36953d2534db2b;hp=fbe60d79def36ee514e9598541a2ab99f05b4539;hpb=33e2d239d0e473a585243de9d9db36e49edf184b;p=libs%2Fgl.git diff --git a/source/glsl/resolve.cpp b/source/glsl/resolve.cpp index fbe60d79..7c58bc6b 100644 --- a/source/glsl/resolve.cpp +++ b/source/glsl/resolve.cpp @@ -179,7 +179,7 @@ void VariableResolver::visit(RefPtr &expr) r_replacement_expr = 0; } -void VariableResolver::check_assignment_target(Statement *declaration) +void VariableResolver::check_assignment_target(VariableDeclaration *declaration) { if(record_target) { @@ -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(arg_type); BasicTypeDeclaration *param_basic = dynamic_cast(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); }