diff --git a/Cargo.lock b/Cargo.lock index d4a68055..6681060f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -208,8 +208,7 @@ dependencies = [ [[package]] name = "d3d12" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" +source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" dependencies = [ "bitflags 2.4.1", "libloading 0.8.1", @@ -291,8 +290,7 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "glow" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886c2a30b160c4c6fec8f987430c26b526b7988ca71f664e6a699ddf6f9601e4" +source = "git+https://github.com/grovesNL/glow.git?rev=29ff917a2b2ff7ce0a81b2cc5681de6d4735b36e#29ff917a2b2ff7ce0a81b2cc5681de6d4735b36e" dependencies = [ "js-sys", "slotmap", @@ -508,8 +506,8 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "naga" -version = "0.14.1" -source = "git+https://github.com/gfx-rs/wgpu?rev=f22009ee7697a3278f2426e794ae10a469e4f4c3#f22009ee7697a3278f2426e794ae10a469e4f4c3" +version = "0.14.0" +source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" dependencies = [ "bit-set", "bitflags 2.4.1", @@ -674,9 +672,9 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "raw-window-handle" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "redox_syscall" @@ -934,8 +932,8 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.18.1" -source = "git+https://github.com/gfx-rs/wgpu?rev=f22009ee7697a3278f2426e794ae10a469e4f4c3#f22009ee7697a3278f2426e794ae10a469e4f4c3" +version = "0.18.0" +source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" dependencies = [ "arrayvec", "bit-vec", @@ -959,7 +957,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=f22009ee7697a3278f2426e794ae10a469e4f4c3#f22009ee7697a3278f2426e794ae10a469e4f4c3" +source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" dependencies = [ "android_system_properties", "arrayvec", @@ -1014,7 +1012,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=f22009ee7697a3278f2426e794ae10a469e4f4c3#f22009ee7697a3278f2426e794ae10a469e4f4c3" +source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" dependencies = [ "bitflags 2.4.1", "js-sys", diff --git a/Cargo.toml b/Cargo.toml index 6e4b8867..281b4da6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ trace = ["wgc/trace"] [dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "f22009ee7697a3278f2426e794ae10a469e4f4c3" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" features = ["raw-window-handle"] @@ -41,7 +41,7 @@ features = ["raw-window-handle"] [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "f22009ee7697a3278f2426e794ae10a469e4f4c3" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" features = ["metal"] @@ -49,7 +49,7 @@ features = ["metal"] [target.'cfg(windows)'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "f22009ee7697a3278f2426e794ae10a469e4f4c3" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" features = ["dx11", "dx12", "gles"] @@ -57,7 +57,7 @@ features = ["dx11", "dx12", "gles"] [target.'cfg(any(windows, all(unix, not(target_os = "emscripten"), not(target_os = "ios"), not(target_os = "macos"))))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "f22009ee7697a3278f2426e794ae10a469e4f4c3" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" features = ["vulkan"] @@ -65,23 +65,23 @@ features = ["vulkan"] [target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "f22009ee7697a3278f2426e794ae10a469e4f4c3" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" features = ["gles"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "f22009ee7697a3278f2426e794ae10a469e4f4c3" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" [dependencies.naga] git = "https://github.com/gfx-rs/wgpu" -rev = "f22009ee7697a3278f2426e794ae10a469e4f4c3" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.14" [dependencies] -raw-window-handle = "0.5" +raw-window-handle = "0.6.0" paste = "1" log = "0.4" thiserror = "1" diff --git a/src/conv.rs b/src/conv.rs index 4efe76df..aba33c79 100644 --- a/src/conv.rs +++ b/src/conv.rs @@ -1,7 +1,8 @@ use crate::native; use crate::utils::{make_slice, ptr_into_label, ptr_into_pathbuf}; use crate::{follow_chain, map_enum}; -use std::num::{NonZeroU32, NonZeroU64}; +use std::num::{NonZeroIsize, NonZeroU32, NonZeroU64}; +use std::ptr::NonNull; use std::{borrow::Cow, ffi::CStr}; map_enum!(map_load_op, WGPULoadOp, wgc::command::LoadOp, Clear, Load); @@ -1442,10 +1443,10 @@ pub unsafe fn map_surface( ) -> CreateSurfaceParams { #[cfg(windows)] if let Some(win) = _win { - let display_handle = raw_window_handle::WindowsDisplayHandle::empty(); - let mut window_handle = raw_window_handle::Win32WindowHandle::empty(); - window_handle.hwnd = win.hwnd; - window_handle.hinstance = win.hinstance; + let display_handle = raw_window_handle::WindowsDisplayHandle::new(); + let mut window_handle = + raw_window_handle::Win32WindowHandle::new(NonZeroIsize::new_unchecked(win.hwnd as _)); + window_handle.hinstance = NonZeroIsize::new(win.hinstance as _); return CreateSurfaceParams::Raw(( raw_window_handle::RawDisplayHandle::Windows(display_handle), @@ -1461,10 +1462,10 @@ pub unsafe fn map_surface( ))] { if let Some(xcb) = _xcb { - let mut display_handle = raw_window_handle::XcbDisplayHandle::empty(); - display_handle.connection = xcb.connection; - let mut window_handle = raw_window_handle::XcbWindowHandle::empty(); - window_handle.window = xcb.window; + let connection = NonNull::::new_unchecked(xcb.connection); + let display_handle = raw_window_handle::XcbDisplayHandle::new(Some(connection), 0); + let window_handle = + raw_window_handle::XcbWindowHandle::new(NonZeroU32::new_unchecked(xcb.window)); return CreateSurfaceParams::Raw(( raw_window_handle::RawDisplayHandle::Xcb(display_handle), @@ -1473,10 +1474,9 @@ pub unsafe fn map_surface( } if let Some(xlib) = _xlib { - let mut display_handle = raw_window_handle::XlibDisplayHandle::empty(); - display_handle.display = xlib.display; - let mut window_handle = raw_window_handle::XlibWindowHandle::empty(); - window_handle.window = xlib.window as _; + let display = NonNull::::new_unchecked(xlib.display); + let display_handle = raw_window_handle::XlibDisplayHandle::new(Some(display), 0); + let window_handle = raw_window_handle::XlibWindowHandle::new(xlib.window as _); return CreateSurfaceParams::Raw(( raw_window_handle::RawDisplayHandle::Xlib(display_handle), @@ -1485,10 +1485,10 @@ pub unsafe fn map_surface( } if let Some(wl) = _wl { - let mut display_handle = raw_window_handle::WaylandDisplayHandle::empty(); - display_handle.display = wl.display; - let mut window_handle = raw_window_handle::WaylandWindowHandle::empty(); - window_handle.surface = wl.surface; + let display = NonNull::::new_unchecked(wl.display); + let surface = NonNull::::new_unchecked(wl.surface); + let display_handle = raw_window_handle::WaylandDisplayHandle::new(display); + let window_handle = raw_window_handle::WaylandWindowHandle::new(surface); return CreateSurfaceParams::Raw(( raw_window_handle::RawDisplayHandle::Wayland(display_handle), @@ -1504,9 +1504,9 @@ pub unsafe fn map_surface( #[cfg(target_os = "android")] if let Some(android) = _android { - let display_handle = raw_window_handle::AndroidDisplayHandle::empty(); - let mut window_handle = raw_window_handle::AndroidNdkWindowHandle::empty(); - window_handle.a_native_window = android.window; + let display_handle = raw_window_handle::AndroidDisplayHandle::new(); + let window_handle = + raw_window_handle::AndroidNdkWindowHandle::new(NonNull::new_unchecked(android.window)); return CreateSurfaceParams::Raw(( raw_window_handle::RawDisplayHandle::Android(display_handle),