From: Mikko Rasa Date: Wed, 28 Apr 2021 11:44:00 +0000 (+0300) Subject: The load cache still needs to be pruned after the loop too X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=7302c50728ea317bcabe2d243af6b9142aac4ccd The load cache still needs to be pruned after the loop too Under SPIR-V's structured flow control rules it's not permissible to use a result from inside the loop except with OpPhi. --- diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 63c76f9a..72f73bd5 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -1902,6 +1902,7 @@ void SpirVGenerator::visit(Iteration &iter) writer.write_op(content.function_body, OP_BRANCH, header_id); writer.write_op_label(merge_block_id); + prune_loads(header_id); reachable = true; }