diff --git a/Cargo.toml b/Cargo.toml index 7083e33a12..286ae85c71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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" @@ -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" diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index 19e7743d6f..a9bbbf7d94 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -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 { @@ -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(), diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index c8e6c3e0cf..c1c3730f23 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -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, ) diff --git a/wgpu-hal/src/dx12/suballocation.rs b/wgpu-hal/src/dx12/suballocation.rs index 8547f13008..7adc0182b3 100644 --- a/wgpu-hal/src/dx12/suballocation.rs +++ b/wgpu-hal/src/dx12/suballocation.rs @@ -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, } } } diff --git a/wgpu-hal/src/gles/wgl.rs b/wgpu-hal/src/gles/wgl.rs index 6a4c3863bb..b1a65f2b9d 100644 --- a/wgpu-hal/src/gles/wgl.rs +++ b/wgpu-hal/src/gles/wgl.rs @@ -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::{ @@ -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()) } } } @@ -382,7 +382,7 @@ fn create_instance_device() -> Result { 1, None, None, - instance, + Some(instance.into()), None, ) } @@ -394,7 +394,7 @@ fn create_instance_device() -> Result { })?; 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"), @@ -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); }; } } @@ -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: {}", @@ -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: {}",