mesa: only update _MaxElement when we actually need it
authorMarek Olšák <maraeo@gmail.com>
Mon, 16 Apr 2012 00:14:18 +0000 (02:14 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 19 Apr 2012 12:47:21 +0000 (14:47 +0200)
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
src/mesa/main/state.c

index b01926622ad2cada51b9d9a7f3322e69d6420ccc..2e9f021619f5533b695c49ff447f42bb912fe5d9 100644 (file)
@@ -561,8 +561,10 @@ _mesa_update_state_locked( struct gl_context *ctx )
       new_prog_state |= update_program( ctx );
    }
 
-   if (new_state & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT))
+   if (ctx->Const.CheckArrayBounds &&
+       (new_state & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT))) {
       _mesa_update_array_object_max_element(ctx, ctx->Array.ArrayObj);
+   }
 
  out:
    new_prog_state |= update_program_constants(ctx);