diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index 2daa72ca..5a649412 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -72,6 +72,7 @@ impl State { force_fallback_adapter: false, }, ).await.unwrap(); + } ``` ### Instance and Adapter @@ -187,6 +188,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 { window, surface, @@ -196,8 +200,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. @@ -293,6 +295,8 @@ match event { state.resize(**new_inner_size); } // ... + } + } } ``` 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.