st/mesa: generate GL_OUT_OF_MEMORY if we can't create the index buffer
authorBrian Paul <brianp@vmware.com>
Wed, 8 May 2013 16:18:49 +0000 (10:18 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 9 May 2013 13:43:46 +0000 (07:43 -0600)
Before, if we failed to allocate the index buffer we'd silently
return from st_draw_vbo() without drawing anything.  We should
raise GL_OUT_OF_MEMORY to give some indication that something went
wrong.

Note: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
src/mesa/state_tracker/st_draw.c

index 437d5541b80d5563c6ad2567219f186ff3d6e89c..a0cf2ca1d8fd54be6eedfd5b4608d6b71406c534 100644 (file)
@@ -230,7 +230,7 @@ st_draw_vbo(struct gl_context *ctx,
                                    nr_prims);
 
       if (!setup_index_buffer(st, ib, &ibuffer)) {
-         /* out of memory */
+         _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBegin/DrawElements/DrawArray");
          return;
       }