shader: Implement MEMBAR.GL

Implement using memoryBarrier in GLSL and OpMemoryBarrier on SPIR-V.
This commit is contained in:
ReinUsesLisp 2019-12-09 21:46:12 -03:00
parent 6edadef96d
commit 425a254fa2
No known key found for this signature in database
GPG key ID: 2DFC508897B39CFE
6 changed files with 47 additions and 2 deletions

View file

@ -1992,6 +1992,11 @@ private:
return {fmt::format("readInvocationARB({}, {})", value, index), Type::Float};
}
Expression MemoryBarrierGL(Operation) {
code.AddLine("memoryBarrier();");
return {};
}
struct Func final {
Func() = delete;
~Func() = delete;
@ -2173,6 +2178,8 @@ private:
&GLSLDecompiler::ThreadId,
&GLSLDecompiler::ShuffleIndexed,
&GLSLDecompiler::MemoryBarrierGL,
};
static_assert(operation_decompilers.size() == static_cast<std::size_t>(OperationCode::Amount));