summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-01-20 06:01:52 +0100
committerGitHub <noreply@github.com>2020-01-20 06:01:52 +0100
commit69b44392a71e0b3207ef22e155d3be750a9e41b8 (patch)
treea74021333cf87e7216204db09d2c9dd01e2bfe5f
parentMerge pull request #3322 from ReinUsesLisp/vk-front-face (diff)
parentvk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-V (diff)
downloadyuzu-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/sirit0
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp14
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) {