mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 03:50:13 +01:00
pan/genxml: Add pan_pack_nodefaults()
The new packing macro will not default initialize fields, which is useful for structures used as override flags or in pan_merge(). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11506 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31041>
This commit is contained in:
parent
03c470d2ab
commit
5fd523fafb
2 changed files with 8 additions and 0 deletions
|
|
@ -68,6 +68,7 @@ ForEachMacros: [
|
|||
'pan_foreach_predecessor',
|
||||
'pan_foreach_successor',
|
||||
'pan_pack',
|
||||
'pan_pack_nodefaults',
|
||||
'pan_section_pack',
|
||||
'panvk_cs_reg_upd_ctx',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -125,6 +125,13 @@ __gen_unpack_padded(const uint8_t *restrict cl, uint32_t start, uint32_t end)
|
|||
({ PREFIX2(T, pack)((uint32_t *) (dst), &name); \\
|
||||
_loop_terminate = NULL; }))
|
||||
|
||||
#define pan_pack_nodefaults(dst, T, name) \\
|
||||
for (struct PREFIX1(T) name = { 0 }, \\
|
||||
*_loop_terminate = &name; \\
|
||||
__builtin_expect(_loop_terminate != NULL, 1); \\
|
||||
({ PREFIX2(T, pack)((uint32_t *) (dst), &name); \\
|
||||
_loop_terminate = NULL; }))
|
||||
|
||||
#define pan_unpack(src, T, name) \\
|
||||
struct PREFIX1(T) name; \\
|
||||
PREFIX2(T, unpack)((uint8_t *)(src), &name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue