Add VertexStateDescriptor (#221)

The vertex state properties are now bundled in the VertexStateDescriptor
which matches the spec.

Fixes #220
This commit is contained in:
aloucks authored and GitHub committed 2020-03-28 10:45:18 -04:00
1 parent 6fd4bf27b6
commit d91b78bdfb
8 files changed
+84 -59

No files matched your search

+19 -17
View File
@@ -268,23 +268,25 @@ impl framework::Example for Example {
write_mask: wgpu::ColorWrite::ALL,
}],
depth_stencil_state: None,
index_format: wgpu::IndexFormat::Uint16,
vertex_buffers: &[wgpu::VertexBufferDescriptor {
stride: vertex_size as wgpu::BufferAddress,
step_mode: wgpu::InputStepMode::Vertex,
attributes: &[
wgpu::VertexAttributeDescriptor {
format: wgpu::VertexFormat::Float4,
offset: 0,
shader_location: 0,
},
wgpu::VertexAttributeDescriptor {
format: wgpu::VertexFormat::Float2,
offset: 4 * 4,
shader_location: 1,
},
],
}],
vertex_state: wgpu::VertexStateDescriptor {
index_format: wgpu::IndexFormat::Uint16,
vertex_buffers: &[wgpu::VertexBufferDescriptor {
stride: vertex_size as wgpu::BufferAddress,
step_mode: wgpu::InputStepMode::Vertex,
attributes: &[
wgpu::VertexAttributeDescriptor {
format: wgpu::VertexFormat::Float4,
offset: 0,
shader_location: 0,
},
wgpu::VertexAttributeDescriptor {
format: wgpu::VertexFormat::Float2,
offset: 4 * 4,
shader_location: 1,
},
],
}],
},
sample_count: 1,
sample_mask: !0,
alpha_to_coverage_enabled: false,