Skip to content

Commit

Permalink
Revert "Updated to latest wgpu (0.18.0) (#3505)"
Browse files Browse the repository at this point in the history
This reverts commit cd46691.
  • Loading branch information
emilk committed Nov 16, 2023
1 parent 82863f8 commit 3d65200
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 110 deletions.
113 changes: 25 additions & 88 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@ opt-level = 2

[workspace.dependencies]
thiserror = "1.0.37"
wgpu = "0.18.0"
# Use this to build wgpu with WebGL support on the Web *instead* of using WebGPU.
#wgpu = { version = "0.18.0", features = ["webgl"] }
wgpu = "0.17.0"
10 changes: 3 additions & 7 deletions crates/eframe/src/web/web_painter_wgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl WebPainterWgpu {

let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: options.wgpu_options.supported_backends,
..Default::default()
dx12_shader_compiler: Default::default(),
});

let canvas = super::canvas_element_or_die(canvas_id);
Expand Down Expand Up @@ -236,24 +236,20 @@ impl WebPainter for WebPainterWgpu {
b: clear_color[2] as f64,
a: clear_color[3] as f64,
}),
store: wgpu::StoreOp::Store,
store: true,
},
})],
depth_stencil_attachment: self.depth_texture_view.as_ref().map(|view| {
wgpu::RenderPassDepthStencilAttachment {
view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
// 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,
store: false,
}),
stencil_ops: None,
}
}),
label: Some("egui_render"),
occlusion_query_set: None,
timestamp_writes: None,
});

renderer.render(&mut render_pass, clipped_primitives, &screen_descriptor);
Expand Down
12 changes: 4 additions & 8 deletions crates/egui-wgpu/src/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Painter {
) -> Self {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: configuration.supported_backends,
..Default::default()
dx12_shader_compiler: Default::default(),
});

Self {
Expand Down Expand Up @@ -565,7 +565,6 @@ impl Painter {
});

let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: Some("egui_render"),
color_attachments: &[Some(wgpu::RenderPassColorAttachment {
view,
resolve_target,
Expand All @@ -576,23 +575,20 @@ impl Painter {
b: clear_color[2] as f64,
a: clear_color[3] as f64,
}),
store: wgpu::StoreOp::Store,
store: true,
},
})],
depth_stencil_attachment: self.depth_texture_view.get(&viewport_id).map(|view| {
wgpu::RenderPassDepthStencilAttachment {
view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
// 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,
store: true,
}),
stencil_ops: None,
}
}),
timestamp_writes: None,
occlusion_query_set: None,
label: Some("egui_render"),
});

renderer.render(&mut render_pass, clipped_primitives, &screen_descriptor);
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ unity = ["epaint/unity"]
[dependencies]
epaint = { version = "0.23.0", path = "../epaint", default-features = false }

ahash = { version = "0.8.6", default-features = false, features = [
ahash = { version = "0.8.1", default-features = false, features = [
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
"std",
] }
Expand Down
3 changes: 0 additions & 3 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ skip = [
{ name = "windows_x86_64_msvc" }, # old version via glutin
{ name = "windows-sys" }, # old version via glutin
{ name = "windows" }, # old version via accesskit
{ name = "spin" }, # old version via ring through rusttls and other libraries, newer for wgpu.
{ name = "glow" }, # TODO(@wumpf): Old version use for glow backend right now, newer for wgpu. Updating this trickles out to updating winit.
{ name = "glutin_wgl_sys" }, # TODO(@wumpf): As above
]
skip-tree = [
{ name = "criterion" }, # dev-dependency
Expand Down

0 comments on commit 3d65200

Please sign in to comment.