Skip to content

Support for windows v0.61 #7937

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

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,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"
Expand Down Expand Up @@ -206,10 +206,10 @@ gpu-alloc = "0.6"
gpu-descriptor = "0.3.2"

# DX12 dependencies
gpu-allocator = { version = "0.27", default-features = false }
gpu-allocator = { git = "https://github.com/Traverse-Research/gpu-allocator", rev = "1ad50b6" }
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.61", default-features = false }

# Gles dependencies
khronos-egl = "6"
Expand All @@ -219,7 +219,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.61", default-features = false }

# wasm32 dependencies
console_error_panic_hook = "0.1.5"
Expand Down
6 changes: 3 additions & 3 deletions wgpu-hal/src/dx12/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1821,8 +1821,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 {
Expand Down Expand Up @@ -1852,7 +1852,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(),
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 @@ -1293,7 +1293,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
2 changes: 1 addition & 1 deletion wgpu-hal/src/dx12/suballocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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,
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions wgpu-hal/src/gles/wgl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloc::{borrow::ToOwned as _, ffi::CString, string::String, sync::Arc, vec::
use core::{
ffi::{c_int, c_void, CStr},
mem::{self, ManuallyDrop},
ptr,
ptr::{self},
time::Duration,
};
use std::{
Expand Down Expand Up @@ -128,7 +128,7 @@ impl WglContext {
if unsafe { OpenGL::wglGetCurrentContext() }.is_invalid() {
return Ok(());
}
unsafe { OpenGL::wglMakeCurrent(None, None) }
unsafe { OpenGL::wglMakeCurrent(Gdi::HDC::default(), OpenGL::HGLRC::default()) }
}
}

Expand Down Expand Up @@ -382,7 +382,7 @@ fn create_instance_device() -> Result<InstanceDevice, crate::InstanceError> {
1,
None,
None,
instance,
Some(instance.into()),
None,
)
}
Expand All @@ -394,7 +394,7 @@ fn create_instance_device() -> Result<InstanceDevice, crate::InstanceError> {
})?;
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"),
Expand Down Expand Up @@ -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);
};
}
}
Expand Down Expand Up @@ -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: {}",
Expand Down Expand Up @@ -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: {}",
Expand Down
Loading