diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index d9e9a8c..1fb8013 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -366,6 +366,9 @@ public: // Barrier + /// Wait for other invocations of this module to reach the current point of execution. + Id OpControlBarrier(Id execution, Id memory, Id semantics); + /// Control the order that memory accesses are observed. Id OpMemoryBarrier(Id scope, Id semantics); diff --git a/src/instructions/barrier.cpp b/src/instructions/barrier.cpp index 8f91c8a..da74bf5 100644 --- a/src/instructions/barrier.cpp +++ b/src/instructions/barrier.cpp @@ -10,6 +10,14 @@ namespace Sirit { +Id Module::OpControlBarrier(Id execution, Id memory, Id semantics) { + auto op = std::make_unique(spv::Op::OpControlBarrier); + op->Add(execution); + op->Add(memory); + op->Add(semantics); + return AddCode(std::move(op)); +} + Id Module::OpMemoryBarrier(Id scope, Id semantics) { auto op = std::make_unique(spv::Op::OpMemoryBarrier); op->Add(scope);