From b8853689fe97318e57a987753e9bf25f73c2b758 Mon Sep 17 00:00:00 2001 From: Aevyrie Date: Sat, 5 Jun 2021 23:52:02 -0700 Subject: [PATCH 1/4] wgpu 0.8 BlendState change --- docs/beginner/tutorial3-pipeline/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/beginner/tutorial3-pipeline/README.md b/docs/beginner/tutorial3-pipeline/README.md index 67b2a7fe..717ea5b8 100644 --- a/docs/beginner/tutorial3-pipeline/README.md +++ b/docs/beginner/tutorial3-pipeline/README.md @@ -1,7 +1,7 @@ # The Pipeline ## What's a pipeline? -If you're familiar with OpenGL, you may remember using shader programs. You can think of a pipeline as a more robust version of that. A pipeline describes all the actions the gpu will preform when acting on a set of data. In this section, we will be creating a `RenderPipeline` specifically. +If you're familiar with OpenGL, you may remember using shader programs. You can think of a pipeline as a more robust version of that. A pipeline describes all the actions the gpu will perform when acting on a set of data. In this section, we will be creating a `RenderPipeline` specifically. ## Wait shaders? Shaders are mini programs that you send to the gpu to perform operations on your data. There are 3 main types of shader: vertex, fragment, and compute. There are others such as geometry shaders, but they're more of an advanced topic. For now we're just going to use vertex, and fragment shaders. @@ -175,8 +175,7 @@ let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescrip entry_point: "main", targets: &[wgpu::ColorTargetState { // 4. format: sc_desc.format, - alpha_blend: wgpu::BlendState::REPLACE, - color_blend: wgpu::BlendState::REPLACE, + blend: Some(wgpu::BlendState::REPLACE), write_mask: wgpu::ColorWrite::ALL, }], }), From c9003caa9f350c01d370f989eaa77d18f8d80bca Mon Sep 17 00:00:00 2001 From: Aevyrie Date: Sun, 6 Jun 2021 01:40:12 -0700 Subject: [PATCH 2/4] ImageDataLayout change --- docs/beginner/tutorial5-textures/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/beginner/tutorial5-textures/README.md b/docs/beginner/tutorial5-textures/README.md index 3032a0af..6f18b0a3 100644 --- a/docs/beginner/tutorial5-textures/README.md +++ b/docs/beginner/tutorial5-textures/README.md @@ -70,8 +70,8 @@ queue.write_texture( // The layout of the texture wgpu::ImageDataLayout { offset: 0, - bytes_per_row: 4 * dimensions.0, - rows_per_image: dimensions.1, + bytes_per_row: std::num::NonZeroU32::new(4 * dimensions.0), + rows_per_image: std::num::NonZeroU32::new(dimensions.1), }, texture_size, ); From adc729747b298e753f38ec1a44da06763d642514 Mon Sep 17 00:00:00 2001 From: Aevyrie Date: Sun, 6 Jun 2021 10:30:46 -0700 Subject: [PATCH 3/4] Fix grammatical error --- 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 55955ac4..e03c96c6 100644 --- a/docs/beginner/tutorial6-uniforms/README.md +++ b/docs/beginner/tutorial6-uniforms/README.md @@ -257,7 +257,7 @@ fn main( } ``` -1. The according to the [WGSL Spec](https://gpuweb.github.io/gpuweb/wgsl/), The block decorator indicates this structure type represents the contents of a buffer resource occupying a single binding slot in the shader’s resource interface. Any structure used as a `uniform` must be annotated with `[[block]]` +1. According to the [WGSL Spec](https://gpuweb.github.io/gpuweb/wgsl/), The block decorator indicates this structure type represents the contents of a buffer resource occupying a single binding slot in the shader’s resource interface. Any structure used as a `uniform` must be annotated with `[[block]]` 2. Because we've created a new bind group, we need to specify which one we're using in the shader. The number is determined by our `render_pipeline_layout`. The `texture_bind_group_layout` is listed first, thus it's `group(0)`, and `uniform_bind_group` is second, so it's `group(1)`. 3. Multiplication order is important when it comes to matrices. The vector goes on the right, and the matrices gone on the left in order of importance. From 5cd42e231ccc992ca5cf00c64cd1f0f83327160d Mon Sep 17 00:00:00 2001 From: Aevyrie Date: Sun, 6 Jun 2021 10:32:38 -0700 Subject: [PATCH 4/4] Missing qualifier --- docs/beginner/tutorial5-textures/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/beginner/tutorial5-textures/README.md b/docs/beginner/tutorial5-textures/README.md index 6f18b0a3..4b336573 100644 --- a/docs/beginner/tutorial5-textures/README.md +++ b/docs/beginner/tutorial5-textures/README.md @@ -492,8 +492,8 @@ impl Texture { rgba, wgpu::ImageDataLayout { offset: 0, - bytes_per_row: NonZeroU32::new(4 * dimensions.0), - rows_per_image: NonZeroU32::new(dimensions.1), + bytes_per_row: std::num::NonZeroU32::new(4 * dimensions.0), + rows_per_image: std::num::NonZeroU32::new(dimensions.1), }, size, );