diff options
Diffstat (limited to 'src/shader_recompiler/frontend')
5 files changed, 8 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index 141efd86c..ef3b00bc2 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -343,6 +343,10 @@ void IREmitter::SetFragColor(u32 index, u32 component, const F32& value) { | |||
| 343 | Inst(Opcode::SetFragColor, Imm32(index), Imm32(component), value); | 343 | Inst(Opcode::SetFragColor, Imm32(index), Imm32(component), value); |
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | void IREmitter::SetSampleMask(const U32& value) { | ||
| 347 | Inst(Opcode::SetSampleMask, value); | ||
| 348 | } | ||
| 349 | |||
| 346 | void IREmitter::SetFragDepth(const F32& value) { | 350 | void IREmitter::SetFragDepth(const F32& value) { |
| 347 | Inst(Opcode::SetFragDepth, value); | 351 | Inst(Opcode::SetFragDepth, value); |
| 348 | } | 352 | } |
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 81833d928..1a585df15 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -88,6 +88,7 @@ public: | |||
| 88 | void SetPatch(Patch patch, const F32& value); | 88 | void SetPatch(Patch patch, const F32& value); |
| 89 | 89 | ||
| 90 | void SetFragColor(u32 index, u32 component, const F32& value); | 90 | void SetFragColor(u32 index, u32 component, const F32& value); |
| 91 | void SetSampleMask(const U32& value); | ||
| 91 | void SetFragDepth(const F32& value); | 92 | void SetFragDepth(const F32& value); |
| 92 | 93 | ||
| 93 | [[nodiscard]] U32 WorkgroupIdX(); | 94 | [[nodiscard]] U32 WorkgroupIdX(); |
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp index b2d7573d9..b53fe2e2a 100644 --- a/src/shader_recompiler/frontend/ir/microinstruction.cpp +++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp | |||
| @@ -75,6 +75,7 @@ bool Inst::MayHaveSideEffects() const noexcept { | |||
| 75 | case Opcode::SetAttributeIndexed: | 75 | case Opcode::SetAttributeIndexed: |
| 76 | case Opcode::SetPatch: | 76 | case Opcode::SetPatch: |
| 77 | case Opcode::SetFragColor: | 77 | case Opcode::SetFragColor: |
| 78 | case Opcode::SetSampleMask: | ||
| 78 | case Opcode::SetFragDepth: | 79 | case Opcode::SetFragDepth: |
| 79 | case Opcode::WriteGlobalU8: | 80 | case Opcode::WriteGlobalU8: |
| 80 | case Opcode::WriteGlobalS8: | 81 | case Opcode::WriteGlobalS8: |
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc index d5e443673..0748efa8d 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -51,6 +51,7 @@ OPCODE(SetAttributeIndexed, Void, U32, | |||
| 51 | OPCODE(GetPatch, F32, Patch, ) | 51 | OPCODE(GetPatch, F32, Patch, ) |
| 52 | OPCODE(SetPatch, Void, Patch, F32, ) | 52 | OPCODE(SetPatch, Void, Patch, F32, ) |
| 53 | OPCODE(SetFragColor, Void, U32, U32, F32, ) | 53 | OPCODE(SetFragColor, Void, U32, U32, F32, ) |
| 54 | OPCODE(SetSampleMask, Void, U32, ) | ||
| 54 | OPCODE(SetFragDepth, Void, F32, ) | 55 | OPCODE(SetFragDepth, Void, F32, ) |
| 55 | OPCODE(GetZFlag, U1, Void, ) | 56 | OPCODE(GetZFlag, U1, Void, ) |
| 56 | OPCODE(GetSFlag, U1, Void, ) | 57 | OPCODE(GetSFlag, U1, Void, ) |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp index 58a53c0ec..c2443c886 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp | |||
| @@ -22,7 +22,7 @@ void ExitFragment(TranslatorVisitor& v) { | |||
| 22 | } | 22 | } |
| 23 | } | 23 | } |
| 24 | if (sph.ps.omap.sample_mask != 0) { | 24 | if (sph.ps.omap.sample_mask != 0) { |
| 25 | throw NotImplementedException("Sample mask"); | 25 | v.ir.SetSampleMask(v.X(src_reg)); |
| 26 | } | 26 | } |
| 27 | if (sph.ps.omap.depth != 0) { | 27 | if (sph.ps.omap.depth != 0) { |
| 28 | v.ir.SetFragDepth(v.F(src_reg + 1)); | 28 | v.ir.SetFragDepth(v.F(src_reg + 1)); |