render: buffer: Stop using glBufferSubData when creating VBOs.
authorDavid Thompson <dthompson2@worcester.edu>
Thu, 6 Sep 2018 13:28:59 +0000 (09:28 -0400)
committerDavid Thompson <dthompson2@worcester.edu>
Thu, 6 Sep 2018 13:28:59 +0000 (09:28 -0400)
* chickadee/render/buffer.scm (make-buffer): Remove unnecessary call
  to glBufferSubData and just use glBufferData to do it all.

chickadee/render/buffer.scm

index 9726698..9635db6 100644 (file)
@@ -170,13 +170,10 @@ used:
     (gpu-state-set! *buffer-state* buffer)
     (gl-buffer-data (buffer-target-gl buffer)
                     length
-                    %null-pointer
+                    (if data
+                        (bytevector->pointer data offset)
+                        %null-pointer)
                     (buffer-usage-gl buffer))
-    (when data
-      (gl-buffer-sub-data (buffer-target-gl buffer)
-                          0
-                          length
-                          (bytevector->pointer data offset)))
     (gpu-state-set! *buffer-state* null-buffer)
     buffer))