Fix `targets` data type in the doc

pull/395/head
Jinlei Li 2 years ago
parent 58944cb8ca
commit df68d03bb4

@ -187,11 +187,11 @@ let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescrip
fragment: Some(wgpu::FragmentState { // 3. fragment: Some(wgpu::FragmentState { // 3.
module: &shader, module: &shader,
entry_point: "fs_main", entry_point: "fs_main",
targets: &[wgpu::ColorTargetState { // 4. targets: &[Some(wgpu::ColorTargetState { // 4.
format: config.format, format: config.format,
blend: Some(wgpu::BlendState::REPLACE), blend: Some(wgpu::BlendState::REPLACE),
write_mask: wgpu::ColorWrites::ALL, write_mask: wgpu::ColorWrites::ALL,
}], })],
}), }),
// continued ... // continued ...
``` ```

@ -158,12 +158,12 @@ let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescrip
fragment: Some(wgpu::FragmentState { fragment: Some(wgpu::FragmentState {
module: &fs_module, module: &fs_module,
entry_point: "main", entry_point: "main",
targets: &[wgpu::ColorTargetState { targets: &[Some(wgpu::ColorTargetState {
format: texture_desc.format, format: texture_desc.format,
alpha_blend: wgpu::BlendState::REPLACE, alpha_blend: wgpu::BlendState::REPLACE,
color_blend: wgpu::BlendState::REPLACE, color_blend: wgpu::BlendState::REPLACE,
write_mask: wgpu::ColorWrites::ALL, write_mask: wgpu::ColorWrites::ALL,
}], })],
}), }),
primitive: wgpu::PrimitiveState { primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList, topology: wgpu::PrimitiveTopology::TriangleList,

Loading…
Cancel
Save