From 6797b6ba45c811ea2c531beb866a98356c4d42e0 Mon Sep 17 00:00:00 2001 From: M Henning Date: Thu, 23 Nov 2023 14:18:20 -0500 Subject: [PATCH] nak: Request alignment that matches the load width Previously, this callback could try to set the requested alignment to NIR_ALIGN_MUL_MAX, which would then overflow the u16 value in the struct. We don't actually need that much alignment though, and this value only really matters if we needed to increase alignment anyway. Part-of: --- src/nouveau/compiler/nak_nir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index d3551571e84..0f60ff92382 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -1014,13 +1014,13 @@ nak_mem_access_size_align(nir_intrinsic_op intrin, return (nir_mem_access_size_align) { .bit_size = chunk_bytes * 8, .num_components = 1, - .align = align, + .align = chunk_bytes, }; } else { return (nir_mem_access_size_align) { .bit_size = 32, .num_components = chunk_bytes / 4, - .align = align, + .align = chunk_bytes, }; } }