diff options
Diffstat (limited to 'src/shader_recompiler/frontend')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 12 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 12 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/translate.cpp | 10 |
3 files changed, 15 insertions, 19 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index 9d7dc034c..ada0be834 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -130,27 +130,27 @@ void IREmitter::SetAttribute(IR::Attribute attribute, const F32& value) { | |||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | U32 IREmitter::WorkgroupIdX() { | 132 | U32 IREmitter::WorkgroupIdX() { |
| 133 | return Inst<U32>(Opcode::WorkgroupIdX); | 133 | return U32{CompositeExtract(Inst(Opcode::WorkgroupId), 0)}; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | U32 IREmitter::WorkgroupIdY() { | 136 | U32 IREmitter::WorkgroupIdY() { |
| 137 | return Inst<U32>(Opcode::WorkgroupIdY); | 137 | return U32{CompositeExtract(Inst(Opcode::WorkgroupId), 1)}; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | U32 IREmitter::WorkgroupIdZ() { | 140 | U32 IREmitter::WorkgroupIdZ() { |
| 141 | return Inst<U32>(Opcode::WorkgroupIdZ); | 141 | return U32{CompositeExtract(Inst(Opcode::WorkgroupId), 2)}; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | U32 IREmitter::LocalInvocationIdX() { | 144 | U32 IREmitter::LocalInvocationIdX() { |
| 145 | return Inst<U32>(Opcode::LocalInvocationIdX); | 145 | return U32{CompositeExtract(Inst(Opcode::LocalInvocationId), 0)}; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | U32 IREmitter::LocalInvocationIdY() { | 148 | U32 IREmitter::LocalInvocationIdY() { |
| 149 | return Inst<U32>(Opcode::LocalInvocationIdY); | 149 | return U32{CompositeExtract(Inst(Opcode::LocalInvocationId), 1)}; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | U32 IREmitter::LocalInvocationIdZ() { | 152 | U32 IREmitter::LocalInvocationIdZ() { |
| 153 | return Inst<U32>(Opcode::LocalInvocationIdZ); | 153 | return U32{CompositeExtract(Inst(Opcode::LocalInvocationId), 2)}; |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | U32 IREmitter::LoadGlobalU8(const U64& address) { | 156 | U32 IREmitter::LoadGlobalU8(const U64& address) { |
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc index 82b04f37c..5dc65f2df 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -21,9 +21,9 @@ OPCODE(GetPred, U1, Pred | |||
| 21 | OPCODE(SetPred, Void, Pred, U1, ) | 21 | OPCODE(SetPred, Void, Pred, U1, ) |
| 22 | OPCODE(GetCbuf, U32, U32, U32, ) | 22 | OPCODE(GetCbuf, U32, U32, U32, ) |
| 23 | OPCODE(GetAttribute, U32, Attribute, ) | 23 | OPCODE(GetAttribute, U32, Attribute, ) |
| 24 | OPCODE(SetAttribute, U32, Attribute, ) | 24 | OPCODE(SetAttribute, Void, Attribute, U32, ) |
| 25 | OPCODE(GetAttributeIndexed, U32, U32, ) | 25 | OPCODE(GetAttributeIndexed, U32, U32, ) |
| 26 | OPCODE(SetAttributeIndexed, U32, U32, ) | 26 | OPCODE(SetAttributeIndexed, Void, U32, U32, ) |
| 27 | OPCODE(GetZFlag, U1, Void, ) | 27 | OPCODE(GetZFlag, U1, Void, ) |
| 28 | OPCODE(GetSFlag, U1, Void, ) | 28 | OPCODE(GetSFlag, U1, Void, ) |
| 29 | OPCODE(GetCFlag, U1, Void, ) | 29 | OPCODE(GetCFlag, U1, Void, ) |
| @@ -32,12 +32,8 @@ OPCODE(SetZFlag, Void, U1, | |||
| 32 | OPCODE(SetSFlag, Void, U1, ) | 32 | OPCODE(SetSFlag, Void, U1, ) |
| 33 | OPCODE(SetCFlag, Void, U1, ) | 33 | OPCODE(SetCFlag, Void, U1, ) |
| 34 | OPCODE(SetOFlag, Void, U1, ) | 34 | OPCODE(SetOFlag, Void, U1, ) |
| 35 | OPCODE(WorkgroupIdX, U32, ) | 35 | OPCODE(WorkgroupId, U32x3, ) |
| 36 | OPCODE(WorkgroupIdY, U32, ) | 36 | OPCODE(LocalInvocationId, U32x3, ) |
| 37 | OPCODE(WorkgroupIdZ, U32, ) | ||
| 38 | OPCODE(LocalInvocationIdX, U32, ) | ||
| 39 | OPCODE(LocalInvocationIdY, U32, ) | ||
| 40 | OPCODE(LocalInvocationIdZ, U32, ) | ||
| 41 | 37 | ||
| 42 | // Undefined | 38 | // Undefined |
| 43 | OPCODE(Undef1, U1, ) | 39 | OPCODE(Undef1, U1, ) |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/translate.cpp b/src/shader_recompiler/frontend/maxwell/translate/translate.cpp index dcc3f6c0e..7e6bb07a2 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/translate.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/translate.cpp | |||
| @@ -11,15 +11,15 @@ | |||
| 11 | 11 | ||
| 12 | namespace Shader::Maxwell { | 12 | namespace Shader::Maxwell { |
| 13 | 13 | ||
| 14 | template <auto visitor_method> | 14 | template <auto method> |
| 15 | static void Invoke(TranslatorVisitor& visitor, Location pc, u64 insn) { | 15 | static void Invoke(TranslatorVisitor& visitor, Location pc, u64 insn) { |
| 16 | using MethodType = decltype(visitor_method); | 16 | using MethodType = decltype(method); |
| 17 | if constexpr (std::is_invocable_r_v<void, MethodType, TranslatorVisitor&, Location, u64>) { | 17 | if constexpr (std::is_invocable_r_v<void, MethodType, TranslatorVisitor&, Location, u64>) { |
| 18 | (visitor.*visitor_method)(pc, insn); | 18 | (visitor.*method)(pc, insn); |
| 19 | } else if constexpr (std::is_invocable_r_v<void, MethodType, TranslatorVisitor&, u64>) { | 19 | } else if constexpr (std::is_invocable_r_v<void, MethodType, TranslatorVisitor&, u64>) { |
| 20 | (visitor.*visitor_method)(insn); | 20 | (visitor.*method)(insn); |
| 21 | } else { | 21 | } else { |
| 22 | (visitor.*visitor_method)(); | 22 | (visitor.*method)(); |
| 23 | } | 23 | } |
| 24 | } | 24 | } |
| 25 | 25 | ||