From 0705c7ad6b6e99000b1811fd2af27e83b6883286 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Tue, 17 Jan 2023 10:56:27 +0100 Subject: [PATCH] Create gles buffers with DYNAMIC_DRAW instead of STATIC_DRAW (#3391) --- CHANGELOG.md | 1 + wgpu-hal/src/gles/device.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cde0f075e..d99adc2df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -196,6 +196,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non - Fixed WebGL not displaying srgb targets correctly if a non-screen filling viewport was previously set. By @Wumpf in [#3093](https://github.com/gfx-rs/wgpu/pull/3093) - Fix disallowing multisampling for float textures if otherwise supported. By @Wumpf in [#3183](https://github.com/gfx-rs/wgpu/pull/3183) - Fix a panic when creating a pipeline with opaque types other than samplers (images and atomic counters). By @James2022-rgb in [#3361](https://github.com/gfx-rs/wgpu/pull/3361) +- Fix uniform buffers being empty on some vendors. By @Dinnerbone in [#3391](https://github.com/gfx-rs/wgpu/pull/3391) #### Vulkan diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index a4eb09a974..9dae237704 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -500,7 +500,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) }; }