Skip to content

Commit

Permalink
[gles] fix duplicated surface compat format computation
Browse files Browse the repository at this point in the history
disable f16 for webgl for now again
  • Loading branch information
Wumpf committed Oct 7, 2022
1 parent 53fc8ed commit 89f1315
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,26 +786,6 @@ impl crate::Adapter<super::Api> for super::Adapter {
&self,
surface: &super::Surface,
) -> Option<crate::SurfaceCapabilities> {
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,
Expand All @@ -819,6 +799,14 @@ impl crate::Adapter<super::Api> 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,
Expand Down

0 comments on commit 89f1315

Please sign in to comment.