diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 20 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 5 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/microinstruction.cpp | 5 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/modifiers.h | 8 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 5 |
5 files changed, 13 insertions, 30 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index ef3b00bc2..aebe7200f 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -86,20 +86,12 @@ void IREmitter::Barrier() { | |||
| 86 | Inst(Opcode::Barrier); | 86 | Inst(Opcode::Barrier); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | void IREmitter::MemoryBarrier(MemoryScope scope) { | 89 | void IREmitter::WorkgroupMemoryBarrier() { |
| 90 | switch (scope) { | 90 | Inst(Opcode::WorkgroupMemoryBarrier); |
| 91 | case MemoryScope::Workgroup: | 91 | } |
| 92 | Inst(Opcode::MemoryBarrierWorkgroupLevel); | 92 | |
| 93 | break; | 93 | void IREmitter::DeviceMemoryBarrier() { |
| 94 | case MemoryScope::Device: | 94 | Inst(Opcode::DeviceMemoryBarrier); |
| 95 | Inst(Opcode::MemoryBarrierDeviceLevel); | ||
| 96 | break; | ||
| 97 | case MemoryScope::System: | ||
| 98 | Inst(Opcode::MemoryBarrierSystemLevel); | ||
| 99 | break; | ||
| 100 | default: | ||
| 101 | throw InvalidArgument("Invalid memory scope {}", scope); | ||
| 102 | } | ||
| 103 | } | 95 | } |
| 104 | 96 | ||
| 105 | void IREmitter::Return() { | 97 | void IREmitter::Return() { |
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 1a585df15..b9d051b43 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -144,8 +144,9 @@ public: | |||
| 144 | [[nodiscard]] Value Select(const U1& condition, const Value& true_value, | 144 | [[nodiscard]] Value Select(const U1& condition, const Value& true_value, |
| 145 | const Value& false_value); | 145 | const Value& false_value); |
| 146 | 146 | ||
| 147 | [[nodiscard]] void Barrier(); | 147 | void Barrier(); |
| 148 | [[nodiscard]] void MemoryBarrier(MemoryScope scope); | 148 | void WorkgroupMemoryBarrier(); |
| 149 | void DeviceMemoryBarrier(); | ||
| 149 | 150 | ||
| 150 | template <typename Dest, typename Source> | 151 | template <typename Dest, typename Source> |
| 151 | [[nodiscard]] Dest BitCast(const Source& value); | 152 | [[nodiscard]] Dest BitCast(const Source& value); |
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp index b53fe2e2a..efa426808 100644 --- a/src/shader_recompiler/frontend/ir/microinstruction.cpp +++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp | |||
| @@ -64,9 +64,8 @@ bool Inst::MayHaveSideEffects() const noexcept { | |||
| 64 | case Opcode::Unreachable: | 64 | case Opcode::Unreachable: |
| 65 | case Opcode::DemoteToHelperInvocation: | 65 | case Opcode::DemoteToHelperInvocation: |
| 66 | case Opcode::Barrier: | 66 | case Opcode::Barrier: |
| 67 | case Opcode::MemoryBarrierWorkgroupLevel: | 67 | case Opcode::WorkgroupMemoryBarrier: |
| 68 | case Opcode::MemoryBarrierDeviceLevel: | 68 | case Opcode::DeviceMemoryBarrier: |
| 69 | case Opcode::MemoryBarrierSystemLevel: | ||
| 70 | case Opcode::Prologue: | 69 | case Opcode::Prologue: |
| 71 | case Opcode::Epilogue: | 70 | case Opcode::Epilogue: |
| 72 | case Opcode::EmitVertex: | 71 | case Opcode::EmitVertex: |
diff --git a/src/shader_recompiler/frontend/ir/modifiers.h b/src/shader_recompiler/frontend/ir/modifiers.h index 447e9703c..5d7efa14c 100644 --- a/src/shader_recompiler/frontend/ir/modifiers.h +++ b/src/shader_recompiler/frontend/ir/modifiers.h | |||
| @@ -25,14 +25,6 @@ enum class FpRounding : u8 { | |||
| 25 | RZ, // Round towards zero | 25 | RZ, // Round towards zero |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | enum class MemoryScope : u32 { | ||
| 29 | DontCare, | ||
| 30 | Warp, | ||
| 31 | Workgroup, | ||
| 32 | Device, | ||
| 33 | System, | ||
| 34 | }; | ||
| 35 | |||
| 36 | struct FpControl { | 28 | struct FpControl { |
| 37 | bool no_contraction{false}; | 29 | bool no_contraction{false}; |
| 38 | FpRounding rounding{FpRounding::DontCare}; | 30 | FpRounding rounding{FpRounding::DontCare}; |
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc index 0748efa8d..1cfc2a943 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -18,9 +18,8 @@ OPCODE(DemoteToHelperInvocation, Void, Labe | |||
| 18 | 18 | ||
| 19 | // Barriers | 19 | // Barriers |
| 20 | OPCODE(Barrier, Void, ) | 20 | OPCODE(Barrier, Void, ) |
| 21 | OPCODE(MemoryBarrierWorkgroupLevel, Void, ) | 21 | OPCODE(WorkgroupMemoryBarrier, Void, ) |
| 22 | OPCODE(MemoryBarrierDeviceLevel, Void, ) | 22 | OPCODE(DeviceMemoryBarrier, Void, ) |
| 23 | OPCODE(MemoryBarrierSystemLevel, Void, ) | ||
| 24 | 23 | ||
| 25 | // Special operations | 24 | // Special operations |
| 26 | OPCODE(Prologue, Void, ) | 25 | OPCODE(Prologue, Void, ) |