X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Foptimize.cpp;h=0f765c2a4aa6ce23edd99f2dd0fed35e4041bd3c;hp=927047cc7c1e387890bf4a3d1a4a784e2039c7ac;hb=305b62cf4f7e2a4ca3cc56109003aed6bde61c25;hpb=fe7996a5985e8e7064004d2f42758d89ebf54b57 diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index 927047cc..0f765c2a 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -75,7 +75,7 @@ void InlineableFunctionLocator::visit(FunctionCall &call) ++count; /* Don't inline functions which are called more than once or are called recursively. */ - if(count>1 || def==current_function) + if((count>1 && def->source!=BUILTIN_SOURCE) || def==current_function) inlineable.erase(def); } @@ -89,7 +89,7 @@ void InlineableFunctionLocator::visit(FunctionDeclaration &func) has_out_params = ((*i)->interface=="out"); unsigned &count = refcounts[func.definition]; - if(count<=1 && !has_out_params) + if((count<=1 || func.source==BUILTIN_SOURCE) && !has_out_params) inlineable.insert(func.definition); SetForScope set(current_function, &func);