From 9a6934d67f413e719f07c82e36221287ca8b1538 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 17 Aug 2020 14:46:56 -0400 Subject: [PATCH] panfrost: Don't reserve for NPOT w/o instancing It's impossible. Down to 5 slabs + 45368. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 79a05341b8b..43c64e4a2c4 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1331,10 +1331,13 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch, unsigned instance_shift = vertex_postfix->instance_shift; unsigned instance_odd = vertex_postfix->instance_odd; - /* Worst case: everything is NPOT */ + /* Worst case: everything is NPOT, which is only possible if instancing + * is enabled. Otherwise single record is gauranteed */ + bool could_npot = instance_shift || instance_odd; struct panfrost_transfer S = panfrost_pool_alloc_aligned(&batch->pool, - MALI_ATTRIBUTE_BUFFER_LENGTH * PIPE_MAX_ATTRIBS * 2, + MALI_ATTRIBUTE_BUFFER_LENGTH * PIPE_MAX_ATTRIBS * + (could_npot ? 2 : 1), MALI_ATTRIBUTE_BUFFER_LENGTH); struct panfrost_transfer T = panfrost_pool_alloc_aligned(&batch->pool, -- 2.30.2