diff options
Diffstat (limited to 'externals/sirit/src/instructions/barrier.cpp')
-rw-r--r-- | externals/sirit/src/instructions/barrier.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/externals/sirit/src/instructions/barrier.cpp b/externals/sirit/src/instructions/barrier.cpp new file mode 100644 index 0000000000..646b5cfb4d --- /dev/null +++ b/externals/sirit/src/instructions/barrier.cpp @@ -0,0 +1,23 @@ +/* This file is part of the sirit project. + * Copyright (c) 2019 sirit + * This software may be used and distributed according to the terms of the + * 3-Clause BSD License + */ + +#include "sirit/sirit.h" + +#include "stream.h" + +namespace Sirit { + +Id Module::OpControlBarrier(Id execution, Id memory, Id semantics) { + code->Reserve(4); + return *code << spv::Op::OpControlBarrier << execution << memory << semantics << EndOp{}; +} + +Id Module::OpMemoryBarrier(Id scope, Id semantics) { + code->Reserve(3); + return *code << spv::Op::OpMemoryBarrier << scope << semantics << EndOp{}; +} + +} // namespace Sirit |