Enable Msaa for webgl by default (#3489)

# Objective

- `Msaa` was disabled in webgl due to a bug in wgpu
- Bug has been fixed (https://github.com/gfx-rs/wgpu/pull/2307) and backported (https://github.com/gfx-rs/wgpu/pull/2327), and updates for [`wgpu-core`](https://crates.io/crates/wgpu-core/0.12.1) and [`wgpu-hal`](https://crates.io/crates/wgpu-hal/0.12.1) have been released

## Solution

- Remove custom config for `Msaa` in webgl
- I also changed two options that were using the arch instead of the `webgl` feature. it shouldn't change much for webgl, but could help if someone wants to target wasm but not webgl2


Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
This commit is contained in:
François 2021-12-29 21:04:28 +00:00
parent 66b517ef81
commit db68704231
2 changed files with 3 additions and 8 deletions

View file

@ -13,7 +13,7 @@ pub struct WgpuOptions {
impl Default for WgpuOptions { impl Default for WgpuOptions {
fn default() -> Self { fn default() -> Self {
let default_backends = if cfg!(target_arch = "wasm32") { let default_backends = if cfg!(feature = "webgl") {
Backends::GL Backends::GL
} else { } else {
Backends::PRIMARY Backends::PRIMARY
@ -21,7 +21,7 @@ impl Default for WgpuOptions {
let backends = wgpu::util::backend_bits_from_env().unwrap_or(default_backends); let backends = wgpu::util::backend_bits_from_env().unwrap_or(default_backends);
let limits = if cfg!(target_arch = "wasm32") { let limits = if cfg!(feature = "webgl") {
wgpu::Limits::downlevel_webgl2_defaults() wgpu::Limits::downlevel_webgl2_defaults()
} else { } else {
#[allow(unused_mut)] #[allow(unused_mut)]

View file

@ -49,12 +49,7 @@ pub struct Msaa {
impl Default for Msaa { impl Default for Msaa {
fn default() -> Self { fn default() -> Self {
Self { Self { samples: 4 }
#[cfg(feature = "webgl")]
samples: 1,
#[cfg(not(feature = "webgl"))]
samples: 4,
}
} }
} }