From 6436e275985261c85c59b1b962cbf8c466e9eaba Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 25 Feb 2021 12:24:41 +0200 Subject: [PATCH] Don't add null entries to variable values This triggered a bug now that function parameters are processed within the function's scope. --- source/glsl/optimize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index 1f5b5d31..fcb1075e 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -160,7 +160,7 @@ void ConstantConditionEliminator::visit(Assignment &assign) void ConstantConditionEliminator::visit(VariableDeclaration &var) { - if(var.constant || current_block->parent) + if((var.constant || current_block->parent) && var.init_expression) variable_values[&var] = var.init_expression.get(); } -- 2.45.2