panfrost: Only allocate the extra attribute buffer entry on Bifrost

Bifrost needs an empty attribute buffer entry to tell the prefecter it
should stop fetching attribute buffers, but Midgard doesn't have this
constraint. It's also useless to have 2 empty entries for the instance or
image case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8808>
This commit is contained in:
Boris Brezillon
2021-01-28 10:26:29 +01:00
parent 63d9e412ec
commit 81a21ea9cd
+2 -1
View File
@@ -1359,7 +1359,8 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
* Also, we allocate more memory than what's needed here if either instancing
* is enabled or images are present, this can be improved. */
unsigned bufs_per_attrib = (ctx->instance_count > 1 || nr_images > 0) ? 2 : 1;
unsigned nr_bufs = (vs->attribute_count + 1) * bufs_per_attrib;
unsigned nr_bufs = (vs->attribute_count * bufs_per_attrib) +
(pan_is_bifrost(dev) ? 1 : 0);
struct panfrost_ptr S = panfrost_pool_alloc_aligned(&batch->pool,
MALI_ATTRIBUTE_BUFFER_LENGTH * nr_bufs,