From 231561d53a1e26f71ce58d032f7d26fa60044f52 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 3 Feb 2023 22:02:34 -0500 Subject: [PATCH] asahi: Correct alignment for USC Uniform packets We only need 4 byte alignment, not 8 bytes. This isn't a big difference in practice, but it probably reduces padding in some cases. More importantly, it corrects our XML to match what the hardware actually does, which is great. (There is exactly enough room for a 40-bit address with 4 byte alignment.) Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/cmdbuf.xml | 6 ++---- src/gallium/drivers/asahi/agx_nir_lower_sysvals.c | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml index 606722f8f7e..0970eb74ba9 100644 --- a/src/asahi/lib/cmdbuf.xml +++ b/src/asahi/lib/cmdbuf.xml @@ -560,17 +560,15 @@ - - + - - + diff --git a/src/gallium/drivers/asahi/agx_nir_lower_sysvals.c b/src/gallium/drivers/asahi/agx_nir_lower_sysvals.c index b76a5cd83d7..77568aca2a5 100644 --- a/src/gallium/drivers/asahi/agx_nir_lower_sysvals.c +++ b/src/gallium/drivers/asahi/agx_nir_lower_sysvals.c @@ -141,10 +141,10 @@ lay_out_uniforms(struct agx_compiled_shader *shader, struct state *state) assert((shader->push_range_count < ARRAY_SIZE(shader->push)) && "AGX_MAX_PUSH_RANGES must be an upper bound"); - /* Offsets must be aligned to 8 bytes, this may require pushing a + /* Offsets must be aligned to 4 bytes, this may require pushing a * little more than intended (otherwise we would need extra copies) */ - range_start = ROUND_DOWN_TO(range_start, 8 / 2); + range_start = ROUND_DOWN_TO(range_start, 4 / 2); shader->push[shader->push_range_count++] = (struct agx_push_range){ .uniform = uniform,