diff options
author | 2022-07-08 19:31:45 +0200 | |
---|---|---|
committer | 2022-07-08 19:31:45 +0200 | |
commit | fa55dff61db47197a961152285c6a6abfab0b217 (patch) | |
tree | 44904afb16a0cab9e22fce0d73a5616676cd426b /wgpu/src/triangle.rs | |
parent | 1dd1a2f97fc747e15e12b5188dad6c41b0d052ea (diff) | |
parent | 66eb6263003c1bbedd1fd14d6b12f172d20a6211 (diff) | |
download | iced-fa55dff61db47197a961152285c6a6abfab0b217.tar.gz iced-fa55dff61db47197a961152285c6a6abfab0b217.tar.bz2 iced-fa55dff61db47197a961152285c6a6abfab0b217.zip |
Merge branch 'master' into theming
Diffstat (limited to 'wgpu/src/triangle.rs')
-rw-r--r-- | wgpu/src/triangle.rs | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index c702243b..40e2f855 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -132,7 +132,7 @@ impl Pipeline { }); let shader = - device.create_shader_module(&wgpu::ShaderModuleDescriptor { + device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some("iced_wgpu::triangle::shader"), source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed( include_str!("shader/triangle.wgsl"), @@ -160,22 +160,11 @@ impl Pipeline { fragment: Some(wgpu::FragmentState { module: &shader, entry_point: "fs_main", - targets: &[wgpu::ColorTargetState { + targets: &[Some(wgpu::ColorTargetState { format, - blend: Some(wgpu::BlendState { - color: wgpu::BlendComponent { - src_factor: wgpu::BlendFactor::SrcAlpha, - dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, - operation: wgpu::BlendOperation::Add, - }, - alpha: wgpu::BlendComponent { - src_factor: wgpu::BlendFactor::One, - dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, - operation: wgpu::BlendOperation::Add, - }, - }), + blend: Some(wgpu::BlendState::ALPHA_BLENDING), write_mask: wgpu::ColorWrites::ALL, - }], + })], }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -361,11 +350,13 @@ impl Pipeline { let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: Some("iced_wgpu::triangle render pass"), - color_attachments: &[wgpu::RenderPassColorAttachment { - view: attachment, - resolve_target, - ops: wgpu::Operations { load, store: true }, - }], + color_attachments: &[Some( + wgpu::RenderPassColorAttachment { + view: attachment, + resolve_target, + ops: wgpu::Operations { load, store: true }, + }, + )], depth_stencil_attachment: None, }); |