Skip to content

Commit c19c6a0

Browse files
committed
bug fix : simplify surface format selection by using preferred format directly
1 parent 1ad5ed2 commit c19c6a0

File tree

1 file changed

+2
-2
lines changed
  • node-graph/libraries/wgpu-executor/src

1 file changed

+2
-2
lines changed

node-graph/libraries/wgpu-executor/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ impl WgpuExecutor {
174174
}
175175

176176
pub fn create_surface_inner(&self, surface: wgpu::Surface<'static>, window_id: SurfaceId) -> Result<SurfaceHandle<Surface>> {
177-
// Get the surface's preferred format (Firefox WebGL may prefer Bgra8Unorm, Chrome prefers Rgba8Unorm)
177+
// Use the surface's preferred format (Firefox prefers Bgra8Unorm, Chrome prefers Rgba8Unorm)
178178
let surface_caps = surface.get_capabilities(&self.context.adapter);
179-
let surface_format = surface_caps.formats.iter().copied().find(|f| f.is_srgb()).unwrap_or(surface_caps.formats[0]);
179+
let surface_format = surface_caps.formats[0];
180180
let blitter = TextureBlitter::new(&self.context.device, surface_format);
181181
Ok(SurfaceHandle {
182182
window_id,

0 commit comments

Comments
 (0)