diff --git a/Cargo.lock b/Cargo.lock index 06ae2c3b87..de656cabee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ab_glyph_rasterizer" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" - [[package]] name = "adler32" version = "1.2.0" @@ -29,19 +23,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "andrew" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" -dependencies = [ - "bitflags", - "rusttype", - "walkdir", - "xdg", - "xml-rs", -] - [[package]] name = "approx" version = "0.4.0" @@ -66,7 +47,7 @@ version = "0.33.3+1.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" dependencies = [ - "libloading 0.7.0", + "libloading", ] [[package]] @@ -189,12 +170,12 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "calloop" -version = "0.6.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" +checksum = "42dcfbd723aa6eff9f024cfd5ad08b11144d79b2d8d37b4a31a006ceab255c77" dependencies = [ "log", - "nix 0.18.0", + "nix", ] [[package]] @@ -399,72 +380,10 @@ dependencies = [ ] [[package]] -name = "crossbeam" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.5" +name = "cty" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" -dependencies = [ - "cfg-if 1.0.0", - "lazy_static", -] +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "d3d12" @@ -473,15 +392,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" dependencies = [ "bitflags", - "libloading 0.7.0", + "libloading", "winapi", ] [[package]] name = "darling" -version = "0.10.2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" dependencies = [ "darling_core", "darling_macro", @@ -489,9 +408,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.10.2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" dependencies = [ "fnv", "ident_case", @@ -503,9 +422,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.10.2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" dependencies = [ "darling_core", "quote", @@ -550,22 +469,13 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "dlib" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" -dependencies = [ - "libloading 0.6.7", -] - [[package]] name = "dlib" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ - "libloading 0.7.0", + "libloading", ] [[package]] @@ -832,7 +742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" dependencies = [ "libc", - "libloading 0.7.0", + "libloading", ] [[package]] @@ -847,16 +757,6 @@ version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" -[[package]] -name = "libloading" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - [[package]] name = "libloading" version = "0.7.0" @@ -902,9 +802,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" dependencies = [ "libc", ] @@ -949,9 +849,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" dependencies = [ "libc", "log", @@ -960,18 +860,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "mio-misc" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ddf05411bb159cdb5801bb10002afb66cb4572be656044315e363460ce69dc2" -dependencies = [ - "crossbeam", - "crossbeam-queue", - "log", - "mio", -] - [[package]] name = "miow" version = "0.3.7" @@ -1003,10 +891,11 @@ dependencies = [ [[package]] name = "ndk" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" +checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" dependencies = [ + "bitflags", "jni-sys", "ndk-sys", "num_enum", @@ -1015,9 +904,9 @@ dependencies = [ [[package]] name = "ndk-glue" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" +checksum = "fc291b8de2095cba8dab7cf381bf582ff4c17a09acf854c32e46545b08085d28" dependencies = [ "lazy_static", "libc", @@ -1029,12 +918,12 @@ dependencies = [ [[package]] name = "ndk-macro" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling", - "proc-macro-crate 0.1.5", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1042,32 +931,21 @@ dependencies = [ [[package]] name = "ndk-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" - -[[package]] -name = "nix" -version = "0.18.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" -dependencies = [ - "bitflags", - "cc", - "cfg-if 0.1.10", - "libc", -] +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" [[package]] name = "nix" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +checksum = "cf1e25ee6b412c2a1e3fcb6a4499a5c1bfe7f43e014bdce9a6b6666e5aa2d187" dependencies = [ "bitflags", "cc", "cfg-if 1.0.0", "libc", + "memoffset", ] [[package]] @@ -1134,7 +1012,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1171,15 +1049,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" -[[package]] -name = "owned_ttf_parser" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" -dependencies = [ - "ttf-parser", -] - [[package]] name = "parking" version = "2.0.0" @@ -1286,15 +1155,6 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - [[package]] name = "proc-macro-crate" version = "1.1.0" @@ -1387,11 +1247,11 @@ checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" [[package]] name = "raw-window-handle" -version = "0.3.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" +checksum = "fba75eee94a9d5273a68c9e1e105d9cffe1ef700532325788389e5a83e2522b7" dependencies = [ - "libc", + "cty", ] [[package]] @@ -1443,25 +1303,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rusttype" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "scoped-tls" version = "1.0.0" @@ -1517,18 +1358,18 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "smithay-client-toolkit" -version = "0.12.3" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" +checksum = "210cf40de565aaaa085face1d860b17f6aee9f76f9d2816307ea2cc45eeb64f3" dependencies = [ - "andrew", "bitflags", "calloop", - "dlib 0.4.2", + "dlib", "lazy_static", "log", "memmap2", - "nix 0.18.0", + "nix", + "pkg-config", "wayland-client", "wayland-cursor", "wayland-protocols", @@ -1546,9 +1387,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" @@ -1599,12 +1440,6 @@ dependencies = [ "serde", ] -[[package]] -name = "ttf-parser" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" - [[package]] name = "unicode-width" version = "0.1.9" @@ -1629,17 +1464,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -1714,14 +1538,14 @@ checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wayland-client" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" +checksum = "9108ec1c37f4774d0c2937ba1a6c23d1786b2152c4a13bd9fdb20e42d16e8841" dependencies = [ "bitflags", "downcast-rs", "libc", - "nix 0.20.0", + "nix", "scoped-tls", "wayland-commons", "wayland-scanner", @@ -1730,11 +1554,11 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" +checksum = "265ef51b3b3e5c9ef098f10425c39624663f459c3821dcaacc4748be975f1beb" dependencies = [ - "nix 0.20.0", + "nix", "once_cell", "smallvec", "wayland-sys", @@ -1742,20 +1566,20 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" +checksum = "6c19bb6628daf4097e58b7911481e8371e13318d5a60894779901bd3267407a7" dependencies = [ - "nix 0.20.0", + "nix", "wayland-client", "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" +checksum = "7b3b6f1dc0193072ef4eadcb144da30d58c1f2895516c063804d213310703c8e" dependencies = [ "bitflags", "wayland-client", @@ -1765,9 +1589,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" +checksum = "eaaf2bc85e7b9143159af96bd23d954a5abe391c4376db712320643280fdc6f4" dependencies = [ "proc-macro2", "quote", @@ -1776,11 +1600,11 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" +checksum = "ba9e06acb775b3007f8d3094438306979e572d1d3b844d7a71557a84b055d959" dependencies = [ - "dlib 0.5.0", + "dlib", "lazy_static", "pkg-config", ] @@ -1872,7 +1696,7 @@ dependencies = [ "inplace_it", "js-sys", "khronos-egl", - "libloading 0.7.0", + "libloading", "log", "metal", "naga", @@ -1940,11 +1764,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winit" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" +checksum = "70466a5f4825cc88c92963591b06dbc255420bffe19d847bfcda475e82d079c0" dependencies = [ "bitflags", + "block", "cocoa", "core-foundation 0.9.1", "core-graphics 0.22.2", @@ -1955,7 +1780,6 @@ dependencies = [ "libc", "log", "mio", - "mio-misc", "ndk", "ndk-glue", "ndk-sys", @@ -1963,10 +1787,10 @@ dependencies = [ "parking_lot", "percent-encoding", "raw-window-handle", - "scopeguard", "smithay-client-toolkit", "wasm-bindgen", "wayland-client", + "wayland-protocols", "web-sys", "winapi", "x11-dl", @@ -1992,12 +1816,6 @@ dependencies = [ "nom", ] -[[package]] -name = "xdg" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" - [[package]] name = "xml-rs" version = "0.8.4" diff --git a/player/Cargo.toml b/player/Cargo.toml index 1ba574acb1..86bb3bdc7d 100644 --- a/player/Cargo.toml +++ b/player/Cargo.toml @@ -17,9 +17,9 @@ publish = false [dependencies] env_logger = "0.8" log = "0.4" -raw-window-handle = "0.3" +raw-window-handle = "0.4" ron = "0.7" -winit = { version = "0.25", optional = true } +winit = { version = "0.26", optional = true } [dependencies.wgt] path = "../wgpu-types" diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 1c4519d184..10b5fcd285 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -29,7 +29,7 @@ fxhash = "0.2" log = "0.4" parking_lot = "0.11" profiling = { version = "1", default-features = false } -raw-window-handle = { version = "0.3", optional = true } +raw-window-handle = { version = "0.4", optional = true } ron = { version = "0.7", optional = true } serde = { version = "1.0", features = ["serde_derive"], optional = true } smallvec = "1" diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 7b1e83ffae..359a9a108e 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -23,7 +23,7 @@ renderdoc = ["libloading", "renderdoc-sys"] bitflags = "1.0" parking_lot = "0.11" profiling = { version = "1", default-features = false } -raw-window-handle = "0.3" +raw-window-handle = "0.4" thiserror = "1" # backends common @@ -86,4 +86,4 @@ features = ["wgsl-in"] [dev-dependencies] env_logger = "0.8" -winit = "0.25" +winit = "0.26" diff --git a/wgpu-hal/src/dx12/instance.rs b/wgpu-hal/src/dx12/instance.rs index 267e50264d..c00fce84ce 100644 --- a/wgpu-hal/src/dx12/instance.rs +++ b/wgpu-hal/src/dx12/instance.rs @@ -151,7 +151,7 @@ impl crate::Instance for super::Instance { has_handle: &impl raw_window_handle::HasRawWindowHandle, ) -> Result { match has_handle.raw_window_handle() { - raw_window_handle::RawWindowHandle::Windows(handle) => Ok(super::Surface { + raw_window_handle::RawWindowHandle::Win32(handle) => Ok(super::Surface { factory: self.factory, wnd_handle: handle.hwnd as *mut _, swap_chain: None, diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index 5852907638..a36e35cbe7 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -23,14 +23,12 @@ type WlDisplayConnectFun = type WlDisplayDisconnectFun = unsafe extern "system" fn(display: *const raw::c_void); -#[cfg(not(any(target_os = "android", target_os = "macos")))] type WlEglWindowCreateFun = unsafe extern "system" fn( surface: *const raw::c_void, width: raw::c_int, height: raw::c_int, ) -> *mut raw::c_void; -#[cfg(not(any(target_os = "android", target_os = "macos")))] type WlEglWindowResizeFun = unsafe extern "system" fn( window: *const raw::c_void, width: raw::c_int, @@ -41,7 +39,6 @@ type WlEglWindowResizeFun = unsafe extern "system" fn( type WlEglWindowDestroyFun = unsafe extern "system" fn(window: *const raw::c_void); -#[cfg(target_os = "android")] extern "C" { pub fn ANativeWindow_setBuffersGeometry( window: *mut raw::c_void, @@ -597,12 +594,9 @@ impl crate::Instance for Instance { let mut inner = self.inner.lock(); match raw_window_handle { - #[cfg(not(any(target_os = "android", target_os = "macos")))] Rwh::Xlib(_) => {} - #[cfg(not(any(target_os = "android", target_os = "macos")))] Rwh::Xcb(_) => {} - #[cfg(target_os = "android")] - Rwh::Android(handle) => { + Rwh::AndroidNdk(handle) => { let format = inner .egl .get_config_attrib(inner.display, inner.config, egl::NATIVE_VISUAL_ID) @@ -615,7 +609,6 @@ impl crate::Instance for Instance { return Err(crate::InstanceError); } } - #[cfg(not(any(target_os = "android", target_os = "macos", target_os = "solaris")))] Rwh::Wayland(handle) => { /* Wayland displays are not sharable between surfaces so if the * surface we receive from this handle is from a different @@ -849,29 +842,19 @@ impl crate::Surface for Surface { let (surface, wl_window) = match self.unconfigure_impl(device) { Some(pair) => pair, None => { - #[cfg_attr(any(target_os = "android", target_os = "macos"), allow(unused_mut))] let mut wl_window = None; - #[cfg(not(any(target_os = "android", target_os = "macos")))] let (mut temp_xlib_handle, mut temp_xcb_handle); #[allow(trivial_casts)] let native_window_ptr = match self.raw_window_handle { - #[cfg(not(any(target_os = "android", target_os = "macos")))] Rwh::Xlib(handle) => { temp_xlib_handle = handle.window; &mut temp_xlib_handle as *mut _ as *mut std::ffi::c_void } - #[cfg(not(any(target_os = "android", target_os = "macos")))] Rwh::Xcb(handle) => { temp_xcb_handle = handle.window; &mut temp_xcb_handle as *mut _ as *mut std::ffi::c_void } - #[cfg(target_os = "android")] - Rwh::Android(handle) => handle.a_native_window, - #[cfg(not(any( - target_os = "android", - target_os = "macos", - target_os = "solaris" - )))] + Rwh::AndroidNdk(handle) => handle.a_native_window, Rwh::Wayland(handle) => { let library = self.wsi_library.as_ref().expect("unsupported window"); let wl_egl_window_create: libloading::Symbol = diff --git a/wgpu-hal/src/metal/mod.rs b/wgpu-hal/src/metal/mod.rs index fb3f41dc4d..3099991f91 100644 --- a/wgpu-hal/src/metal/mod.rs +++ b/wgpu-hal/src/metal/mod.rs @@ -85,12 +85,12 @@ impl crate::Instance for Instance { ) -> Result { match has_handle.raw_window_handle() { #[cfg(target_os = "ios")] - raw_window_handle::RawWindowHandle::IOS(handle) => { + raw_window_handle::RawWindowHandle::UiKit(handle) => { let _ = &self.managed_metal_layer_delegate; Ok(Surface::from_uiview(handle.ui_view)) } #[cfg(target_os = "macos")] - raw_window_handle::RawWindowHandle::MacOS(handle) => Ok(Surface::from_nsview( + raw_window_handle::RawWindowHandle::AppKit(handle) => Ok(Surface::from_nsview( handle.ns_view, &self.managed_metal_layer_delegate, )), diff --git a/wgpu-hal/src/vulkan/instance.rs b/wgpu-hal/src/vulkan/instance.rs index af4cc03b0f..0412617946 100644 --- a/wgpu-hal/src/vulkan/instance.rs +++ b/wgpu-hal/src/vulkan/instance.rs @@ -547,56 +547,41 @@ impl crate::Instance for super::Instance { use raw_window_handle::RawWindowHandle; match has_handle.raw_window_handle() { - #[cfg(all( - unix, - not(target_os = "android"), - not(target_os = "macos"), - not(target_os = "ios"), - not(target_os = "solaris") - ))] RawWindowHandle::Wayland(handle) if self.extensions.contains(&khr::WaylandSurface::name()) => { Ok(self.create_surface_from_wayland(handle.display, handle.surface)) } - #[cfg(all( - unix, - not(target_os = "android"), - not(target_os = "macos"), - not(target_os = "ios"), - not(target_os = "solaris") - ))] RawWindowHandle::Xlib(handle) if self.extensions.contains(&khr::XlibSurface::name()) => { Ok(self.create_surface_from_xlib(handle.display as *mut _, handle.window)) } - #[cfg(all( - unix, - not(target_os = "android"), - not(target_os = "macos"), - not(target_os = "ios") - ))] RawWindowHandle::Xcb(handle) if self.extensions.contains(&khr::XcbSurface::name()) => { Ok(self.create_surface_from_xcb(handle.connection, handle.window)) } - #[cfg(target_os = "android")] - RawWindowHandle::Android(handle) => { + RawWindowHandle::AndroidNdk(handle) => { Ok(self.create_surface_android(handle.a_native_window)) } #[cfg(windows)] - RawWindowHandle::Windows(handle) => { + RawWindowHandle::Win32(handle) => { use winapi::um::libloaderapi::GetModuleHandleW; let hinstance = GetModuleHandleW(std::ptr::null()); Ok(self.create_surface_from_hwnd(hinstance as *mut _, handle.hwnd)) } #[cfg(target_os = "macos")] - RawWindowHandle::MacOS(handle) + RawWindowHandle::AppKit(handle) if self.extensions.contains(&ext::MetalSurface::name()) => { Ok(self.create_surface_from_ns_view(handle.ns_view)) } + #[cfg(target_os = "ios")] + RawWindowHandle::UiKit(handle) + if self.extensions.contains(&ext::MetalSurface::name()) => + { + Ok(self.create_surface_from_ns_view(handle.ui_view)) + } _ => Err(crate::InstanceError), } } diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index c6f6e96c7f..d92961d5db 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -110,7 +110,7 @@ version = "0.11" arrayvec = "0.7" log = "0.4" parking_lot = "0.11" -raw-window-handle = "0.3" +raw-window-handle = "0.4" serde = { version = "1", features = ["derive"], optional = true } smallvec = "1" @@ -126,7 +126,7 @@ noise = { version = "0.7", default-features = false } obj = "0.10" png = "0.16" rand = "0.7.2" -winit = "0.25" +winit = "0.26" [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] async-executor = "1.0" @@ -289,4 +289,3 @@ console_log = "0.1.2" # We need the Location feature in the framework examples web-sys = { version = "0.3.53", features = ["Location"] } rand = { version = "0.7", features = ["wasm-bindgen"] } -winit = { version = "0.25", features = ["web-sys"] }