]> git.tdb.fi Git - libs/gl.git/commitdiff
Mark the start of a SPIR-V function as reachable
authorMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 17:17:09 +0000 (19:17 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 17:17:09 +0000 (19:17 +0200)
This fixes erroneously generated OpUnreachable instructions which
appeared at the end of some functions.

source/glsl/spirv.cpp

index 39aa9a0672a72159ec7952cc668c004e9714bd5b..7bec551b166fd4b3303c23591c24886f1baac9b6 100644 (file)
@@ -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<FunctionDeclaration *> set_func(current_function, &func);
        func.body.visit(*this);