From fff6dd36eacb590cdeece732eeb2f706e0b8dd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= <8672791+mockersf@users.noreply.github.com> Date: Wed, 29 Dec 2021 18:03:20 +0100 Subject: [PATCH 1/2] reenable msaa by default in webgl --- crates/bevy_render/src/view/mod.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 89dbfa53aa785..9914c6fa16bc6 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -49,12 +49,7 @@ pub struct Msaa { impl Default for Msaa { fn default() -> Self { - Self { - #[cfg(feature = "webgl")] - samples: 1, - #[cfg(not(feature = "webgl"))] - samples: 4, - } + Self { samples: 4 } } } From 2e355770f3d4ed776d627dc60bd4c45f66512e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= <8672791+mockersf@users.noreply.github.com> Date: Wed, 29 Dec 2021 18:03:50 +0100 Subject: [PATCH 2/2] fix a few options to use the feature instead of the arch --- crates/bevy_render/src/options.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_render/src/options.rs b/crates/bevy_render/src/options.rs index 379abbe708c62..e517140c65fc0 100644 --- a/crates/bevy_render/src/options.rs +++ b/crates/bevy_render/src/options.rs @@ -13,7 +13,7 @@ pub struct WgpuOptions { impl Default for WgpuOptions { fn default() -> Self { - let default_backends = if cfg!(target_arch = "wasm32") { + let default_backends = if cfg!(feature = "webgl") { Backends::GL } else { Backends::PRIMARY @@ -21,7 +21,7 @@ impl Default for WgpuOptions { 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() } else { #[allow(unused_mut)]