On Thu, Aug 2, 2018 at 1:54 PM, Eric Anholt <[email protected]> wrote: > Marek Olšák <[email protected]> writes: > >> From: Marek Olšák <[email protected]> >> >> 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.
Sadly, _mesa_error is not available in Gallium. Marek _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
