From f45d87ab48086be4c5aac3e1bde135471e0068b6 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Wed, 2 Jul 2025 11:18:42 +0200 Subject: [PATCH 1/2] [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 | 66 ++++++++++-------------------- Cargo.toml | 13 +++--- wgpu-hal/src/dx12/command.rs | 27 ++++-------- wgpu-hal/src/dx12/device.rs | 2 +- wgpu-hal/src/dx12/mod.rs | 2 +- wgpu-hal/src/dx12/suballocation.rs | 3 +- wgpu-hal/src/gles/wgl.rs | 12 +++--- 9 files changed, 55 insertions(+), 86 deletions(-) diff --git a/.deny.toml b/.deny.toml index b95868d767d..8be55a8e193 100644 --- a/.deny.toml +++ b/.deny.toml @@ -21,13 +21,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" }, @@ -84,6 +82,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 92e445dee13..7f84a828114 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -739,6 +739,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 a518e7ef7e9..adb860c9c1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1867,13 +1867,12 @@ dependencies = [ [[package]] name = "gpu-allocator" version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +source = "git+https://github.com/Traverse-Research/gpu-allocator?rev=955b13a#955b13a45bff8308b48d553032f9d6216c0e57e6" dependencies = [ "log", "presser", "thiserror 1.0.69", - "windows 0.58.0", + "windows 0.59.0", ] [[package]] @@ -5124,8 +5123,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", ] @@ -5275,12 +5274,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]] @@ -5307,15 +5306,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]] @@ -5325,9 +5324,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", ] @@ -5344,9 +5343,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", @@ -5364,17 +5363,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" @@ -5408,15 +5396,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" @@ -5428,12 +5407,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 1fba257724c..949c2d0ee82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,7 +132,7 @@ indicatif = "0.18" itertools = { version = "0.14" } jobserver = "0.1" ktx2 = "0.4" -libc = { version = "0.2.168", 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" @@ -166,7 +166,7 @@ pp-rs = "0.2.1" profiling = { version = "1.0.1", default-features = false } quote = "1.0.38" raw-window-handle = { version = "0.6.2", default-features = false } -rwh_05 = { version = "0.5.2", package = "raw-window-handle" } # temporary compatibility for glutin-winit +rwh_05 = { version = "0.5.2", package = "raw-window-handle" } # temporary compatibility for glutin-winit rayon = "1.3" regex-lite = "0.1" renderdoc-sys = "1" @@ -210,7 +210,7 @@ gpu-descriptor = "0.3.2" gpu-allocator = { version = "0.27", default-features = false } 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" @@ -220,7 +220,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" @@ -241,7 +241,7 @@ deno_webidl = "0.192.0" deno_webgpu = { version = "0.157.0", path = "./deno_webgpu" } deno_unsync = "0.4.2" deno_error = "0.5.5" -tokio = "1.39" +tokio = "1.47" termcolor = "1.1.3" # android dependencies @@ -251,6 +251,9 @@ ndk-sys = "0.6" [patch.crates-io] wgpu = { path = "./wgpu" } +# https://github.com/Traverse-Research/gpu-allocator/pull/258 +gpu-allocator = { git = "https://github.com/Traverse-Research/gpu-allocator", rev = "955b13a" } + [profile.release] lto = "thin" debug = true diff --git a/wgpu-hal/src/dx12/command.rs b/wgpu-hal/src/dx12/command.rs index edfea952ed2..12aeeccc327 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/device.rs b/wgpu-hal/src/dx12/device.rs index 34454c9f963..a7a8f0b7a03 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, diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index c15f3b81e4e..d7125190353 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -1317,7 +1317,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 8cee4102303..1f4bca271db 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, }; diff --git a/wgpu-hal/src/gles/wgl.rs b/wgpu-hal/src/gles/wgl.rs index 6a4c3863bb8..bc8c38f12a8 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 44e09d80fb7489e316eab2082d2acc0f12c007d6 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 27 Jul 2025 23:21:57 +0200 Subject: [PATCH 2/2] [d3d12 wgl] Upgrade to `windows 0.61` crates https://github.com/microsoft/windows-rs/releases/tag/63 --- Cargo.lock | 70 ++++++------------------------ Cargo.toml | 9 ++-- wgpu-hal/src/dx12/device.rs | 6 +-- wgpu-hal/src/dx12/mod.rs | 2 +- wgpu-hal/src/dx12/suballocation.rs | 2 +- wgpu-types/src/counters.rs | 1 + 6 files changed, 25 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index adb860c9c1f..8726ee01b66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1698,7 +1698,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows 0.61.3", + "windows", ] [[package]] @@ -1867,12 +1867,13 @@ dependencies = [ [[package]] name = "gpu-allocator" version = "0.27.0" -source = "git+https://github.com/Traverse-Research/gpu-allocator?rev=955b13a#955b13a45bff8308b48d553032f9d6216c0e57e6" +source = "git+https://github.com/Traverse-Research/gpu-allocator?rev=673e4ecb503af4188e0ca576acd0dad681f22413#673e4ecb503af4188e0ca576acd0dad681f22413" dependencies = [ + "hashbrown", "log", "presser", - "thiserror 1.0.69", - "windows 0.59.0", + "thiserror 2.0.16", + "windows", ] [[package]] @@ -2296,7 +2297,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.3", + "windows-targets 0.48.5", ] [[package]] @@ -5123,8 +5124,8 @@ dependencies = [ "wasm-bindgen", "web-sys", "wgpu-types", - "windows 0.59.0", - "windows-core 0.59.0", + "windows", + "windows-core", "winit 0.29.15", ] @@ -5272,16 +5273,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" @@ -5289,7 +5280,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", @@ -5301,20 +5292,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]] @@ -5323,11 +5301,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]] @@ -5336,22 +5314,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" @@ -5392,7 +5359,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", ] @@ -5405,15 +5372,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 949c2d0ee82..5cb04ef6f42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -207,10 +207,10 @@ gpu-alloc = "0.6" gpu-descriptor = "0.3.2" # DX12 dependencies -gpu-allocator = { version = "0.27", default-features = false } +gpu-allocator = { version = "0.27", 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.59", default-features = false } +windows-core = { version = "0.61", default-features = false } # Gles dependencies khronos-egl = "6" @@ -220,7 +220,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" @@ -252,7 +252,8 @@ ndk-sys = "0.6" wgpu = { path = "./wgpu" } # https://github.com/Traverse-Research/gpu-allocator/pull/258 -gpu-allocator = { git = "https://github.com/Traverse-Research/gpu-allocator", rev = "955b13a" } +# https://github.com/Traverse-Research/gpu-allocator/pull/269 +gpu-allocator = { git = "https://github.com/Traverse-Research/gpu-allocator", rev = "673e4ecb503af4188e0ca576acd0dad681f22413" } [profile.release] lto = "thin" diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index a7a8f0b7a03..ba542f62f6c 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -1905,8 +1905,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 { @@ -1936,7 +1936,7 @@ impl crate::Device for super::Device { RasterizedStream: 0, }, BlendState: 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 d7125190353..39805d84c72 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -92,7 +92,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-hal/src/dx12/suballocation.rs b/wgpu-hal/src/dx12/suballocation.rs index 1f4bca271db..9d6c988b4d7 100644 --- a/wgpu-hal/src/dx12/suballocation.rs +++ b/wgpu-hal/src/dx12/suballocation.rs @@ -144,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-types/src/counters.rs b/wgpu-types/src/counters.rs index 644cbac7de5..a0ee6a45848 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, }