summaryrefslogtreecommitdiff
path: root/spirv_cross_parsed_ir.cpp
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2019-07-18 13:34:47 +0200
committerHans-Kristian Arntzen <post@arntzen-software.no>2019-07-19 10:06:19 +0200
commita86308bce1075c13a608f05ce2341b9be9f87806 (patch)
tree83135bc90a0a73e31edf28488bd152c557e02ad9 /spirv_cross_parsed_ir.cpp
parent98d8bcd64b58ddc754927985861ef6f53625917c (diff)
downloadSPIRV-Cross-a86308bce1075c13a608f05ce2341b9be9f87806.tar.gz
SPIRV-Cross-a86308bce1075c13a608f05ce2341b9be9f87806.tar.bz2
SPIRV-Cross-a86308bce1075c13a608f05ce2341b9be9f87806.zip
MSL: Begin rewrite of buffer packing logic.
Diffstat (limited to 'spirv_cross_parsed_ir.cpp')
-rw-r--r--spirv_cross_parsed_ir.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/spirv_cross_parsed_ir.cpp b/spirv_cross_parsed_ir.cpp
index f0b6f7b1..d58db688 100644
--- a/spirv_cross_parsed_ir.cpp
+++ b/spirv_cross_parsed_ir.cpp
@@ -749,4 +749,36 @@ Meta *ParsedIR::find_meta(uint32_t id)
return nullptr;
}
+ParsedIR::LoopLock ParsedIR::create_loop_lock() const
+{
+ return ParsedIR::LoopLock(&loop_iteration_depth);
+}
+
+ParsedIR::LoopLock::~LoopLock()
+{
+ if (lock)
+ (*lock)--;
+}
+
+ParsedIR::LoopLock::LoopLock(uint32_t *lock_)
+ : lock(lock_)
+{
+ if (lock)
+ (*lock)++;
+}
+
+ParsedIR::LoopLock::LoopLock(LoopLock &&other) SPIRV_CROSS_NOEXCEPT
+{
+ *this = move(other);
+}
+
+ParsedIR::LoopLock &ParsedIR::LoopLock::operator=(LoopLock &&other) SPIRV_CROSS_NOEXCEPT
+{
+ if (lock)
+ (*lock)--;
+ lock = other.lock;
+ other.lock = nullptr;
+ return *this;
+}
+
} // namespace SPIRV_CROSS_NAMESPACE