Skip to content

Commit

Permalink
Increase GL MAX_PUSH_CONSTANTS from 16 to 64 (#3374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone authored Jan 13, 2023
1 parent f2d2a0c commit 4400ff8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,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

Expand Down
3 changes: 2 additions & 1 deletion wgpu-hal/src/gles/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/gles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion wgpu/tests/shader/struct_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4400ff8

Please sign in to comment.