From 74ad525566f4e7e5384b8d562d6e0b270fb93136 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 15 Jan 2020 16:06:30 +0300 Subject: [PATCH] vk: Fixup for cs_scatter job - Access to the stencil output has to be atomic as each 'word' is shared among 4 adjacent texels - TODO: Can be optimized using mirrored buffer views --- rpcs3/Emu/RSX/VK/VKCompute.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKCompute.h b/rpcs3/Emu/RSX/VK/VKCompute.h index 8c222c71ea..36937ea999 100644 --- a/rpcs3/Emu/RSX/VK/VKCompute.h +++ b/rpcs3/Emu/RSX/VK/VKCompute.h @@ -529,7 +529,7 @@ namespace vk " stencil_offset = (index / 4);\n" " stencil_shift = (index % 4) * 8;\n" " stencil = (value & 0xFF) << stencil_shift;\n" - " data[stencil_offset + s_offset] |= stencil;\n"; + " atomicOr(data[stencil_offset + s_offset], stencil);\n"; cs_shuffle_base::build(""); } @@ -548,7 +548,7 @@ namespace vk " stencil_offset = (index / 4);\n" " stencil_shift = (index % 4) * 8;\n" " stencil = (value & 0xFF) << stencil_shift;\n" - " data[stencil_offset + s_offset] |= stencil;\n"; + " atomicOr(data[stencil_offset + s_offset], stencil);\n"; cs_shuffle_base::build(""); }