Fix for drawing meshes with VBOs disabled in sculpt mode
authorNicholas Bishop <nicholasbishop@gmail.com>
Sat, 20 Oct 2012 00:45:44 +0000 (00:45 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sat, 20 Oct 2012 00:45:44 +0000 (00:45 +0000)
* This is another fix for r51118. Was drawing flat-shaded GPU buffers
  with VBOs even when VBOs were disabled in the preferences.

source/blender/gpu/intern/gpu_buffers.c

index c0b4987c3fc51bde198c05683d1488383bdd1bab..2986ce85c880674a656662bb47d2e3e9bbb80188 100644 (file)
@@ -1562,7 +1562,7 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
                glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
        }
 
-       if (buffers->index_buf || !buffers->smooth)
+       if (gpu_vbo_enabled() && (buffers->index_buf || !buffers->smooth))
                glGenBuffersARB(1, &buffers->vert_buf);
 
        buffers->tot_tri = tottri;