Add Bind groups
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
|
||||
pub struct Vertex {
|
||||
position: [f32; 3],
|
||||
color: [f32; 3],
|
||||
texture_coords: [f32; 2],
|
||||
}
|
||||
|
||||
impl Vertex {
|
||||
@@ -21,7 +21,7 @@ impl Vertex {
|
||||
wgpu::VertexAttribute {
|
||||
offset: std::mem::size_of::<[f32; 3]>() as wgpu::BufferAddress,
|
||||
shader_location: 1,
|
||||
format: wgpu::VertexFormat::Float32x3,
|
||||
format: wgpu::VertexFormat::Float32x2,
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -29,19 +29,18 @@ impl Vertex {
|
||||
}
|
||||
|
||||
pub const VERTICES: &[Vertex] = &[
|
||||
// Top
|
||||
Vertex {
|
||||
position: [0.0, 0.5, 0.0],
|
||||
color: [1.0, 0.0, 0.0],
|
||||
},
|
||||
// Left
|
||||
Vertex {
|
||||
position: [-0.5, -0.5, 0.0],
|
||||
color: [0.0, 1.0, 0.0],
|
||||
},
|
||||
// Right
|
||||
Vertex {
|
||||
position: [0.5, -0.5, 0.0],
|
||||
color: [0.0, 0.0, 1.0],
|
||||
},
|
||||
Vertex { position: [-0.0868241, 0.49240386, 0.0], texture_coords: [0.4131759, 0.00759614], }, // A
|
||||
Vertex { position: [-0.49513406, 0.06958647, 0.0], texture_coords: [0.0048659444, 0.43041354], }, // B
|
||||
Vertex { position: [-0.21918549, -0.44939706, 0.0], texture_coords: [0.28081453, 0.949397], }, // C
|
||||
Vertex { position: [0.35966998, -0.3473291, 0.0], texture_coords: [0.85967, 0.84732914], }, // D
|
||||
Vertex { position: [0.44147372, 0.2347359, 0.0], texture_coords: [0.9414737, 0.2652641], }, // E
|
||||
];
|
||||
|
||||
pub const INDICES: &[u16] = &[
|
||||
// pentagon
|
||||
0, 1, 4,
|
||||
1, 2, 4,
|
||||
2, 3, 4,
|
||||
// padding
|
||||
0,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user