From 94f4ecba8dd8611133b94154a28b6e85cc9903de Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 17 Aug 2020 14:49:52 -0400 Subject: [PATCH] panfrost: Reduce attribute buffer allocations With vertex ID / instance ID in use, vs->attribute_count will be expanded appropriately. Without them in use, everything is 1:1 (or 1:2 in the worst case of NPOT everything). Down to 3 slabs + 64184 bytes. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 43c64e4a2c4..0b4a9bed4f4 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1336,7 +1336,7 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch, bool could_npot = instance_shift || instance_odd; struct panfrost_transfer S = panfrost_pool_alloc_aligned(&batch->pool, - MALI_ATTRIBUTE_BUFFER_LENGTH * PIPE_MAX_ATTRIBS * + MALI_ATTRIBUTE_BUFFER_LENGTH * vs->attribute_count * (could_npot ? 2 : 1), MALI_ATTRIBUTE_BUFFER_LENGTH); -- 2.30.2