mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
gallium/u_threaded: skip draws if user index buffer size has size == 0
This happens when all draws have count == 0.
Fixes: 85b6ba136b "st/mesa: implement Driver.DrawGallium callbacks
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8345>
This commit is contained in:
parent
c69b8fd651
commit
be50c7f329
1 changed files with 6 additions and 0 deletions
|
|
@ -2401,6 +2401,9 @@ tc_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info,
|
|||
struct pipe_resource *buffer = NULL;
|
||||
unsigned offset;
|
||||
|
||||
if (!size)
|
||||
return;
|
||||
|
||||
/* This must be done before adding draw_vbo, because it could generate
|
||||
* e.g. transfer_unmap and flush partially-uninitialized draw_vbo
|
||||
* to the driver if it was done afterwards.
|
||||
|
|
@ -2445,6 +2448,9 @@ tc_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info,
|
|||
for (unsigned i = 0; i < num_draws; i++)
|
||||
total_count += draws[i].count;
|
||||
|
||||
if (!total_count)
|
||||
return;
|
||||
|
||||
/* Allocate space for all index buffers.
|
||||
*
|
||||
* This must be done before adding draw_vbo, because it could generate
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue