Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deps: Update wgpu from 23 to 24 and thiserror from 1 to 2. #571

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 126 additions & 104 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ arbitrary = { version = "1.4.1", features = ["derive"] }
arrayvec = { version = "0.7.4", default-features = false }
async_fn_traits = { version = "0.1.1", default-features = false }
base64 = { version = "0.22.1", default-features = false }
bitflags = { version = "2.6.0", default-features = false }
bitflags = { version = "2.8.0", default-features = false }
bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] }
bytemuck = { version = "1.19.0", default-features = false, features = ["derive", "must_cast"] }
bytemuck = { version = "1.21.0", default-features = false, features = ["derive", "must_cast"] }
cfg-if = { version = "1.0.0", default-features = false }
# When upgrading clap, beware text output changes causing integration tests to fail.
clap = { version = "4.2.4", default-features = false, features = ["cargo", "deprecated", "derive", "help", "std", "suggestions", "usage", "wrap_help"] }
Expand Down Expand Up @@ -146,7 +146,7 @@ snapbox = "0.6.10" # keep in sync with `trycmd`
strum = { version = "0.26.3", default-features = false, features = ["derive"] }
sync_wrapper = { version = "1.0.0", default-features = false }
tempfile = { version = "3.15.0", default-features = false }
thiserror = { version = "1.0.65", default-features = false }
thiserror = { version = "2.0.11", default-features = false }
time = { version = "0.3.36", default-features = false }
# Tokio is used for async test-running and for certain binaries.
# The library crates do not require Tokio.
Expand All @@ -155,9 +155,9 @@ trycmd = "0.15.4" # keep in sync with `snapbox`
unicode-segmentation = { version = "1.10.1", default-features = false }
unicode-width = { version = "0.2", default-features = false }
# explicitly enabling "std" needed for <https://github.com/rustwasm/wasm-bindgen/issues/4303>
wasm-bindgen-futures = { version = "0.4.46", default-features = false, features = ["std"] }
wasm-bindgen-futures = { version = "0.4.50", default-features = false, features = ["std"] }
web-time = { version = "1.1.0", default-features = false }
wgpu = { version = "23.0.0", default-features = false, features = ["wgsl"] }
wgpu = { version = "24.0.0", default-features = false, features = ["wgsl"] }
yield-progress = { version = "0.1.6", default-features = false }

# Note: Lints are also necessarily redefined in the workspaces other than this one.
Expand Down
2 changes: 2 additions & 0 deletions all-is-cubes-desktop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
//! so that additional development tools can reuse the same UI code. Use at your own risk.
//! Documentation is lacking.

// Increase recursion limit for deeply nested wgpu types
#![recursion_limit = "256"]
// Crate-specific lint settings. (General settings can be found in the workspace manifest.)
#![forbid(unsafe_code)]

Expand Down
6 changes: 3 additions & 3 deletions all-is-cubes-desktop/src/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ pub async fn create_winit_wgpu_desktop_session(
window.window.inner_size(),
));

let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::util::backend_bits_from_env().unwrap_or_else(wgpu::Backends::all),
let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends: wgpu::Backends::from_env().unwrap_or_else(wgpu::Backends::all),
..Default::default()
});

Expand All @@ -215,7 +215,7 @@ pub async fn create_winit_wgpu_desktop_session(
wgpu::util::initialize_adapter_from_env(&instance, Some(&surface));
if adapter.is_none() {
let request_adapter_future = instance.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::util::power_preference_from_env()
power_preference: wgpu::PowerPreference::from_env()
.unwrap_or(wgpu::PowerPreference::HighPerformance),
compatible_surface: Some(&surface),
force_fallback_adapter: false,
Expand Down
2 changes: 1 addition & 1 deletion all-is-cubes-gpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ resource = "0.5.0"
send_wrapper = { workspace = true, features = ["futures"] }
wasm-bindgen-futures = { workspace = true }
# For initializing tests on web. (This is not a dev-dependency because some of said tests are not in this package.)
web-sys = { version = "0.3.73", features = ["OffscreenCanvas"] }
web-sys = { version = "0.3.77", features = ["OffscreenCanvas"] }
web-time = { workspace = true }
wgpu = { workspace = true, optional = true }

Expand Down
1 change: 1 addition & 0 deletions all-is-cubes-gpu/src/in_wgpu/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ fn bloom_mip_view(mip_level: u32, bloom_texture: &wgpu::Texture) -> wgpu::Textur
label: Some(&format!("BloomResources bloom[{mip_level}]")),
format: None,
dimension: None,
usage: None,
aspect: wgpu::TextureAspect::default(),
base_mip_level: mip_level,
mip_level_count: Some(1),
Expand Down
4 changes: 2 additions & 2 deletions all-is-cubes-gpu/src/in_wgpu/frame_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl<In, Out: Copy + Default + bytemuck::Pod> DrawableTexture<In, Out> {
if let Some(texture) = &self.texture {
let full_width = self.local_buffer.size().width;
queue.write_texture(
wgpu::ImageCopyTexture {
wgpu::TexelCopyTextureInfo {
texture,
mip_level: 0,
origin: wgpu::Origin3d {
Expand All @@ -113,7 +113,7 @@ impl<In, Out: Copy + Default + bytemuck::Pod> DrawableTexture<In, Out> {
* dirty_rect.top_left.y as usize
+ dirty_rect.top_left.x as usize..],
),
wgpu::ImageDataLayout {
wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(u32::try_from(size_of::<Out>()).unwrap() * full_width),
rows_per_image: None,
Expand Down
4 changes: 2 additions & 2 deletions all-is-cubes-gpu/src/in_wgpu/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ pub fn write_texture_by_aab<T: Pod, U>(
let size = region.size();

queue.write_texture(
wgpu::ImageCopyTexture {
wgpu::TexelCopyTextureInfo {
texture,
mip_level: 0,
origin: point_to_origin(region.min),
aspect: wgpu::TextureAspect::All,
},
bytemuck::must_cast_slice::<T, u8>(data),
wgpu::ImageDataLayout {
wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(size_of::<T>() as u32 * size.width),
rows_per_image: Some(size.height),
Expand Down
10 changes: 5 additions & 5 deletions all-is-cubes-gpu/src/in_wgpu/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use all_is_cubes_render::{camera, Flaws, Rendering};
#[doc(hidden)]
pub async fn create_instance_for_test_or_exit() -> wgpu::Instance {
let stderr = &mut std::io::stderr();
let backends = wgpu::util::backend_bits_from_env().unwrap_or_else(wgpu::Backends::all);
let backends = wgpu::Backends::from_env().unwrap_or_else(wgpu::Backends::all);

let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends,
..Default::default()
});
Expand Down Expand Up @@ -97,7 +97,7 @@ pub async fn try_create_adapter_for_test(
));
adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::util::power_preference_from_env()
power_preference: wgpu::PowerPreference::from_env()
.unwrap_or(wgpu::PowerPreference::HighPerformance),
compatible_surface: surface.as_ref(),
force_fallback_adapter: false,
Expand Down Expand Up @@ -290,9 +290,9 @@ impl TextureCopyParameters {
device.create_command_encoder(&wgpu::CommandEncoderDescriptor::default());
encoder.copy_texture_to_buffer(
texture.as_image_copy(),
wgpu::ImageCopyBuffer {
wgpu::TexelCopyBufferInfo {
buffer: &temp_buffer,
layout: wgpu::ImageDataLayout {
layout: wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(padded_bytes_per_row),
rows_per_image: Some(self.size.height),
Expand Down
6 changes: 3 additions & 3 deletions all-is-cubes-gpu/src/in_wgpu/light_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,16 @@ impl LightTexture {
// TODO: When compute shaders are available, use a compute shader to do these
// scattered writes instead of issuing individual commands.
encoder.copy_buffer_to_texture(
wgpu::ImageCopyBuffer {
wgpu::TexelCopyBufferInfo {
buffer: &self.copy_buffer,
layout: wgpu::ImageDataLayout {
layout: wgpu::TexelCopyBufferLayout {
offset: (index_in_batch * (LIGHT_CHUNK_VOLUME * Self::COMPONENTS))
as u64,
bytes_per_row: None,
rows_per_image: None,
},
},
wgpu::ImageCopyTexture {
wgpu::TexelCopyTextureInfo {
texture: &self.texture,
mip_level: 0,
origin: point_to_origin(
Expand Down
2 changes: 1 addition & 1 deletion all-is-cubes-gpu/src/in_wgpu/skybox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn compute_skybox(queue: &wgpu::Queue, texture: &wgpu::Texture, sky: &Sky) {
queue.write_texture(
texture.as_image_copy(),
bytemuck::must_cast_slice::<[Component; CHANNELS], u8>(&data[..]),
wgpu::ImageDataLayout {
wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(resolution * (size_of::<Component>() * CHANNELS) as u32),
rows_per_image: Some(resolution),
Expand Down
Loading
Loading