From 3913089d2d87623e4be6169cf5f0902bd1a29e3f Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Sat, 30 Jan 2021 11:36:38 +0100 Subject: [PATCH] panfrost: Set attribs and attrib_bufs to NULL when attrib_count = 0 It's just easier to read pandecode traces when those pointers are set to NULL for the attribute_count=0 case. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Reviewed-by: Italo Nicola Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 685aaf9..b264521 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1326,6 +1326,11 @@ panfrost_emit_image_attribs(struct panfrost_batch *batch, struct panfrost_context *ctx = batch->ctx; struct panfrost_shader_state *shader = panfrost_get_shader_state(ctx, type); + if (!shader->attribute_count) { + *buffers = 0; + return 0; + } + /* Images always need a MALI_ATTRIBUTE_BUFFER_CONTINUATION_3D */ unsigned attrib_buf_size = MALI_ATTRIBUTE_BUFFER_LENGTH + MALI_ATTRIBUTE_BUFFER_CONTINUATION_3D_LENGTH; @@ -1362,6 +1367,11 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch, unsigned nr_bufs = (vs->attribute_count * bufs_per_attrib) + (pan_is_bifrost(dev) ? 1 : 0); + if (!nr_bufs) { + *buffers = 0; + return 0; + } + struct panfrost_ptr S = panfrost_pool_alloc_aligned(&batch->pool, MALI_ATTRIBUTE_BUFFER_LENGTH * nr_bufs, MALI_ATTRIBUTE_BUFFER_LENGTH * 2); -- 2.7.4