aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-04-26 01:17:47 +0200
committerMarek Olšák <[email protected]>2013-05-11 23:45:01 +0200
commit081c789c3e1c6896bd8446d67db4a6740efdf92d (patch)
tree6682b591c3918757a8f0815a003e65db6aeb23db /src/mesa/main
parentdb38e9a0e179441f59274f6f2a751912c29872e2 (diff)
mesa: skip _MaxElement computation unless driver needs strict bounds checking
If Const.CheckArrayBounds is false, the only code using _MaxElement is glDrawRangeElements, so I changed it and explained in the code why _MaxElement is not very useful there. BTW, the big magic number was copied to the letter from _mesa_update_array_max_element. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/state.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index e7e23caeb79..1b927ca65db 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -411,8 +411,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);