Merge branch 'master' into patch-1

pull/49/head
Cedric Hutchings 4 years ago committed by GitHub
commit 500d84058b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,7 +11,7 @@ A vertex is a point in 3d space (can also be 2d). These vertices are then bundle
<img src="./tutorial3-pipeline-vertices.png" />
Most modern rendering uses triangles to make simple shapes such as cube, and complex shapes such as person.
Most modern rendering uses triangles to make all shapes, from simple (such as cubes) to complex (such as people).
<!-- Todo: Find/make an image to put here -->
@ -27,7 +27,7 @@ In order to do that, we're going to need something to do the conversion. Add the
```toml
[dependencies]
# ...
glsl-to-spirv = "0.1"
shaderc = "0.6"
```
We'll use this in a bit, but first let's create the shaders.

@ -83,7 +83,6 @@ Self {
swap_chain,
render_pipeline,
vertex_buffer,
hidpi_factor,
size,
}
```
@ -324,7 +323,6 @@ Self {
// NEW!
index_buffer,
num_indices,
hidpi_factor,
size,
}
```

@ -373,7 +373,7 @@ fn input(&mut self, event: &WindowEvent) -> bool {
Up to this point, the camera controller isn't actually doing anything. The values in our uniform buffer need to be updated. There are 2 main methods to do that.
1. We can create a separate buffer and copy it's contents to our `uniform_buffer`. The new buffer is known as a staging buffer. This method is usually how it's done as it allows the contents of the main buffer (in this case `uniform_buffer`) to only be accessible by the gpu. The gpu can do some speed optimizations which it couldn't if we could access the buffer via the cpu.
2. We can call on of the mapping method's `map_read_async`, and `map_write_async` on the buffer itself. These allow us to access a buffer's contents directly, but requires us to deal with the `async` aspect of these methods this also requires our buffer to use the `BufferUsage::MAP_READ` and/or `BufferUsage::MAP_WRITE`. We won't talk about it here, but you check out [Wgpu without a window](../../intermediate/windowless) tutorial if you want to know more.
2. We can call on of the mapping method's `map_read_async`, and `map_write_async` on the buffer itself. These allow us to access a buffer's contents directly, but requires us to deal with the `async` aspect of these methods this also requires our buffer to use the `BufferUsage::MAP_READ` and/or `BufferUsage::MAP_WRITE`. We won't talk about it here, but you check out [Wgpu without a window](../../showcase/windowless) tutorial if you want to know more.
Enough about that though, let's get into actually implementing the code.

Loading…
Cancel
Save