diff --git a/CHANGELOG.md b/CHANGELOG.md index ef4548fa31..0f81b26bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,25 @@ Bottom level categories: ## Unreleased +## 23.0.1 (2024-11-25) + +This release includes patches for `wgpu`, `wgpu-core` and `wgpu-hal`. All other crates remain at [23.0.0](https://github.com/gfx-rs/wgpu/releases/tag/v23.0.0). +Below changes were cherry-picked from 24.0.0 development line. + +### Bug fixes + +#### General + +- Fix Texture view leaks regression. By @xiaopengli89 in [#6576](https://github.com/gfx-rs/wgpu/pull/6576) + +#### Metal + +- Fix surface creation crashing on iOS. By @mockersf in [#6535](https://github.com/gfx-rs/wgpu/pull/6535) + +#### Vulkan + +- Fix surface capabilities being advertised when its query failed. By @wumpf in [#6510](https://github.com/gfx-rs/wgpu/pull/6510) + ## 23.0.0 (2024-10-25) ### Themes of this release diff --git a/Cargo.lock b/Cargo.lock index 8ab3d854b5..97dcaed7f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1739,7 +1739,7 @@ checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] name = "lock-analyzer" -version = "23.0.0" +version = "23.0.1" dependencies = [ "anyhow", "ron", @@ -2271,7 +2271,7 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "player" -version = "23.0.0" +version = "23.0.1" dependencies = [ "env_logger", "log", @@ -3564,7 +3564,7 @@ dependencies = [ [[package]] name = "wgpu" -version = "23.0.0" +version = "23.0.1" dependencies = [ "arrayvec", "cfg_aliases", @@ -3588,7 +3588,7 @@ dependencies = [ [[package]] name = "wgpu-benchmark" -version = "23.0.0" +version = "23.0.1" dependencies = [ "bincode", "bytemuck", @@ -3605,7 +3605,7 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "23.0.0" +version = "23.0.1" dependencies = [ "arrayvec", "bit-vec", @@ -3631,7 +3631,7 @@ dependencies = [ [[package]] name = "wgpu-examples" -version = "23.0.0" +version = "23.0.1" dependencies = [ "bytemuck", "cfg-if", @@ -3662,7 +3662,7 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "23.0.0" +version = "23.0.1" dependencies = [ "android_system_properties", "arrayvec", @@ -3712,7 +3712,7 @@ dependencies = [ [[package]] name = "wgpu-info" -version = "23.0.0" +version = "23.0.1" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -3725,7 +3725,7 @@ dependencies = [ [[package]] name = "wgpu-macros" -version = "23.0.0" +version = "23.0.1" dependencies = [ "heck 0.5.0", "quote", @@ -3734,7 +3734,7 @@ dependencies = [ [[package]] name = "wgpu-test" -version = "23.0.0" +version = "23.0.1" dependencies = [ "anyhow", "arrayvec", diff --git a/Cargo.toml b/Cargo.toml index 0a5481abfd..96c6a123d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,13 +47,13 @@ keywords = ["graphics"] license = "MIT OR Apache-2.0" homepage = "https://wgpu.rs/" repository = "https://github.com/gfx-rs/wgpu" -version = "23.0.0" +version = "23.0.1" authors = ["gfx-rs developers"] [workspace.dependencies.wgc] package = "wgpu-core" path = "./wgpu-core" -version = "23.0.0" +version = "23.0.1" [workspace.dependencies.wgt] package = "wgpu-types" @@ -63,7 +63,7 @@ version = "23.0.0" [workspace.dependencies.hal] package = "wgpu-hal" path = "./wgpu-hal" -version = "23.0.0" +version = "23.0.1" [workspace.dependencies.naga] path = "./naga" @@ -126,8 +126,8 @@ static_assertions = "1.1.0" strum = { version = "0.25.0", features = ["derive"] } tracy-client = "0.17" thiserror = "1.0.65" -wgpu = { version = "23.0.0", path = "./wgpu", default-features = false } -wgpu-core = { version = "23.0.0", path = "./wgpu-core" } +wgpu = { version = "23.0.1", path = "./wgpu", default-features = false } +wgpu-core = { version = "23.0.1", path = "./wgpu-core" } wgpu-macros = { version = "23.0.0", path = "./wgpu-macros" } wgpu-test = { version = "23.0.0", path = "./tests" } wgpu-types = { version = "23.0.0", path = "./wgpu-types" } diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 5906aeb339..34bb25fc87 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu-core" -version = "23.0.0" +version = "23.0.1" authors = ["gfx-rs developers"] edition = "2021" description = "WebGPU core logic on wgpu-hal" diff --git a/wgpu-core/src/weak_vec.rs b/wgpu-core/src/weak_vec.rs index b645cc714d..f6034c6e90 100644 --- a/wgpu-core/src/weak_vec.rs +++ b/wgpu-core/src/weak_vec.rs @@ -47,7 +47,7 @@ impl WeakVec { } if let Some(i) = self.empty_slots.pop() { self.inner[i] = Some(value); - self.scan_slots_on_next_push = false; + self.scan_slots_on_next_push = self.empty_slots.is_empty(); } else { self.inner.push(Some(value)); self.scan_slots_on_next_push = self.inner.len() == self.inner.capacity(); diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 35e85f45da..e4a2943af1 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu-hal" -version = "23.0.0" +version = "23.0.1" authors = ["gfx-rs developers"] edition = "2021" description = "WebGPU hardware abstraction layer" diff --git a/wgpu-hal/src/metal/surface.rs b/wgpu-hal/src/metal/surface.rs index 668b602474..b35c73c910 100644 --- a/wgpu-hal/src/metal/surface.rs +++ b/wgpu-hal/src/metal/surface.rs @@ -1,6 +1,5 @@ #![allow(clippy::let_unit_value)] // `let () =` being used to constrain result type -use std::ffi::c_uint; use std::mem::ManuallyDrop; use std::ptr::NonNull; use std::sync::Once; @@ -207,23 +206,26 @@ impl super::Surface { let new_layer: *mut Object = msg_send![class!(CAMetalLayer), new]; let () = msg_send![root_layer, addSublayer: new_layer]; - // Automatically resize the sublayer's frame to match the - // superlayer's bounds. - // - // Note that there is a somewhat hidden design decision in this: - // We define the `width` and `height` in `configure` to control - // the `drawableSize` of the layer, while `bounds` and `frame` are - // outside of the user's direct control - instead, though, they - // can control the size of the view (or root layer), and get the - // desired effect that way. - // - // We _could_ also let `configure` set the `bounds` size, however - // that would be inconsistent with using the root layer directly - // (as we may do, see above). - let width_sizable = 1 << 1; // kCALayerWidthSizable - let height_sizable = 1 << 4; // kCALayerHeightSizable - let mask: c_uint = width_sizable | height_sizable; - let () = msg_send![new_layer, setAutoresizingMask: mask]; + #[cfg(target_os = "macos")] + { + // Automatically resize the sublayer's frame to match the + // superlayer's bounds. + // + // Note that there is a somewhat hidden design decision in this: + // We define the `width` and `height` in `configure` to control + // the `drawableSize` of the layer, while `bounds` and `frame` are + // outside of the user's direct control - instead, though, they + // can control the size of the view (or root layer), and get the + // desired effect that way. + // + // We _could_ also let `configure` set the `bounds` size, however + // that would be inconsistent with using the root layer directly + // (as we may do, see above). + let width_sizable = 1 << 1; // kCALayerWidthSizable + let height_sizable = 1 << 4; // kCALayerHeightSizable + let mask: std::ffi::c_uint = width_sizable | height_sizable; + let () = msg_send![new_layer, setAutoresizingMask: mask]; + } // Specify the relative size that the auto resizing mask above // will keep (i.e. tell it to fill out its superlayer). diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index 6d15492f4c..14fd86a5da 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -2254,7 +2254,8 @@ impl crate::Adapter for super::Adapter { Ok(present_modes) => present_modes, Err(e) => { log::error!("get_physical_device_surface_present_modes: {}", e); - Vec::new() + // Per definition of `SurfaceCapabilities`, there must be at least one present mode. + return None; } } }; @@ -2269,7 +2270,8 @@ impl crate::Adapter for super::Adapter { Ok(formats) => formats, Err(e) => { log::error!("get_physical_device_surface_formats: {}", e); - Vec::new() + // Per definition of `SurfaceCapabilities`, there must be at least one present format. + return None; } } }; diff --git a/wgpu/src/backend/wgpu_core.rs b/wgpu/src/backend/wgpu_core.rs index 652df388ff..ff84b5b683 100644 --- a/wgpu/src/backend/wgpu_core.rs +++ b/wgpu/src/backend/wgpu_core.rs @@ -702,10 +702,7 @@ impl crate::Context for ContextWgpuCore { .surface_get_capabilities(surface_data.id, *adapter_data) { Ok(caps) => caps, - Err(wgc::instance::GetSurfaceSupportError::Unsupported) => { - wgt::SurfaceCapabilities::default() - } - Err(err) => self.handle_error_fatal(err, "Surface::get_supported_formats"), + Err(_) => wgt::SurfaceCapabilities::default(), } }