From e484dab089e86e889f007ad362f72337542015a0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 22 Apr 2021 15:30:41 +0300 Subject: [PATCH] Clear r_constant_result for a function call by default Also clear it before processing a variable initializer, just in case. --- source/glsl/spirv.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 52885342..7d6edf65 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -1051,6 +1051,7 @@ void SpirVGenerator::visit(FunctionCall &call) throw internal_error("function call in constant expression"); Id result_type_id = get_id(*call.type); + r_constant_result = false; if(call.constructor) visit_constructor(call, argument_ids, all_args_const); @@ -1574,6 +1575,7 @@ void SpirVGenerator::visit(VariableDeclaration &var) { SetFlag set_const(constant_expression, !current_function); r_expression_result_id = 0; + r_constant_result = false; var.init_expression->visit(*this); init_id = r_expression_result_id; } -- 2.45.2