From 5c5d094255ae5b0a07f99392a5a099ad9c8e8e38 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 16 Dec 2016 23:52:39 +0200 Subject: [PATCH] Remove useless declarations of main() from shaders --- source/programcompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.45.2