From 6241c4f2ef7166923ffbfd825804b1cbaedd533d Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 17 May 2023 09:25:19 +0200 Subject: [PATCH 1/2] Always support 4x MSAA on GL --- wgpu-hal/src/gles/adapter.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index b14857ae22..dac13f27df 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -713,10 +713,12 @@ impl crate::Adapter 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 } }; From 02daebac697254db70e77b455ddef48d2ab64683 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 17 May 2023 09:54:46 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ba8660e40..e7a4446592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,8 @@ Bottom level categories: ### Bug Fixes +- Fix missing 4X MSAA support on some OpenGL backends. By @emilk in [#3780](https://github.com/gfx-rs/wgpu/pull/3780) + #### General - Fix crash on dropping `wgpu::CommandBuffer`. By @wumpf in [#3726](https://github.com/gfx-rs/wgpu/pull/3726).