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:
authorClément Foucault <foucault.clem@gmail.com>2019-06-12 00:35:35 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-06-13 19:11:43 +0300
commitc49f91a3b604da2b26b6c8bc2d3736c84870fe1b (patch)
tree2d16ed81eb8b01753241a88fddecddbcf2453af8
parent30116a5274930ece7acaf8b4c6d5e389b32f8b69 (diff)
Fix T65669 Bones in Envelope Display break apart after selecting bone
This was because the VAOs were not updated if an instance batch was reusing a VBO containing instances attributes which was reinitialized. Now we ensure the Batch will reconfigure the VAOs if the VBO is 0.
-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);