Mesa (7.11): vbo: do not call _mesa_max_buffer_index in debug builds

Marek Olšák mareko at kemper.freedesktop.org
Sun Aug 7 16:37:07 UTC 2011


Module: Mesa
Branch: 7.11
Commit: f396e43b7d609d93e5ba0b9053c16cec96f8e402
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f396e43b7d609d93e5ba0b9053c16cec96f8e402

Author: Marek Olšák <maraeo at gmail.com>
Date:   Thu Aug  4 07:38:13 2011 +0200

vbo: do not call _mesa_max_buffer_index in debug builds

That code drops performance in Unigine Heaven and Tropics
by a factor of 10. That's too crazy even for a debug build.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit c251d83d916336f95109363e919920a024947230)

---

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

diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 7959337..5903ae2 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -909,11 +909,10 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
       if (0)
          _mesa_print_arrays(ctx);
 
-#ifdef DEBUG
       /* 'end' was out of bounds, but now let's check the actual array
        * indexes to see if any of them are out of bounds.
        */
-      {
+      if (0) {
          GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
                                              ctx->Array.ElementArrayBufferObj);
          if (max >= ctx->Array.ArrayObj->_MaxElement) {
@@ -934,7 +933,6 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
           * upper bound wrong.
           */
       }
-#endif
 
       /* Set 'end' to the max possible legal value */
       assert(ctx->Array.ArrayObj->_MaxElement >= 1);




More information about the mesa-commit mailing list