Merge pull request #3981 from ReinUsesLisp/bar

shader/other: Implement BAR.SYNC 0x0
This commit is contained in:
bunnei
2020-05-26 14:40:13 -04:00
committed by GitHub
5 changed files with 34 additions and 1 deletions

View File

@ -2335,6 +2335,15 @@ private:
return {fmt::format("readInvocationARB({}, {})", value, index), Type::Float};
}
Expression Barrier(Operation) {
if (!ir.IsDecompiled()) {
LOG_ERROR(Render_OpenGL, "barrier() used but shader is not decompiled");
return {};
}
code.AddLine("barrier();");
return {};
}
Expression MemoryBarrierGL(Operation) {
code.AddLine("memoryBarrier();");
return {};
@ -2581,6 +2590,7 @@ private:
&GLSLDecompiler::ThreadMask<Func::Lt>,
&GLSLDecompiler::ShuffleIndexed,
&GLSLDecompiler::Barrier,
&GLSLDecompiler::MemoryBarrierGL,
};
static_assert(operation_decompilers.size() == static_cast<std::size_t>(OperationCode::Amount));