Skip to content

Commit 3dfb9e6

Browse files
authored
cargo: Bump windows crate range to 0.53-0.57 (#213)
* cargo: Bump `windows` crate range to `0.53-0.54` Because of the refactoring of `CanInto` (to now only support `unsafe` `IntoParam` boilerplate for `Abi` purposes) in favour of regular `From` implementations for type-safe upcasting, the new releases are no longer backwards-compatible with `windows 0.51-0.52`. * Lighten required `windows` features Most namespaces are parents which are enabled automatically when enabling their childeren (and the root `Win32` namespace depends on `Win32_Foundation` since newer `windows` releases). Except `Direct3D`, which is not required for `gpu-allocator` but only used in the examples. * Increase allowed `windows` version range to `0.53-0.56`
1 parent 95ba6d0 commit 3dfb9e6

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

Cargo.toml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,9 @@ metal = { version = "0.28.0", git = "https://github.com/gfx-rs/metal-rs", rev =
4141
winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "impl-debug"], optional = true }
4242

4343
[target.'cfg(windows)'.dependencies.windows]
44-
version = ">=0.51,<=0.52"
44+
version = ">=0.53,<=0.56"
4545
features = [
46-
"Win32_Foundation",
47-
"Win32_Graphics",
48-
"Win32_Graphics_Direct3D",
4946
"Win32_Graphics_Direct3D12",
50-
"Win32_Graphics_Dxgi",
5147
"Win32_Graphics_Dxgi_Common",
5248
]
5349
optional = true
@@ -61,13 +57,10 @@ env_logger = "0.10"
6157
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }
6258

6359
[target.'cfg(windows)'.dev-dependencies.windows]
64-
version = ">=0.51,<=0.52"
60+
version = ">=0.53,<=0.56"
6561
features = [
66-
"Win32_Foundation",
67-
"Win32_Graphics",
6862
"Win32_Graphics_Direct3D",
6963
"Win32_Graphics_Direct3D12",
70-
"Win32_Graphics_Dxgi",
7164
"Win32_Graphics_Dxgi_Common",
7265
]
7366

examples/d3d12-buffer-winrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use gpu_allocator::d3d12::{
44
};
55
use gpu_allocator::MemoryLocation;
66
use log::*;
7-
use windows::core::{ComInterface, Result};
7+
use windows::core::{Interface, Result};
88
use windows::Win32::{
99
Foundation::E_NOINTERFACE,
1010
Graphics::{

src/d3d12/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ impl std::ops::Deref for ID3D12DeviceVersion {
256256
fn deref(&self) -> &Self::Target {
257257
match self {
258258
Self::Device(device) => device,
259-
// Windows-rs hides CanInto, we know that Device10/Device12 is a subclass of Device but there's not even a Deref.
260-
Self::Device10(device10) => windows::core::CanInto::can_into(device10),
261-
Self::Device12(device12) => windows::core::CanInto::can_into(device12),
259+
Self::Device10(device10) => device10.into(),
260+
Self::Device12(device12) => device12.into(),
262261
}
263262
}
264263
}

0 commit comments

Comments
 (0)