From: Mikko Rasa Date: Thu, 25 Feb 2021 10:24:41 +0000 (+0200) Subject: Don't add null entries to variable values X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6436e275985261c85c59b1b962cbf8c466e9eaba;p=libs%2Fgl.git Don't add null entries to variable values This triggered a bug now that function parameters are processed within the function's scope. --- 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(); }