Skip to content

Commit 44d6477

Browse files
torokati44adrian17
authored andcommitted
Lower max_color_attachments limit for GL to 4 (backport of #6994) (#7169)
Co-authored-by: Adrian Wielgosik <[email protected]>
1 parent 9bb65cd commit 44d6477

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ Bottom level categories:
4040

4141
## Unreleased
4242

43-
### v24.0.2 (2025-02-??)
43+
### v24.0.2 (2025-02-26)
4444

4545
#### Bug Fixes
46+
- Fix GLES renderpass clears causing violation of `max_color_attachments` limit. By @adrian17 in [#6994](https://github.com/gfx-rs/wgpu/pull/6994).
4647
- Fix a possible deadlock within `Queue::write_texture`. By @metamuffin in [#7004](https://github.com/gfx-rs/wgpu/pull/7004)
4748

4849
### v24.0.1 (2025-01-22)

wgpu-hal/src/gles/adapter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@ impl super::Adapter {
824824
private_caps,
825825
workarounds,
826826
features,
827+
limits: limits.clone(),
827828
shading_language_version,
828829
next_shader_id: Default::default(),
829830
program_cache: Default::default(),

wgpu-hal/src/gles/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ struct AdapterShared {
271271
context: AdapterContext,
272272
private_caps: PrivateCapabilities,
273273
features: wgt::Features,
274+
limits: wgt::Limits,
274275
workarounds: Workarounds,
275276
shading_language_version: naga::back::glsl::Version,
276277
next_shader_id: AtomicU32,

wgpu-hal/src/gles/queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,8 @@ impl super::Queue {
10781078
0,
10791079
)
10801080
};
1081-
for i in 0..crate::MAX_COLOR_ATTACHMENTS {
1082-
let target = glow::COLOR_ATTACHMENT0 + i as u32;
1081+
for i in 0..self.shared.limits.max_color_attachments {
1082+
let target = glow::COLOR_ATTACHMENT0 + i;
10831083
unsafe {
10841084
gl.framebuffer_texture_2d(
10851085
glow::DRAW_FRAMEBUFFER,

0 commit comments

Comments
 (0)