diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-08-01 10:51:44 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-08-01 10:55:21 +0300 |
commit | b97e9b0499f299e140271498302218f7ef6920ac (patch) | |
tree | 6957aa48abec5baa6a8151f75fd4f41643b9c872 /spirv_cross.hpp | |
parent | ffca8735ff42a9e7a3d1dbb984cf3bf2ca724ebc (diff) |
Fix severe performance issue with invariant expression invalidation.
We were going down a tree of expressions multiple times and this caused
an exponential explosion in time, which was not caught until recently.
Fix this by blocking any traversal going through an ID more than one
time.
This fix overall improves performance by almost an order of magnitude on a
particular test shader rather than slowing it down by ~75x.
Diffstat (limited to 'spirv_cross.hpp')
-rw-r--r-- | spirv_cross.hpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spirv_cross.hpp b/spirv_cross.hpp index 7797bf25..ca75dc66 100644 --- a/spirv_cross.hpp +++ b/spirv_cross.hpp @@ -816,6 +816,7 @@ protected: std::unordered_set<uint32_t> forwarded_temporaries; std::unordered_set<uint32_t> suppressed_usage_tracking; std::unordered_set<uint32_t> hoisted_temporaries; + std::unordered_set<uint32_t> forced_invariant_temporaries; Bitset active_input_builtins; Bitset active_output_builtins; |