From 676db0a5f255197b17b1a8c5be2663a146d847f2 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Tue, 17 Jan 2023 04:55:26 +0100 Subject: [PATCH] Create gles buffers with DYNAMIC_DRAW instead of STATIC_DRAW --- wgpu-hal/src/gles/device.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index f0c630d59f2..1ac34237afb 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -499,7 +499,10 @@ impl crate::Device for super::Device { glow::DYNAMIC_DRAW } } else { - glow::STATIC_DRAW + // Even if the usage doesn't contain SRC_READ, we update it internally at least once + // Some vendors take usage very literally and STATIC_DRAW will freeze us with an empty buffer + // https://github.com/gfx-rs/wgpu/issues/3371 + glow::DYNAMIC_DRAW }; unsafe { gl.buffer_data_size(target, raw_size, usage) }; }