Browse Source
Merge pull request #3328 from ReinUsesLisp/vulkan-atoms
vk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-V
pull/15/merge
bunnei
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
4 deletions
-
externals/sirit
-
src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
|
|
|
@ -1 +1 @@ |
|
|
|
Subproject commit 9f4d057aa28c4e9509bdc767afb27b4aee303b7e |
|
|
|
Subproject commit a712959f1e373a33b48042b5934e288a243d5954 |
|
|
|
@ -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) { |
|
|
|
|