X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Foptimize.cpp;h=441a73a072e8df7740c27b62f9d3c5cc1f9596b2;hp=080bfd7c2705001a40fdf8b97abeb9401c4821bd;hb=801c209fa0a2878c0675b7808154de93bc42f5fd;hpb=d2303923980a08cf6e429a9ce7359d3683c79251 diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index 080bfd7c..441a73a0 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -728,6 +728,13 @@ void UnusedVariableRemover::visit(FunctionCall &call) /* Treat function calls as having side effects so expression statements consisting of nothing but a function call won't be optimized away. */ r_side_effects = true; + + if(stage->type==Stage::GEOMETRY && call.name=="EmitVertex") + { + for(map::const_iterator i=variables.begin(); i!=variables.end(); ++i) + if(i->second.output) + referenced(i->first, call); + } } void UnusedVariableRemover::record_assignment(const Assignment::Target &target, Node &node)