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

Fix missing 4X MSAA support on some OpenGL backends #3780

Merged
merged 3 commits into from
May 19, 2023
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 @@ -57,6 +57,7 @@ Bottom level categories:
### Bug Fixes

- Fix order of arguments to glPolygonOffset by @komadori in [#3783](https://github.com/gfx-rs/wgpu/pull/3783).
- Fix missing 4X MSAA support on some OpenGL backends. By @emilk in [#3780](https://github.com/gfx-rs/wgpu/pull/3780)

#### General

Expand Down
8 changes: 5 additions & 3 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,12 @@ impl crate::Adapter<super::Api> for super::Adapter {
| Tfc::MULTISAMPLE_X16
} else if max_samples >= 8 {
Tfc::MULTISAMPLE_X2 | Tfc::MULTISAMPLE_X4 | Tfc::MULTISAMPLE_X8
} else if max_samples >= 4 {
Tfc::MULTISAMPLE_X2 | Tfc::MULTISAMPLE_X4
} else {
Tfc::MULTISAMPLE_X2
// The lowest supported level in GLE3.0/WebGL2 is 4X
// (see GL_MAX_SAMPLES in https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml).
// On some platforms, like iOS Safari, `get_parameter_i32(MAX_SAMPLES)` returns 0,
// so we always fall back to supporting 4x here.
Tfc::MULTISAMPLE_X2 | Tfc::MULTISAMPLE_X4
nical marked this conversation as resolved.
Show resolved Hide resolved
}
};

Expand Down