Skip to content

Commit fbbeadd

Browse files
committed
apply gemini suggestions
1 parent 02ac81b commit fbbeadd

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

  • editor/src/node_graph_executor
  • node-graph/libraries/wgpu-executor/src

editor/src/node_graph_executor/runtime.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,11 @@ impl NodeRuntime {
348348
// Configure the surface at physical resolution (for HiDPI displays)
349349
let surface_inner = &surface.surface.inner;
350350
let surface_caps = surface_inner.get_capabilities(&executor.context.adapter);
351-
// Use the surface's preferred format (Firefox WebGL prefers Bgra8Unorm, Chrome prefers Rgba8Unorm)
352-
let surface_format = surface_caps.formats.iter().copied().find(|f| f.is_srgb()).unwrap_or(surface_caps.formats[0]);
353351
surface_inner.configure(
354352
&executor.context.device,
355353
&vello::wgpu::SurfaceConfiguration {
356354
usage: vello::wgpu::TextureUsages::RENDER_ATTACHMENT | vello::wgpu::TextureUsages::COPY_DST,
357-
format: surface_format,
355+
format: surface.surface.format,
358356
width: physical_resolution.x,
359357
height: physical_resolution.y,
360358
present_mode: surface_caps.present_modes[0],

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pub struct Surface {
4949
pub inner: wgpu::Surface<'static>,
5050
pub target_texture: Mutex<Option<TargetTexture>>,
5151
pub blitter: TextureBlitter,
52+
pub format: wgpu::TextureFormat,
5253
}
5354

5455
#[derive(Clone, Debug)]
@@ -183,6 +184,7 @@ impl WgpuExecutor {
183184
inner: surface,
184185
target_texture: Mutex::new(None),
185186
blitter,
187+
format: surface_format,
186188
},
187189
})
188190
}

0 commit comments

Comments
 (0)