Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw/intern/draw_cache_inline.h')
-rw-r--r--source/blender/draw/intern/draw_cache_inline.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/draw/intern/draw_cache_inline.h b/source/blender/draw/intern/draw_cache_inline.h
index 720cc31b0be..120e547bbe2 100644
--- a/source/blender/draw/intern/draw_cache_inline.h
+++ b/source/blender/draw/intern/draw_cache_inline.h
@@ -89,21 +89,12 @@ BLI_INLINE void DRW_vbo_request(GPUBatch *batch, GPUVertBuf **vbo)
*vbo = GPU_vertbuf_create(GPU_USAGE_STATIC);
}
if (batch != NULL) {
- /* HACK set first vbo if not init. */
- if (batch->verts[0] == NULL) {
- GPU_batch_vertbuf_add(batch, *vbo);
- }
- else {
- /* HACK: bypass assert */
- int vbo_vert_len = (*vbo)->vertex_len;
- (*vbo)->vertex_len = batch->verts[0]->vertex_len;
- GPU_batch_vertbuf_add(batch, *vbo);
- (*vbo)->vertex_len = vbo_vert_len;
- }
+ /* HACK we set vbos that may not yet be valid. */
+ GPU_batch_vertbuf_add(batch, *vbo);
}
}
BLI_INLINE bool DRW_vbo_requested(GPUVertBuf *vbo)
{
- return (vbo != NULL && vbo->format.attr_len == 0);
+ return (vbo != NULL && (GPU_vertbuf_get_status(vbo) & GPU_VERTBUF_INIT) == 0);
}