Otherwise if would try to set zero-sized storage for the buffers, which
is not allowed.
Also guard against empty batches in resize_buffers just in case.
return;
}
+ if(batches.empty())
+ return;
+
if(dirty)
resize_buffers();
{
if(dirty&VERTEX_BUFFER)
vbuf->storage(vertices.get_required_buffer_size());
- if(dirty&INDEX_BUFFER)
+ if((dirty&INDEX_BUFFER) && !batches.empty())
ibuf->storage(batches.front().get_required_buffer_size());
dirty = 0;
}