[Mesa-dev] [PATCH 02/10] mesa: only update _MaxElement when we actually need it

Marek Olšák maraeo at gmail.com
Wed Apr 18 07:16:36 PDT 2012


---
 src/mesa/main/state.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index b019266..2e9f021 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -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);
-- 
1.7.5.4



More information about the mesa-dev mailing list