From: Mikko Rasa Date: Sun, 7 Nov 2021 17:17:09 +0000 (+0200) Subject: Mark the start of a SPIR-V function as reachable X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7ab4261d281c7885bbdfb0a782ed231b2cd08293;p=libs%2Fgl.git Mark the start of a SPIR-V function as reachable This fixes erroneously generated OpUnreachable instructions which appeared at the end of some functions. --- diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 39aa9a06..7bec551b 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -1817,6 +1817,7 @@ void SpirVGenerator::visit(FunctionDeclaration &func) variable_load_ids[func.parameters[i].get()] = param_id; } + reachable = true; writer.begin_function_body(next_id++); SetForScope set_func(current_function, &func); func.body.visit(*this);