diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-04-11 04:16:16 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-04-11 04:16:16 +0400 |
commit | 52af5fa31fbc0a1855a28d957d4387e5d6a15170 (patch) | |
tree | 38fd5f7ae4688e4762d71068fedd1b553aea9b5e /source | |
parent | 69d2af764354f515816ec0d187b824c325d4788d (diff) |
Change GPU deletion at GPU buffer update time. This should be detected
and done at PBVH update time, since it is possible to have no triangles
to display in a buffer if node is hidden.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 07d634522e2..177ffd071fd 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -2096,15 +2096,7 @@ void GPU_update_bmesh_pbvh_buffers(GPU_PBVH_Buffers *buffers, else totvert = tottri * 3; - /* some nodes may lose all their vertices/faces. Normally we should delete those but since we don't - * support dynamic nodes yet, just return immediately to avoid opengl errors */ if (!tottri) { - if (buffers->index_buf) - glDeleteBuffersARB(1, &buffers->index_buf); - if (buffers->vert_buf) - glDeleteBuffersARB(1, &buffers->vert_buf); - buffers->vert_buf = 0; - buffers->index_buf = 0; buffers->tot_tri = 0; return; } @@ -2529,7 +2521,7 @@ void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial, offset += buffers->gridkey.grid_area * sizeof(VertexBufferFormat); } } - else { + else if (buffers->tot_tri) { int totelem = buffers->tot_tri * 3; glVertexPointer(3, GL_FLOAT, sizeof(VertexBufferFormat), |