Skip to content

Commit 77cef5a

Browse files
committed
[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.
1 parent 6558deb commit 77cef5a

File tree

5 files changed

+111
-54
lines changed

5 files changed

+111
-54
lines changed

Cargo.lock

+87-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ gpu-descriptor = "0.3"
158158
gpu-allocator = { version = "0.27", default-features = false }
159159
range-alloc = "0.1"
160160
mach-dxcompiler-rs = { version = "0.1.4", default-features = false }
161-
windows-core = { version = "0.58", default-features = false }
161+
windows-core = { version = "0.59", default-features = false }
162162

163163
# Gles dependencies
164164
khronos-egl = "6"
@@ -168,7 +168,7 @@ glutin-winit = { version = "0.4", default-features = false }
168168
glutin_wgl_sys = "0.6"
169169

170170
# DX12 and GLES dependencies
171-
windows = { version = "0.58", default-features = false }
171+
windows = { version = "0.59", default-features = false }
172172

173173
# wasm32 dependencies
174174
console_error_panic_hook = "0.1.7"
@@ -197,6 +197,11 @@ ndk-sys = "0.5.0"
197197
[patch.crates-io]
198198
wgpu = { path = "./wgpu" }
199199

200+
# https://github.com/Traverse-Research/gpu-allocator/pull/258
201+
gpu-allocator = { git = "https://github.com/Traverse-Research/gpu-allocator", rev = "955b13a" }
202+
# https://github.com/Xudong-Huang/generator-rs/pull/72
203+
generator = { git = "https://github.com/MarijnS95/generator-rs", rev = "e4afb28" }
204+
200205
[profile.release]
201206
lto = "thin"
202207
debug = true

wgpu-hal/src/dx12/command.rs

+10-19
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
use std::{mem, ops::Range};
2+
3+
use windows::Win32::{
4+
Foundation,
5+
Graphics::{Direct3D12, Dxgi},
6+
};
7+
use windows_core::Interface as _;
8+
19
use super::conv;
210
use crate::{
311
auxil::{self, dxgi::result::HResult as _},
412
dx12::borrow_interface_temporarily,
513
AccelerationStructureEntries,
614
};
7-
use std::{mem, ops::Range};
8-
use windows::Win32::{
9-
Foundation,
10-
Graphics::{Direct3D12, Dxgi},
11-
};
12-
use windows_core::Interface;
1315

1416
fn make_box(origin: &wgt::Origin3d, size: &crate::CopyExtent) -> Direct3D12::D3D12_BOX {
1517
Direct3D12::D3D12_BOX {
@@ -792,23 +794,12 @@ impl crate::CommandEncoder for super::CommandEncoder {
792794
if let Some(ds_view) = ds_view {
793795
if flags != Direct3D12::D3D12_CLEAR_FLAGS::default() {
794796
unsafe {
795-
// list.ClearDepthStencilView(
796-
// ds_view,
797-
// flags,
798-
// ds.clear_value.0,
799-
// ds.clear_value.1 as u8,
800-
// None,
801-
// )
802-
// TODO: Replace with the above in the next breaking windows-rs release,
803-
// when https://github.com/microsoft/win32metadata/pull/1971 is in.
804-
(Interface::vtable(list).ClearDepthStencilView)(
805-
Interface::as_raw(list),
797+
list.ClearDepthStencilView(
806798
ds_view,
807799
flags,
808800
ds.clear_value.0,
809801
ds.clear_value.1 as u8,
810-
0,
811-
std::ptr::null(),
802+
None,
812803
)
813804
}
814805
}

wgpu-hal/src/dx12/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ impl crate::Surface for Surface {
12211221
.ok_or(crate::SurfaceError::Other("IDXGIFactoryMedia not found"))?
12221222
.CreateSwapChainForCompositionSurfaceHandle(
12231223
&device.present_queue,
1224-
handle,
1224+
Some(handle),
12251225
&desc,
12261226
None,
12271227
)

0 commit comments

Comments
 (0)