pan/genxml: Generate MALI_XXX_PACKED_T macros

Will be useful to easily define packed type variables from the
pan_[un]pack() functions, which we'll need during the pan_pack
revamp.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32962>
This commit is contained in:
Boris Brezillon
2025-01-09 09:54:48 +01:00
committed by Marge Bot
parent 39d8b56c4a
commit b9caca64f2

View File

@@ -624,6 +624,7 @@ class Parser(object):
print("struct %s_packed {" % aggregate.name.lower())
print(" uint32_t opaque[{}];".format(aggregate.get_size() // 4))
print("};\n")
print('#define {}_PACKED_T struct {}_packed'.format(aggregate.name.upper(), aggregate.name.lower()))
print('#define {}_LENGTH {}'.format(aggregate.name.upper(), aggregate.size))
if aggregate.align != None:
print('#define {}_ALIGN {}'.format(aggregate.name.upper(), aggregate.align))