asahi: fix _packed USC structs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
This commit is contained in:
Alyssa Rosenzweig 2024-03-19 11:07:54 -04:00 committed by Marge Bot
parent b3fdede75b
commit 6a63fffeaa

View file

@ -702,7 +702,11 @@ class Parser(object):
print('#define {} {}'.format (name + "_LENGTH", self.group.length))
if self.group.align != None:
print('#define {} {}'.format (name + "_ALIGN", self.group.align))
print('struct {}_packed {{ uint32_t opaque[{}]; }};'.format(name.lower(), self.group.length // 4))
# round up to handle 6 half-word USC structures
words = (self.group.length + 4 - 1) // 4
print('struct {}_packed {{ uint32_t opaque[{}];}};'.format(name.lower(),
words))
def emit_unpack_function(self, name, group):
print("static inline void")