Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2020-06-29 13:20:35 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2020-06-29 13:20:35 +0300
commit3afbfdb0909e218b7c6b66bafa367dfc9a0e387e (patch)
treebb9a020068fd5c586ac7859a9065ce78f6f3f356 /spirv_cross.cpp
parent05188aca692924a6c5ad312fc819fa1d5aa9c787 (diff)
Implement context-sensitive expression read tracking.
When inside a loop, treat any read of outer expressions to happen multiple times, forcing a temporary of said outer expressions. This avoids the problem where we can end up relying on loop-invariant code motion to happen in the compiler when converting optimized shaders.
Diffstat (limited to 'spirv_cross.cpp')
-rw-r--r--spirv_cross.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/spirv_cross.cpp b/spirv_cross.cpp
index 8abe19a4..19c9e1a9 100644
--- a/spirv_cross.cpp
+++ b/spirv_cross.cpp
@@ -4674,3 +4674,8 @@ bool Compiler::flush_phi_required(BlockID from, BlockID to) const
return true;
return false;
}
+
+void Compiler::add_loop_level()
+{
+ current_loop_level++;
+}