From f61585f85b6c79cccbcff4dd87d8005c05c2d038 Mon Sep 17 00:00:00 2001 From: Mark Hildreth Date: Sat, 30 May 2020 00:02:08 -0400 Subject: [PATCH 1/3] Some small fixes. --- docs/beginner/tutorial3-pipeline/README.md | 4 ++-- docs/beginner/tutorial4-buffer/README.md | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/beginner/tutorial3-pipeline/README.md b/docs/beginner/tutorial3-pipeline/README.md index ea70c93f..24692cb5 100644 --- a/docs/beginner/tutorial3-pipeline/README.md +++ b/docs/beginner/tutorial3-pipeline/README.md @@ -11,7 +11,7 @@ A vertex is a point in 3d space (can also be 2d). These vertices are then bundle -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). @@ -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" +cshader = "0.6" ``` We'll use this in a bit, but first let's create the shaders. diff --git a/docs/beginner/tutorial4-buffer/README.md b/docs/beginner/tutorial4-buffer/README.md index 8f182823..ba9a80a9 100644 --- a/docs/beginner/tutorial4-buffer/README.md +++ b/docs/beginner/tutorial4-buffer/README.md @@ -7,7 +7,7 @@ You were probably getting sick of me saying stuff like "we'll get to that when w A buffer is a blob of data on the GPU. A buffer is guaranteed to be contiguous, meaning that all the data is store sequentially in memory. Buffer's generally are used to store simple things like a struct or an array, but it can store more complex stuff such as graph structures like a tree (provided all the nodes are stored together and don't reference anything outside of the buffer). We are going to use buffer's a lot, so let's get started with two of the most important one's: the vertex buffer, and the index buffer. ## The vertex buffer -Previously we've stored vertex data directly in the vertex shader. While that worked fine to get our bootstraps on, it simply won't do longterm. The types of objects we need to draw will vary in size, and recompiling the shader whenever we need to update the model would massively slow down our program. Instead we are going to use buffers to store the vertex data we want to draw. Before we do that though we need to describe what a vertex looks like. We'll do this by creating a new struct. +Previously we've stored vertex data directly in the vertex shader. While that worked fine to get our bootstraps on, it simply won't do long-term. The types of objects we need to draw will vary in size, and recompiling the shader whenever we need to update the model would massively slow down our program. Instead we are going to use buffers to store the vertex data we want to draw. Before we do that though we need to describe what a vertex looks like. We'll do this by creating a new struct. ```rust // main.rs @@ -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, } ``` From 6fd4bdeb4cdc905886a319262ab700a1426cd61c Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Sun, 31 May 2020 22:30:20 +0900 Subject: [PATCH 2/3] Fix a broken link --- docs/beginner/tutorial6-uniforms/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/beginner/tutorial6-uniforms/README.md b/docs/beginner/tutorial6-uniforms/README.md index 9de972e5..50e78d85 100644 --- a/docs/beginner/tutorial6-uniforms/README.md +++ b/docs/beginner/tutorial6-uniforms/README.md @@ -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. From bd84d927665120cb439e773e98dc2c70f444092f Mon Sep 17 00:00:00 2001 From: Mark Hildreth Date: Sun, 31 May 2020 11:24:54 -0400 Subject: [PATCH 3/3] Fixed name of package --- docs/beginner/tutorial3-pipeline/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/beginner/tutorial3-pipeline/README.md b/docs/beginner/tutorial3-pipeline/README.md index 24692cb5..978ed7ac 100644 --- a/docs/beginner/tutorial3-pipeline/README.md +++ b/docs/beginner/tutorial3-pipeline/README.md @@ -27,7 +27,7 @@ In order to do that, we're going to need something to do the conversion. Add the ```toml [dependencies] # ... -cshader = "0.6" +shaderc = "0.6" ``` We'll use this in a bit, but first let's create the shaders.