From 90c89817585b41fdd1ab24153fec41d28d56cab0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 24 Feb 2021 00:37:04 +0200 Subject: [PATCH] Ignore function parameters in InterfaceGenerator --- source/glsl/generate.cpp | 6 ++++++ source/glsl/generate.h | 1 + 2 files changed, 7 insertions(+) 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 &); }; -- 2.45.2