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 <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6204>
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);