mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
mesa: Handle zero-stride arrays in _mesa_update_array_max_element()
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
fb370f89db
commit
965900e830
1 changed files with 4 additions and 2 deletions
|
|
@ -51,8 +51,10 @@ _mesa_update_array_max_element(struct gl_client_array *array)
|
|||
GLsizeiptrARB bufSize = (GLsizeiptrARB) array->BufferObj->Size;
|
||||
|
||||
if (offset < bufSize) {
|
||||
array->_MaxElement = (bufSize - offset + array->StrideB
|
||||
- array->_ElementSize) / array->StrideB;
|
||||
const GLuint stride = array->StrideB ?
|
||||
array->StrideB : array->_ElementSize;
|
||||
array->_MaxElement = (bufSize - offset + stride
|
||||
- array->_ElementSize) / stride;
|
||||
}
|
||||
else {
|
||||
array->_MaxElement = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue