Skip to content

Commit

Permalink
fix missing field window
Browse files Browse the repository at this point in the history
  • Loading branch information
yzx9 committed Oct 1, 2024
1 parent ad3d08b commit 18f93a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/beginner/tutorial2-surface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
```
Expand Down
2 changes: 2 additions & 0 deletions docs/beginner/tutorial3-pipeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ struct State<'a> {
queue: wgpu::Queue,
config: wgpu::SurfaceConfiguration,
size: winit::dpi::PhysicalSize<u32>,
window: &'a Window,
// NEW!
render_pipeline: wgpu::RenderPipeline,
}
Expand Down Expand Up @@ -288,6 +289,7 @@ Self {
queue,
config,
size,
window,
// NEW!
render_pipeline,
}
Expand Down
5 changes: 5 additions & 0 deletions docs/beginner/tutorial4-buffer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Self {
queue,
config,
size,
window,
render_pipeline,
vertex_buffer,
}
Expand Down Expand Up @@ -261,6 +262,8 @@ impl<'a> State<'a> {
device,
queue,
config,
size,
window,
render_pipeline,
vertex_buffer,
num_vertices,
Expand Down Expand Up @@ -389,6 +392,7 @@ struct State<'a> {
queue: wgpu::Queue,
config: wgpu::SurfaceConfiguration,
size: winit::dpi::PhysicalSize<u32>,
window: &'a Window,
render_pipeline: wgpu::RenderPipeline,
vertex_buffer: wgpu::Buffer,
// NEW!
Expand All @@ -406,6 +410,7 @@ Self {
queue,
config,
size,
window,
render_pipeline,
vertex_buffer,
// NEW!
Expand Down
8 changes: 5 additions & 3 deletions docs/beginner/tutorial5-textures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -248,6 +248,7 @@ struct State<'a> {
queue: wgpu::Queue,
config: wgpu::SurfaceConfiguration,
size: winit::dpi::PhysicalSize<u32>,
window: &'a wgpu::Window,
render_pipeline: wgpu::RenderPipeline,
vertex_buffer: wgpu::Buffer,
index_buffer: wgpu::Buffer,
Expand All @@ -268,6 +269,7 @@ impl<'a> State<'a> {
queue,
config,
size,
window,
render_pipeline,
vertex_buffer,
index_buffer,
Expand Down Expand Up @@ -534,7 +536,7 @@ impl Texture {
..Default::default()
}
);

Ok(Self { texture, view, sampler })
}
}
Expand Down

0 comments on commit 18f93a9

Please sign in to comment.