From: Mikko Rasa Date: Thu, 22 Apr 2021 12:30:41 +0000 (+0300) Subject: Clear r_constant_result for a function call by default X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e484dab089e86e889f007ad362f72337542015a0;p=libs%2Fgl.git Clear r_constant_result for a function call by default Also clear it before processing a variable initializer, just in case. --- 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; }