summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/render/buffer.scm7
1 files changed, 3 insertions, 4 deletions
diff --git a/chickadee/render/buffer.scm b/chickadee/render/buffer.scm
index 04598df..4d196d9 100644
--- a/chickadee/render/buffer.scm
+++ b/chickadee/render/buffer.scm
@@ -209,13 +209,12 @@ the vertex buffer to be updated with new vertex data. The
vertex buffer data back to the GPU."
(unless (buffer-mapped? buffer) ;; Don't map a buffer that is already mapped!
(let ((target (buffer-target-gl buffer))
- (length (buffer-length buffer))
- (usage (buffer-usage-gl buffer)))
+ (length (buffer-length buffer)))
(gpu-state-set! *buffer-state* buffer)
- (when (eq? usage 'stream)
+ (when (eq? (buffer-usage buffer) '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))
+ (gl-buffer-data target length %null-pointer (buffer-usage-gl buffer)))
(let ((ptr (gl-map-buffer target (version-1-5 read-write))))
(set-buffer-data! buffer (pointer->bytevector ptr length))))))