Skip to content

Commit

Permalink
Merge branch 'wgpu-0.18-update' of https://github.com/emilk/egui into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
Norlock committed Oct 31, 2023
2 parents 0bce16c + 5d703ae commit e2e20ff
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 33 deletions.
113 changes: 88 additions & 25 deletions Cargo.lock

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

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

[workspace.dependencies]
thiserror = "1.0.37"
wgpu = "0.17.0"
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"] }
8 changes: 5 additions & 3 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,
dx12_shader_compiler: Default::default(),
..Default::default()
});

let canvas = super::canvas_element_or_die(canvas_id);
Expand Down Expand Up @@ -237,20 +237,22 @@ 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| {
wgpu::RenderPassDepthStencilAttachment {
view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: false,
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);
Expand Down
10 changes: 6 additions & 4 deletions crates/egui-wgpu/src/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl Painter {
) -> Self {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: configuration.supported_backends,
dx12_shader_compiler: Default::default(),
..Default::default()
});

Self {
Expand Down Expand Up @@ -528,6 +528,7 @@ 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 @@ -538,20 +539,21 @@ impl Painter {
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| {
wgpu::RenderPassDepthStencilAttachment {
view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: true,
store: wgpu::StoreOp::Discard,
}),
stencil_ops: None,
}
}),
label: Some("egui_render"),
timestamp_writes: None,
occlusion_query_set: None,
});

renderer.render(&mut render_pass, clipped_primitives, &screen_descriptor);
Expand Down

0 comments on commit e2e20ff

Please sign in to comment.