Use vertex_attr_array macro
This commit is contained in:
parent
c70f90f320
commit
a53e7559fe
3 changed files with 19 additions and 71 deletions
|
|
@ -165,33 +165,13 @@ impl Pipeline {
|
|||
wgpu::VertexBufferLayout {
|
||||
array_stride: mem::size_of::<Instance>() as u64,
|
||||
step_mode: wgpu::InputStepMode::Instance,
|
||||
attributes: &[
|
||||
wgpu::VertexAttribute {
|
||||
shader_location: 1,
|
||||
format: wgpu::VertexFormat::Float32x2,
|
||||
offset: 0,
|
||||
},
|
||||
wgpu::VertexAttribute {
|
||||
shader_location: 2,
|
||||
format: wgpu::VertexFormat::Float32x2,
|
||||
offset: 4 * 2,
|
||||
},
|
||||
wgpu::VertexAttribute {
|
||||
shader_location: 3,
|
||||
format: wgpu::VertexFormat::Float32x2,
|
||||
offset: 4 * 4,
|
||||
},
|
||||
wgpu::VertexAttribute {
|
||||
shader_location: 4,
|
||||
format: wgpu::VertexFormat::Float32x2,
|
||||
offset: 4 * 6,
|
||||
},
|
||||
wgpu::VertexAttribute {
|
||||
shader_location: 5,
|
||||
format: wgpu::VertexFormat::Sint32,
|
||||
offset: 4 * 8,
|
||||
},
|
||||
],
|
||||
attributes: &wgpu::vertex_attr_array!(
|
||||
1 => Float32x2,
|
||||
2 => Float32x2,
|
||||
3 => Float32x2,
|
||||
4 => Float32x2,
|
||||
5 => Sint32,
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue