From 5cf7eec6b153baa69788938cac902e59da965d62 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 6 Aug 2020 09:13:32 -0400 Subject: [PATCH] nir/lower_ssbo: Don't set align_* for atomics Fixes crashes when lowering atomic SSBOs: run: ../src/compiler/nir/nir.h:1875: nir_intrinsic_align_mul: Assertion `info->index_map[NIR_INTRINSIC_ALIGN_MUL] > 0' failed. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Jason Ekstrand Reviewed-by: Eric Anholt Part-of: --- src/compiler/nir/nir_lower_ssbo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_lower_ssbo.c b/src/compiler/nir/nir_lower_ssbo.c index 904d92fa7e8..1c861755619 100644 --- a/src/compiler/nir/nir_lower_ssbo.c +++ b/src/compiler/nir/nir_lower_ssbo.c @@ -128,8 +128,10 @@ lower_ssbo_instr(nir_builder *b, nir_intrinsic_instr *intr) global->num_components = intr->num_components; global->src[is_store ? 1 : 0] = nir_src_for_ssa(address); - nir_intrinsic_set_align_mul(global, nir_intrinsic_align_mul(intr)); - nir_intrinsic_set_align_offset(global, nir_intrinsic_align_offset(intr)); + if (!is_atomic) { + nir_intrinsic_set_align_mul(global, nir_intrinsic_align_mul(intr)); + nir_intrinsic_set_align_offset(global, nir_intrinsic_align_offset(intr)); + } if (is_store) { nir_src_copy(&global->src[0], &intr->src[0], global); -- 2.30.2