diff --git a/source/blender/draw/intern/draw_instance_data.cc b/source/blender/draw/intern/draw_instance_data.cc index 9cb541193b2..215c39c3e9b 100644 --- a/source/blender/draw/intern/draw_instance_data.cc +++ b/source/blender/draw/intern/draw_instance_data.cc @@ -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. */ diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.cc b/source/blender/gpu/opengl/gl_vertex_buffer.cc index 0e831003f41..889de8ea5cc 100644 --- a/source/blender/gpu/opengl/gl_vertex_buffer.cc +++ b/source/blender/gpu/opengl/gl_vertex_buffer.cc @@ -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. */