diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eba5dd776..e3ebecb65c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -133,6 +133,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non #### GLES - Browsers that support `OVR_multiview2` now report the `MULTIVIEW` feature by @expenses in [#3121](https://github.com/gfx-rs/wgpu/pull/3121). +- `Limits::max_push_constant_size` on GLES is now 256 by @Dinnerbone in [#3374](https://github.com/gfx-rs/wgpu/pull/3374). #### Vulkan diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index f0c630d59f..a4eb09a974 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -372,7 +372,8 @@ impl super::Device { } } - let mut uniforms: [super::UniformDesc; super::MAX_PUSH_CONSTANTS] = Default::default(); + let mut uniforms: [super::UniformDesc; super::MAX_PUSH_CONSTANTS] = + [None; super::MAX_PUSH_CONSTANTS].map(|_: Option<()>| Default::default()); let count = unsafe { gl.get_active_uniforms(program) }; let mut offset = 0; diff --git a/wgpu-hal/src/gles/mod.rs b/wgpu-hal/src/gles/mod.rs index e57b05a979..6ba7f89e12 100644 --- a/wgpu-hal/src/gles/mod.rs +++ b/wgpu-hal/src/gles/mod.rs @@ -95,7 +95,7 @@ const MAX_TEXTURE_SLOTS: usize = 16; const MAX_SAMPLERS: usize = 16; const MAX_VERTEX_ATTRIBUTES: usize = 16; const ZERO_BUFFER_SIZE: usize = 256 << 10; -const MAX_PUSH_CONSTANTS: usize = 16; +const MAX_PUSH_CONSTANTS: usize = 64; impl crate::Api for Api { type Instance = Instance; diff --git a/wgpu/tests/shader/struct_layout.rs b/wgpu/tests/shader/struct_layout.rs index c0bba4d1ed..a2f1f8a1ed 100644 --- a/wgpu/tests/shader/struct_layout.rs +++ b/wgpu/tests/shader/struct_layout.rs @@ -221,7 +221,8 @@ fn push_constant_input() { .limits(Limits { max_push_constant_size: MAX_BUFFER_SIZE as u32, ..Limits::downlevel_defaults() - }), + }) + .backend_failure(Backends::GL), |ctx| { shader_input_output_test( ctx,