panfrost: Fix attribute buffer underallocation
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Aug 2020 18:37:44 +0000 (14:37 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 20 Aug 2020 16:15:02 +0000 (18:15 +0200)
Breaks on the pathological where everything is NPOT.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: e646c861fc6 ("panfrost: Use packs for vertex attribute buffers")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>

src/gallium/drivers/panfrost/pan_cmdstream.c

index 73c321cd8a350a8160a64ac7e1854736c08a5741..1b0c8d731736a043734c8c0dda535502979e8c32 100644 (file)
@@ -1333,8 +1333,8 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
         /* Worst case: everything is NPOT */
 
         struct panfrost_transfer S = panfrost_pool_alloc_aligned(&batch->pool,
         /* Worst case: everything is NPOT */
 
         struct panfrost_transfer S = panfrost_pool_alloc_aligned(&batch->pool,
-                        MALI_ATTRIBUTE_LENGTH * PIPE_MAX_ATTRIBS * 2,
-                        MALI_ATTRIBUTE_LENGTH);
+                        MALI_ATTRIBUTE_BUFFER_LENGTH * PIPE_MAX_ATTRIBS * 2,
+                        MALI_ATTRIBUTE_BUFFER_LENGTH);
 
         struct panfrost_transfer T = panfrost_pool_alloc_aligned(&batch->pool,
                         MALI_ATTRIBUTE_LENGTH * (PAN_INSTANCE_ID + 1),
 
         struct panfrost_transfer T = panfrost_pool_alloc_aligned(&batch->pool,
                         MALI_ATTRIBUTE_LENGTH * (PAN_INSTANCE_ID + 1),