Skip to content

Commit 4400ff8

Browse files
authored
Increase GL MAX_PUSH_CONSTANTS from 16 to 64 (#3374)
1 parent f2d2a0c commit 4400ff8

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non
134134
#### GLES
135135

136136
- Browsers that support `OVR_multiview2` now report the `MULTIVIEW` feature by @expenses in [#3121](https://github.com/gfx-rs/wgpu/pull/3121).
137+
- `Limits::max_push_constant_size` on GLES is now 256 by @Dinnerbone in [#3374](https://github.com/gfx-rs/wgpu/pull/3374).
137138

138139
#### Vulkan
139140

wgpu-hal/src/gles/device.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ impl super::Device {
372372
}
373373
}
374374

375-
let mut uniforms: [super::UniformDesc; super::MAX_PUSH_CONSTANTS] = Default::default();
375+
let mut uniforms: [super::UniformDesc; super::MAX_PUSH_CONSTANTS] =
376+
[None; super::MAX_PUSH_CONSTANTS].map(|_: Option<()>| Default::default());
376377
let count = unsafe { gl.get_active_uniforms(program) };
377378
let mut offset = 0;
378379

wgpu-hal/src/gles/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const MAX_TEXTURE_SLOTS: usize = 16;
9595
const MAX_SAMPLERS: usize = 16;
9696
const MAX_VERTEX_ATTRIBUTES: usize = 16;
9797
const ZERO_BUFFER_SIZE: usize = 256 << 10;
98-
const MAX_PUSH_CONSTANTS: usize = 16;
98+
const MAX_PUSH_CONSTANTS: usize = 64;
9999

100100
impl crate::Api for Api {
101101
type Instance = Instance;

wgpu/tests/shader/struct_layout.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ fn push_constant_input() {
221221
.limits(Limits {
222222
max_push_constant_size: MAX_BUFFER_SIZE as u32,
223223
..Limits::downlevel_defaults()
224-
}),
224+
})
225+
.backend_failure(Backends::GL),
225226
|ctx| {
226227
shader_input_output_test(
227228
ctx,

0 commit comments

Comments
 (0)