GPU: Add assert on zero sized VBOs
These can create GL errors that are not reported appropriately.
This commit is contained in:
@@ -215,7 +215,6 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
|
||||
GPU_vertbuf_data_resize(*handle->buf, target_buf_size);
|
||||
}
|
||||
GPU_vertbuf_data_len_set(*handle->buf, vert_len);
|
||||
GPU_vertbuf_use(handle->buf); /* Send data. */
|
||||
}
|
||||
}
|
||||
/* Finish pending instancing batches. */
|
||||
|
||||
@@ -93,6 +93,8 @@ void GLVertBuf::bind()
|
||||
|
||||
if (flag & GPU_VERTBUF_DATA_DIRTY) {
|
||||
vbo_size_ = this->size_used_get();
|
||||
|
||||
BLI_assert(vbo_size_ != 0);
|
||||
/* Orphan the vbo to avoid sync then upload data. */
|
||||
glBufferData(GL_ARRAY_BUFFER, ceil_to_multiple_ul(vbo_size_, 16), nullptr, to_gl(usage_));
|
||||
/* Do not transfer data from host to device when buffer is device only. */
|
||||
|
||||
Reference in New Issue
Block a user