From e1f756af65398a384d6b6f924bba1ae406a71ba7 Mon Sep 17 00:00:00 2001 From: erwanvivien <44021072+erwanvivien@users.noreply.github.com> Date: Tue, 8 Nov 2022 23:15:34 +0100 Subject: [PATCH 1/5] fix: missing ending curly brace --- docs/beginner/tutorial2-surface/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index f37d9dd3..522e493b 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -61,6 +61,7 @@ impl State { force_fallback_adapter: false, }, ).await.unwrap(); + } ``` ### Instance and Adapter From 424bcfeed1e8a73d8e7caad417eb693ae510b5a4 Mon Sep 17 00:00:00 2001 From: erwanvivien <44021072+erwanvivien@users.noreply.github.com> Date: Tue, 8 Nov 2022 23:23:16 +0100 Subject: [PATCH 2/5] fix: removed curly, repeated prototype --- docs/beginner/tutorial2-surface/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index 522e493b..afa8d81e 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -177,6 +177,9 @@ Regardless, `PresentMode::Fifo` will always be supported, and `PresentMode::Auto Now that we've configured our surface properly we can add these new fields at the end of the method. ```rust + async fn new(window: &Window) -> Self { + // ... + Self { surface, device, @@ -185,8 +188,6 @@ Now that we've configured our surface properly we can add these new fields at th size, } } - // ... -} ``` Since our `State::new()` method is async we need to change `run()` to be async as well so that we can await it. From 50ca6f8b22ea5b77d59720fe6837e1171a473520 Mon Sep 17 00:00:00 2001 From: erwanvivien <44021072+erwanvivien@users.noreply.github.com> Date: Tue, 8 Nov 2022 23:25:44 +0100 Subject: [PATCH 3/5] fix: added missing curly to match --- docs/beginner/tutorial2-surface/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index afa8d81e..cb44b679 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -283,6 +283,8 @@ match event { state.resize(**new_inner_size); } // ... + } + } } ``` From 9db939d53c5681888c0e11db98a89780d95972d0 Mon Sep 17 00:00:00 2001 From: erwanvivien <44021072+erwanvivien@users.noreply.github.com> Date: Sun, 25 Dec 2022 19:25:04 +0100 Subject: [PATCH 4/5] feat: added tesselation shader & consider not using them Example of people not recommending them: - https://www.reddit.com/r/vulkan/comments/c9ws13/comment/etaunjz/?utm_source=share&utm_medium=web2x&context=3 - http://www.joshbarczak.com/blog/?p=667 - https://www.reddit.com/r/gamedev/comments/1d5duf/comment/c9n2xri/?utm_source=share&utm_medium=web2x&context=3 - https://community.khronos.org/t/does-the-use-of-geometric-shaders-significantly-reduce-performance/106326 --- 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 9ab5837b..89ce88dc 100644 --- a/docs/beginner/tutorial3-pipeline/README.md +++ b/docs/beginner/tutorial3-pipeline/README.md @@ -4,7 +4,7 @@ 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. +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 or tesselation shaders, but they're not supported by WebGL. They should be avoided in general, [see discussions](https://community.khronos.org/t/does-the-use-of-geometric-shaders-significantly-reduce-performance/106326). For now, we're just going to use vertex, and fragment shaders. ## Vertex, fragment... what are those? A vertex is a point in 3d space (can also be 2d). These vertices are then bundled in groups of 2s to form lines and/or 3s to form triangles. From 3e775e000d09fdcfd7f75883f56f53c2bfee2f6c Mon Sep 17 00:00:00 2001 From: erwanvivien <44021072+erwanvivien@users.noreply.github.com> Date: Thu, 29 Dec 2022 00:07:15 +0100 Subject: [PATCH 5/5] feat: added link to CompareFunction It adds more insights to what the field are for --- docs/beginner/tutorial8-depth/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/beginner/tutorial8-depth/README.md b/docs/beginner/tutorial8-depth/README.md index e4abca3d..0dca94bb 100644 --- a/docs/beginner/tutorial8-depth/README.md +++ b/docs/beginner/tutorial8-depth/README.md @@ -93,7 +93,7 @@ let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescrip }); ``` -1. The `depth_compare` function tells us when to discard a new pixel. Using `LESS` means pixels will be drawn front to back. Here are all the values you can use. +1. The `depth_compare` function tells us when to discard a new pixel. Using `LESS` means pixels will be drawn front to back. The other possible values for a [CompareFunction](https://docs.rs/wgpu/latest/wgpu/enum.CompareFunction.html) that you can use: ```rust #[repr(C)]