asahi: add agx_usc_push_packed helper

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-18 14:57:09 -04:00 committed by Marge Bot
parent 9974f68bb9
commit 5d375e6143

View file

@ -62,6 +62,14 @@ agx_usc_builder_validate(struct agx_usc_builder *b, size_t size)
it; it = false, (b)->head += AGX_USC_##struct_name##_LENGTH) \
agx_pack((b)->head, USC_##struct_name, template)
#define agx_usc_push_blob(b, blob, length) \
for (bool it = agx_usc_builder_validate((b), length); it; \
it = false, (b)->head += length) \
memcpy((b)->head, blob, length);
#define agx_usc_push_packed(b, struct_name, packed) \
agx_usc_push_blob(b, packed.opaque, AGX_USC_##struct_name##_LENGTH);
static void
agx_usc_uniform(struct agx_usc_builder *b, unsigned start_halfs,
unsigned size_halfs, uint64_t buffer)