diff options
-rw-r--r-- | chickadee/render/buffer.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chickadee/render/buffer.scm b/chickadee/render/buffer.scm index 7f0c168..4363d22 100644 --- a/chickadee/render/buffer.scm +++ b/chickadee/render/buffer.scm @@ -196,9 +196,10 @@ vertex buffer data back to the GPU." (length (buffer-length buffer)) (usage (buffer-usage-gl buffer))) (gpu-state-set! *buffer-state* buffer) - ;; Orphan the buffer to avoid implicit synchronization. - ;; See: https://www.opengl.org/wiki/Buffer_Object_Streaming#Buffer_re-specification - (gl-buffer-data target length %null-pointer usage) + (when (eq? usage 'stream) + ;; Orphan the buffer to avoid implicit synchronization. + ;; See: https://www.opengl.org/wiki/Buffer_Object_Streaming#Buffer_re-specification + (gl-buffer-data target length %null-pointer usage)) (let ((ptr (gl-map-buffer target (version-1-5 read-write)))) (set-buffer-data! buffer (pointer->bytevector ptr length))))) |