From 5944a246e957c5b1d8d32440a673ed05ab434711 Mon Sep 17 00:00:00 2001 From: Westerbly Snaydley Date: Fri, 10 Nov 2023 21:56:57 -0300 Subject: [PATCH] update wgpu-core to latest git version --- Cargo.lock | 90 ++++++++++++++++++++++++++--------------------------- Cargo.toml | 18 +++++------ src/conv.rs | 31 +++++++++--------- 3 files changed, 68 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 772b03a0..86b83054 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", @@ -230,9 +229,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ "libc", "windows-sys", @@ -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", @@ -375,9 +373,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown", @@ -386,9 +384,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -424,9 +422,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" @@ -450,9 +448,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -509,7 +507,7 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "naga" version = "0.14.0" -source = "git+https://github.com/gfx-rs/naga?rev=92e41b43e437146b5d946eb238de963be1168016#92e41b43e437146b5d946eb238de963be1168016" +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" @@ -736,9 +734,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", "errno", @@ -755,18 +753,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", @@ -790,9 +788,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "spirv" @@ -806,9 +804,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -870,9 +868,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -880,9 +878,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -895,9 +893,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -905,9 +903,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", @@ -918,15 +916,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -935,7 +933,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=49b7ec97c164bac9ee877f45cdd806fbefecc5a4#49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +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=49b7ec97c164bac9ee877f45cdd806fbefecc5a4#49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +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=49b7ec97c164bac9ee877f45cdd806fbefecc5a4#49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" dependencies = [ "bitflags 2.4.1", "js-sys", @@ -1139,18 +1137,18 @@ checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "zerocopy" -version = "0.7.15" +version = "0.7.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ba595b9f2772fbee2312de30eeb80ec773b4cb2f1e8098db024afadda6c06f" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.15" +version = "0.7.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772666c41fb6dceaf520b564b962d738a8e1a83b41bd48945f50837aed78bb1d" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index e86c3b53..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 = "49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +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 = "49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +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 = "49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +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 = "49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +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 = "49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" features = ["gles"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "49b7ec97c164bac9ee877f45cdd806fbefecc5a4" +rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" version = "0.18" [dependencies.naga] -git = "https://github.com/gfx-rs/naga" -rev = "92e41b43e437146b5d946eb238de963be1168016" +git = "https://github.com/gfx-rs/wgpu" +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..402786a5 100644 --- a/src/conv.rs +++ b/src/conv.rs @@ -3,6 +3,7 @@ use crate::utils::{make_slice, ptr_into_label, ptr_into_pathbuf}; use crate::{follow_chain, map_enum}; use std::num::{NonZeroU32, NonZeroU64}; use std::{borrow::Cow, ffi::CStr}; +use core::ptr::NonNull; map_enum!(map_load_op, WGPULoadOp, wgc::command::LoadOp, Clear, Load); map_enum!( @@ -1442,8 +1443,8 @@ 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(); + let display_handle = raw_window_handle::WindowsDisplayHandle::new(); + let mut window_handle = raw_window_handle::Win32WindowHandle::new(); window_handle.hwnd = win.hwnd; window_handle.hinstance = win.hinstance; @@ -1461,10 +1462,9 @@ 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 +1473,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 +1484,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,8 +1503,8 @@ 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(); + let display_handle = raw_window_handle::AndroidDisplayHandle::new(); + let mut window_handle = raw_window_handle::AndroidNdkWindowHandle::new(); window_handle.a_native_window = android.window; return CreateSurfaceParams::Raw((