diff --git a/Cargo.lock b/Cargo.lock index 34ae0dfb30..d4220d9ceb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,24 +60,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" -[[package]] -name = "android-activity" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0" -dependencies = [ - "android-properties", - "bitflags 1.3.2", - "cc", - "jni-sys", - "libc", - "log", - "ndk 0.7.0", - "ndk-context", - "ndk-sys 0.4.1+23.1.7779620", - "num_enum 0.6.1", -] - [[package]] name = "android-activity" version = "0.5.0" @@ -323,32 +305,13 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -[[package]] -name = "block-sys" -version = "0.1.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" -dependencies = [ - "objc-sys 0.2.0-beta.2", -] - [[package]] name = "block-sys" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dd7cf50912cddc06dc5ea7c08c5e81c1b2c842a70d19def1848d54c586fed92" dependencies = [ - "objc-sys 0.3.1", -] - -[[package]] -name = "block2" -version = "0.2.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" -dependencies = [ - "block-sys 0.1.0-beta.1", - "objc2-encode 2.0.0-pre.2", + "objc-sys", ] [[package]] @@ -357,8 +320,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ - "block-sys 0.2.0", - "objc2 0.4.1", + "block-sys", + "objc2", ] [[package]] @@ -1655,9 +1618,9 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" dependencies = [ - "block2 0.3.0", + "block2", "dispatch", - "objc2 0.4.1", + "objc2", ] [[package]] @@ -2225,15 +2188,6 @@ dependencies = [ "num_enum_derive 0.5.11", ] -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive 0.6.1", -] - [[package]] name = "num_enum" version = "0.7.0" @@ -2255,18 +2209,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.38", -] - [[package]] name = "num_enum_derive" version = "0.7.0" @@ -2313,46 +2255,20 @@ dependencies = [ "objc_exception", ] -[[package]] -name = "objc-sys" -version = "0.2.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" - [[package]] name = "objc-sys" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99e1d07c6eab1ce8b6382b8e3c7246fe117ff3f8b34be065f5ebace6749fe845" -[[package]] -name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" -dependencies = [ - "block2 0.2.0-alpha.6", - "objc-sys 0.2.0-beta.2", - "objc2-encode 2.0.0-pre.2", -] - [[package]] name = "objc2" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "objc-sys 0.3.1", - "objc2-encode 3.0.0", -] - -[[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys 0.2.0-beta.2", + "objc-sys", + "objc2-encode", ] [[package]] @@ -2889,19 +2805,6 @@ dependencies = [ "tiny-skia 0.7.0", ] -[[package]] -name = "sctk-adwaita" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" -dependencies = [ - "ab_glyph", - "log", - "memmap2 0.5.10", - "smithay-client-toolkit 0.16.1", - "tiny-skia 0.8.4", -] - [[package]] name = "sctk-adwaita" version = "0.7.0" @@ -3276,20 +3179,6 @@ dependencies = [ "tiny-skia-path 0.7.0", ] -[[package]] -name = "tiny-skia" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67" -dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "bytemuck", - "cfg-if", - "png", - "tiny-skia-path 0.8.4", -] - [[package]] name = "tiny-skia" version = "0.11.2" @@ -3314,17 +3203,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "tiny-skia-path" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adbfb5d3f3dd57a0e11d12f4f13d4ebbbc1b5c15b7ab0a156d030b21da5f677c" -dependencies = [ - "arrayref", - "bytemuck", - "strict-num", -] - [[package]] name = "tiny-skia-path" version = "0.11.2" @@ -4069,7 +3947,7 @@ dependencies = [ "web-sys", "wgpu-types", "winapi", - "winit 0.28.7", + "winit 0.29.2", ] [[package]] @@ -4713,41 +4591,6 @@ dependencies = [ "x11-dl", ] -[[package]] -name = "winit" -version = "0.28.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" -dependencies = [ - "android-activity 0.4.3", - "bitflags 1.3.2", - "cfg_aliases", - "core-foundation", - "core-graphics 0.22.3", - "dispatch", - "instant", - "libc", - "log", - "mio", - "ndk 0.7.0", - "objc2 0.3.0-beta.3.patch-leaks.3", - "once_cell", - "orbclient", - "percent-encoding", - "raw-window-handle 0.5.2", - "redox_syscall 0.3.5", - "sctk-adwaita 0.5.4", - "smithay-client-toolkit 0.16.1", - "wasm-bindgen", - "wayland-client 0.29.5", - "wayland-commons", - "wayland-protocols 0.29.5", - "wayland-scanner 0.29.5", - "web-sys", - "windows-sys 0.45.0", - "x11-dl", -] - [[package]] name = "winit" version = "0.29.2" @@ -4755,7 +4598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b829f75d02fe1e225b97c91a04c326900147a50234d1141a1cbe215ce8798c11" dependencies = [ "ahash", - "android-activity 0.5.0", + "android-activity", "atomic-waker", "bitflags 2.4.1", "bytemuck", @@ -4771,7 +4614,7 @@ dependencies = [ "memmap2 0.9.0", "ndk 0.8.0", "ndk-sys 0.5.0+25.2.9519653", - "objc2 0.4.1", + "objc2", "once_cell", "orbclient", "percent-encoding", diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 136d4ab246..f769661831 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -137,7 +137,7 @@ features = ["wgsl-in"] [dev-dependencies] cfg-if = "1" env_logger = "0.10" -winit = { version = "0.28.7", features = [ "android-native-activity" ] } # for "halmark" example +winit = { version = "0.29.2", features = [ "android-native-activity" ] } # for "halmark" example [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] glutin = "0.29.1" # for "gles" example diff --git a/wgpu-hal/examples/halmark/main.rs b/wgpu-hal/examples/halmark/main.rs index b751a85e96..2ff6b917c3 100644 --- a/wgpu-hal/examples/halmark/main.rs +++ b/wgpu-hal/examples/halmark/main.rs @@ -5,7 +5,7 @@ extern crate wgpu_hal as hal; use hal::{ Adapter as _, CommandEncoder as _, Device as _, Instance as _, Queue as _, Surface as _, }; -use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; +use raw_window_handle::{HasDisplayHandle, HasWindowHandle}; use std::{ borrow::{Borrow, Cow}, @@ -95,10 +95,15 @@ impl Example { gles_minor_version: wgt::Gles3MinorVersion::default(), }; let instance = unsafe { A::Instance::init(&instance_desc)? }; - let mut surface = unsafe { - instance - .create_surface(window.raw_display_handle(), window.raw_window_handle()) - .unwrap() + let mut surface = { + let raw_window_handle = window.window_handle()?.as_raw(); + let raw_display_handle = window.display_handle()?.as_raw(); + + unsafe { + instance + .create_surface(raw_display_handle, raw_window_handle) + .unwrap() + } }; let (adapter, capabilities) = unsafe {