From 25646c7772c0bdda9ddf29490130e3a653d4c6aa Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 27 Apr 2023 14:41:17 -0400 Subject: [PATCH] asahi: Bump MAX_PUSH_RANGES to the worst-case This shortcuts all headaches about how big this should be. It does increase memory usage a bit if there are lots of shader variants compiled, but this should be tolerable, and can be optimized later if so required. Thanks to the previous commit, the disk cache size should be unaffected. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_state.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index ac1cc7ee850..e44d3010946 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -96,8 +96,12 @@ struct PACKED agx_draw_uniforms { }; }; -/* We only push whole elements at a time so we can calculate an upper bound */ -#define AGX_MAX_PUSH_RANGES (1 + PIPE_MAX_CONSTANT_BUFFERS + PIPE_MAX_ATTRIBS) +/* In the architecture, there are 512 uniform registers, each 16-bits. In a + * theoretical worst case, we could push to all of them. We use a worst-case + * maximum because the expression for a tight upper bound is too messy and easy + * to go out of sync with the code. + */ +#define AGX_MAX_PUSH_RANGES (512) struct agx_push_range { /* Base 16-bit uniform to push to */