[Bf-blender-cvs] [52af5fa] master: 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.

Antony Riakiotakis noreply at git.blender.org
Fri Apr 11 03:10:30 CEST 2014


Commit: 52af5fa31fbc0a1855a28d957d4387e5d6a15170
Author: Antony Riakiotakis
Date:   Fri Apr 11 03:16:16 2014 +0300
https://developer.blender.org/rB52af5fa31fbc0a1855a28d957d4387e5d6a15170

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.

===================================================================

M	source/blender/gpu/intern/gpu_buffers.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 07d6345..177ffd0 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),




More information about the Bf-blender-cvs mailing list