@ -123,28 +123,16 @@ For you visually learners, our vertex buffer looks like this.
![A figure of the VertexBufferDescriptor](./vb_desc.png)
Let's create a static method on `Vertex` that returns this descriptor.
Let's create a static method on `Vertex` that returns this descriptor. Thankfully, wgpu provides us with a convenient macro for doing this! `vertex_attr_array!` expands into an array of descriptors with automatically calculated offsets.
@ -247,7 +247,7 @@ let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayout
```
## A change to the VERTICES
There's a few things we need to change about our `Vertex` definition. Up to now we've been using a `color` attribute to dictate the color of our mesh. Now that we're using a texture we want to replace our `color` with `tex_coords`.
There's a few things we need to change about our `Vertex` definition. Up to now we've been using a `color` attribute to dictate the color of our mesh. Now that we're using a texture we want to replace our `color` with `tex_coords`, which is only two floats instead of three.
```rust
#[repr(C)]
@ -263,25 +263,10 @@ We need to reflect these changes in the `VertexBufferDescriptor`.