diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index 6a11fcb0..c16a5d9f 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -215,12 +215,12 @@ Now that we've configured our surface properly, we can add these new fields at t // ... Self { - window, surface, device, queue, config, size, + window, } } ``` diff --git a/docs/beginner/tutorial3-pipeline/README.md b/docs/beginner/tutorial3-pipeline/README.md index 7ff49ddd..0e1733e9 100644 --- a/docs/beginner/tutorial3-pipeline/README.md +++ b/docs/beginner/tutorial3-pipeline/README.md @@ -167,6 +167,7 @@ struct State<'a> { queue: wgpu::Queue, config: wgpu::SurfaceConfiguration, size: winit::dpi::PhysicalSize, + window: &'a Window, // NEW! render_pipeline: wgpu::RenderPipeline, } @@ -288,6 +289,7 @@ Self { queue, config, size, + window, // NEW! render_pipeline, } diff --git a/docs/beginner/tutorial4-buffer/README.md b/docs/beginner/tutorial4-buffer/README.md index 7ddbe01c..a0047879 100644 --- a/docs/beginner/tutorial4-buffer/README.md +++ b/docs/beginner/tutorial4-buffer/README.md @@ -110,6 +110,7 @@ Self { queue, config, size, + window, render_pipeline, vertex_buffer, } @@ -261,6 +262,8 @@ impl<'a> State<'a> { device, queue, config, + size, + window, render_pipeline, vertex_buffer, num_vertices, @@ -389,6 +392,7 @@ struct State<'a> { queue: wgpu::Queue, config: wgpu::SurfaceConfiguration, size: winit::dpi::PhysicalSize, + window: &'a Window, render_pipeline: wgpu::RenderPipeline, vertex_buffer: wgpu::Buffer, // NEW! @@ -406,6 +410,7 @@ Self { queue, config, size, + window, render_pipeline, vertex_buffer, // NEW! diff --git a/docs/beginner/tutorial5-textures/README.md b/docs/beginner/tutorial5-textures/README.md index 86e02730..75a2aa42 100644 --- a/docs/beginner/tutorial5-textures/README.md +++ b/docs/beginner/tutorial5-textures/README.md @@ -49,12 +49,12 @@ Now, let's create the `Texture`: let texture_size = wgpu::Extent3d { width: dimensions.0, height: dimensions.1, + // All textures are stored as 3D, we represent our 2D texture + // by setting depth to 1. depth_or_array_layers: 1, }; let diffuse_texture = device.create_texture( &wgpu::TextureDescriptor { - // All textures are stored as 3D, we represent our 2D texture - // by setting depth to 1. size: texture_size, mip_level_count: 1, // We'll talk about this a little later sample_count: 1, @@ -248,6 +248,7 @@ struct State<'a> { queue: wgpu::Queue, config: wgpu::SurfaceConfiguration, size: winit::dpi::PhysicalSize, + window: &'a wgpu::Window, render_pipeline: wgpu::RenderPipeline, vertex_buffer: wgpu::Buffer, index_buffer: wgpu::Buffer, @@ -268,6 +269,7 @@ impl<'a> State<'a> { queue, config, size, + window, render_pipeline, vertex_buffer, index_buffer, @@ -534,7 +536,7 @@ impl Texture { ..Default::default() } ); - + Ok(Self { texture, view, sampler }) } }