r600/sfn: Fix used of local shared write mask

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
This commit is contained in:
Gert Wollny
2022-07-22 15:51:50 +02:00
committed by Marge Bot
parent ca1c78e885
commit d92ce8566b
+7 -4
View File
@@ -982,12 +982,15 @@ bool Shader::emit_local_store(nir_intrinsic_instr *instr)
unsigned write_mask = nir_intrinsic_write_mask(instr);
auto address = value_factory().src(instr->src[1], 0);
int swizzle_base = (write_mask & 0x3) ? 0 : 2;
write_mask |= write_mask >> 2;
int swizzle_base = 0;
unsigned w = write_mask;
while (!(w & 1)) {
++swizzle_base;
w >>= 1;
}
write_mask = write_mask >> swizzle_base;
if ((write_mask & 3) != 3) {
if (write_mask == 2)
swizzle_base += 1;
auto value = value_factory().src(instr->src[0], swizzle_base);
emit_instruction(new LDSAtomicInstr(LDS_WRITE, nullptr, address, {value}));
} else {