]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't dismantle aggregates which are function parameters
authorMikko Rasa <tdb@tdb.fi>
Sun, 10 Oct 2021 08:51:04 +0000 (11:51 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 10 Oct 2021 10:54:56 +0000 (13:54 +0300)
source/glsl/optimize.cpp
source/glsl/optimize.h

index 42e4a86ec7feb3466f7e0a119b4bf1a4feb28916..0d6f753768ad2bd5fdbf7ff4d3a8f44ff75f1cb9 100644 (file)
@@ -717,6 +717,11 @@ void AggregateDismantler::visit(VariableDeclaration &var)
        }
 }
 
+void AggregateDismantler::visit(FunctionDeclaration &func)
+{
+       func.body.visit(*this);
+}
+
 
 template<typename T>
 T ConstantFolder::evaluate_logical(char oper, T left, T right)
index aebe080c585206b14d533a4c09ef3c926878392d..b8ab3201ccc54aa74fc603fce30caf8b5bd6b683 100644 (file)
@@ -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