Skip to content

Commit 89f1315

Browse files
committed
[gles] fix duplicated surface compat format computation
disable f16 for webgl for now again
1 parent 53fc8ed commit 89f1315

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
@@ -786,26 +786,6 @@ impl crate::Adapter<super::Api> for super::Adapter {
786786
&self,
787787
surface: &super::Surface,
788788
) -> Option<crate::SurfaceCapabilities> {
789-
let mut formats = if surface.supports_srgb() {
790-
vec![
791-
wgt::TextureFormat::Rgba8UnormSrgb,
792-
#[cfg(not(target_arch = "wasm32"))]
793-
wgt::TextureFormat::Bgra8UnormSrgb,
794-
]
795-
} else {
796-
vec![
797-
wgt::TextureFormat::Rgba8Unorm,
798-
#[cfg(not(target_arch = "wasm32"))]
799-
wgt::TextureFormat::Bgra8Unorm,
800-
]
801-
};
802-
if self
803-
.shared
804-
.private_caps
805-
.contains(super::PrivateCapabilities::COLOR_BUFFER_HALF_FLOAT)
806-
{
807-
formats.push(wgt::TextureFormat::Rgba16Float)
808-
}
809789
if surface.presentable {
810790
let mut formats = vec![
811791
wgt::TextureFormat::Rgba8Unorm,
@@ -819,6 +799,14 @@ impl crate::Adapter<super::Api> for super::Adapter {
819799
wgt::TextureFormat::Bgra8UnormSrgb,
820800
])
821801
}
802+
#[cfg(not(target_arch = "wasm32"))]
803+
if self
804+
.shared
805+
.private_caps
806+
.contains(super::PrivateCapabilities::COLOR_BUFFER_HALF_FLOAT)
807+
{
808+
formats.push(wgt::TextureFormat::Rgba16Float)
809+
}
822810

823811
Some(crate::SurfaceCapabilities {
824812
formats,

0 commit comments

Comments
 (0)