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:
-rw-r--r--source/blender/draw/intern/draw_instance_data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c
index e7a41ee3e43..3e5dfb53fc7 100644
--- a/source/blender/draw/intern/draw_instance_data.c
+++ b/source/blender/draw/intern/draw_instance_data.c
@@ -141,7 +141,7 @@ GPUBatch *DRW_temp_batch_instance_request(DRWInstanceDataList *idatalist,
GPUBatch *batch = BLI_memblock_alloc(idatalist->pool_instancing);
bool is_compatible = (batch->gl_prim_type == geom->gl_prim_type) && (batch->inst == buf) &&
- (batch->phase == GPU_BATCH_READY_TO_DRAW);
+ (buf->vbo_id != 0) && (batch->phase == GPU_BATCH_READY_TO_DRAW);
for (int i = 0; i < GPU_BATCH_VBO_MAX_LEN && is_compatible; i++) {
if (batch->verts[i] != geom->verts[i]) {
is_compatible = false;
@@ -167,7 +167,7 @@ GPUBatch *DRW_temp_batch_request(DRWInstanceDataList *idatalist,
GPUPrimType prim_type)
{
GPUBatch *batch = BLI_memblock_alloc(idatalist->pool_batching);
- bool is_compatible = (batch->verts[0] == buf) &&
+ bool is_compatible = (batch->verts[0] == buf) && (buf->vbo_id != 0) &&
(batch->gl_prim_type == convert_prim_type_to_gl(prim_type));
if (!is_compatible) {
GPU_batch_clear(batch);