summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp12
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc12
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/translate.cpp10
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
132U32 IREmitter::WorkgroupIdX() { 132U32 IREmitter::WorkgroupIdX() {
133 return Inst<U32>(Opcode::WorkgroupIdX); 133 return U32{CompositeExtract(Inst(Opcode::WorkgroupId), 0)};
134} 134}
135 135
136U32 IREmitter::WorkgroupIdY() { 136U32 IREmitter::WorkgroupIdY() {
137 return Inst<U32>(Opcode::WorkgroupIdY); 137 return U32{CompositeExtract(Inst(Opcode::WorkgroupId), 1)};
138} 138}
139 139
140U32 IREmitter::WorkgroupIdZ() { 140U32 IREmitter::WorkgroupIdZ() {
141 return Inst<U32>(Opcode::WorkgroupIdZ); 141 return U32{CompositeExtract(Inst(Opcode::WorkgroupId), 2)};
142} 142}
143 143
144U32 IREmitter::LocalInvocationIdX() { 144U32 IREmitter::LocalInvocationIdX() {
145 return Inst<U32>(Opcode::LocalInvocationIdX); 145 return U32{CompositeExtract(Inst(Opcode::LocalInvocationId), 0)};
146} 146}
147 147
148U32 IREmitter::LocalInvocationIdY() { 148U32 IREmitter::LocalInvocationIdY() {
149 return Inst<U32>(Opcode::LocalInvocationIdY); 149 return U32{CompositeExtract(Inst(Opcode::LocalInvocationId), 1)};
150} 150}
151 151
152U32 IREmitter::LocalInvocationIdZ() { 152U32 IREmitter::LocalInvocationIdZ() {
153 return Inst<U32>(Opcode::LocalInvocationIdZ); 153 return U32{CompositeExtract(Inst(Opcode::LocalInvocationId), 2)};
154} 154}
155 155
156U32 IREmitter::LoadGlobalU8(const U64& address) { 156U32 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
21OPCODE(SetPred, Void, Pred, U1, ) 21OPCODE(SetPred, Void, Pred, U1, )
22OPCODE(GetCbuf, U32, U32, U32, ) 22OPCODE(GetCbuf, U32, U32, U32, )
23OPCODE(GetAttribute, U32, Attribute, ) 23OPCODE(GetAttribute, U32, Attribute, )
24OPCODE(SetAttribute, U32, Attribute, ) 24OPCODE(SetAttribute, Void, Attribute, U32, )
25OPCODE(GetAttributeIndexed, U32, U32, ) 25OPCODE(GetAttributeIndexed, U32, U32, )
26OPCODE(SetAttributeIndexed, U32, U32, ) 26OPCODE(SetAttributeIndexed, Void, U32, U32, )
27OPCODE(GetZFlag, U1, Void, ) 27OPCODE(GetZFlag, U1, Void, )
28OPCODE(GetSFlag, U1, Void, ) 28OPCODE(GetSFlag, U1, Void, )
29OPCODE(GetCFlag, U1, Void, ) 29OPCODE(GetCFlag, U1, Void, )
@@ -32,12 +32,8 @@ OPCODE(SetZFlag, Void, U1,
32OPCODE(SetSFlag, Void, U1, ) 32OPCODE(SetSFlag, Void, U1, )
33OPCODE(SetCFlag, Void, U1, ) 33OPCODE(SetCFlag, Void, U1, )
34OPCODE(SetOFlag, Void, U1, ) 34OPCODE(SetOFlag, Void, U1, )
35OPCODE(WorkgroupIdX, U32, ) 35OPCODE(WorkgroupId, U32x3, )
36OPCODE(WorkgroupIdY, U32, ) 36OPCODE(LocalInvocationId, U32x3, )
37OPCODE(WorkgroupIdZ, U32, )
38OPCODE(LocalInvocationIdX, U32, )
39OPCODE(LocalInvocationIdY, U32, )
40OPCODE(LocalInvocationIdZ, U32, )
41 37
42// Undefined 38// Undefined
43OPCODE(Undef1, U1, ) 39OPCODE(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
12namespace Shader::Maxwell { 12namespace Shader::Maxwell {
13 13
14template <auto visitor_method> 14template <auto method>
15static void Invoke(TranslatorVisitor& visitor, Location pc, u64 insn) { 15static 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