mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 22:10:11 +01:00
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.
This commit is contained in:
parent
9b9e056615
commit
cda3236092
1 changed files with 2 additions and 1 deletions
|
|
@ -76,7 +76,8 @@ update_array(GLcontext *ctx, struct gl_client_array *array,
|
|||
*/
|
||||
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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue