mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
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 <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:
parent
81a21ea9cd
commit
3913089d2d
1 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue