diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index b43a87c909..23689ea505 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -410,6 +410,10 @@ impl crate::Device for super::Device { .shared .workarounds .contains(super::Workarounds::EMULATE_BUFFER_MAP) + || !self + .shared + .private_caps + .contains(super::PrivateCapabilities::BUFFER_ALLOCATION) { let mut buf = vec![0; buffer.size as usize]; let ptr = buf.as_mut_ptr(); diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 8ea9e161db..1f0de90577 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -699,8 +699,7 @@ impl Limits { /// These default limits are guarenteed to be compatible with GLES3, and D3D11, and WebGL2 pub fn downlevel_webgl2_defaults() -> Self { - #[cfg(target_arch = "wasm32")] - let defaults = Self { + Self { max_storage_buffers_per_shader_stage: 0, max_storage_textures_per_shader_stage: 0, max_dynamic_storage_buffers_per_pipeline_layout: 0, @@ -709,12 +708,7 @@ impl Limits { // Most of the values should be the same as the downlevel defaults ..Self::downlevel_defaults() - }; - - #[cfg(not(target_arch = "wasm32"))] - let defaults = Self::downlevel_defaults(); - - defaults + } } /// Modify the current limits to use the resolution limits of the other.