GPU: prevent assert for zero length arrays

This could happen with the build modifier.
This commit is contained in:
Campbell Barton 2019-10-14 18:37:31 +11:00
parent 95f020c853
commit e8220dea60
1 changed files with 1 additions and 1 deletions

View File

@ -243,7 +243,7 @@ GPUIndexBuf *GPU_indexbuf_create_subrange(GPUIndexBuf *elem_src, uint start, uin
{
GPUIndexBuf *elem = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf");
BLI_assert(elem_src && !elem_src->is_subrange);
BLI_assert(start + length <= elem_src->index_len);
BLI_assert((length == 0) || (start + length <= elem_src->index_len));
#if GPU_TRACK_INDEX_RANGE
elem->index_type = elem_src->index_type;
elem->gl_index_type = elem_src->gl_index_type;