Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[d3d12 wgl] Upgrade to windows 0.59 crates #6876

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 87 additions & 26 deletions Cargo.lock

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

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ gpu-descriptor = "0.3"
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"

# 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.7"
Expand Down Expand Up @@ -197,6 +197,11 @@ ndk-sys = "0.5.0"
[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" }
# https://github.com/Xudong-Huang/generator-rs/pull/72
generator = { git = "https://github.com/MarijnS95/generator-rs", rev = "e4afb28" }

[profile.release]
lto = "thin"
debug = true
Expand Down
29 changes: 10 additions & 19 deletions wgpu-hal/src/dx12/command.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
use std::{mem, ops::Range};

use windows::Win32::{
Foundation,
Graphics::{Direct3D12, Dxgi},
};
use windows_core::Interface as _;

use super::conv;
use crate::{
auxil::{self, dxgi::result::HResult as _},
dx12::borrow_interface_temporarily,
AccelerationStructureEntries,
};
use std::{mem, ops::Range};
use windows::Win32::{
Foundation,
Graphics::{Direct3D12, Dxgi},
};
use windows_core::Interface;

fn make_box(origin: &wgt::Origin3d, size: &crate::CopyExtent) -> Direct3D12::D3D12_BOX {
Direct3D12::D3D12_BOX {
Expand Down Expand Up @@ -792,23 +794,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,
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 @@ -1221,7 +1221,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
Loading