]> git.tdb.fi Git - libs/gl.git/commitdiff
The load cache still needs to be pruned after the loop too
authorMikko Rasa <tdb@tdb.fi>
Wed, 28 Apr 2021 11:44:00 +0000 (14:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 28 Apr 2021 12:28:25 +0000 (15:28 +0300)
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

index 63c76f9a2233050851e9491af42855ee9f0e8a8c..72f73bd56bdf9c4ff1d3738342986b6fbf7a315f 100644 (file)
@@ -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;
 }