From: Mikko Rasa Date: Sun, 10 Oct 2021 08:51:04 +0000 (+0300) Subject: Don't dismantle aggregates which are function parameters X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=57ff0b07aca38aee593a85831ba600b77e3b7a7b;p=libs%2Fgl.git Don't dismantle aggregates which are function parameters --- diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index 42e4a86e..0d6f7537 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -717,6 +717,11 @@ void AggregateDismantler::visit(VariableDeclaration &var) } } +void AggregateDismantler::visit(FunctionDeclaration &func) +{ + func.body.visit(*this); +} + template T ConstantFolder::evaluate_logical(char oper, T left, T right) diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index aebe080c..b8ab3201 100644 --- a/source/glsl/optimize.h +++ b/source/glsl/optimize.h @@ -195,6 +195,7 @@ private: virtual void visit(StructDeclaration &) { } virtual void visit(VariableDeclaration &); virtual void visit(InterfaceBlock &) { } + virtual void visit(FunctionDeclaration &); }; /** Replaces expressions consisting entirely of literals with the results of