From 4752a20db31bbb9f3bec2117d86b67831eb67031 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 29 Sep 2025 10:56:42 +0200 Subject: [PATCH 1/3] [d3d12 wgl] Upgrade to `windows 0.59` crates https://github.com/microsoft/windows-rs/releases/tag/0.61.0 The latest `windows 0.59` and `windows-core 0.59` crates were just released (strangely tagged `0.61`), including some minor code improvements for us. The MSRV has been bumped to `1.74`, but `wgpu` is already on `1.76` anyway. --- .deny.toml | 15 +++---- .github/workflows/ci.yml | 1 + Cargo.lock | 72 +++++++++++------------------- Cargo.toml | 12 ++--- wgpu-hal/src/dx12/command.rs | 27 ++++------- wgpu-hal/src/dx12/dcomp.rs | 6 ++- wgpu-hal/src/dx12/device.rs | 2 +- wgpu-hal/src/dx12/mod.rs | 2 +- wgpu-hal/src/dx12/suballocation.rs | 5 ++- wgpu-hal/src/gles/wgl.rs | 12 ++--- 10 files changed, 64 insertions(+), 90 deletions(-) diff --git a/.deny.toml b/.deny.toml index fd4fb3a8a1..b5af633547 100644 --- a/.deny.toml +++ b/.deny.toml @@ -22,13 +22,11 @@ skip = [ # Deno uses an old version { name = "which", version = "6.0.3" }, - # Loom uses a new windows version - { name = "windows", version = "0.61.1" }, - { name = "windows-core", version = "0.61.2" }, - { name = "windows-implement", version = "0.60.0" }, - { name = "windows-interface", version = "0.59.1" }, - { name = "windows-result", version = "0.3.4" }, - { name = "windows-strings", version = "0.4.2" }, + # Temporarily allow older Windows version until updates make it through + { name = "windows", version = "0.59" }, + { name = "windows-core", version = "0.59" }, + { name = "windows-implement", version = "0.59" }, + { name = "windows-strings", version = "0.3" }, # cargo-metadata uses old version. Only used for infrastructure. { name = "toml", version = "0.8.23" }, @@ -76,6 +74,3 @@ allow-git = [ unknown-registry = "deny" unknown-git = "deny" required-git-spec = "rev" - -[sources.allow-org] -github = ["gfx-rs"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38c2eef7ec..f27b5e59f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -746,6 +746,7 @@ jobs: with: command: check advisories arguments: --all-features --workspace + command-arguments: -Dwarnings rust-version: ${{ env.REPO_MSRV }} cargo-deny-check-rest: diff --git a/Cargo.lock b/Cargo.lock index 7ccdeeccbe..0e589b7f39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1861,14 +1861,15 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795" dependencies = [ + "hashbrown 0.16.0", "log", "presser", - "thiserror 1.0.69", - "windows 0.58.0", + "thiserror 2.0.16", + "windows 0.59.0", ] [[package]] @@ -1931,6 +1932,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" dependencies = [ + "allocator-api2", + "equivalent", "foldhash 0.2.0", "serde", ] @@ -5096,8 +5099,8 @@ dependencies = [ "wasm-bindgen", "web-sys", "wgpu-types", - "windows 0.58.0", - "windows-core 0.58.0", + "windows 0.59.0", + "windows-core 0.59.0", "winit 0.29.15", ] @@ -5247,12 +5250,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.58.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", + "windows-core 0.59.0", + "windows-targets 0.53.3", ] [[package]] @@ -5279,15 +5282,15 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.58.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", + "windows-implement 0.59.0", + "windows-interface", + "windows-result", + "windows-strings 0.3.1", + "windows-targets 0.53.3", ] [[package]] @@ -5297,9 +5300,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ "windows-implement 0.60.0", - "windows-interface 0.59.1", + "windows-interface", "windows-link 0.1.3", - "windows-result 0.3.4", + "windows-result", "windows-strings 0.4.2", ] @@ -5316,9 +5319,9 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.58.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" dependencies = [ "proc-macro2", "quote", @@ -5336,17 +5339,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-interface" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-interface" version = "0.59.1" @@ -5380,15 +5372,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.3.4" @@ -5400,12 +5383,11 @@ dependencies = [ [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", + "windows-link 0.1.3", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bd58ec379e..f99bda2186 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,7 +135,7 @@ indicatif = "0.18" itertools = { version = "0.14" } jobserver = "0.1" ktx2 = "0.4" -libc = { version = "0.2.171", default-features = false } +libc = { version = "0.2.172", default-features = false } # See https://github.com/rust-fuzz/libfuzzer/issues/126 libfuzzer-sys = ">0.4.0,<=0.4.7" libloading = "0.8" @@ -210,10 +210,12 @@ gpu-alloc = "0.6" gpu-descriptor = "0.3.2" # DX12 dependencies -gpu-allocator = { version = "0.27", default-features = false } +gpu-allocator = { version = "0.28", default-features = false, features = [ + "hashbrown", +] } range-alloc = "0.1" mach-dxcompiler-rs = { version = "0.1.4", default-features = false } # remember to increase max_shader_model if applicable -windows-core = { version = "0.58", default-features = false } +windows-core = { version = "0.59", default-features = false } # Gles dependencies khronos-egl = "6" @@ -223,7 +225,7 @@ glutin-winit = { version = "0.4", default-features = false } glutin_wgl_sys = "0.6" # DX12 and GLES dependencies -windows = { version = "0.58", default-features = false } +windows = { version = "0.59", default-features = false } # wasm32 dependencies console_error_panic_hook = "0.1.5" @@ -245,7 +247,7 @@ deno_webidl = "0.214.0" deno_webgpu = { version = "0.181.0", path = "./deno_webgpu" } deno_unsync = "0.4.4" deno_error = "0.7.0" -tokio = "1.45.1" +tokio = "1.47" termcolor = "1.1.3" # android dependencies diff --git a/wgpu-hal/src/dx12/command.rs b/wgpu-hal/src/dx12/command.rs index 19b06867f8..cc09e729a5 100644 --- a/wgpu-hal/src/dx12/command.rs +++ b/wgpu-hal/src/dx12/command.rs @@ -1,17 +1,19 @@ use alloc::vec::Vec; use core::{mem, ops::Range}; -use windows::Win32::{ - Foundation, - Graphics::{Direct3D12, Dxgi}, +use windows::{ + core::Interface as _, + Win32::{ + Foundation, + Graphics::{Direct3D12, Dxgi}, + }, }; -use windows_core::Interface; use super::conv; use crate::{ auxil::{ self, - dxgi::{name::ObjectExt, result::HResult as _}, + dxgi::{name::ObjectExt as _, result::HResult as _}, }, dx12::borrow_interface_temporarily, AccelerationStructureEntries, @@ -864,23 +866,12 @@ impl crate::CommandEncoder for super::CommandEncoder { if let Some(ds_view) = ds_view { if flags != Direct3D12::D3D12_CLEAR_FLAGS::default() { unsafe { - // list.ClearDepthStencilView( - // ds_view, - // flags, - // ds.clear_value.0, - // ds.clear_value.1 as u8, - // None, - // ) - // TODO: Replace with the above in the next breaking windows-rs release, - // when https://github.com/microsoft/win32metadata/pull/1971 is in. - (Interface::vtable(list).ClearDepthStencilView)( - Interface::as_raw(list), + list.ClearDepthStencilView( ds_view, flags, ds.clear_value.0, ds.clear_value.1 as u8, - 0, - core::ptr::null(), + None, ) } } diff --git a/wgpu-hal/src/dx12/dcomp.rs b/wgpu-hal/src/dx12/dcomp.rs index e99849a6dc..46ef3da4d0 100644 --- a/wgpu-hal/src/dx12/dcomp.rs +++ b/wgpu-hal/src/dx12/dcomp.rs @@ -2,8 +2,10 @@ use alloc::sync::Arc; use core::{ffi, ptr}; use once_cell::sync::Lazy; -use windows::Win32::{Foundation::HWND, Graphics::DirectComposition}; -use windows_core::Interface; +use windows::{ + core::Interface as _, + Win32::{Foundation::HWND, Graphics::DirectComposition}, +}; use super::DynLib; diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index a135478e38..33d3044f0f 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -23,7 +23,7 @@ use super::{conv, descriptor, D3D12Lib}; use crate::{ auxil::{ self, - dxgi::{name::ObjectExt, result::HResult}, + dxgi::{name::ObjectExt as _, result::HResult as _}, }, dx12::{ borrow_optional_interface_temporarily, shader_compilation, suballocation, DCompLib, diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index 981409192c..5330be616a 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -1330,7 +1330,7 @@ impl crate::Surface for Surface { .ok_or(crate::SurfaceError::Other("IDXGIFactoryMedia not found"))? .CreateSwapChainForCompositionSurfaceHandle( &device.present_queue, - handle, + Some(handle), &desc, None, ) diff --git a/wgpu-hal/src/dx12/suballocation.rs b/wgpu-hal/src/dx12/suballocation.rs index 8cee410230..9d6c988b4d 100644 --- a/wgpu-hal/src/dx12/suballocation.rs +++ b/wgpu-hal/src/dx12/suballocation.rs @@ -1,10 +1,11 @@ use alloc::sync::Arc; + use gpu_allocator::{d3d12::AllocationCreateDesc, MemoryLocation}; use parking_lot::Mutex; use windows::Win32::Graphics::{Direct3D12, Dxgi}; use crate::{ - auxil::dxgi::{name::ObjectExt, result::HResult as _}, + auxil::dxgi::{name::ObjectExt as _, result::HResult as _}, dx12::conv, }; @@ -143,7 +144,7 @@ impl Allocator { allocations, blocks, total_allocated_bytes: upstream.total_allocated_bytes, - total_reserved_bytes: upstream.total_reserved_bytes, + total_reserved_bytes: upstream.total_capacity_bytes, } } } diff --git a/wgpu-hal/src/gles/wgl.rs b/wgpu-hal/src/gles/wgl.rs index 6a4c3863bb..bc8c38f12a 100644 --- a/wgpu-hal/src/gles/wgl.rs +++ b/wgpu-hal/src/gles/wgl.rs @@ -128,7 +128,7 @@ impl WglContext { if unsafe { OpenGL::wglGetCurrentContext() }.is_invalid() { return Ok(()); } - unsafe { OpenGL::wglMakeCurrent(None, None) } + unsafe { OpenGL::wglMakeCurrent(Default::default(), Default::default()) } } } @@ -382,7 +382,7 @@ fn create_instance_device() -> Result { 1, None, None, - instance, + Some(instance.into()), None, ) } @@ -394,7 +394,7 @@ fn create_instance_device() -> Result { })?; let window = Window { window }; - let dc = unsafe { Gdi::GetDC(window.window) }; + let dc = unsafe { Gdi::GetDC(Some(window.window)) }; if dc.is_invalid() { return Err(crate::InstanceError::with_source( String::from("unable to create memory device"), @@ -636,7 +636,7 @@ struct DeviceContextHandle { impl Drop for DeviceContextHandle { fn drop(&mut self) { unsafe { - Gdi::ReleaseDC(self.window, self.device); + Gdi::ReleaseDC(Some(self.window), self.device); }; } } @@ -672,7 +672,7 @@ impl Surface { ) -> Result<(), crate::SurfaceError> { let swapchain = self.swapchain.read(); let sc = swapchain.as_ref().unwrap(); - let dc = unsafe { Gdi::GetDC(self.window) }; + let dc = unsafe { Gdi::GetDC(Some(self.window)) }; if dc.is_invalid() { log::error!( "unable to get the device context from window: {}", @@ -750,7 +750,7 @@ impl crate::Surface for Surface { // Remove the old configuration. unsafe { self.unconfigure(device) }; - let dc = unsafe { Gdi::GetDC(self.window) }; + let dc = unsafe { Gdi::GetDC(Some(self.window)) }; if dc.is_invalid() { log::error!( "unable to get the device context from window: {}", From db85afa1537eeb1b6d29780dc4fc9a100e8fe118 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 27 Jul 2025 23:21:57 +0200 Subject: [PATCH 2/3] [d3d12 wgl] Upgrade to `windows 0.61` crates https://github.com/microsoft/windows-rs/releases/tag/63 --- Cargo.lock | 63 ++++++------------------------------- Cargo.toml | 4 +-- wgpu-hal/src/dx12/device.rs | 6 ++-- wgpu-hal/src/dx12/mod.rs | 2 +- wgpu-types/src/counters.rs | 1 + 5 files changed, 17 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e589b7f39..96b31461ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1692,7 +1692,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows 0.61.3", + "windows", ] [[package]] @@ -1869,7 +1869,7 @@ dependencies = [ "log", "presser", "thiserror 2.0.16", - "windows 0.59.0", + "windows", ] [[package]] @@ -5099,8 +5099,8 @@ dependencies = [ "wasm-bindgen", "web-sys", "wgpu-types", - "windows 0.59.0", - "windows-core 0.59.0", + "windows", + "windows-core", "winit 0.29.15", ] @@ -5248,16 +5248,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" -dependencies = [ - "windows-core 0.59.0", - "windows-targets 0.53.3", -] - [[package]] name = "windows" version = "0.61.3" @@ -5265,7 +5255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ "windows-collections", - "windows-core 0.61.2", + "windows-core", "windows-future", "windows-link 0.1.3", "windows-numerics", @@ -5277,20 +5267,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" -dependencies = [ - "windows-implement 0.59.0", - "windows-interface", - "windows-result", - "windows-strings 0.3.1", - "windows-targets 0.53.3", + "windows-core", ] [[package]] @@ -5299,11 +5276,11 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.0", + "windows-implement", "windows-interface", "windows-link 0.1.3", "windows-result", - "windows-strings 0.4.2", + "windows-strings", ] [[package]] @@ -5312,22 +5289,11 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link 0.1.3", "windows-threading", ] -[[package]] -name = "windows-implement" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-implement" version = "0.60.0" @@ -5368,7 +5334,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link 0.1.3", ] @@ -5381,15 +5347,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[package]] -name = "windows-strings" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows-strings" version = "0.4.2" diff --git a/Cargo.toml b/Cargo.toml index f99bda2186..86a169191e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -215,7 +215,7 @@ gpu-allocator = { version = "0.28", default-features = false, features = [ ] } range-alloc = "0.1" mach-dxcompiler-rs = { version = "0.1.4", default-features = false } # remember to increase max_shader_model if applicable -windows-core = { version = "0.59", default-features = false } +windows-core = { version = "0.61", default-features = false } # Gles dependencies khronos-egl = "6" @@ -225,7 +225,7 @@ glutin-winit = { version = "0.4", default-features = false } glutin_wgl_sys = "0.6" # DX12 and GLES dependencies -windows = { version = "0.59", default-features = false } +windows = { version = "0.61", default-features = false } # wasm32 dependencies console_error_panic_hook = "0.1.5" diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index 33d3044f0f..df50db3212 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -1875,8 +1875,8 @@ impl crate::Device for super::Device { DepthBias: bias.constant, DepthBiasClamp: bias.clamp, SlopeScaledDepthBias: bias.slope_scale, - DepthClipEnable: Foundation::BOOL::from(!desc.primitive.unclipped_depth), - MultisampleEnable: Foundation::BOOL::from(desc.multisample.count > 1), + DepthClipEnable: windows_core::BOOL::from(!desc.primitive.unclipped_depth), + MultisampleEnable: windows_core::BOOL::from(desc.multisample.count > 1), ForcedSampleCount: 0, AntialiasedLineEnable: false.into(), ConservativeRaster: if desc.primitive.conservative { @@ -1905,7 +1905,7 @@ impl crate::Device for super::Device { RasterizedStream: 0, }; let blend_state = Direct3D12::D3D12_BLEND_DESC { - AlphaToCoverageEnable: Foundation::BOOL::from( + AlphaToCoverageEnable: windows_core::BOOL::from( desc.multisample.alpha_to_coverage_enabled, ), IndependentBlendEnable: true.into(), diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index 5330be616a..1c0c5a3b8b 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -93,7 +93,7 @@ use hashbrown::HashMap; use parking_lot::{Mutex, RwLock}; use suballocation::Allocator; use windows::{ - core::{Free, Interface}, + core::{Free as _, Interface}, Win32::{ Foundation, Graphics::{Direct3D, Direct3D12, DirectComposition, Dxgi}, diff --git a/wgpu-types/src/counters.rs b/wgpu-types/src/counters.rs index 644cbac7de..a0ee6a4584 100644 --- a/wgpu-types/src/counters.rs +++ b/wgpu-types/src/counters.rs @@ -181,6 +181,7 @@ pub struct AllocatorReport { /// Sum of the memory used by all allocations, in bytes. pub total_allocated_bytes: u64, /// Sum of the memory reserved by all memory blocks including unallocated regions, in bytes. + // XXX: Rename to total_capacity_bytes following the rename at https://github.com/Traverse-Research/gpu-allocator/pull/266? pub total_reserved_bytes: u64, } From da44f096eb16e3e37b04d741e928753ca0443146 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Tue, 23 Sep 2025 21:17:03 -0400 Subject: [PATCH 3/3] =?UTF-8?q?WIP:=20chore:=20upgrade=20`windows`=200.59.?= =?UTF-8?q?0=20=E2=86=92=200.62.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .deny.toml | 6 --- Cargo.lock | 92 +++++++++++++++++++--------------------- Cargo.toml | 16 ++++++- wgpu-hal/src/gles/wgl.rs | 18 ++++---- 4 files changed, 66 insertions(+), 66 deletions(-) diff --git a/.deny.toml b/.deny.toml index b5af633547..d450cf7d10 100644 --- a/.deny.toml +++ b/.deny.toml @@ -22,12 +22,6 @@ skip = [ # Deno uses an old version { name = "which", version = "6.0.3" }, - # Temporarily allow older Windows version until updates make it through - { name = "windows", version = "0.59" }, - { name = "windows-core", version = "0.59" }, - { name = "windows-implement", version = "0.59" }, - { name = "windows-strings", version = "0.3" }, - # cargo-metadata uses old version. Only used for infrastructure. { name = "toml", version = "0.8.23" }, { name = "ordered-float", version = "2.10.1" }, diff --git a/Cargo.lock b/Cargo.lock index 96b31461ed..7ca8f38b54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,9 +20,9 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" [[package]] name = "addr2line" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ "gimli", ] @@ -142,8 +142,7 @@ dependencies = [ [[package]] name = "anstyle" version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" +source = "git+https://github.com/erichdongubler-contrib/anstyle?rev=c065f776e0190b400cc0afcb0ef4d36fe295dc43#c065f776e0190b400cc0afcb0ef4d36fe295dc43" [[package]] name = "anstyle-parse" @@ -157,21 +156,19 @@ dependencies = [ [[package]] name = "anstyle-query" version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +source = "git+https://github.com/erichdongubler-contrib/anstyle?rev=c065f776e0190b400cc0afcb0ef4d36fe295dc43#c065f776e0190b400cc0afcb0ef4d36fe295dc43" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] name = "anstyle-wincon" version = "3.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +source = "git+https://github.com/erichdongubler-contrib/anstyle?rev=c065f776e0190b400cc0afcb0ef4d36fe295dc43#c065f776e0190b400cc0afcb0ef4d36fe295dc43" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -292,8 +289,7 @@ checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "backtrace" version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +source = "git+https://github.com/rust-lang/backtrace-rs?rev=00105b6b2692cdbc93056d0162a52f5565480240#00105b6b2692cdbc93056d0162a52f5565480240" dependencies = [ "addr2line", "cfg-if", @@ -301,7 +297,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-link 0.2.0", ] [[package]] @@ -1684,25 +1680,23 @@ dependencies = [ [[package]] name = "generator" version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2" +source = "git+https://github.com/Xudong-Huang/generator-rs?rev=6201b45c99b2f41d133e4c5ca1803885d61be732#6201b45c99b2f41d133e4c5ca1803885d61be732" dependencies = [ "cc", "cfg-if", "libc", "log", "rustversion", - "windows", + "windows-link 0.2.0", ] [[package]] name = "gethostname" version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc257fdb4038301ce4b9cd1b3b51704509692bb3ff716a410cbd07925d9dae55" +source = "git+https://github.com/erichdongubler-contrib/gethostname.rs?rev=5cd016032cb925d2396018af7b1f261a8957482e#5cd016032cb925d2396018af7b1f261a8957482e" dependencies = [ "rustix 1.0.8", - "windows-targets 0.52.6", + "windows-link 0.2.0", ] [[package]] @@ -1734,9 +1728,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "gl_generator" @@ -2303,12 +2297,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-targets 0.53.3", + "windows-link 0.2.0", ] [[package]] @@ -3041,9 +3035,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.7" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "memchr", ] @@ -5250,47 +5244,47 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.61.3" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +checksum = "9579d0e6970fd5250aa29aba5994052385ff55cf7b28a059e484bb79ea842e42" dependencies = [ "windows-collections", "windows-core", "windows-future", - "windows-link 0.1.3", + "windows-link 0.2.0", "windows-numerics", ] [[package]] name = "windows-collections" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +checksum = "a90dd7a7b86859ec4cdf864658b311545ef19dbcf17a672b52ab7cefe80c336f" dependencies = [ "windows-core", ] [[package]] name = "windows-core" -version = "0.61.2" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.1.3", + "windows-link 0.2.0", "windows-result", "windows-strings", ] [[package]] name = "windows-future" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +checksum = "b2194dee901458cb79e1148a4e9aac2b164cc95fa431891e7b296ff0b2f1d8a6" dependencies = [ "windows-core", - "windows-link 0.1.3", + "windows-link 0.2.0", "windows-threading", ] @@ -5330,30 +5324,30 @@ checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" [[package]] name = "windows-numerics" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +checksum = "2ce3498fe0aba81e62e477408383196b4b0363db5e0c27646f932676283b43d8" dependencies = [ "windows-core", - "windows-link 0.1.3", + "windows-link 0.2.0", ] [[package]] name = "windows-result" -version = "0.3.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" dependencies = [ - "windows-link 0.1.3", + "windows-link 0.2.0", ] [[package]] name = "windows-strings" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" dependencies = [ - "windows-link 0.1.3", + "windows-link 0.2.0", ] [[package]] @@ -5475,11 +5469,11 @@ dependencies = [ [[package]] name = "windows-threading" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +checksum = "ab47f085ad6932defa48855254c758cdd0e2f2d48e62a34118a268d8f345e118" dependencies = [ - "windows-link 0.1.3", + "windows-link 0.2.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 86a169191e..ca81d566db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -215,7 +215,7 @@ gpu-allocator = { version = "0.28", default-features = false, features = [ ] } range-alloc = "0.1" mach-dxcompiler-rs = { version = "0.1.4", default-features = false } # remember to increase max_shader_model if applicable -windows-core = { version = "0.61", default-features = false } +windows-core = { version = "0.62", default-features = false } # Gles dependencies khronos-egl = "6" @@ -225,7 +225,7 @@ glutin-winit = { version = "0.4", default-features = false } glutin_wgl_sys = "0.6" # DX12 and GLES dependencies -windows = { version = "0.61", default-features = false } +windows = { version = "0.62", default-features = false } # wasm32 dependencies console_error_panic_hook = "0.1.5" @@ -257,6 +257,18 @@ ndk-sys = "0.6" [patch.crates-io] wgpu = { path = "./wgpu" } +# https://github.com/Xudong-Huang/generator-rs/pull/76 +generator = { git = "https://github.com/Xudong-Huang/generator-rs", rev = "6201b45c99b2f41d133e4c5ca1803885d61be732" } + +anstyle = { git = "https://github.com/erichdongubler-contrib/anstyle", rev = "c065f776e0190b400cc0afcb0ef4d36fe295dc43" } +anstyle-query = { git = "https://github.com/erichdongubler-contrib/anstyle", rev = "c065f776e0190b400cc0afcb0ef4d36fe295dc43" } +anstyle-wincon = { git = "https://github.com/erichdongubler-contrib/anstyle", rev = "c065f776e0190b400cc0afcb0ef4d36fe295dc43" } + +# https://github.com/rust-lang/backtrace-rs/pull/727 +backtrace = { git = "https://github.com/rust-lang/backtrace-rs", rev = "00105b6b2692cdbc93056d0162a52f5565480240" } + +gethostname = { git = "https://github.com/erichdongubler-contrib/gethostname.rs", rev = "5cd016032cb925d2396018af7b1f261a8957482e" } + [profile.release] lto = "thin" debug = true diff --git a/wgpu-hal/src/gles/wgl.rs b/wgpu-hal/src/gles/wgl.rs index bc8c38f12a..19490a2a11 100644 --- a/wgpu-hal/src/gles/wgl.rs +++ b/wgpu-hal/src/gles/wgl.rs @@ -226,7 +226,7 @@ unsafe fn setup_pixel_format(dc: Gdi::HDC) -> Result<(), crate::InstanceError> { if index == 0 { return Err(crate::InstanceError::with_source( String::from("unable to choose pixel format"), - Error::from_win32(), + Error::from_thread(), )); } @@ -244,7 +244,7 @@ unsafe fn setup_pixel_format(dc: Gdi::HDC) -> Result<(), crate::InstanceError> { if index == 0 { return Err(crate::InstanceError::with_source( String::from("unable to get pixel format index"), - Error::from_win32(), + Error::from_thread(), )); } let mut format = Default::default(); @@ -254,7 +254,7 @@ unsafe fn setup_pixel_format(dc: Gdi::HDC) -> Result<(), crate::InstanceError> { { return Err(crate::InstanceError::with_source( String::from("unable to read pixel format"), - Error::from_win32(), + Error::from_thread(), )); } @@ -311,7 +311,7 @@ fn create_global_window_class() -> Result { if atom == 0 { return Err(crate::InstanceError::with_source( String::from("unable to register window class"), - Error::from_win32(), + Error::from_thread(), )); } @@ -398,7 +398,7 @@ fn create_instance_device() -> Result { if dc.is_invalid() { return Err(crate::InstanceError::with_source( String::from("unable to create memory device"), - Error::from_win32(), + Error::from_thread(), )); } let dc = DeviceContextHandle { @@ -484,7 +484,7 @@ impl crate::Instance for Instance { if context.is_null() { return Err(crate::InstanceError::with_source( String::from("unable to create OpenGL context"), - Error::from_win32(), + Error::from_thread(), )); } WglContext { @@ -676,7 +676,7 @@ impl Surface { if dc.is_invalid() { log::error!( "unable to get the device context from window: {}", - Error::from_win32() + Error::from_thread() ); return Err(crate::SurfaceError::Other( "unable to get the device context from window", @@ -754,7 +754,7 @@ impl crate::Surface for Surface { if dc.is_invalid() { log::error!( "unable to get the device context from window: {}", - Error::from_win32() + Error::from_thread() ); return Err(crate::SurfaceError::Other( "unable to get the device context from window", @@ -828,7 +828,7 @@ impl crate::Surface for Surface { }; if unsafe { extra.SwapIntervalEXT(if vsync { 1 } else { 0 }) } == Foundation::FALSE.0 { - log::error!("unable to set swap interval: {}", Error::from_win32()); + log::error!("unable to set swap interval: {}", Error::from_thread()); return Err(crate::SurfaceError::Other("unable to set swap interval")); }