From: Mikko Rasa Date: Sat, 10 Dec 2016 20:48:07 +0000 (+0200) Subject: Always treat GLSL function parameters as referenced X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=eb4f947bcd825230cfa0f1f27046d9c729435d6e;p=libs%2Fgl.git Always treat GLSL function parameters as referenced They can't be removed so adding them to the set of unused nodes would lead to an infinite loop. --- diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index cc4b5efe..13b203b4 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -1346,6 +1346,8 @@ void ProgramCompiler::UnusedVariableLocator::visit(FunctionDeclaration &func) BlockVariableMap &block_variables = variables.back(); for(BlockVariableMap::iterator i=block_variables.begin(); i!=block_variables.end(); ++i) i->second.conditionally_assigned = true; + for(vector >::iterator i=func.parameters.begin(); i!=func.parameters.end(); ++i) + block_variables[i->get()].referenced = true; merge_down_variables(); }