diff --git a/Cargo.lock b/Cargo.lock index 6681060f..5eb8f7a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -190,15 +190,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics-types" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -208,7 +208,7 @@ dependencies = [ [[package]] name = "d3d12" version = "0.7.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +source = "git+https://github.com/gfx-rs/wgpu?rev=6dc9ccab8592645fda3204be1cfb5929fd7f924d#6dc9ccab8592645fda3204be1cfb5929fd7f924d" dependencies = [ "bitflags 2.4.1", "libloading 0.8.1", @@ -229,12 +229,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -348,9 +348,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -368,7 +368,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -384,9 +384,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -422,9 +422,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libloading" @@ -443,14 +443,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -507,7 +507,7 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "naga" version = "0.14.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +source = "git+https://github.com/gfx-rs/wgpu?rev=6dc9ccab8592645fda3204be1cfb5929fd7f924d#6dc9ccab8592645fda3204be1cfb5929fd7f924d" dependencies = [ "bit-set", "bitflags 2.4.1", @@ -566,9 +566,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "parking_lot" @@ -590,7 +590,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -642,18 +642,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89dff0959d98c9758c88826cc002e2c3d0b9dfac4139711d1f30de442f1139b" +checksum = "1de09527cd2ea2c2d59fb6c2f8c1ab8c71709ed9d1b6d60b0e1c9fbb6fdcb33c" [[package]] name = "quote" @@ -734,15 +734,15 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.24" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -753,18 +753,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -779,9 +779,9 @@ checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "slotmap" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ "version_check", ] @@ -804,9 +804,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" dependencies = [ "proc-macro2", "quote", @@ -868,9 +868,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -878,9 +878,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", @@ -893,9 +893,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -903,9 +903,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", @@ -916,15 +916,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -933,7 +933,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +source = "git+https://github.com/gfx-rs/wgpu?rev=6dc9ccab8592645fda3204be1cfb5929fd7f924d#6dc9ccab8592645fda3204be1cfb5929fd7f924d" dependencies = [ "arrayvec", "bit-vec", @@ -957,7 +957,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +source = "git+https://github.com/gfx-rs/wgpu?rev=6dc9ccab8592645fda3204be1cfb5929fd7f924d#6dc9ccab8592645fda3204be1cfb5929fd7f924d" dependencies = [ "android_system_properties", "arrayvec", @@ -1012,7 +1012,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "0.18.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=2e7fd75712bfaacdaaa5538204cfe8b9360f82ca#2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +source = "git+https://github.com/gfx-rs/wgpu?rev=6dc9ccab8592645fda3204be1cfb5929fd7f924d#6dc9ccab8592645fda3204be1cfb5929fd7f924d" dependencies = [ "bitflags 2.4.1", "js-sys", @@ -1069,7 +1069,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -1078,13 +1087,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -1093,42 +1117,84 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "xml-rs" version = "0.8.19" @@ -1137,18 +1203,18 @@ checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "306dca4455518f1f31635ec308b6b3e4eb1b11758cefafc782827d0aa7acb5c7" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "be912bf68235a88fbefd1b73415cb218405958d1655b2ece9035a19920bdf6ba" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 281b4da6..6309ad3e 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 = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +rev = "6dc9ccab8592645fda3204be1cfb5929fd7f924d" 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 = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +rev = "6dc9ccab8592645fda3204be1cfb5929fd7f924d" version = "0.18" features = ["metal"] @@ -49,15 +49,15 @@ features = ["metal"] [target.'cfg(windows)'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +rev = "6dc9ccab8592645fda3204be1cfb5929fd7f924d" version = "0.18" -features = ["dx11", "dx12", "gles"] +features = ["dx12", "gles"] # We want the wgpu-core Vulkan backend on Unix (but not emscripten, macOS, iOS) and Windows. [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 = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +rev = "6dc9ccab8592645fda3204be1cfb5929fd7f924d" version = "0.18" features = ["vulkan"] @@ -65,19 +65,19 @@ 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 = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +rev = "6dc9ccab8592645fda3204be1cfb5929fd7f924d" version = "0.18" features = ["gles"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +rev = "6dc9ccab8592645fda3204be1cfb5929fd7f924d" version = "0.18" [dependencies.naga] git = "https://github.com/gfx-rs/wgpu" -rev = "2e7fd75712bfaacdaaa5538204cfe8b9360f82ca" +rev = "6dc9ccab8592645fda3204be1cfb5929fd7f924d" version = "0.14" [dependencies] diff --git a/examples/framework/framework.c b/examples/framework/framework.c index 3ba1dd8f..600686c8 100644 --- a/examples/framework/framework.c +++ b/examples/framework/framework.c @@ -117,36 +117,36 @@ WGPUBuffer frmwrk_device_create_buffer_init( return buffer; } -#define print_storage_report(report, prefix) \ - printf("%snumOccupied=%zu\n", prefix, report.numOccupied); \ - printf("%snumVacant=%zu\n", prefix, report.numVacant); \ +#define print_registry_report(report, prefix) \ + printf("%snumAllocated=%zu\n", prefix, report.numAllocated); \ + printf("%snumKeptFromUser=%zu\n", prefix, report.numKeptFromUser); \ + printf("%snumReleasedFromUser=%zu\n", prefix, report.numReleasedFromUser); \ + printf("%snumDestroyedFromUser=%zu\n", prefix, report.numDestroyedFromUser); \ printf("%snumError=%zu\n", prefix, report.numError); \ printf("%selementSize=%zu\n", prefix, report.elementSize) #define print_hub_report(report, prefix) \ - print_storage_report(report.adapters, prefix "adapter."); \ - print_storage_report(report.devices, prefix "devices."); \ - print_storage_report(report.pipelineLayouts, prefix "pipelineLayouts."); \ - print_storage_report(report.shaderModules, prefix "shaderModules."); \ - print_storage_report(report.bindGroupLayouts, prefix "bindGroupLayouts."); \ - print_storage_report(report.bindGroups, prefix "bindGroups."); \ - print_storage_report(report.commandBuffers, prefix "commandBuffers."); \ - print_storage_report(report.renderBundles, prefix "renderBundles."); \ - print_storage_report(report.renderPipelines, prefix "renderPipelines."); \ - print_storage_report(report.computePipelines, prefix "computePipelines."); \ - print_storage_report(report.querySets, prefix "querySets."); \ - print_storage_report(report.textures, prefix "textures."); \ - print_storage_report(report.textureViews, prefix "textureViews."); \ - print_storage_report(report.samplers, prefix "samplers.") + print_registry_report(report.adapters, prefix "adapter."); \ + print_registry_report(report.devices, prefix "devices."); \ + print_registry_report(report.queues, prefix "queues."); \ + print_registry_report(report.pipelineLayouts, prefix "pipelineLayouts."); \ + print_registry_report(report.shaderModules, prefix "shaderModules."); \ + print_registry_report(report.bindGroupLayouts, prefix "bindGroupLayouts."); \ + print_registry_report(report.bindGroups, prefix "bindGroups."); \ + print_registry_report(report.commandBuffers, prefix "commandBuffers."); \ + print_registry_report(report.renderBundles, prefix "renderBundles."); \ + print_registry_report(report.renderPipelines, prefix "renderPipelines."); \ + print_registry_report(report.computePipelines, prefix "computePipelines."); \ + print_registry_report(report.querySets, prefix "querySets."); \ + print_registry_report(report.textures, prefix "textures."); \ + print_registry_report(report.textureViews, prefix "textureViews."); \ + print_registry_report(report.samplers, prefix "samplers.") void frmwrk_print_global_report(WGPUGlobalReport report) { printf("struct WGPUGlobalReport {\n"); - print_storage_report(report.surfaces, "\tsurfaces."); + print_registry_report(report.surfaces, "\tsurfaces."); switch (report.backendType) { - case WGPUBackendType_D3D11: - print_hub_report(report.dx11, "\tdx11."); - break; case WGPUBackendType_D3D12: print_hub_report(report.dx12, "\tdx12."); break; diff --git a/ffi/wgpu.h b/ffi/wgpu.h index 22011ee1..be381a2a 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -155,38 +155,40 @@ typedef struct WGPUShaderModuleGLSLDescriptor { WGPUShaderDefine * defines; } WGPUShaderModuleGLSLDescriptor; -typedef struct WGPUStorageReport { - size_t numOccupied; - size_t numVacant; - size_t numError; - size_t elementSize; -} WGPUStorageReport; +typedef struct WGPURegistryReport { + size_t numAllocated; + size_t numKeptFromUser; + size_t numReleasedFromUser; + size_t numDestroyedFromUser; + size_t numError; + size_t elementSize; +} WGPURegistryReport; typedef struct WGPUHubReport { - WGPUStorageReport adapters; - WGPUStorageReport devices; - WGPUStorageReport pipelineLayouts; - WGPUStorageReport shaderModules; - WGPUStorageReport bindGroupLayouts; - WGPUStorageReport bindGroups; - WGPUStorageReport commandBuffers; - WGPUStorageReport renderBundles; - WGPUStorageReport renderPipelines; - WGPUStorageReport computePipelines; - WGPUStorageReport querySets; - WGPUStorageReport buffers; - WGPUStorageReport textures; - WGPUStorageReport textureViews; - WGPUStorageReport samplers; + WGPURegistryReport adapters; + WGPURegistryReport devices; + WGPURegistryReport queues; + WGPURegistryReport pipelineLayouts; + WGPURegistryReport shaderModules; + WGPURegistryReport bindGroupLayouts; + WGPURegistryReport bindGroups; + WGPURegistryReport commandBuffers; + WGPURegistryReport renderBundles; + WGPURegistryReport renderPipelines; + WGPURegistryReport computePipelines; + WGPURegistryReport querySets; + WGPURegistryReport buffers; + WGPURegistryReport textures; + WGPURegistryReport textureViews; + WGPURegistryReport samplers; } WGPUHubReport; typedef struct WGPUGlobalReport { - WGPUStorageReport surfaces; + WGPURegistryReport surfaces; WGPUBackendType backendType; WGPUHubReport vulkan; WGPUHubReport metal; WGPUHubReport dx12; - WGPUHubReport dx11; WGPUHubReport gl; } WGPUGlobalReport; diff --git a/src/conv.rs b/src/conv.rs index a002890f..4ee871a6 100644 --- a/src/conv.rs +++ b/src/conv.rs @@ -250,9 +250,6 @@ pub fn map_instance_backend_flags(flags: native::WGPUInstanceBackend) -> wgt::Ba if (flags & native::WGPUInstanceBackend_DX12) != 0 { result |= wgt::Backends::DX12; } - if (flags & native::WGPUInstanceBackend_DX11) != 0 { - result |= wgt::Backends::DX11; - } result } @@ -315,8 +312,11 @@ pub fn map_device_descriptor<'a>( ( wgt::DeviceDescriptor { label: ptr_into_label(des.label), - features: map_features(make_slice(des.requiredFeatures, des.requiredFeatureCount)), - limits: match unsafe { des.requiredLimits.as_ref() } { + required_features: map_features(make_slice( + des.requiredFeatures, + des.requiredFeatureCount, + )), + required_limits: match unsafe { des.requiredLimits.as_ref() } { Some(required_limits) => unsafe { follow_chain!( map_required_limits((required_limits, base_limits), @@ -836,6 +836,7 @@ pub fn to_native_texture_format(rs_type: wgt::TextureFormat) -> Option None, wgt::TextureFormat::Rgba16Unorm => None, wgt::TextureFormat::Rgba16Snorm => None, + wgt::TextureFormat::NV12 => None, wgt::TextureFormat::Astc { block:_, channel: AstcChannel::Hdr } => None, wgt::TextureFormat::R8Unorm => Some(native::WGPUTextureFormat_R8Unorm), @@ -966,10 +967,12 @@ pub fn map_primitive_state( } #[inline] -pub fn map_storage_report(report: wgc::storage::StorageReport) -> native::WGPUStorageReport { - native::WGPUStorageReport { - numOccupied: report.num_occupied, - numVacant: report.num_error, +pub fn map_storage_report(report: wgc::registry::RegistryReport) -> native::WGPURegistryReport { + native::WGPURegistryReport { + numAllocated: report.num_allocated, + numKeptFromUser: report.num_kept_from_user, + numReleasedFromUser: report.num_released_from_user, + numDestroyedFromUser: report.num_destroyed_from_user, numError: report.num_error, elementSize: report.element_size, } @@ -980,6 +983,7 @@ pub fn map_hub_report(report: wgc::hub::HubReport) -> native::WGPUHubReport { native::WGPUHubReport { adapters: map_storage_report(report.adapters), devices: map_storage_report(report.devices), + queues: map_storage_report(report.queues), pipelineLayouts: map_storage_report(report.pipeline_layouts), shaderModules: map_storage_report(report.shader_modules), bindGroupLayouts: map_storage_report(report.bind_group_layouts), @@ -1024,15 +1028,9 @@ pub fn write_global_report( } #[cfg(windows)] - { - if let Some(dx12) = report.dx12 { - native_report.dx12 = map_hub_report(dx12); - native_report.backendType = native::WGPUBackendType_D3D12; - } - if let Some(dx11) = report.dx11 { - native_report.dx11 = map_hub_report(dx11); - native_report.backendType = native::WGPUBackendType_D3D11; - } + if let Some(dx12) = report.dx12 { + native_report.dx12 = map_hub_report(dx12); + native_report.backendType = native::WGPUBackendType_D3D12; } #[cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))] @@ -1089,9 +1087,9 @@ pub fn features_to_native(features: wgt::Features) -> Vec not yet available in wgpu-core + if features.contains(wgt::Features::FLOAT32_FILTERABLE) { + temp.push(native::WGPUFeatureName_Float32Filterable); + } // wgpu-rs only features if features.contains(wgt::Features::PUSH_CONSTANTS) { @@ -1140,7 +1138,7 @@ pub fn map_feature(feature: native::WGPUFeatureName) -> Option { native::WGPUFeatureName_ShaderF16 => Some(Features::SHADER_F16), native::WGPUFeatureName_RG11B10UfloatRenderable => Some(Features::RG11B10UFLOAT_RENDERABLE), native::WGPUFeatureName_BGRA8UnormStorage => Some(Features::BGRA8UNORM_STORAGE), - //native::WGPUFeatureName_Float32Filterable => Some(Features::FLOAT32_FILTERABLE), + native::WGPUFeatureName_Float32Filterable => Some(Features::FLOAT32_FILTERABLE), // wgpu-rs only features native::WGPUNativeFeature_PushConstants => Some(Features::PUSH_CONSTANTS), @@ -1442,15 +1440,14 @@ pub enum CreateSurfaceParams { pub unsafe fn map_surface( _: &native::WGPUSurfaceDescriptor, - _win: Option<&native::WGPUSurfaceDescriptorFromWindowsHWND>, - _xcb: Option<&native::WGPUSurfaceDescriptorFromXcbWindow>, - _xlib: Option<&native::WGPUSurfaceDescriptorFromXlibWindow>, - _wl: Option<&native::WGPUSurfaceDescriptorFromWaylandSurface>, - _metal: Option<&native::WGPUSurfaceDescriptorFromMetalLayer>, - _android: Option<&native::WGPUSurfaceDescriptorFromAndroidNativeWindow>, + win: Option<&native::WGPUSurfaceDescriptorFromWindowsHWND>, + xcb: Option<&native::WGPUSurfaceDescriptorFromXcbWindow>, + xlib: Option<&native::WGPUSurfaceDescriptorFromXlibWindow>, + wl: Option<&native::WGPUSurfaceDescriptorFromWaylandSurface>, + metal: Option<&native::WGPUSurfaceDescriptorFromMetalLayer>, + android: Option<&native::WGPUSurfaceDescriptorFromAndroidNativeWindow>, ) -> CreateSurfaceParams { - #[cfg(windows)] - if let Some(win) = _win { + if let Some(win) = win { let display_handle = raw_window_handle::WindowsDisplayHandle::new(); let mut window_handle = raw_window_handle::Win32WindowHandle::new(NonZeroIsize::new_unchecked(win.hwnd as _)); @@ -1462,56 +1459,47 @@ pub unsafe fn map_surface( )); } - #[cfg(all( - unix, - not(target_os = "android"), - not(target_os = "ios"), - not(target_os = "macos") - ))] - { - if let Some(xcb) = _xcb { - 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), - raw_window_handle::RawWindowHandle::Xcb(window_handle), - )); - } + if let Some(xcb) = xcb { + 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)); - if let Some(xlib) = _xlib { - 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::Xcb(display_handle), + raw_window_handle::RawWindowHandle::Xcb(window_handle), + )); + } - return CreateSurfaceParams::Raw(( - raw_window_handle::RawDisplayHandle::Xlib(display_handle), - raw_window_handle::RawWindowHandle::Xlib(window_handle), - )); - } + if let Some(xlib) = xlib { + 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), + raw_window_handle::RawWindowHandle::Xlib(window_handle), + )); + } - if let Some(wl) = _wl { - 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); + if let Some(wl) = wl { + 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), - raw_window_handle::RawWindowHandle::Wayland(window_handle), - )); - } + return CreateSurfaceParams::Raw(( + raw_window_handle::RawDisplayHandle::Wayland(display_handle), + raw_window_handle::RawWindowHandle::Wayland(window_handle), + )); } #[cfg(any(target_os = "ios", target_os = "macos"))] - if let Some(metal) = _metal { + if let Some(metal) = metal { return CreateSurfaceParams::Metal(metal.layer); } - #[cfg(target_os = "android")] - if let Some(android) = _android { + if let Some(android) = android { let display_handle = raw_window_handle::AndroidDisplayHandle::new(); let window_handle = raw_window_handle::AndroidNdkWindowHandle::new(NonNull::new_unchecked(android.window)); diff --git a/src/lib.rs b/src/lib.rs index ec9e0f99..a7761332 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -161,6 +161,7 @@ impl Drop for WGPUComputePipelineImpl { pub struct WGPUDeviceImpl { context: Arc, id: id::DeviceId, + queue_id: id::QueueId, error_sink: ErrorSink, } impl Drop for WGPUDeviceImpl { @@ -218,6 +219,14 @@ pub struct WGPUQueueImpl { id: id::QueueId, error_sink: ErrorSink, } +impl Drop for WGPUQueueImpl { + fn drop(&mut self) { + if !thread::panicking() { + let context = &self.context; + gfx_select!(self.id => context.queue_drop(self.id)); + } + } +} pub struct WGPURenderBundleImpl { context: Arc, @@ -679,7 +688,6 @@ pub unsafe extern "C" fn wgpuAdapterGetProperties( wgt::Backend::Vulkan => native::WGPUBackendType_Vulkan, wgt::Backend::Metal => native::WGPUBackendType_Metal, wgt::Backend::Dx12 => native::WGPUBackendType_D3D12, - wgt::Backend::Dx11 => native::WGPUBackendType_D3D11, wgt::Backend::Gl => native::WGPUBackendType_OpenGL, wgt::Backend::BrowserWebGpu => native::WGPUBackendType_WebGPU, }, @@ -765,7 +773,7 @@ pub unsafe extern "C" fn wgpuAdapterRequestDevice( } None => ( wgt::DeviceDescriptor { - limits: base_limits, + required_limits: base_limits, ..Default::default() }, std::ptr::null(), @@ -773,11 +781,12 @@ pub unsafe extern "C" fn wgpuAdapterRequestDevice( ), }; - let (device_id, err) = gfx_select!(adapter_id => + let (device_id, queue_id, err) = gfx_select!(adapter_id => context.adapter_request_device( adapter_id, &desc, ptr_into_path(trace_str), + (), () ) ); @@ -788,6 +797,7 @@ pub unsafe extern "C" fn wgpuAdapterRequestDevice( Arc::into_raw(Arc::new(WGPUDeviceImpl { context: context.clone(), id: device_id, + queue_id, error_sink: Arc::new(Mutex::new(ErrorSinkRaw::new(device_lost_handler))), })), std::ptr::null(), @@ -948,7 +958,7 @@ pub unsafe extern "C" fn wgpuBufferMapAsync( native::WGPUMapMode_Read => wgc::device::HostMap::Read, _ => panic!("invalid map mode"), }, - callback: wgc::resource::BufferMapCallback::from_rust(Box::new( + callback: Some(wgc::resource::BufferMapCallback::from_rust(Box::new( move |result: resource::BufferAccessResult| { let status = match result { Ok(()) => native::WGPUBufferMapAsyncStatus_Success, @@ -969,7 +979,7 @@ pub unsafe extern "C" fn wgpuBufferMapAsync( callback(status, userdata.as_ptr()); }, - )), + ))), }; if let Err(cause) = gfx_select!(buffer_id => context.buffer_map_async(buffer_id, offset as u64 .. (offset + size) as u64, operation)) @@ -1174,7 +1184,7 @@ pub unsafe extern "C" fn wgpuCommandEncoderClearBuffer( match size { 0 => panic!("invalid size"), conv::WGPU_WHOLE_SIZE => None, - _ => Some(NonZeroU64::new_unchecked(size)), + _ => Some(size), } )) { handle_error( @@ -2476,14 +2486,14 @@ pub unsafe extern "C" fn wgpuDeviceGetLimits( #[no_mangle] pub unsafe extern "C" fn wgpuDeviceGetQueue(device: native::WGPUDevice) -> native::WGPUQueue { - let (device_id, context, error_sink) = { + let (queue_id, context, error_sink) = { let device = device.as_ref().expect("invalid device"); - (device.id, &device.context, &device.error_sink) + (device.queue_id, &device.context, &device.error_sink) }; Arc::into_raw(Arc::new(WGPUQueueImpl { context: context.clone(), - id: device_id, + id: queue_id, error_sink: error_sink.clone(), })) } @@ -2645,7 +2655,6 @@ pub unsafe extern "C" fn wgpuInstanceRequestAdapter( match options.backendType { native::WGPUBackendType_Undefined => wgt::Backends::all(), native::WGPUBackendType_WebGPU => wgt::Backends::BROWSER_WEBGPU, - native::WGPUBackendType_D3D11 => wgt::Backends::DX11, native::WGPUBackendType_D3D12 => wgt::Backends::DX12, native::WGPUBackendType_Metal => wgt::Backends::METAL, native::WGPUBackendType_Vulkan => wgt::Backends::VULKAN,