summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-04-04 08:04:48 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:26 +0200
commitfc93bc2abde0b54a0a495f9b28a76fd34b47f320 (patch)
treefc0b0c022604b3e4adfc28864b8c91b58a9b3c06 /src/shader_recompiler/frontend/ir
parentshader: Abstract breadth searches and use the abstraction (diff)
downloadyuzu-fc93bc2abde0b54a0a495f9b28a76fd34b47f320.tar
yuzu-fc93bc2abde0b54a0a495f9b28a76fd34b47f320.tar.gz
yuzu-fc93bc2abde0b54a0a495f9b28a76fd34b47f320.tar.bz2
yuzu-fc93bc2abde0b54a0a495f9b28a76fd34b47f320.tar.lz
yuzu-fc93bc2abde0b54a0a495f9b28a76fd34b47f320.tar.xz
yuzu-fc93bc2abde0b54a0a495f9b28a76fd34b47f320.tar.zst
yuzu-fc93bc2abde0b54a0a495f9b28a76fd34b47f320.zip
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp4
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h1
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.cpp4
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc1
4 files changed, 10 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index dbd38a28b..246c3b9ef 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -82,6 +82,10 @@ void IREmitter::SelectionMerge(Block* merge_block) {
Inst(Opcode::SelectionMerge, merge_block);
}
+void IREmitter::Barrier() {
+ Inst(Opcode::Barrier);
+}
+
void IREmitter::MemoryBarrier(MemoryScope scope) {
switch (scope) {
case MemoryScope::Workgroup:
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 81a57fefe..1b00c548d 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -128,6 +128,7 @@ public:
[[nodiscard]] Value Select(const U1& condition, const Value& true_value,
const Value& false_value);
+ [[nodiscard]] void Barrier();
[[nodiscard]] void MemoryBarrier(MemoryScope scope);
template <typename Dest, typename Source>
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp
index 074c71d53..481202d94 100644
--- a/src/shader_recompiler/frontend/ir/microinstruction.cpp
+++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp
@@ -57,6 +57,10 @@ bool Inst::MayHaveSideEffects() const noexcept {
case Opcode::Return:
case Opcode::Unreachable:
case Opcode::DemoteToHelperInvocation:
+ case Opcode::Barrier:
+ case Opcode::MemoryBarrierWorkgroupLevel:
+ case Opcode::MemoryBarrierDeviceLevel:
+ case Opcode::MemoryBarrierSystemLevel:
case Opcode::Prologue:
case Opcode::Epilogue:
case Opcode::SetAttribute:
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index 734f5328b..dcd54bcf7 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -17,6 +17,7 @@ OPCODE(Unreachable, Void,
OPCODE(DemoteToHelperInvocation, Void, Label, )
// Barriers
+OPCODE(Barrier, Void, )
OPCODE(MemoryBarrierWorkgroupLevel, Void, )
OPCODE(MemoryBarrierDeviceLevel, Void, )
OPCODE(MemoryBarrierSystemLevel, Void, )