From 47ef07cf1559b338b3ce0b530f5c383c86c15350 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 12 Jan 2023 21:54:46 +0100 Subject: [PATCH] Increase GL MAX_PUSH_CONSTANTS from 16 to 64 --- CHANGELOG.md | 1 + wgpu-hal/src/gles/device.rs | 3 ++- wgpu-hal/src/gles/mod.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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;