diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate/impl')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp | 30 |
1 files changed, 10 insertions, 20 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 2a2a294df..86e433e41 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp | |||
| @@ -12,34 +12,24 @@ namespace Shader::Maxwell { | |||
| 12 | namespace { | 12 | namespace { |
| 13 | // Seems to be in CUDA terminology. | 13 | // Seems to be in CUDA terminology. |
| 14 | enum class LocalScope : u64 { | 14 | enum class LocalScope : u64 { |
| 15 | CTG = 0, | 15 | CTA, |
| 16 | GL = 1, | 16 | GL, |
| 17 | SYS = 2, | 17 | SYS, |
| 18 | VC = 3, | 18 | VC, |
| 19 | }; | 19 | }; |
| 20 | |||
| 21 | IR::MemoryScope LocalScopeToMemoryScope(LocalScope scope) { | ||
| 22 | switch (scope) { | ||
| 23 | case LocalScope::CTG: | ||
| 24 | return IR::MemoryScope::Workgroup; | ||
| 25 | case LocalScope::GL: | ||
| 26 | return IR::MemoryScope::Device; | ||
| 27 | case LocalScope::SYS: | ||
| 28 | return IR::MemoryScope::System; | ||
| 29 | default: | ||
| 30 | throw NotImplementedException("Unimplemented Local Scope {}", scope); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | |||
| 34 | } // Anonymous namespace | 20 | } // Anonymous namespace |
| 35 | 21 | ||
| 36 | void TranslatorVisitor::MEMBAR(u64 inst) { | 22 | void TranslatorVisitor::MEMBAR(u64 inst) { |
| 37 | union { | 23 | union { |
| 38 | u64 raw; | 24 | u64 raw; |
| 39 | BitField<8, 2, LocalScope> scope; | 25 | BitField<8, 2, LocalScope> scope; |
| 40 | } membar{inst}; | 26 | } const membar{inst}; |
| 41 | 27 | ||
| 42 | ir.MemoryBarrier(LocalScopeToMemoryScope(membar.scope)); | 28 | if (membar.scope == LocalScope::CTA) { |
| 29 | ir.WorkgroupMemoryBarrier(); | ||
| 30 | } else { | ||
| 31 | ir.DeviceMemoryBarrier(); | ||
| 32 | } | ||
| 43 | } | 33 | } |
| 44 | 34 | ||
| 45 | void TranslatorVisitor::DEPBAR() { | 35 | void TranslatorVisitor::DEPBAR() { |