summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-01-19 20:37:39 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-01-19 20:40:31 +0100
commitb2c976ad0e5dbbcae16c419628c144a7f28e0d17 (patch)
tree3a6d9f254c6ad48a4466b99634562df1ad0c2678 /src
parentMerge pull request #3317 from ReinUsesLisp/gl-decomp-cc-decomp (diff)
downloadyuzu-b2c976ad0e5dbbcae16c419628c144a7f28e0d17.tar
yuzu-b2c976ad0e5dbbcae16c419628c144a7f28e0d17.tar.gz
yuzu-b2c976ad0e5dbbcae16c419628c144a7f28e0d17.tar.bz2
yuzu-b2c976ad0e5dbbcae16c419628c144a7f28e0d17.tar.lz
yuzu-b2c976ad0e5dbbcae16c419628c144a7f28e0d17.tar.xz
yuzu-b2c976ad0e5dbbcae16c419628c144a7f28e0d17.tar.zst
yuzu-b2c976ad0e5dbbcae16c419628c144a7f28e0d17.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp14
1 files changed, 11 insertions, 3 deletions
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) {