summaryrefslogtreecommitdiffstats
path: root/examples/integration/src/scene.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-08-27 14:55:41 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-08-27 14:55:41 +0200
commitbae0a3e46e6f4f21ef8c6c8e9035efb7c87a9449 (patch)
tree2f2784514c13978158dd2de062fea61c9f64f9f3 /examples/integration/src/scene.rs
parentbb5f034e08c46e5ce46ed0e38a684c5ca710cb11 (diff)
downloadiced-bae0a3e46e6f4f21ef8c6c8e9035efb7c87a9449.tar.gz
iced-bae0a3e46e6f4f21ef8c6c8e9035efb7c87a9449.tar.bz2
iced-bae0a3e46e6f4f21ef8c6c8e9035efb7c87a9449.zip
Update `wgpu` in `integration` example
Diffstat (limited to '')
-rw-r--r--examples/integration/src/scene.rs40
1 files changed, 20 insertions, 20 deletions
diff --git a/examples/integration/src/scene.rs b/examples/integration/src/scene.rs
index 74cbb925..67a40eab 100644
--- a/examples/integration/src/scene.rs
+++ b/examples/integration/src/scene.rs
@@ -22,17 +22,18 @@ impl Scene {
color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor {
attachment: target,
resolve_target: None,
- load_op: wgpu::LoadOp::Clear,
- store_op: wgpu::StoreOp::Store,
- clear_color: {
- let [r, g, b, a] = background_color.into_linear();
+ ops: wgpu::Operations {
+ load: wgpu::LoadOp::Clear({
+ let [r, g, b, a] = background_color.into_linear();
- wgpu::Color {
- r: r as f64,
- g: g as f64,
- b: b as f64,
- a: a as f64,
- }
+ wgpu::Color {
+ r: r as f64,
+ g: g as f64,
+ b: b as f64,
+ a: a as f64,
+ }
+ }),
+ store: true,
},
}],
depth_stencil_attachment: None,
@@ -46,25 +47,23 @@ impl Scene {
}
fn build_pipeline(device: &wgpu::Device) -> wgpu::RenderPipeline {
- let vs = include_bytes!("shader/vert.spv");
- let fs = include_bytes!("shader/frag.spv");
+ let vs_module =
+ device.create_shader_module(wgpu::include_spirv!("shader/vert.spv"));
- let vs_module = device.create_shader_module(
- &wgpu::read_spirv(std::io::Cursor::new(&vs[..])).unwrap(),
- );
-
- let fs_module = device.create_shader_module(
- &wgpu::read_spirv(std::io::Cursor::new(&fs[..])).unwrap(),
- );
+ let fs_module =
+ device.create_shader_module(wgpu::include_spirv!("shader/frag.spv"));
let pipeline_layout =
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
+ label: None,
+ push_constant_ranges: &[],
bind_group_layouts: &[],
});
let pipeline =
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
- layout: &pipeline_layout,
+ label: None,
+ layout: Some(&pipeline_layout),
vertex_stage: wgpu::ProgrammableStageDescriptor {
module: &vs_module,
entry_point: "main",
@@ -79,6 +78,7 @@ fn build_pipeline(device: &wgpu::Device) -> wgpu::RenderPipeline {
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
+ ..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: &[wgpu::ColorStateDescriptor {