From b0f1964771de91281ad6775fa409b1a0a03d9338 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 3 Feb 2023 20:54:41 -0500 Subject: [PATCH] asahi: Strengthen agx_usc_uniform contract Check the size explicitly, instead of just implicitly in the GenXML pack: it is the responsibility of the caller to split up larger uploads. While this is nominally more complicated, agx_usc_uniform is called in the draw hot path whereas the actual splitting decision can usually be done at compile-time. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/agx_usc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/asahi/lib/agx_usc.h b/src/asahi/lib/agx_usc.h index 8e43f571f19..18c701d68e9 100644 --- a/src/asahi/lib/agx_usc.h +++ b/src/asahi/lib/agx_usc.h @@ -68,6 +68,7 @@ agx_usc_uniform(struct agx_usc_builder *b, unsigned start_halfs, unsigned size_halfs, uint64_t buffer) { assert((start_halfs + size_halfs) < (1 << 9) && "uniform file overflow"); + assert(size_halfs <= 64 && "caller's responsibility to split"); if (start_halfs & BITFIELD_BIT(8)) { agx_usc_pack(b, UNIFORM_HIGH, cfg) {