Marek Olšák <mar...@gmail.com> writes: > From: Marek Olšák <marek.ol...@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.
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev