From ee79b717530d424d0689abcc2bb3760dd9f8a254 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 7 Apr 2024 16:53:21 -0400 Subject: [PATCH] asahi: pack UVS key properly Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/agx_uvs.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/asahi/lib/agx_uvs.h b/src/asahi/lib/agx_uvs.h index d7be280ff4d..a486c3dfe52 100644 --- a/src/asahi/lib/agx_uvs.h +++ b/src/asahi/lib/agx_uvs.h @@ -29,22 +29,6 @@ enum uvs_group { * qualifiers. */ struct agx_unlinked_uvs_layout { - /* Offset of each group in the UVS in words. */ - uint8_t group_offs[UVS_NUM_GROUP]; - - /* Size of the UVS allocation in words. >= last group_offs element */ - uint8_t size; - - /* Size of the UVS_VARYINGS */ - uint8_t user_size; - - /* Number of 32-bit components written for each slot. TODO: Model 16-bit. - * - * Invariant: sum_{slot} (components[slot]) = - * group_offs[PSIZ] - group_offs[VARYINGS] - */ - uint8_t components[VARYING_SLOT_MAX]; - /* Bit i set <===> components[i] != 0 && i != POS && i != PSIZ. For fast * iteration of user varyings. */ @@ -55,7 +39,26 @@ struct agx_unlinked_uvs_layout { /* Partial data structure, must be merged with FS selects */ struct agx_output_select_packed osel; + + /* Offset of each group in the UVS in words. */ + uint8_t group_offs[UVS_NUM_GROUP]; + + /* Size of the UVS allocation in words. >= last group_offs element */ + uint8_t size; + + /* Size of the UVS_VARYINGS */ + uint8_t user_size; + + uint8_t pad; + + /* Number of 32-bit components written for each slot. TODO: Model 16-bit. + * + * Invariant: sum_{slot} (components[slot]) = + * group_offs[PSIZ] - group_offs[VARYINGS] + */ + uint8_t components[VARYING_SLOT_MAX]; }; +static_assert(sizeof(struct agx_unlinked_uvs_layout) == 88, "packed"); bool agx_nir_lower_uvs(struct nir_shader *s, struct agx_unlinked_uvs_layout *layout);