diff --git a/src/asahi/lib/agx_usc.h b/src/asahi/lib/agx_usc.h index f5fc9103eb0..163c8d1ac4b 100644 --- a/src/asahi/lib/agx_usc.h +++ b/src/asahi/lib/agx_usc.h @@ -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)