Mesa (master): mesa: only update array _MaxElement if array is enabled

Brian Paul brianp at kemper.freedesktop.org
Wed May 18 14:15:10 UTC 2011


Module: Mesa
Branch: master
Commit: 496bf04905197dc46c2dffe281008bd7f5edf8a8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=496bf04905197dc46c2dffe281008bd7f5edf8a8

Author: Brian Paul <brianp at vmware.com>
Date:   Wed May 18 08:14:32 2011 -0600

mesa: only update array _MaxElement if array is enabled

Fixes failed assertion when calling _mesa_print_arrays() debug function.

---

 src/mesa/main/arrayobj.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 4bfb242..83a82e8 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -289,9 +289,10 @@ remove_array_object( struct gl_context *ctx, struct gl_array_object *obj )
 static GLuint
 update_min(GLuint min, struct gl_client_array *array)
 {
-   _mesa_update_array_max_element(array);
-   if (array->Enabled)
+   if (array->Enabled) {
+      _mesa_update_array_max_element(array);
       return MIN2(min, array->_MaxElement);
+   }
    else
       return min;
 }




More information about the mesa-commit mailing list