From: Mikko Rasa Date: Tue, 23 Feb 2021 22:37:04 +0000 (+0200) Subject: Ignore function parameters in InterfaceGenerator X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=90c89817585b41fdd1ab24153fec41d28d56cab0;p=libs%2Fgl.git Ignore function parameters in InterfaceGenerator --- diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index 0662f989..62c879c8 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -394,6 +394,12 @@ void InterfaceGenerator::visit(VariableDeclaration &var) TraversingVisitor::visit(var); } +void InterfaceGenerator::visit(FunctionDeclaration &func) +{ + // Skip parameters because they're not useful here + func.body.visit(*this); +} + void InterfaceGenerator::visit(Passthrough &pass) { vector pass_vars; diff --git a/source/glsl/generate.h b/source/glsl/generate.h index c54860fc..f904021a 100644 --- a/source/glsl/generate.h +++ b/source/glsl/generate.h @@ -101,6 +101,7 @@ private: ExpressionStatement &insert_assignment(const std::string &, Expression *); virtual void visit(VariableReference &); virtual void visit(VariableDeclaration &); + virtual void visit(FunctionDeclaration &); virtual void visit(Passthrough &); };