summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell/translate/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate/impl')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp12
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp2
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp5
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
11namespace Shader::Maxwell { 11namespace Shader::Maxwell {
12namespace { 12namespace {
@@ -21,28 +21,24 @@ enum class LocalScope : u64 {
21IR::MemoryScope LocalScopeToMemoryScope(LocalScope scope) { 21IR::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
38void TranslatorVisitor::MEMBAR(u64 inst) { 36void 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
48void TranslatorVisitor::DEPBAR() { 44void 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
52void TranslatorVisitor::VOTE_vtg(u64) { 52void 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