1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Updated to latest wgpu (0.18.0) (#3505)

Tested on M1 Mac:
* native
* webgl, firefox
* webgpu, chrome

all looking normal


Updated minor ahash version because 0.8.1 got yanked. Added some deny
exceptions for now - we'll have to update winit soon to resolve glow
related cargo deny errors (not a big issue though since we don't expect
wgpu and glow backends to be used at the same time)
This commit is contained in:
Andreas Reich
2023-11-11 21:58:32 +01:00
committed by GitHub
parent 6ba356d3d8
commit cd46691423
6 changed files with 110 additions and 34 deletions

View File

@@ -77,7 +77,7 @@ impl WebPainterWgpu {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: options.wgpu_options.supported_backends,
dx12_shader_compiler: Default::default(),
..Default::default()
});
let canvas = super::canvas_element_or_die(canvas_id);
@@ -237,7 +237,7 @@ impl WebPainter for WebPainterWgpu {
b: clear_color[2] as f64,
a: clear_color[3] as f64,
}),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: self.depth_texture_view.as_ref().map(|view| {
@@ -245,12 +245,16 @@ impl WebPainter for WebPainterWgpu {
view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: false,
// It is very unlikely that the depth buffer is needed after egui finished rendering
// so no need to store it. (this can improve performance on tiling GPUs like mobile chips or Apple Silicon)
store: wgpu::StoreOp::Discard,
}),
stencil_ops: None,
}
}),
label: Some("egui_render"),
occlusion_query_set: None,
timestamp_writes: None,
});
renderer.render(&mut render_pass, clipped_primitives, &screen_descriptor);