Skip to content

Commit 3f0a93e

Browse files
committed
[gles] fix duplicated surface compat format computation
disable f16 for webgl for now again
1 parent ca38180 commit 3f0a93e

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

wgpu-hal/src/gles/adapter.rs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -785,26 +785,6 @@ impl crate::Adapter<super::Api> for super::Adapter {
785785
&self,
786786
surface: &super::Surface,
787787
) -> Option<crate::SurfaceCapabilities> {
788-
let mut formats = if surface.supports_srgb() {
789-
vec![
790-
wgt::TextureFormat::Rgba8UnormSrgb,
791-
#[cfg(not(target_arch = "wasm32"))]
792-
wgt::TextureFormat::Bgra8UnormSrgb,
793-
]
794-
} else {
795-
vec![
796-
wgt::TextureFormat::Rgba8Unorm,
797-
#[cfg(not(target_arch = "wasm32"))]
798-
wgt::TextureFormat::Bgra8Unorm,
799-
]
800-
};
801-
if self
802-
.shared
803-
.private_caps
804-
.contains(super::PrivateCapabilities::COLOR_BUFFER_HALF_FLOAT)
805-
{
806-
formats.push(wgt::TextureFormat::Rgba16Float)
807-
}
808788
if surface.presentable {
809789
let mut formats = vec![
810790
wgt::TextureFormat::Rgba8Unorm,
@@ -818,6 +798,14 @@ impl crate::Adapter<super::Api> for super::Adapter {
818798
wgt::TextureFormat::Bgra8UnormSrgb,
819799
])
820800
}
801+
#[cfg(not(target_arch = "wasm32"))]
802+
if self
803+
.shared
804+
.private_caps
805+
.contains(super::PrivateCapabilities::COLOR_BUFFER_HALF_FLOAT)
806+
{
807+
formats.push(wgt::TextureFormat::Rgba16Float)
808+
}
821809

822810
Some(crate::SurfaceCapabilities {
823811
formats,

0 commit comments

Comments
 (0)