From 57ff0b07aca38aee593a85831ba600b77e3b7a7b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 10 Oct 2021 11:51:04 +0300 Subject: [PATCH] Don't dismantle aggregates which are function parameters --- source/glsl/optimize.cpp | 5 +++++ source/glsl/optimize.h | 1 + 2 files changed, 6 insertions(+) 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 -- 2.45.2