From: Mikko Rasa Date: Fri, 16 Dec 2016 21:52:39 +0000 (+0200) Subject: Remove useless declarations of main() from shaders X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5c5d094255ae5b0a07f99392a5a099ad9c8e8e38;p=libs%2Fgl.git Remove useless declarations of main() from shaders --- diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index 13b203b4..0d61c685 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -1447,7 +1447,7 @@ void ProgramCompiler::UnusedFunctionLocator::visit(FunctionDeclaration &func) { TraversingVisitor::visit(func); - if(func.name!="main" && !used_definitions.count(&func)) + if((func.name!="main" || func.body.body.empty()) && !used_definitions.count(&func)) unused_nodes.insert(&func); }