[Mesa-dev] [PATCH] gallium/u_vbuf: handle indirect multidraws correctly and efficiently (v3)

Eric Anholt eric at anholt.net
Thu Aug 2 17:54:34 UTC 2018


Marek Olšák <maraeo at gmail.com> writes:

> From: Marek Olšák <marek.olsak at amd.com>
>
> v2: need to do MAX{start+count} instead of MAX{count}
>     added piglit tests
> v3: use malloc
> ---
>  src/gallium/auxiliary/util/u_vbuf.c | 204 ++++++++++++++++++++++++----
>  1 file changed, 180 insertions(+), 24 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
> index 746ff1085ce..a7a8a3be21b 100644
> --- a/src/gallium/auxiliary/util/u_vbuf.c
> +++ b/src/gallium/auxiliary/util/u_vbuf.c

> -      new_info.count = data[0];
> -      new_info.instance_count = data[1];
> -      new_info.start = data[2];
> -      pipe_buffer_unmap(pipe, transfer);
> -      new_info.indirect = NULL;
> -
> -      if (!new_info.count)
> +      if (!draw_count)
>           return;
> +
> +      unsigned data_size = (draw_count - 1) * indirect->stride +
> +                           (new_info.index_size ? 20 : 16);
> +      unsigned *data = malloc(data_size);
> +      if (!data)
> +         return; /* report an error? */

I think you can just _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
and then return.  With that, r-b.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180802/fe7ed57c/attachment.sig>


More information about the mesa-dev mailing list