[rs] Explicitly declare vertex attribute descriptors in cube example

This commit is contained in:
Aaron Loucks
2020-03-07 23:37:32 -05:00
parent a332377222
commit 738653d1fe

View File

@@ -3,8 +3,6 @@ mod framework;
use zerocopy::{AsBytes, FromBytes};
use wgpu::vertex_attr_array;
#[repr(C)]
#[derive(Clone, Copy, AsBytes, FromBytes)]
struct Vertex {
@@ -277,7 +275,18 @@ impl framework::Example for Example {
vertex_buffers: &[wgpu::VertexBufferDescriptor {
stride: vertex_size as wgpu::BufferAddress,
step_mode: wgpu::InputStepMode::Vertex,
attributes: &vertex_attr_array![0 => Float4, 1 => Float2],
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,