diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate/impl')
3 files changed, 7 insertions, 12 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp index 933af572c..26d5e276b 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | #include "common/bit_field.h" | 5 | #include "common/bit_field.h" |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "shader_recompiler/frontend/ir/modifiers.h" | 7 | #include "shader_recompiler/frontend/ir/modifiers.h" |
| 8 | #include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" | ||
| 9 | #include "shader_recompiler/frontend/maxwell/opcodes.h" | 8 | #include "shader_recompiler/frontend/maxwell/opcodes.h" |
| 9 | #include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" | ||
| 10 | 10 | ||
| 11 | namespace Shader::Maxwell { | 11 | namespace Shader::Maxwell { |
| 12 | namespace { | 12 | namespace { |
| @@ -21,28 +21,24 @@ enum class LocalScope : u64 { | |||
| 21 | IR::MemoryScope LocalScopeToMemoryScope(LocalScope scope) { | 21 | IR::MemoryScope LocalScopeToMemoryScope(LocalScope scope) { |
| 22 | switch (scope) { | 22 | switch (scope) { |
| 23 | case LocalScope::CTG: | 23 | case LocalScope::CTG: |
| 24 | return IR::MemoryScope::Warp; | 24 | return IR::MemoryScope::Workgroup; |
| 25 | case LocalScope::GL: | 25 | case LocalScope::GL: |
| 26 | return IR::MemoryScope::Device; | 26 | return IR::MemoryScope::Device; |
| 27 | case LocalScope::SYS: | 27 | case LocalScope::SYS: |
| 28 | return IR::MemoryScope::System; | 28 | return IR::MemoryScope::System; |
| 29 | case LocalScope::VC: | ||
| 30 | return IR::MemoryScope::Workgroup; // or should be device? | ||
| 31 | default: | 29 | default: |
| 32 | throw NotImplementedException("Unimplemented Local Scope {}", scope); | 30 | throw NotImplementedException("Unimplemented Local Scope {}", scope); |
| 33 | } | 31 | } |
| 34 | } | 32 | } |
| 35 | 33 | ||
| 36 | } // namespace | 34 | } // Anonymous namespace |
| 37 | 35 | ||
| 38 | void TranslatorVisitor::MEMBAR(u64 inst) { | 36 | void TranslatorVisitor::MEMBAR(u64 inst) { |
| 39 | union { | 37 | union { |
| 40 | u64 raw; | 38 | u64 raw; |
| 41 | BitField<8, 2, LocalScope> scope; | 39 | BitField<8, 2, LocalScope> scope; |
| 42 | } membar{inst}; | 40 | } membar{inst}; |
| 43 | IR::BarrierInstInfo info{}; | 41 | ir.MemoryBarrier(LocalScopeToMemoryScope(membar.scope)); |
| 44 | info.scope.Assign(LocalScopeToMemoryScope(membar.scope)); | ||
| 45 | ir.MemoryBarrier(info); | ||
| 46 | } | 42 | } |
| 47 | 43 | ||
| 48 | void TranslatorVisitor::DEPBAR() { | 44 | void TranslatorVisitor::DEPBAR() { |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp index 731ac643f..7d9c42a83 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp | |||
| @@ -96,8 +96,10 @@ enum class SpecialRegister : u64 { | |||
| 96 | case SpecialRegister::SR_CTAID_Z: | 96 | case SpecialRegister::SR_CTAID_Z: |
| 97 | return ir.WorkgroupIdZ(); | 97 | return ir.WorkgroupIdZ(); |
| 98 | case SpecialRegister::SR_WSCALEFACTOR_XY: | 98 | case SpecialRegister::SR_WSCALEFACTOR_XY: |
| 99 | // LOG_WARNING(ShaderDecompiler, "SR_WSCALEFACTOR_XY (Stubbed)"); | ||
| 99 | return ir.Imm32(Common::BitCast<u32>(1.0f)); | 100 | return ir.Imm32(Common::BitCast<u32>(1.0f)); |
| 100 | case SpecialRegister::SR_WSCALEFACTOR_Z: | 101 | case SpecialRegister::SR_WSCALEFACTOR_Z: |
| 102 | // LOG_WARNING(ShaderDecompiler, "SR_WSCALEFACTOR_Z (Stubbed)"); | ||
| 101 | return ir.Imm32(Common::BitCast<u32>(1.0f)); | 103 | return ir.Imm32(Common::BitCast<u32>(1.0f)); |
| 102 | case SpecialRegister::SR_LANEID: | 104 | case SpecialRegister::SR_LANEID: |
| 103 | return ir.LaneId(); | 105 | return ir.LaneId(); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp index 2acabb662..d508e1e23 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp | |||
| @@ -50,10 +50,7 @@ void TranslatorVisitor::VOTE(u64 insn) { | |||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void TranslatorVisitor::VOTE_vtg(u64) { | 52 | void TranslatorVisitor::VOTE_vtg(u64) { |
| 53 | // LOG_WARNING("VOTE.VTG: Stubbed!"); | 53 | // LOG_WARNING(ShaderDecompiler, "VOTE.VTG: Stubbed!"); |
| 54 | auto imm = ir.Imm1(false); | ||
| 55 | ir.SetFCSMFlag(imm); | ||
| 56 | ir.SetTRFlag(imm); | ||
| 57 | } | 54 | } |
| 58 | 55 | ||
| 59 | } // namespace Shader::Maxwell | 56 | } // namespace Shader::Maxwell |