st/mesa: move out of memory check in st_draw_vbo()
authorBrian Paul <brianp@vmware.com>
Tue, 29 Oct 2013 00:33:32 +0000 (18:33 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 29 Oct 2013 14:09:34 +0000 (08:09 -0600)
Before we were only checking the st->vertex_array_out_of_memory flag
after updating array state.  But if there's two consecutive glDrawArrays
calls and the first one is skipped because of OOM, the second one should
be skipped too.

Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_draw.c

index c35723087f12913e6998ced61456a8f8e8a45210..51bb23807e8f64bba634e71b68fc4dd86aa47f30 100644 (file)
@@ -210,9 +210,6 @@ st_draw_vbo(struct gl_context *ctx,
    if (st->dirty.st || ctx->NewDriverState) {
       st_validate_state(st);
 
-      if (st->vertex_array_out_of_memory)
-         return;
-
 #if 0
       if (MESA_VERBOSE & VERBOSE_GLSL) {
          check_uniforms(ctx);
@@ -222,6 +219,10 @@ st_draw_vbo(struct gl_context *ctx,
 #endif
    }
 
+   if (st->vertex_array_out_of_memory) {
+      return;
+   }
+
    util_draw_init_info(&info);
 
    if (ib) {