From 39d610bb7fd573941c3dd362949a7fff02165908 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 10 May 2019 08:25:28 -0400 Subject: render: buffer: Fix buffer orphaning for streaming buffers. * chickadee/render/buffer.scm (map-buffer!): Compare symbols to symbols for checking stream usage. -__- --- chickadee/render/buffer.scm | 7 +++---- 1 file 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)))))) -- cgit v1.2.3