Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #6994 to the 24.x branch #7169

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Bottom level categories:
* Fix `wgpu` not building with `--no-default-features` on when targeting `wasm32-unknown-unknown`. By @wumpf in [#6946](https://github.com/gfx-rs/wgpu/pull/6946).
* Implement `Clone` on `ShaderModule`. By @a1phyr in [#6937](https://github.com/gfx-rs/wgpu/pull/6937).
- Fix `CopyExternalImageDestInfo` not exported on `wgpu`. By @wumpf in [#6962](https://github.com/gfx-rs/wgpu/pull/6962).
- Reduce downlevel `max_color_attachments` limit from 8 to 4 for better GLES compatibility. By @adrian17 in [#6994](https://github.com/gfx-rs/wgpu/pull/6994).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the wrong section. I will fix this.


## v24.0.0 (2025-01-15)

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ wgpu = { version = "24.0.1", path = "./wgpu", default-features = false, features
"dx12",
"metal",
"static-dxc",
"webgl",
] }
wgpu-core = { version = "24.0.0", path = "./wgpu-core" }
wgpu-macros = { version = "24.0.1", path = "./wgpu-macros" }
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ impl super::Adapter {
private_caps,
workarounds,
features,
limits: limits.clone(),
shading_language_version,
next_shader_id: Default::default(),
program_cache: Default::default(),
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/gles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ struct AdapterShared {
context: AdapterContext,
private_caps: PrivateCapabilities,
features: wgt::Features,
limits: wgt::Limits,
workarounds: Workarounds,
shading_language_version: naga::back::glsl::Version,
next_shader_id: AtomicU32,
Expand Down
4 changes: 2 additions & 2 deletions wgpu-hal/src/gles/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,8 +1078,8 @@ impl super::Queue {
0,
)
};
for i in 0..crate::MAX_COLOR_ATTACHMENTS {
let target = glow::COLOR_ATTACHMENT0 + i as u32;
for i in 0..self.shared.limits.max_color_attachments {
let target = glow::COLOR_ATTACHMENT0 + i;
unsafe {
gl.framebuffer_texture_2d(
glow::DRAW_FRAMEBUFFER,
Expand Down
5 changes: 3 additions & 2 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ impl Limits {
/// min_uniform_buffer_offset_alignment: 256,
/// min_storage_buffer_offset_alignment: 256,
/// max_inter_stage_shader_components: 60,
/// max_color_attachments: 8,
/// max_color_attachments: 4,
/// max_color_attachment_bytes_per_sample: 32,
/// max_compute_workgroup_storage_size: 16352, // *
/// max_compute_invocations_per_workgroup: 256,
Expand All @@ -1344,6 +1344,7 @@ impl Limits {
max_texture_dimension_3d: 256,
max_storage_buffers_per_shader_stage: 4,
max_uniform_buffer_binding_size: 16 << 10, // (16 KiB)
max_color_attachments: 4,
// see: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=7
max_compute_workgroup_storage_size: 16352,
..Self::defaults()
Expand Down Expand Up @@ -1381,7 +1382,7 @@ impl Limits {
/// min_uniform_buffer_offset_alignment: 256,
/// min_storage_buffer_offset_alignment: 256,
/// max_inter_stage_shader_components: 31,
/// max_color_attachments: 8,
/// max_color_attachments: 4,
/// max_color_attachment_bytes_per_sample: 32,
/// max_compute_workgroup_storage_size: 0, // +
/// max_compute_invocations_per_workgroup: 0, // +
Expand Down
Loading