mesa: Branch 'master'
Roland Scheidegger
sroland at kemper.freedesktop.org
Tue Mar 27 19:04:42 UTC 2007
src/mesa/main/varray.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
New commits:
diff-tree cda32360925d84072a69c6fc0bfebbfe07d90ebc (from 9b9e056615bc63d5498feb6999bd4df431170022)
Author: Roland Scheidegger <sroland at tungstengraphics.com>
Date: Tue Mar 27 21:03:32 2007 +0200
fix incorrect _MaxElement calculation
The calculation of _MaxElement was wrong if the stride was larger than
elementSize, which lead to rejection of every DrawElements call which accessed
the maximum element if CheckArrayBounds was enabled.
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index a048509..bf1ad01 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -76,7 +76,8 @@ update_array(GLcontext *ctx, struct gl_c
*/
if (ctx->Array.ArrayBufferObj->Name)
array->_MaxElement = ((GLsizeiptrARB) ctx->Array.ArrayBufferObj->Size
- - (GLsizeiptrARB) array->Ptr) / array->StrideB;
+ - (GLsizeiptrARB) array->Ptr + array->StrideB
+ - elementSize) / array->StrideB;
else
#endif
array->_MaxElement = 2 * 1000 * 1000 * 1000; /* just a big number */
More information about the mesa-commit
mailing list