Skip to content

Commit 62d3b6f

Browse files
emilkcwfitzgerald
authored andcommitted
Fix missing 4X MSAA support on some OpenGL backends (#3780)
* Always support 4x MSAA on GL * Update changelog
1 parent e11459c commit 62d3b6f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Bottom level categories:
4242

4343
### Bug Fixes
4444

45+
- Fix missing 4X MSAA support on some OpenGL backends. By @emilk in [#3780](https://github.com/gfx-rs/wgpu/pull/3780)
46+
4547
#### General
4648

4749
- Fix crash on dropping `wgpu::CommandBuffer`. By @wumpf in [#3726](https://github.com/gfx-rs/wgpu/pull/3726).

wgpu-hal/src/gles/adapter.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,12 @@ impl crate::Adapter<super::Api> for super::Adapter {
713713
| Tfc::MULTISAMPLE_X16
714714
} else if max_samples >= 8 {
715715
Tfc::MULTISAMPLE_X2 | Tfc::MULTISAMPLE_X4 | Tfc::MULTISAMPLE_X8
716-
} else if max_samples >= 4 {
717-
Tfc::MULTISAMPLE_X2 | Tfc::MULTISAMPLE_X4
718716
} else {
719-
Tfc::MULTISAMPLE_X2
717+
// The lowest supported level in GLE3.0/WebGL2 is 4X
718+
// (see GL_MAX_SAMPLES in https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml).
719+
// On some platforms, like iOS Safari, `get_parameter_i32(MAX_SAMPLES)` returns 0,
720+
// so we always fall back to supporting 4x here.
721+
Tfc::MULTISAMPLE_X2 | Tfc::MULTISAMPLE_X4
720722
}
721723
};
722724

0 commit comments

Comments
 (0)