Skip to content

Commit

Permalink
Merge pull request #564 from sotrh/22.0
Browse files Browse the repository at this point in the history
update to 22.0
  • Loading branch information
sotrh authored Jul 20, 2024
2 parents 8ff619b + ac0f7cd commit 2129ad0
Show file tree
Hide file tree
Showing 100 changed files with 526 additions and 817 deletions.
File renamed without changes.
850 changes: 137 additions & 713 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ members = [
]
exclude = [
"code/showcase/imgui-demo",
#"code/showcase/pong",
"code/showcase/pong",
]
4 changes: 2 additions & 2 deletions code/beginner/tutorial1-window/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ cfg-if = "1"
winit = { version = "0.29", features = ["rwh_05"] }
env_logger = "0.10"
log = "0.4"
wgpu = "0.19"
wgpu = "22.0"
pollster = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "1.0"
wgpu = { version = "0.19", features = ["webgl"]}
wgpu = { version = "22.0", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4.30"
web-sys = { version = "0.3.69", features = [
Expand Down
4 changes: 2 additions & 2 deletions code/beginner/tutorial2-surface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ cfg-if = "1"
winit = { version = "0.29", features = ["rwh_05"] }
env_logger = "0.10"
log = "0.4"
wgpu = "0.19.3"
wgpu = "22.0"
pollster = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "1.0"
wgpu = { version = "0.19", features = ["webgl"]}
wgpu = { version = "22.0", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
Expand Down
1 change: 1 addition & 0 deletions code/beginner/tutorial2-surface/src/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
None, // Trace path
)
Expand Down
1 change: 1 addition & 0 deletions code/beginner/tutorial2-surface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
// Some(&std::path::Path::new("trace")), // Trace path
None,
Expand Down
4 changes: 2 additions & 2 deletions code/beginner/tutorial3-pipeline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ cfg-if = "1"
winit = { version = "0.29", features = ["rwh_05"] }
env_logger = "0.10"
log = "0.4"
wgpu = "0.19"
wgpu = "22.0"
pollster = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "1.0"
wgpu = { version = "0.19", features = ["webgl"]}
wgpu = { version = "22.0", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
Expand Down
8 changes: 8 additions & 0 deletions code/beginner/tutorial3-pipeline/src/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
None, // Trace path
)
Expand Down Expand Up @@ -102,6 +103,7 @@ impl<'a> State<'a> {
module: &shader,
entry_point: "vs_main",
buffers: &[],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -114,6 +116,7 @@ impl<'a> State<'a> {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -137,6 +140,8 @@ impl<'a> State<'a> {
// If the pipeline will be used with a multiview render pass, this
// indicates how many array layers the attachments will have.
multiview: None,
// Useful for optimizing shader compilation on Android
cache: None,
});

let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
Expand All @@ -152,6 +157,7 @@ impl<'a> State<'a> {
module: &shader,
entry_point: "vs_main",
buffers: &[],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -161,6 +167,7 @@ impl<'a> State<'a> {
blend: Some(wgpu::BlendState::REPLACE),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -180,6 +187,7 @@ impl<'a> State<'a> {
// If the pipeline will be used with a multiview render pass, this
// indicates how many array layers the attachments will have.
multiview: None,
cache: None,
});

let use_color = true;
Expand Down
5 changes: 5 additions & 0 deletions code/beginner/tutorial3-pipeline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
None, // Trace path
)
Expand Down Expand Up @@ -104,6 +105,7 @@ impl<'a> State<'a> {
module: &shader,
entry_point: "vs_main",
buffers: &[],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -116,6 +118,7 @@ impl<'a> State<'a> {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -139,6 +142,8 @@ impl<'a> State<'a> {
// If the pipeline will be used with a multiview render pass, this
// indicates how many array layers the attachments will have.
multiview: None,
// Useful for optimizing shader compilation on Android
cache: None,
});

Self {
Expand Down
6 changes: 3 additions & 3 deletions code/beginner/tutorial4-buffer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
cfg-if = "1"
winit = { version = "0.29", features = ["rwh_05"] }
wgpu = "0.19"
wgpu = "22.0"
env_logger = "0.10"
log = "0.4"
pollster = "0.3"
# NEW!
bytemuck = { version = "1.12", features = [ "derive" ] }
bytemuck = { version = "1.16", features = [ "derive" ] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "1.0"
wgpu = { version = "0.19", features = ["webgl"]}
wgpu = { version = "22.0", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
Expand Down
5 changes: 5 additions & 0 deletions code/beginner/tutorial4-buffer/src/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
None, // Trace path
)
Expand Down Expand Up @@ -169,6 +170,7 @@ impl<'a> State<'a> {
module: &shader,
entry_point: "vs_main",
buffers: &[Vertex::desc()],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -181,6 +183,7 @@ impl<'a> State<'a> {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -204,6 +207,8 @@ impl<'a> State<'a> {
// If the pipeline will be used with a multiview render pass, this
// indicates how many array layers the attachments will have.
multiview: None,
// Useful for optimizing shader compilation on Android
cache: None,
});

let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
Expand Down
5 changes: 5 additions & 0 deletions code/beginner/tutorial4-buffer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
None, // Trace path
)
Expand Down Expand Up @@ -165,6 +166,7 @@ impl<'a> State<'a> {
module: &shader,
entry_point: "vs_main",
buffers: &[Vertex::desc()],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -177,6 +179,7 @@ impl<'a> State<'a> {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -200,6 +203,8 @@ impl<'a> State<'a> {
// If the pipeline will be used with a multiview render pass, this
// indicates how many array layers the attachments will have.
multiview: None,
// Useful for optimizing shader compilation on Android
cache: None,
});

let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
Expand Down
6 changes: 3 additions & 3 deletions code/beginner/tutorial5-textures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
cfg-if = "1"
anyhow = "1.0"
bytemuck = { version = "1.12", features = [ "derive" ] }
bytemuck = { version = "1.16", features = [ "derive" ] }
env_logger = "0.10"
log = "0.4"
pollster = "0.3"
wgpu = "0.19"
wgpu = "22.0"
winit = { version = "0.29", features = ["rwh_05"] }

[dependencies.image]
Expand All @@ -25,7 +25,7 @@ features = ["png", "jpeg"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "1.0"
wgpu = { version = "0.19", features = ["webgl"]}
wgpu = { version = "22.0", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
Expand Down
5 changes: 5 additions & 0 deletions code/beginner/tutorial5-textures/src/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
None, // Trace path
)
Expand Down Expand Up @@ -232,6 +233,7 @@ impl<'a> State<'a> {
module: &shader,
entry_point: "vs_main",
buffers: &[Vertex::desc()],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -244,6 +246,7 @@ impl<'a> State<'a> {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -267,6 +270,8 @@ impl<'a> State<'a> {
// If the pipeline will be used with a multiview render pass, this
// indicates how many array layers the attachments will have.
multiview: None,
// Useful for optimizing shader compilation on Android
cache: None,
});

let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
Expand Down
5 changes: 5 additions & 0 deletions code/beginner/tutorial5-textures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl<'a> State<'a> {
} else {
wgpu::Limits::default()
},
memory_hints: Default::default(),
},
None, // Trace path
)
Expand Down Expand Up @@ -208,6 +209,7 @@ impl<'a> State<'a> {
module: &shader,
entry_point: "vs_main",
buffers: &[Vertex::desc()],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -220,6 +222,7 @@ impl<'a> State<'a> {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -243,6 +246,8 @@ impl<'a> State<'a> {
// If the pipeline will be used with a multiview render pass, this
// indicates how many array layers the attachments will have.
multiview: None,
// Useful for optimizing shader compilation on Android
cache: None,
});

let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
Expand Down
1 change: 1 addition & 0 deletions code/beginner/tutorial5-textures/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use anyhow::*;
use image::GenericImageView;

pub struct Texture {
#[allow(unused)]
pub texture: wgpu::Texture,
pub view: wgpu::TextureView,
pub sampler: wgpu::Sampler,
Expand Down
6 changes: 3 additions & 3 deletions code/beginner/tutorial6-uniforms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
cfg-if = "1"
anyhow = "1.0"
bytemuck = { version = "1.12", features = [ "derive" ] }
bytemuck = { version = "1.16", features = [ "derive" ] }
cgmath = "0.18"
env_logger = "0.10"
log = "0.4"
pollster = "0.3"
wgpu = "0.19"
wgpu = "22.0"
winit = { version = "0.29", features = ["rwh_05"] }

[dependencies.image]
Expand All @@ -26,7 +26,7 @@ features = ["png", "jpeg"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "1.0"
wgpu = { version = "0.19", features = ["webgl"]}
wgpu = { version = "22.0", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
Expand Down
Loading

0 comments on commit 2129ad0

Please sign in to comment.