Skip to content

Commit

Permalink
[d3d12 wgl] Upgrade to windows 0.59 crates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MarijnS95 committed Jan 8, 2025
1 parent a8a9173 commit 7841fa7
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 35 deletions.
152 changes: 139 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ bit-set = "0.8"
gpu-allocator = { version = "0.27", default-features = false }
range-alloc = "0.1"
mach-dxcompiler-rs = { version = "0.1.4", default-features = false }
windows-core = { version = "0.58", default-features = false }
windows-core = { version = "0.59", default-features = false }

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

# DX 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.7"
Expand Down Expand Up @@ -207,6 +207,9 @@ ndk-sys = "0.5.0"
#js-sys = { path = "../wasm-bindgen/crates/js-sys" }
#wasm-bindgen = { path = "../wasm-bindgen" }

# https://github.com/Traverse-Research/gpu-allocator/pull/258
gpu-allocator = { git = "https://github.com/Traverse-Research/gpu-allocator", rev = "dd4ad67" }

[profile.release]
lto = "thin"
debug = true
Expand Down
15 changes: 2 additions & 13 deletions wgpu-hal/src/dx12/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,23 +768,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.
(windows_core::Interface::vtable(list).ClearDepthStencilView)(
windows_core::Interface::as_raw(list),
list.ClearDepthStencilView(
ds_view,
flags,
ds.clear_value.0,
ds.clear_value.1 as u8,
0,
std::ptr::null(),
None,
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/dx12/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ impl crate::Surface for Surface {
.ok_or(crate::SurfaceError::Other("IDXGIFactoryMedia not found"))?
.CreateSwapChainForCompositionSurfaceHandle(
&device.present_queue,
handle,
Some(handle),
&desc,
None,
)
Expand Down
Loading

0 comments on commit 7841fa7

Please sign in to comment.