diff options
author | bunnei <bunneidev@gmail.com> | 2020-01-20 06:01:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-20 06:01:52 +0100 |
commit | 69b44392a71e0b3207ef22e155d3be750a9e41b8 (patch) | |
tree | a74021333cf87e7216204db09d2c9dd01e2bfe5f | |
parent | Merge pull request #3322 from ReinUsesLisp/vk-front-face (diff) | |
parent | vk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-V (diff) | |
download | yuzu-69b44392a71e0b3207ef22e155d3be750a9e41b8.tar yuzu-69b44392a71e0b3207ef22e155d3be750a9e41b8.tar.gz yuzu-69b44392a71e0b3207ef22e155d3be750a9e41b8.tar.bz2 yuzu-69b44392a71e0b3207ef22e155d3be750a9e41b8.tar.lz yuzu-69b44392a71e0b3207ef22e155d3be750a9e41b8.tar.xz yuzu-69b44392a71e0b3207ef22e155d3be750a9e41b8.tar.zst yuzu-69b44392a71e0b3207ef22e155d3be750a9e41b8.zip |
m--------- | externals/sirit | 0 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 14 |
2 files changed, 11 insertions, 3 deletions
diff --git a/externals/sirit b/externals/sirit -Subproject 9f4d057aa28c4e9509bdc767afb27b4aee303b7 +Subproject a712959f1e373a33b48042b5934e288a243d595 diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 0cf97cafa..dd6d2ef03 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -1796,9 +1796,17 @@ private: return {}; } - Expression UAtomicAdd(Operation) { - UNIMPLEMENTED(); - return {}; + Expression UAtomicAdd(Operation operation) { + const auto& smem = std::get<SmemNode>(*operation[0]); + Id address = AsUint(Visit(smem.GetAddress())); + address = OpShiftRightLogical(t_uint, address, Constant(t_uint, 2U)); + const Id pointer = OpAccessChain(t_smem_uint, shared_memory, address); + + const Id scope = Constant(t_uint, static_cast<u32>(spv::Scope::Device)); + const Id semantics = Constant(t_uint, 0U); + + const Id value = AsUint(Visit(operation[1])); + return {OpAtomicIAdd(t_uint, pointer, scope, semantics, value), Type::Uint}; } Expression Branch(Operation operation) { |