From 7302c50728ea317bcabe2d243af6b9142aac4ccd Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 28 Apr 2021 14:44:00 +0300 Subject: [PATCH] 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. --- source/glsl/spirv.cpp | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.43.0