panfrost: Reduce attribute buffer allocations
[mesa.git] / src / gallium / drivers / panfrost / pan_cmdstream.c
index 43c64e4a2c4d5306e1e9f125a10dc23c22eba773..0b4a9bed4f49812564f63e43a9cb06def85ed3d4 100644 (file)
@@ -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);