From 3f0a93ebe9219694c29cd72759403533853349a3 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Fri, 7 Oct 2022 09:30:56 +0200 Subject: [PATCH] [gles] fix duplicated surface compat format computation disable f16 for webgl for now again --- wgpu-hal/src/gles/adapter.rs | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index 1c965cc8ef2..a08062b22f3 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -785,26 +785,6 @@ impl crate::Adapter for super::Adapter { &self, surface: &super::Surface, ) -> Option { - let mut formats = if surface.supports_srgb() { - vec![ - wgt::TextureFormat::Rgba8UnormSrgb, - #[cfg(not(target_arch = "wasm32"))] - wgt::TextureFormat::Bgra8UnormSrgb, - ] - } else { - vec![ - wgt::TextureFormat::Rgba8Unorm, - #[cfg(not(target_arch = "wasm32"))] - wgt::TextureFormat::Bgra8Unorm, - ] - }; - if self - .shared - .private_caps - .contains(super::PrivateCapabilities::COLOR_BUFFER_HALF_FLOAT) - { - formats.push(wgt::TextureFormat::Rgba16Float) - } if surface.presentable { let mut formats = vec![ wgt::TextureFormat::Rgba8Unorm, @@ -818,6 +798,14 @@ impl crate::Adapter for super::Adapter { wgt::TextureFormat::Bgra8UnormSrgb, ]) } + #[cfg(not(target_arch = "wasm32"))] + if self + .shared + .private_caps + .contains(super::PrivateCapabilities::COLOR_BUFFER_HALF_FLOAT) + { + formats.push(wgt::TextureFormat::Rgba16Float) + } Some(crate::SurfaceCapabilities { formats,