wgpu: Update to 0.10
This commit is contained in:
parent
663c3685da
commit
18753b77fc
14 changed files with 100 additions and 89 deletions
|
|
@ -23,7 +23,7 @@ impl Pipeline {
|
|||
label: Some("iced_wgpu::quad uniforms layout"),
|
||||
entries: &[wgpu::BindGroupLayoutEntry {
|
||||
binding: 0,
|
||||
visibility: wgpu::ShaderStage::VERTEX,
|
||||
visibility: wgpu::ShaderStages::VERTEX,
|
||||
ty: wgpu::BindingType::Buffer {
|
||||
ty: wgpu::BufferBindingType::Uniform,
|
||||
has_dynamic_offset: false,
|
||||
|
|
@ -38,7 +38,7 @@ impl Pipeline {
|
|||
let constants_buffer = device.create_buffer(&wgpu::BufferDescriptor {
|
||||
label: Some("iced_wgpu::quad uniforms buffer"),
|
||||
size: mem::size_of::<Uniforms>() as wgpu::BufferAddress,
|
||||
usage: wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST,
|
||||
usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST,
|
||||
mapped_at_creation: false,
|
||||
});
|
||||
|
||||
|
|
@ -64,7 +64,6 @@ impl Pipeline {
|
|||
source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(
|
||||
include_str!("shader/quad.wgsl"),
|
||||
)),
|
||||
flags: wgpu::ShaderFlags::all(),
|
||||
});
|
||||
|
||||
let pipeline =
|
||||
|
|
@ -77,7 +76,7 @@ impl Pipeline {
|
|||
buffers: &[
|
||||
wgpu::VertexBufferLayout {
|
||||
array_stride: mem::size_of::<Vertex>() as u64,
|
||||
step_mode: wgpu::InputStepMode::Vertex,
|
||||
step_mode: wgpu::VertexStepMode::Vertex,
|
||||
attributes: &[wgpu::VertexAttribute {
|
||||
shader_location: 0,
|
||||
format: wgpu::VertexFormat::Float32x2,
|
||||
|
|
@ -86,7 +85,7 @@ impl Pipeline {
|
|||
},
|
||||
wgpu::VertexBufferLayout {
|
||||
array_stride: mem::size_of::<layer::Quad>() as u64,
|
||||
step_mode: wgpu::InputStepMode::Instance,
|
||||
step_mode: wgpu::VertexStepMode::Instance,
|
||||
attributes: &wgpu::vertex_attr_array!(
|
||||
1 => Float32x2,
|
||||
2 => Float32x2,
|
||||
|
|
@ -115,7 +114,7 @@ impl Pipeline {
|
|||
operation: wgpu::BlendOperation::Add,
|
||||
},
|
||||
}),
|
||||
write_mask: wgpu::ColorWrite::ALL,
|
||||
write_mask: wgpu::ColorWrites::ALL,
|
||||
}],
|
||||
}),
|
||||
primitive: wgpu::PrimitiveState {
|
||||
|
|
@ -135,20 +134,20 @@ impl Pipeline {
|
|||
device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
||||
label: Some("iced_wgpu::quad vertex buffer"),
|
||||
contents: bytemuck::cast_slice(&QUAD_VERTS),
|
||||
usage: wgpu::BufferUsage::VERTEX,
|
||||
usage: wgpu::BufferUsages::VERTEX,
|
||||
});
|
||||
|
||||
let indices =
|
||||
device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
||||
label: Some("iced_wgpu::quad index buffer"),
|
||||
contents: bytemuck::cast_slice(&QUAD_INDICES),
|
||||
usage: wgpu::BufferUsage::INDEX,
|
||||
usage: wgpu::BufferUsages::INDEX,
|
||||
});
|
||||
|
||||
let instances = device.create_buffer(&wgpu::BufferDescriptor {
|
||||
label: Some("iced_wgpu::quad instance buffer"),
|
||||
size: mem::size_of::<layer::Quad>() as u64 * MAX_INSTANCES as u64,
|
||||
usage: wgpu::BufferUsage::VERTEX | wgpu::BufferUsage::COPY_DST,
|
||||
usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST,
|
||||
mapped_at_creation: false,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue