diff options
| author | 2021-02-08 02:54:35 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:22 -0400 | |
| commit | 2930dccecc933d6748772e9f51a5724fe1e6771b (patch) | |
| tree | ec4aa48062f8a2fcba31b1c64f769ddf25a87832 /src/shader_recompiler/frontend/ir | |
| parent | shader: Better constant folding (diff) | |
| download | yuzu-2930dccecc933d6748772e9f51a5724fe1e6771b.tar.gz yuzu-2930dccecc933d6748772e9f51a5724fe1e6771b.tar.xz yuzu-2930dccecc933d6748772e9f51a5724fe1e6771b.zip | |
spirv: Initial SPIR-V support
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 12 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 12 |
2 files changed, 10 insertions, 14 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, ) |