diff --git a/Cargo.lock b/Cargo.lock index 4c56a22..803b60b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,6 +14,24 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -23,6 +41,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "alsa" version = "0.6.0" @@ -45,6 +69,33 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "android-activity" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +dependencies = [ + "android-properties", + "bitflags 2.6.0", + "cc", + "cesu8", + "jni 0.21.1", + "jni-sys", + "libc", + "log", + "ndk 0.9.0", + "ndk-context", + "ndk-sys 0.6.0+11769913", + "num_enum 0.7.3", + "thiserror", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -60,6 +111,33 @@ dependencies = [ "libc", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.3.0" @@ -100,14 +178,38 @@ dependencies = [ "itertools 0.12.1", "lazy_static", "lazycell", + "log", + "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", "syn 2.0.76", + "which", ] +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitfield" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5acf59e2452f0c4b968b15ce4b9468f57b45f7733b919d68b19fcc39264bfb8" + [[package]] name = "bitflags" version = "1.3.2" @@ -126,6 +228,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -144,12 +255,32 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.6.0", + "log", + "polling", + "rustix", + "slab", + "thiserror", +] + [[package]] name = "case_insensitive_hashmap" version = "1.0.1" @@ -185,18 +316,24 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "cgl" version = "0.3.2" @@ -232,7 +369,7 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading 0.8.5", + "libloading", ] [[package]] @@ -245,56 +382,55 @@ dependencies = [ ] [[package]] -name = "cocoa" -version = "0.23.0" +name = "codespan-reporting" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54201c07dcf3a5ca33fececb8042aed767ee4bfd5a0235a8ceabcda956044b2" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation 0.9.4", - "core-graphics 0.22.3", - "foreign-types", - "libc", - "objc", + "termcolor", + "unicode-width", ] [[package]] -name = "cocoa" -version = "0.24.1" +name = "colored" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation 0.9.4", - "core-graphics 0.22.3", - "foreign-types", - "libc", - "objc", + "lazy_static", + "windows-sys 0.48.0", ] [[package]] -name = "cocoa-foundation" -version = "0.1.2" +name = "com" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" dependencies = [ - "bitflags 1.3.2", - "block", - "core-foundation 0.9.4", - "core-graphics-types", - "libc", - "objc", + "com_macros", ] [[package]] -name = "color_quant" -version = "1.1.0" +name = "com_macros" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "combine" @@ -307,13 +443,12 @@ dependencies = [ ] [[package]] -name = "core-foundation" -version = "0.7.0" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "core-foundation-sys 0.7.0", - "libc", + "crossbeam-utils", ] [[package]] @@ -322,16 +457,10 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "core-foundation-sys 0.8.7", + "core-foundation-sys", "libc", ] -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -340,24 +469,12 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" -version = "0.19.2" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ "bitflags 1.3.2", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", + "core-foundation", "core-graphics-types", "foreign-types", "libc", @@ -370,21 +487,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", - "core-foundation 0.9.4", + "core-foundation", "libc", ] [[package]] -name = "core-video-sys" -version = "0.1.4" +name = "core2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" dependencies = [ - "cfg-if 0.1.10", - "core-foundation-sys 0.7.0", - "core-graphics 0.19.2", - "libc", - "objc", + "memchr", ] [[package]] @@ -394,7 +507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" dependencies = [ "bitflags 1.3.2", - "core-foundation-sys 0.8.7", + "core-foundation-sys", "coreaudio-sys", ] @@ -413,23 +526,23 @@ version = "0.14.0" source = "git+https://github.com/doukutsu-rs/cpal?rev=9d269d8724102404e73a61e9def0c0cbc921b676#9d269d8724102404e73a61e9def0c0cbc921b676" dependencies = [ "alsa", - "core-foundation-sys 0.8.7", + "core-foundation-sys", "coreaudio-rs", "dasp_sample", "jni 0.19.0", "js-sys", "libc", "mach", - "ndk", + "ndk 0.7.0", "ndk-context", "oboe", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "thiserror", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows", + "windows 0.43.0", ] [[package]] @@ -438,57 +551,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", + "cfg-if", ] [[package]] @@ -498,10 +561,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] -name = "cty" -version = "0.2.2" +name = "cursor-icon" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "darling" @@ -538,6 +601,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dary_heap" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" + [[package]] name = "dasp_sample" version = "0.11.0" @@ -553,7 +622,7 @@ checksum = "50eb3a329e19d78c3a3dfa4ec5a51ecb84fa3a20c06edad04be25356018218f9" [[package]] name = "deko3d" version = "0.1.0" -source = "git+https://github.com/doukutsu-rs/deko3d-rs?branch=master#acddd174321c842367971faeb9aebcdb99ddfef3" +source = "git+https://github.com/doukutsu-rs/deko3d-rs?rev=acddd174321c842367971faeb9aebcdb99ddfef3#acddd174321c842367971faeb9aebcdb99ddfef3" dependencies = [ "bitflags 1.3.2", "deko3d-sys", @@ -562,29 +631,39 @@ dependencies = [ [[package]] name = "deko3d-sys" version = "0.1.0" -source = "git+https://github.com/doukutsu-rs/deko3d-rs?branch=master#acddd174321c842367971faeb9aebcdb99ddfef3" +source = "git+https://github.com/doukutsu-rs/deko3d-rs?rev=acddd174321c842367971faeb9aebcdb99ddfef3#acddd174321c842367971faeb9aebcdb99ddfef3" dependencies = [ "bindgen 0.62.0", ] [[package]] -name = "directories" -version = "3.0.2" +name = "deranged" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -606,9 +685,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] -name = "doukutsu-rs" -version = "0.101.0" +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ + "libloading", +] + +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", +] + +[[package]] +name = "doukutsu-rs" +version = "1.0.0" +dependencies = [ + "bitfield", "byteorder", "case_insensitive_hashmap", "chrono", @@ -618,35 +716,37 @@ dependencies = [ "discord-rich-presence", "downcast", "encoding_rs", - "fern", "glutin", "image", "imgui", - "itertools 0.10.5", + "include-flate", + "itertools 0.13.0", "jni 0.20.0", "lazy_static", "lewton", "log", - "ndk", + "ndk 0.7.0", "ndk-glue", - "ndk-sys", - "num-derive", + "ndk-sys 0.4.1+23.1.7779620", + "num-derive 0.4.2", "num-traits", - "objc", + "objc2", "open", "paste", "pelite", - "rc-box", + "pollster", "sdl2", "sdl2-sys", "serde", "serde_cbor", "serde_derive", "serde_json", + "simple_logger", "strum", "strum_macros", "vec_mut_scan", "webbrowser", + "wgpu", "winapi", "winit", "winres", @@ -659,6 +759,12 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" +[[package]] +name = "dpi" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" + [[package]] name = "either" version = "1.13.0" @@ -671,7 +777,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -680,16 +786,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "erasable" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f11890ce181d47a64e5d1eb4b6caba0e7bae911a356723740d058a5d0340b7d" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "errno" version = "0.3.9" @@ -709,15 +805,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "fern" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" -dependencies = [ - "log", -] - [[package]] name = "flate2" version = "1.0.33" @@ -736,18 +823,30 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foreign-types" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ + "foreign-types-macros", "foreign-types-shared", ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "foreign-types-macros" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" @@ -758,13 +857,23 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi", ] @@ -787,56 +896,57 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "glutin" -version = "0.26.0" -source = "git+https://github.com/doukutsu-rs/glutin.git?rev=2dd95f042e6e090d36f577cbea125560dd99bd27#2dd95f042e6e090d36f577cbea125560dd99bd27" +name = "glow" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f865cbd94bd355b89611211e49508da98a1fce0ad755c1e8448fb96711b24528" dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2491aa3090f682ddd920b184491844440fdd14379c7eef8f5bc10ef7fb3242fd" +dependencies = [ + "bitflags 2.6.0", + "cfg_aliases 0.2.1", "cgl", - "cocoa 0.23.0", - "core-foundation 0.9.4", + "core-foundation", + "dispatch", "glutin_egl_sys", - "glutin_emscripten_sys", - "glutin_gles2_sys", "glutin_glx_sys", "glutin_wgl_sys", - "lazy_static", - "libloading 0.6.7", - "log", - "ndk-glue", - "objc", - "osmesa-sys", - "parking_lot 0.11.2", - "winapi", - "winit", + "libloading", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "raw-window-handle 0.6.2", + "wayland-sys", + "windows-sys 0.52.0", + "x11-dl", ] [[package]] name = "glutin_egl_sys" -version = "0.1.5" -source = "git+https://github.com/doukutsu-rs/glutin.git?rev=2dd95f042e6e090d36f577cbea125560dd99bd27#2dd95f042e6e090d36f577cbea125560dd99bd27" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae99fff4d2850dbe6fb8c1fa8e4fead5525bab715beaacfccf3fb994e01c827" dependencies = [ "gl_generator", - "winapi", -] - -[[package]] -name = "glutin_emscripten_sys" -version = "0.1.1" -source = "git+https://github.com/doukutsu-rs/glutin.git?rev=2dd95f042e6e090d36f577cbea125560dd99bd27#2dd95f042e6e090d36f577cbea125560dd99bd27" - -[[package]] -name = "glutin_gles2_sys" -version = "0.1.5" -source = "git+https://github.com/doukutsu-rs/glutin.git?rev=2dd95f042e6e090d36f577cbea125560dd99bd27#2dd95f042e6e090d36f577cbea125560dd99bd27" -dependencies = [ - "gl_generator", - "objc", + "windows-sys 0.52.0", ] [[package]] name = "glutin_glx_sys" -version = "0.1.7" -source = "git+https://github.com/doukutsu-rs/glutin.git?rev=2dd95f042e6e090d36f577cbea125560dd99bd27#2dd95f042e6e090d36f577cbea125560dd99bd27" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2b2d3918e76e18e08796b55eb64e8fe6ec67d5a6b2e2a7e2edce224ad24c63" dependencies = [ "gl_generator", "x11-dl", @@ -844,12 +954,64 @@ dependencies = [ [[package]] name = "glutin_wgl_sys" -version = "0.1.5" -source = "git+https://github.com/doukutsu-rs/glutin.git?rev=2dd95f042e6e090d36f577cbea125560dd99bd27#2dd95f042e6e090d36f577cbea125560dd99bd27" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" dependencies = [ "gl_generator", ] +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.6.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "gpu-allocator" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +dependencies = [ + "log", + "presser", + "thiserror", + "windows 0.58.0", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" +dependencies = [ + "bitflags 2.6.0", + "gpu-descriptor-types", + "hashbrown", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "half" version = "1.8.3" @@ -861,12 +1023,43 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hassle-rs" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" +dependencies = [ + "bitflags 2.6.0", + "com", + "libc", + "libloading", + "thiserror", + "widestring", + "winapi", +] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] name = "home" @@ -884,11 +1077,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", - "core-foundation-sys 0.8.7", + "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -918,13 +1111,12 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" dependencies = [ "bytemuck", - "byteorder", - "color_quant", + "byteorder-lite", "num-traits", "png", ] @@ -932,26 +1124,49 @@ dependencies = [ [[package]] name = "imgui" version = "0.12.0" -source = "git+https://github.com/imgui-rs/imgui-rs.git?rev=5d771a83b82c5cc3dd58cca3f969d900369262e6#5d771a83b82c5cc3dd58cca3f969d900369262e6" +source = "git+https://github.com/imgui-rs/imgui-rs.git?rev=67f7f11363e62f09aa0e1288a17800e505860486#67f7f11363e62f09aa0e1288a17800e505860486" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "imgui-sys", "mint", - "parking_lot 0.12.3", + "parking_lot", ] [[package]] name = "imgui-sys" version = "0.12.0" -source = "git+https://github.com/imgui-rs/imgui-rs.git?rev=5d771a83b82c5cc3dd58cca3f969d900369262e6#5d771a83b82c5cc3dd58cca3f969d900369262e6" +source = "git+https://github.com/imgui-rs/imgui-rs.git?rev=67f7f11363e62f09aa0e1288a17800e505860486#67f7f11363e62f09aa0e1288a17800e505860486" dependencies = [ "cc", - "cfg-if 1.0.0", + "cfg-if", "chlorine", "mint", ] +[[package]] +name = "include-flate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df49c16750695486c1f34de05da5b7438096156466e7f76c38fcdf285cf0113e" +dependencies = [ + "include-flate-codegen", + "lazy_static", + "libflate", +] + +[[package]] +name = "include-flate-codegen" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c5b246c6261be723b85c61ecf87804e8ea4a35cb68be0ff282ed84b95ffe7d7" +dependencies = [ + "libflate", + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "indexmap" version = "2.4.0" @@ -962,29 +1177,20 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1030,7 +1236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", - "cfg-if 1.0.0", + "cfg-if", "combine", "jni-sys", "log", @@ -1063,6 +1269,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading", + "pkg-config", +] + [[package]] name = "khronos_api" version = "3.1.0" @@ -1099,13 +1316,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] -name = "libloading" -version = "0.6.7" +name = "libflate" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" dependencies = [ - "cfg-if 1.0.0", - "winapi", + "adler32", + "core2", + "crc32fast", + "dary_heap", + "libflate_lz77", +] + +[[package]] +name = "libflate_lz77" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" +dependencies = [ + "core2", + "hashbrown", + "rle-decode-fast", ] [[package]] @@ -1114,10 +1345,21 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-targets 0.52.6", ] +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "libredox" version = "0.1.3" @@ -1134,6 +1376,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.12" @@ -1183,6 +1431,21 @@ dependencies = [ "autocfg", ] +[[package]] +name = "metal" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" +dependencies = [ + "bitflags 2.6.0", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1215,37 +1478,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" [[package]] -name = "mio" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +name = "naga" +version = "22.0.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=aadca17885e60ee4527da7559334dacec3b57475#aadca17885e60ee4527da7559334dacec3b57475" dependencies = [ - "libc", + "arrayvec", + "bit-set", + "bitflags 2.6.0", + "cfg_aliases 0.1.1", + "codespan-reporting", + "hexf-parse", + "indexmap", "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "mio-misc" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47412f3a52115b936ff2a229b803498c7b4d332adeb87c2f1498c9da54c398c" -dependencies = [ - "crossbeam", - "crossbeam-queue", - "log", - "mio", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", + "rustc-hash", + "spirv", + "termcolor", + "thiserror", + "unicode-xid", ] [[package]] @@ -1256,12 +1505,26 @@ checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags 1.3.2", "jni-sys", - "ndk-sys", - "num_enum", + "ndk-sys 0.4.1+23.1.7779620", + "num_enum 0.5.11", "raw-window-handle 0.5.2", "thiserror", ] +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.6.0", + "jni-sys", + "log", + "ndk-sys 0.6.0+11769913", + "num_enum 0.7.3", + "thiserror", +] + [[package]] name = "ndk-context" version = "0.1.1" @@ -1276,12 +1539,12 @@ checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" dependencies = [ "libc", "log", - "ndk", + "ndk 0.7.0", "ndk-context", "ndk-macro", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "once_cell", - "parking_lot 0.12.3", + "parking_lot", ] [[package]] @@ -1306,6 +1569,24 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + [[package]] name = "nix" version = "0.23.2" @@ -1314,7 +1595,7 @@ checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" dependencies = [ "bitflags 1.3.2", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -1336,13 +1617,10 @@ dependencies = [ ] [[package]] -name = "ntapi" -version = "0.3.7" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", -] +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-derive" @@ -1355,6 +1633,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1370,7 +1659,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive 0.7.3", ] [[package]] @@ -1385,6 +1683,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "objc" version = "0.2.7" @@ -1394,6 +1713,209 @@ dependencies = [ "malloc_buf", ] +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.6.0", + "block2", + "dispatch", + "libc", + "objc2", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + [[package]] name = "oboe" version = "0.5.0" @@ -1401,9 +1923,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8868cc237ee02e2d9618539a23a8d228b9bb3fc2e7a5b11eed3831de77c395d0" dependencies = [ "jni 0.20.0", - "ndk", + "ndk 0.7.0", "ndk-context", - "num-derive", + "num-derive 0.3.3", "num-traits", "oboe-sys", ] @@ -1443,23 +1965,18 @@ dependencies = [ ] [[package]] -name = "osmesa-sys" -version = "0.1.2" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" -dependencies = [ - "shared_library", -] +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] -name = "parking_lot" -version = "0.11.2" +name = "orbclient" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", + "libredox 0.0.2", ] [[package]] @@ -1469,21 +1986,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -1492,7 +1995,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.5.3", "smallvec", @@ -1540,6 +2043,32 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + [[package]] name = "pkg-config" version = "0.3.30" @@ -1559,6 +2088,49 @@ dependencies = [ "miniz_oxide 0.7.4", ] +[[package]] +name = "polling" +version = "3.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "pollster" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.76", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -1578,6 +2150,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" + [[package]] name = "quote" version = "1.0.37" @@ -1588,23 +2166,10 @@ dependencies = [ ] [[package]] -name = "raw-window-handle" -version = "0.3.4" +name = "range-alloc" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" -dependencies = [ - "libc", - "raw-window-handle 0.4.3", -] - -[[package]] -name = "raw-window-handle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" -dependencies = [ - "cty", -] +checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "raw-window-handle" @@ -1613,19 +2178,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] -name = "rc-box" -version = "1.2.0" +name = "raw-window-handle" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0690759eabf094030c2cdabc25ade1395bac02210d920d655053c1d49583fd8" -dependencies = [ - "erasable", -] +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] @@ -1646,7 +2208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", - "libredox", + "libredox 0.1.3", "thiserror", ] @@ -1679,6 +2241,18 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "rle-decode-fast" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -1727,21 +2301,25 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sdl2" -version = "0.36.0" -source = "git+https://github.com/doukutsu-rs/rust-sdl2.git?rev=f2f1e29a416bcc22f2faf411866db2c8d9536308#f2f1e29a416bcc22f2faf411866db2c8d9536308" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b498da7d14d1ad6c839729bd4ad6fc11d90a57583605f3b4df2cd709a9cd380" dependencies = [ "bitflags 1.3.2", "lazy_static", "libc", + "raw-window-handle 0.6.2", "sdl2-sys", ] [[package]] name = "sdl2-sys" -version = "0.36.0" -source = "git+https://github.com/doukutsu-rs/rust-sdl2.git?rev=f2f1e29a416bcc22f2faf411866db2c8d9536308#f2f1e29a416bcc22f2faf411866db2c8d9536308" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "951deab27af08ed9c6068b7b0d05a93c91f0a8eb16b6b816a5e73452a43521d3" dependencies = [ - "cfg-if 1.0.0", + "bindgen 0.69.4", + "cfg-if", "cmake", "libc", "version-compare", @@ -1789,16 +2367,6 @@ dependencies = [ "serde", ] -[[package]] -name = "shared_library" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" -dependencies = [ - "lazy_static", - "libc", -] - [[package]] name = "shlex" version = "1.3.0" @@ -1811,12 +2379,66 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simple_logger" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c5dfa5e08767553704aa0ffd9d9794d527103c736aba9854773851fd7497eb" +dependencies = [ + "colored", + "log", + "time", + "windows-sys 0.48.0", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.10.0" @@ -1825,21 +2447,21 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.24.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] @@ -1864,6 +2486,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.63" @@ -1884,6 +2515,39 @@ dependencies = [ "syn 2.0.76", ] +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1925,6 +2589,22 @@ dependencies = [ "winnow", ] +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" + [[package]] name = "unicase" version = "2.7.0" @@ -1955,6 +2635,24 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + +[[package]] +name = "unicode-xid" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + [[package]] name = "url" version = "2.5.2" @@ -2015,7 +2713,7 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "wasm-bindgen-macro", ] @@ -2041,7 +2739,7 @@ version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2076,6 +2774,18 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +[[package]] +name = "wayland-sys" +version = "0.31.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43676fe2daf68754ecf1d72026e4e6c15483198b5d24e888b74d3f22f887a148" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.70" @@ -2087,22 +2797,135 @@ dependencies = [ ] [[package]] -name = "webbrowser" -version = "0.8.15" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db67ae75a9405634f5882791678772c94ff5f16a66535aae186e26aa0841fc8b" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "core-foundation 0.9.4", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "425ba64c1e13b1c6e8c5d2541c8fac10022ca584f33da781db01b5756aef1f4e" +dependencies = [ + "block2", + "core-foundation", "home", "jni 0.21.1", "log", "ndk-context", - "objc", - "raw-window-handle 0.5.2", + "objc2", + "objc2-foundation", "url", "web-sys", ] +[[package]] +name = "wgpu" +version = "22.0.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=aadca17885e60ee4527da7559334dacec3b57475#aadca17885e60ee4527da7559334dacec3b57475" +dependencies = [ + "arrayvec", + "cfg_aliases 0.1.1", + "document-features", + "js-sys", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle 0.6.2", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "22.0.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=aadca17885e60ee4527da7559334dacec3b57475#aadca17885e60ee4527da7559334dacec3b57475" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.6.0", + "cfg_aliases 0.1.1", + "document-features", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot", + "profiling", + "raw-window-handle 0.6.2", + "rustc-hash", + "smallvec", + "thiserror", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "22.0.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=aadca17885e60ee4527da7559334dacec3b57475#aadca17885e60ee4527da7559334dacec3b57475" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.6.0", + "block", + "cfg_aliases 0.1.1", + "core-graphics-types", + "glow", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "hassle-rs", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "parking_lot", + "profiling", + "range-alloc", + "raw-window-handle 0.6.2", + "renderdoc-sys", + "rustc-hash", + "smallvec", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "windows 0.58.0", + "windows-core 0.58.0", +] + +[[package]] +name = "wgpu-types" +version = "22.0.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=aadca17885e60ee4527da7559334dacec3b57475#aadca17885e60ee4527da7559334dacec3b57475" +dependencies = [ + "bitflags 2.6.0", + "js-sys", + "web-sys", +] + [[package]] name = "which" version = "4.4.2" @@ -2115,6 +2938,12 @@ dependencies = [ "rustix", ] +[[package]] +name = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" + [[package]] name = "winapi" version = "0.3.9" @@ -2161,6 +2990,16 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -2170,6 +3009,60 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -2194,6 +3087,15 @@ dependencies = [ "windows-targets 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -2227,6 +3129,21 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "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.6" @@ -2249,6 +3166,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -2261,6 +3184,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[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.6" @@ -2273,6 +3202,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[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.6" @@ -2291,6 +3226,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[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.6" @@ -2303,6 +3244,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[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.6" @@ -2315,6 +3262,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[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.6" @@ -2327,6 +3280,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[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.6" @@ -2335,31 +3294,45 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" -version = "0.24.0" -source = "git+https://github.com/doukutsu-rs/winit.git?rev=878f206d19af01b0977277929eee5e32667453c0#878f206d19af01b0977277929eee5e32667453c0" +version = "0.30.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be9e76a1f1077e04a411f0b989cbd3c93339e1771cb41e71ac4aee95bfd2c67" dependencies = [ - "bitflags 1.3.2", - "cocoa 0.24.1", - "core-foundation 0.9.4", - "core-graphics 0.22.3", - "core-video-sys", - "dispatch", - "instant", - "lazy_static", + "android-activity", + "atomic-waker", + "bitflags 2.6.0", + "block2", + "bytemuck", + "calloop", + "cfg_aliases 0.2.1", + "concurrent-queue", + "core-foundation", + "core-graphics", + "cursor-icon", + "dpi", + "js-sys", "libc", - "log", - "mio", - "mio-misc", - "ndk", - "ndk-glue", - "ndk-sys", - "objc", - "parking_lot 0.11.2", + "ndk 0.9.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "orbclient", "percent-encoding", - "raw-window-handle 0.3.4", - "scopeguard", - "winapi", + "pin-project", + "redox_syscall 0.4.1", + "rustix", + "smol_str", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "web-time", + "windows-sys 0.52.0", "x11-dl", + "x11rb", + "xkbcommon-dl", ] [[package]] @@ -2391,6 +3364,46 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading", + "once_cell", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.6.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" + [[package]] name = "xml-rs" version = "0.8.21" @@ -2405,3 +3418,23 @@ checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" dependencies = [ "xml-rs", ] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] diff --git a/Cargo.toml b/Cargo.toml index 72bf440..38ac724 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,13 +37,14 @@ category = "Game" osx_minimum_system_version = "10.12" [features] -default = ["default-base", "backend-sdl", "render-opengl", "exe", "webbrowser", "discord-rpc"] +default = ["default-base", "backend-sdl", "render-opengl", "render-wgpu", "exe", "webbrowser", "discord-rpc"] default-base = ["ogg-playback"] ogg-playback = ["lewton"] backend-sdl = ["sdl2", "sdl2-sys"] -backend-winit = ["winit", "glutin", "render-opengl"] +backend-winit = ["winit", "glutin"] backend-horizon = [] render-opengl = [] +render-wgpu = ["wgpu"] discord-rpc = ["discord-rich-presence"] netplay = ["serde_cbor"] editor = [] @@ -52,7 +53,7 @@ android = [] [dependencies] #glutin = { path = "./3rdparty/glutin/glutin", optional = true } -#winit = { path = "./3rdparty/winit", optional = true, default_features = false, features = ["x11"] } +#winit = { path = "./3rdparty/winit", optional = true, default-features = false, features = ["x11"] } #sdl2 = { path = "./3rdparty/rust-sdl2", optional = true, features = ["unsafe_textures", "bundled", "static-link"] } #sdl2-sys = { path = "./3rdparty/rust-sdl2/sdl2-sys", optional = true, features = ["bundled", "static-link"] } #cpal = { path = "./3rdparty/cpal" } @@ -61,13 +62,13 @@ byteorder = "1.4" case_insensitive_hashmap = "1.0.0" chrono = { version = "0.4", default-features = false, features = ["clock", "std"] } cpal = { git = "https://github.com/doukutsu-rs/cpal", rev = "9d269d8724102404e73a61e9def0c0cbc921b676" } -directories = "3" +directories = "5" discord-rich-presence = { version = "0.2", optional = true } downcast = "0.11" encoding_rs = "0.8.33" glutin = { version = "0.32.0", optional = true } imgui = { git = "https://github.com/imgui-rs/imgui-rs.git", rev = "67f7f11363e62f09aa0e1288a17800e505860486" } -image = { version = "0.24", default-features = false, features = ["png", "bmp"] } +image = { version = "0.25", default-features = false, features = ["png", "bmp"] } itertools = "0.13.0" include-flate = "0.3.0" lazy_static = "1.4" @@ -78,25 +79,26 @@ num-traits = "0.2" open = "3.2" paste = "1.0" pelite = { version = ">=0.9.2", default-features = false, features = ["std"] } -sdl2 = { version = "0.37", optional = true, features = ["unsafe_textures", "bundled", "static-link"] } -sdl2-sys = { version = "0.37", optional = true, features = ["bundled", "static-link"] } -rc-box = "1.2.0" +pollster = "0.3.0" +sdl2 = { version = "0.37", optional = true, features = ["unsafe_textures", "bundled", "static-link", "raw-window-handle", "use-bindgen"] } +sdl2-sys = { version = "0.37", optional = true, features = ["bundled", "static-link", "use-bindgen"] } serde = { version = "1", features = ["derive"] } serde_derive = "1" serde_cbor = { version = "0.11", optional = true } serde_json = "1.0" simple_logger = { version = "5.0.0", features = ["colors", "threads"] } -strum = "0.24" -strum_macros = "0.24" +strum = "0.26" +strum_macros = "0.26" # remove and replace when extract_if is in stable vec_mut_scan = "0.4" webbrowser = { version = "1.0.1", optional = true } -winit = { version = "0.30.2", optional = true, default_features = false, features = ["x11"] } +wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "aadca17885e60ee4527da7559334dacec3b57475", optional = true } +winit = { version = "0.30.2", optional = true, default-features = false, features = ["x11"] } xmltree = "0.10" #hack to not link SDL_image on Windows(causes a linker error) [target.'cfg(not(target_os = "windows"))'.dependencies] -sdl2 = { version = "0.37", optional = true, features = ["image", "unsafe_textures", "bundled", "static-link"] } +sdl2 = { version = "0.37", optional = true, features = ["image", "unsafe_textures", "bundled", "static-link", "raw-window-handle", "use-bindgen"] } [target.'cfg(target_os = "windows")'.dependencies] winapi = { version = "0.3", features = ["winuser"] } diff --git a/src/framework/backend_sdl2.rs b/src/framework/backend_sdl2.rs index eee1de2..a47c104 100644 --- a/src/framework/backend_sdl2.rs +++ b/src/framework/backend_sdl2.rs @@ -38,6 +38,8 @@ use crate::framework::graphics::{BlendMode, SwapMode}; use crate::framework::keyboard::ScanCode; #[cfg(feature = "render-opengl")] use crate::framework::render_opengl::{GLContext, OpenGLRenderer}; +#[cfg(feature = "render-wgpu")] +use crate::framework::render_wgpu::WGPURenderer; use crate::framework::ui::init_imgui; use crate::framework::{filesystem, render_opengl}; use crate::game::shared_game_state::WindowMode; @@ -161,6 +163,19 @@ struct SDL2Context { preferred_renderer: Option, } +#[allow(unused)] +fn wm_info() -> sdl2_sys::SDL_SysWMinfo { + unsafe { + // safety: fields are initialized by SDL_GetWindowWMInfo + let mut winfo: sdl2_sys::SDL_SysWMinfo = mem::MaybeUninit::zeroed().assume_init(); + winfo.version.major = sdl2_sys::SDL_MAJOR_VERSION as _; + winfo.version.minor = sdl2_sys::SDL_MINOR_VERSION as _; + winfo.version.patch = sdl2_sys::SDL_PATCHLEVEL as _; + + winfo + } +} + impl SDL2EventLoop { pub fn new(sdl: &Sdl, size_hint: (u16, u16), ctx: &Context) -> GameResult> { let event_pump = sdl.event_pump().map_err(GameError::WindowError)?; @@ -223,11 +238,7 @@ impl SDL2EventLoop { const NSWindowStyleMaskFullSizeContentView: u32 = 1 << 15; // safety: fields are initialized by SDL_GetWindowWMInfo - let mut winfo: sdl2_sys::SDL_SysWMinfo = mem::MaybeUninit::zeroed().assume_init(); - winfo.version.major = sdl2_sys::SDL_MAJOR_VERSION as _; - winfo.version.minor = sdl2_sys::SDL_MINOR_VERSION as _; - winfo.version.patch = sdl2_sys::SDL_PATCHLEVEL as _; - + let mut winfo = wm_info(); let mut whandle = self.refs.deref().borrow().window.window().raw(); if sdl2_sys::SDL_GetWindowWMInfo(whandle, &mut winfo as *mut _) != sdl2_sys::SDL_bool::SDL_FALSE { @@ -320,9 +331,29 @@ impl SDL2EventLoop { OpenGLRenderer::new(gl_context, imgui) } - fn try_create_sdl2_renderer(&self) -> GameResult> { + #[cfg(feature = "render-wgpu")] + fn try_create_wgpu_renderer(&self) -> GameResult> { + use std::{ffi::c_ulong, mem::MaybeUninit, num::NonZero, ptr::NonNull}; + + use sdl2_sys::{SDL_bool, SDL_SYSWM_TYPE}; + use wgpu::rwh::{HasDisplayHandle, HasWindowHandle}; + + let mut refs = self.refs.borrow_mut(); + + let (window_handle, display_handle) = unsafe { + let window = refs.window.window(); + let window_handle = HasWindowHandle::window_handle(window) + .map_err(|e| GameError::WindowError("Failed to get raw window handle".to_owned()))?; + let display_handle = HasDisplayHandle::display_handle(window) + .map_err(|e| GameError::WindowError("Failed to get raw display handle".to_owned()))?; + + (window_handle.as_raw(), display_handle.as_raw()) + }; let imgui = Self::create_imgui()?; + WGPURenderer::new(imgui, display_handle, window_handle) + } + fn try_create_sdl2_renderer(&self) -> GameResult> { let mut refs = self.refs.borrow_mut(); let window = std::mem::take(&mut refs.window); @@ -517,6 +548,9 @@ impl BackendEventLoop for SDL2EventLoop { let mut renderers = { let mut renderers: Vec<(&'static str, fn(&Self) -> GameResult>)> = Vec::new(); + #[cfg(feature = "render-wgpu")] + renderers.push((WGPURenderer::RENDERER_ID, Self::try_create_wgpu_renderer)); + #[cfg(feature = "render-opengl")] renderers.push((OpenGLRenderer::RENDERER_ID, Self::try_create_opengl_renderer)); diff --git a/src/framework/mod.rs b/src/framework/mod.rs index d2a29d2..4ca92d7 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -18,6 +18,8 @@ pub mod graphics; pub mod keyboard; #[cfg(feature = "render-opengl")] pub mod render_opengl; +#[cfg(feature = "render-wgpu")] +pub mod render_wgpu; pub mod ui; pub mod util; pub mod vfs; diff --git a/src/framework/render_opengl.rs b/src/framework/render_opengl.rs index 03a6c5a..9aaa988 100644 --- a/src/framework/render_opengl.rs +++ b/src/framework/render_opengl.rs @@ -666,6 +666,8 @@ pub struct OpenGLRenderer { render_data: RenderData, def_matrix: [[f32; 4]; 4], curr_matrix: [[f32; 4]; 4], + imgui_display_size: [f32; 2], + imgui_display_scale: [f32; 2], } impl OpenGLRenderer { @@ -680,6 +682,9 @@ impl OpenGLRenderer { let mut render_data = RenderData::new(); render_data.init(refs.gles2_mode, &mut imgui, &gl); + let imgui_display_size = imgui.io_mut().display_size; + let imgui_display_scale = imgui.io_mut().display_framebuffer_scale; + Ok(Box::new(OpenGLRenderer { refs, gl, @@ -687,6 +692,8 @@ impl OpenGLRenderer { render_data, def_matrix: [[0.0; 4]; 4], curr_matrix: [[0.0; 4]; 4], + imgui_display_size, + imgui_display_scale, })) } } @@ -709,13 +716,6 @@ impl BackendRenderer for OpenGLRenderer { } fn present(&mut self) -> GameResult { - { - let mutex = GAME_SUSPENDED.lock().unwrap(); - if *mutex { - return Ok(()); - } - } - unsafe { let gl = &self.gl; gl.gl.BindFramebuffer(gl::FRAMEBUFFER, self.render_data.render_fbo as _); @@ -807,6 +807,9 @@ impl BackendRenderer for OpenGLRenderer { gl.gl.UseProgram(self.render_data.tex_shader.program_id); gl.gl.Uniform1i(self.render_data.tex_shader.texture, 0); gl.gl.UniformMatrix4fv(self.render_data.tex_shader.proj_mtx, 1, gl::FALSE, self.curr_matrix.as_ptr() as _); + + self.imgui_display_size = self.imgui.borrow().io().display_size; + self.imgui_display_scale = self.imgui.borrow().io().display_framebuffer_scale; } Ok(()) @@ -1089,9 +1092,8 @@ impl BackendRenderer for OpenGLRenderer { gl.gl.Disable(gl::DEPTH_TEST); gl.gl.Enable(gl::SCISSOR_TEST); - let imgui = self.imgui()?; - let [width, height] = imgui.borrow().io().display_size; - let [scale_w, scale_h] = imgui.borrow().io().display_framebuffer_scale; + let [width, height] = self.imgui_display_size; + let [scale_w, scale_h] = self.imgui_display_scale; let fb_width = width * scale_w; let fb_height = height * scale_h; diff --git a/src/framework/render_wgpu.rs b/src/framework/render_wgpu.rs new file mode 100644 index 0000000..dfe6051 --- /dev/null +++ b/src/framework/render_wgpu.rs @@ -0,0 +1,735 @@ +use std::{ + any::Any, + borrow::Borrow, + cell::{Cell, Ref, RefCell, RefMut}, + rc::Rc, +}; + +use imgui::{DrawData, TextureId, Ui}; +use wgpu::{ + rwh::{RawDisplayHandle, RawWindowHandle}, + util::{DeviceExt, TextureDataOrder}, + AdapterInfo, Device, Extent3d, Instance, PowerPreference, Queue, RenderPass, Surface, SurfaceTargetUnsafe, Texture, + TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, +}; + +use crate::common::{Color, Rect}; + +use super::{ + backend::{BackendRenderer, BackendShader, BackendTexture, SpriteBatchCommand, VertexData}, + error::{GameError, GameResult}, + graphics::{BlendMode, SwapMode}, + util::field_offset, +}; + +const fn convert_swap_mode(swap_mode: SwapMode) -> wgpu::PresentMode { + match swap_mode { + SwapMode::Immediate => wgpu::PresentMode::AutoNoVsync, + SwapMode::VSync => wgpu::PresentMode::AutoVsync, + SwapMode::Adaptive => wgpu::PresentMode::Mailbox, + } +} + +const fn to_wgpu_color(color: Color) -> wgpu::Color { + wgpu::Color { r: color.r as _, g: color.g as _, b: color.b as _, a: color.a as _ } +} + +#[repr(C)] +#[derive(Clone, Copy)] +struct VertUBO { + proj_mtx: [[f32; 4]; 4], +} + +impl Default for VertUBO { + fn default() -> Self { + VertUBO { proj_mtx: [[0.0; 4]; 4] } + } +} + +struct WGPUContext { + instance: wgpu::Instance, + adapter: wgpu::Adapter, + device: wgpu::Device, + queue: wgpu::Queue, + surface: wgpu::Surface<'static>, + surface_texture: RefCell>, + swap_mode: Cell, + encoder: RefCell>, + render_target: RefCell>, + basic_shader: wgpu::ShaderModule, + vbo: wgpu::Buffer, + ebo: wgpu::Buffer, + curr_mtx: RefCell, +} + +impl Drop for WGPUContext { + fn drop(&mut self) { + self.surface_texture.replace(None); + self.render_target.replace(None); + self.encoder.replace(None); + } +} + +fn vertex_layout() -> wgpu::VertexBufferLayout<'static> { + const ATTRIBS: [wgpu::VertexAttribute; 3] = wgpu::vertex_attr_array![0 => Float32x2, 1 => Unorm8x4, 2 => Float32x2]; + + wgpu::VertexBufferLayout { + array_stride: std::mem::size_of::() as wgpu::BufferAddress, + step_mode: wgpu::VertexStepMode::Vertex, + attributes: &ATTRIBS, + } +} + +impl WGPUContext { + fn get_encoder(&self) -> RefMut<'_, wgpu::CommandEncoder> { + { + let mut encoder = self.encoder.borrow_mut(); + if encoder.is_none() { + *encoder = Some(self.device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None })); + } + } + + RefMut::map(self.encoder.borrow_mut(), |e| e.as_mut().unwrap()) + } + + fn finish_encoder_and_present(&self) { + let mut encoder = self.encoder.borrow_mut(); + if let Some(encoder) = encoder.take() { + self.queue.submit(std::iter::once(encoder.finish())); + let st = self.surface_texture.take(); + if let Some(st) = st { + st.present(); + } + } + } + + fn resize(&self, width: u32, height: u32) -> GameResult { + if width == 0 || height == 0 { + return Err(GameError::RenderError("Invalid window size".to_owned())); + } + + let mut config = self.surface.get_default_config(&self.adapter, width, height); + + if let Some(mut c) = config { + c.present_mode = convert_swap_mode(self.swap_mode.get()); + + self.render_target.replace(None); + self.surface_texture.replace(None); + self.surface.configure(&self.device, &c); + + Ok(()) + } else { + Err(GameError::RenderError("Failed to get default surface configuration".to_owned())) + } + } + + fn draw_indexed(&self, vertices: &[VertexData], indices: &[u16], texture: &wgpu::Texture) { + let mut encoder = self.get_encoder(); + + let camera_buffer = self.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: None, + contents: unsafe { + std::slice::from_raw_parts( + &self.curr_mtx.borrow().proj_mtx as *const _ as *const u8, + std::mem::size_of::(), + ) + }, + usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST, + }); + + let tex_view = texture.create_view(&wgpu::TextureViewDescriptor::default()); + let sampler = self.device.create_sampler(&wgpu::SamplerDescriptor { + address_mode_u: wgpu::AddressMode::ClampToEdge, + address_mode_v: wgpu::AddressMode::ClampToEdge, + address_mode_w: wgpu::AddressMode::ClampToEdge, + mag_filter: wgpu::FilterMode::Nearest, + min_filter: wgpu::FilterMode::Nearest, + mipmap_filter: wgpu::FilterMode::Nearest, + ..Default::default() + }); + let texture_bind_group_layout = self.device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { + entries: &[ + wgpu::BindGroupLayoutEntry { + binding: 0, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Texture { + multisampled: false, + view_dimension: wgpu::TextureViewDimension::D2, + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + }, + count: None, + }, + wgpu::BindGroupLayoutEntry { + binding: 1, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering), + count: None, + }, + ], + label: None, + }); + let camera_bind_group_layout = self.device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { + entries: &[wgpu::BindGroupLayoutEntry { + binding: 0, + visibility: wgpu::ShaderStages::VERTEX, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, + min_binding_size: None, + }, + count: None, + }], + label: None, + }); + let texture_bind_group = self.device.create_bind_group(&wgpu::BindGroupDescriptor { + layout: &texture_bind_group_layout, + entries: &[ + wgpu::BindGroupEntry { binding: 0, resource: wgpu::BindingResource::TextureView(&tex_view) }, + wgpu::BindGroupEntry { binding: 1, resource: wgpu::BindingResource::Sampler(&sampler) }, + ], + label: None, + }); + let camera_bind_group = self.device.create_bind_group(&wgpu::BindGroupDescriptor { + layout: &camera_bind_group_layout, + entries: &[wgpu::BindGroupEntry { binding: 0, resource: camera_buffer.as_entire_binding() }], + label: None, + }); + + let render_pipeline_layout = self.device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { + label: None, + bind_group_layouts: &[&texture_bind_group_layout, &camera_bind_group_layout], + push_constant_ranges: &[], + }); + + let render_pipeline = self.device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { + label: None, + layout: Some(&render_pipeline_layout), + vertex: wgpu::VertexState { + module: &self.basic_shader, + entry_point: Some("vs_main"), + buffers: &[vertex_layout()], + compilation_options: wgpu::PipelineCompilationOptions::default(), + }, + primitive: wgpu::PrimitiveState { + topology: wgpu::PrimitiveTopology::TriangleList, + strip_index_format: None, + front_face: wgpu::FrontFace::Cw, + cull_mode: Some(wgpu::Face::Back), + polygon_mode: wgpu::PolygonMode::Fill, + unclipped_depth: false, + conservative: false, + }, + depth_stencil: None, + multisample: wgpu::MultisampleState { count: 1, mask: !0, alpha_to_coverage_enabled: false }, + fragment: Some(wgpu::FragmentState { + module: &self.basic_shader, + entry_point: Some("fs_main_textured"), + targets: &[Some(wgpu::ColorTargetState { + format: wgpu::TextureFormat::Bgra8UnormSrgb, + blend: Some(wgpu::BlendState::ALPHA_BLENDING), + write_mask: wgpu::ColorWrites::ALL, + })], + compilation_options: wgpu::PipelineCompilationOptions::default(), + }), + multiview: None, + cache: None, + }); + + let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + label: Some("Render Pass"), + color_attachments: &[Some(wgpu::RenderPassColorAttachment { + view: self.render_target.borrow().as_ref().unwrap(), + resolve_target: None, + ops: wgpu::Operations { load: wgpu::LoadOp::Load, store: wgpu::StoreOp::Store }, + })], + depth_stencil_attachment: None, + timestamp_writes: None, + occlusion_query_set: None, + }); + + let vbo = self.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("VBO"), + contents: unsafe { + std::slice::from_raw_parts( + vertices.as_ptr() as *const u8, + vertices.len() * std::mem::size_of::(), + ) + }, + usage: wgpu::BufferUsages::VERTEX, + }); + + let ebo = self.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("EBO"), + contents: unsafe { + std::slice::from_raw_parts(indices.as_ptr() as *const u8, indices.len() * std::mem::size_of::()) + }, + usage: wgpu::BufferUsages::INDEX, + }); + + rpass.set_pipeline(&render_pipeline); + rpass.set_bind_group(0, &texture_bind_group, &[]); + rpass.set_bind_group(1, &camera_bind_group, &[]); + rpass.set_vertex_buffer(0, vbo.slice(..)); + rpass.set_index_buffer(ebo.slice(..), wgpu::IndexFormat::Uint16); + rpass.draw_indexed(0..indices.len() as u32, 0, 0..1); + } +} + +pub struct WGPUTexture { + ctx: Rc, + image: Rc, + vertices: Vec, + indices: Vec, + uv: (f32, f32), +} + +impl WGPUTexture { + fn new(ctx: Rc, image: wgpu::Texture) -> Self { + let (width, height) = (image.size().width, image.size().height); + let uv = (1.0 / width as f32, 1.0 / height as f32); + let image = Rc::new(image); + + Self { ctx, image, vertices: Vec::new(), indices: Vec::new(), uv } + } +} + +impl BackendTexture for WGPUTexture { + fn dimensions(&self) -> (u16, u16) { + let size = self.image.size(); + (size.width as _, size.height as _) + } + + fn add(&mut self, command: SpriteBatchCommand) { + let (tex_scale_x, tex_scale_y) = self.uv; + + match command { + SpriteBatchCommand::DrawRect(src, dest) => { + let vertices = [ + VertexData { + position: (dest.left, dest.bottom), + uv: (src.left * tex_scale_x, src.bottom * tex_scale_y), + color: (255, 255, 255, 255), + }, + VertexData { + position: (dest.left, dest.top), + uv: (src.left * tex_scale_x, src.top * tex_scale_y), + color: (255, 255, 255, 255), + }, + VertexData { + position: (dest.right, dest.top), + uv: (src.right * tex_scale_x, src.top * tex_scale_y), + color: (255, 255, 255, 255), + }, + VertexData { + position: (dest.right, dest.bottom), + uv: (src.right * tex_scale_x, src.bottom * tex_scale_y), + color: (255, 255, 255, 255), + }, + ]; + let idx = self.vertices.len() as u16; + self.indices.extend_from_slice(&[idx, idx + 1, idx + 2, idx, idx + 2, idx + 3]); + self.vertices.extend_from_slice(&vertices); + } + SpriteBatchCommand::DrawRectFlip(mut src, dest, flip_x, flip_y) => { + if flip_x { + std::mem::swap(&mut src.left, &mut src.right); + } + + if flip_y { + std::mem::swap(&mut src.top, &mut src.bottom); + } + + let vertices = [ + VertexData { + position: (dest.left, dest.bottom), + uv: (src.left * tex_scale_x, src.bottom * tex_scale_y), + color: (255, 255, 255, 255), + }, + VertexData { + position: (dest.left, dest.top), + uv: (src.left * tex_scale_x, src.top * tex_scale_y), + color: (255, 255, 255, 255), + }, + VertexData { + position: (dest.right, dest.top), + uv: (src.right * tex_scale_x, src.top * tex_scale_y), + color: (255, 255, 255, 255), + }, + VertexData { + position: (dest.right, dest.bottom), + uv: (src.right * tex_scale_x, src.bottom * tex_scale_y), + color: (255, 255, 255, 255), + }, + ]; + let idx = self.vertices.len() as u16; + self.indices.extend_from_slice(&[idx, idx + 1, idx + 2, idx, idx + 2, idx + 3]); + self.vertices.extend_from_slice(&vertices); + } + SpriteBatchCommand::DrawRectTinted(src, dest, color) => { + let color = color.to_rgba(); + let vertices = [ + VertexData { + position: (dest.left, dest.bottom), + uv: (src.left * tex_scale_x, src.bottom * tex_scale_y), + color, + }, + VertexData { + position: (dest.left, dest.top), + uv: (src.left * tex_scale_x, src.top * tex_scale_y), + color, + }, + VertexData { + position: (dest.right, dest.top), + uv: (src.right * tex_scale_x, src.top * tex_scale_y), + color, + }, + VertexData { + position: (dest.right, dest.bottom), + uv: (src.right * tex_scale_x, src.bottom * tex_scale_y), + color, + }, + ]; + let idx = self.vertices.len() as u16; + self.indices.extend_from_slice(&[idx, idx + 1, idx + 2, idx, idx + 2, idx + 3]); + self.vertices.extend_from_slice(&vertices); + } + SpriteBatchCommand::DrawRectFlipTinted(mut src, dest, flip_x, flip_y, color) => { + if flip_x { + std::mem::swap(&mut src.left, &mut src.right); + } + + if flip_y { + std::mem::swap(&mut src.top, &mut src.bottom); + } + + let color = color.to_rgba(); + + let vertices = [ + VertexData { + position: (dest.left, dest.bottom), + uv: (src.left * tex_scale_x, src.bottom * tex_scale_y), + color, + }, + VertexData { + position: (dest.left, dest.top), + uv: (src.left * tex_scale_x, src.top * tex_scale_y), + color, + }, + VertexData { + position: (dest.right, dest.top), + uv: (src.right * tex_scale_x, src.top * tex_scale_y), + color, + }, + VertexData { + position: (dest.right, dest.bottom), + uv: (src.right * tex_scale_x, src.bottom * tex_scale_y), + color, + }, + ]; + let idx = self.vertices.len() as u16; + self.indices.extend_from_slice(&[idx, idx + 1, idx + 2, idx, idx + 2, idx + 3]); + self.vertices.extend_from_slice(&vertices); + } + } + } + + fn clear(&mut self) { + self.vertices.clear(); + self.indices.clear(); + } + + fn draw(&mut self) -> GameResult<()> { + if self.vertices.is_empty() { + return Ok(()); + } + + self.ctx.draw_indexed(&self.vertices, &self.indices, &self.image); + + Ok(()) + } + + fn as_any(&self) -> &dyn Any { + self + } +} + +pub struct WGPURenderer { + imgui: Rc>, + ctx: Rc, + size: (u32, u32), + name: String, +} + +impl WGPURenderer { + pub const RENDERER_ID: &'static str = "wgpu"; + + pub fn new( + mut imgui: imgui::Context, + raw_display_handle: RawDisplayHandle, + raw_window_handle: RawWindowHandle, + ) -> GameResult> { + pollster::block_on(Self::new_async(imgui, raw_display_handle, raw_window_handle)) + } + + // grrrr + pub async fn new_async( + mut imgui: imgui::Context, + raw_display_handle: RawDisplayHandle, + raw_window_handle: RawWindowHandle, + ) -> GameResult> { + let _ = imgui.fonts().build_alpha8_texture(); + + let instance = wgpu::Instance::default(); + + let surface = unsafe { + instance + .create_surface_unsafe(SurfaceTargetUnsafe::RawHandle { raw_display_handle, raw_window_handle }) + .map_err(|e: wgpu::CreateSurfaceError| { + GameError::RenderError(format!("Failed to create WGPU surface: {:?}", e)) + })? + }; + + let adapter = instance + .request_adapter(&wgpu::RequestAdapterOptions { + power_preference: PowerPreference::HighPerformance, + force_fallback_adapter: false, + compatible_surface: Some(&surface), + }) + .await; + + let adapter = if let Some(adapter) = adapter { + adapter + } else { + return Err(GameError::RenderError("No WGPU compatible adapter found".to_owned())); + }; + + let AdapterInfo { name, driver, device_type, backend, .. } = adapter.get_info(); + log::info!("Selected adapter: {} ({}), type: {:?}", name, driver, device_type); + + let (device, queue) = adapter + .request_device( + &wgpu::DeviceDescriptor { + label: None, + required_features: wgpu::Features::empty(), + // Make sure we use the texture resolution limits from the adapter, so we can support images the size of the swapchain. + required_limits: wgpu::Limits::downlevel_webgl2_defaults().using_resolution(adapter.limits()), + memory_hints: wgpu::MemoryHints::MemoryUsage, + }, + None, + ) + .await + .map_err(|e| GameError::RenderError(format!("Failed to create WGPU device: {:?}", e)))?; + + let config = surface + .get_default_config(&adapter, 640, 480) + .ok_or_else(|| GameError::RenderError("Failed to get preferred surface format".to_owned()))?; + + surface.configure(&device, &config); + + let surface_texture = surface + .get_current_texture() + .map_err(|e| GameError::RenderError(format!("Failed to get surface texture: {:?}", e)))?; + + let basic_module_desc: wgpu::ShaderModuleDescriptor = wgpu::include_wgsl!("shaders/wgpu/basic.wgsl"); + let basic_shader = device.create_shader_module(basic_module_desc); + + let vbo = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("VBO"), + contents: &[], + usage: wgpu::BufferUsages::VERTEX, + }); + let ebo = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("EBO"), + contents: &[], + usage: wgpu::BufferUsages::INDEX, + }); + + let ctx = Rc::new(WGPUContext { + instance, + adapter, + device, + queue, + surface, + surface_texture: RefCell::new(Some(surface_texture)), + encoder: RefCell::new(None), + swap_mode: Cell::new(SwapMode::VSync), + render_target: RefCell::new(None), + basic_shader, + vbo, + ebo, + curr_mtx: RefCell::new(VertUBO::default()), + }); + + let name = format!("wgpu-rs ({}, {})", backend, name); + Ok(Box::new(WGPURenderer { imgui: Rc::new(RefCell::new(imgui)), ctx, name, size: (640, 480) })) + } +} + +impl BackendRenderer for WGPURenderer { + fn renderer_name(&self) -> String { + self.name.clone() + } + + fn prepare_draw(&mut self, width: f32, height: f32) -> GameResult { + let new_size = (width as u32, height as u32); + if new_size != self.size { + self.size = new_size; + self.ctx.resize(self.size.0, self.size.1)?; + } + + self.ctx.surface_texture.replace(None); + let surface_texture = self.ctx.surface.get_current_texture(); + let surface_texture = match surface_texture { + Ok(surface_texture) => surface_texture, + Err(e) => { + self.ctx.resize(self.size.0, self.size.1)?; + self.ctx + .surface + .get_current_texture() + .map_err(|e| GameError::RenderError(format!("Failed to get surface texture: {:?}", e)))? + } + }; + self.ctx.surface_texture.replace(Some(surface_texture)); + + self.set_render_target(None)?; + + self.ctx.curr_mtx.borrow_mut().proj_mtx = [ + [2.0 / width, 0.0, 0.0, 0.0], + [0.0, 2.0 / -height, 0.0, 0.0], + [0.0, 0.0, -1.0, 0.0], + [-1.0, 1.0, 0.0, 1.0], + ]; + Ok(()) + } + + fn clear(&mut self, color: Color) { + let view = self.ctx.render_target.borrow(); + let view = if let Some(rt) = view.as_ref() { + rt + } else { + return; + }; + + let mut encoder = self.ctx.get_encoder(); + + let _rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + label: Some("Clear"), + color_attachments: &[Some(wgpu::RenderPassColorAttachment { + view, + resolve_target: None, + ops: wgpu::Operations { + // + load: wgpu::LoadOp::Clear(to_wgpu_color(color)), + store: wgpu::StoreOp::Store, + }, + })], + depth_stencil_attachment: None, + occlusion_query_set: None, + timestamp_writes: None, + }); + } + + fn present(&mut self) -> GameResult { + self.ctx.finish_encoder_and_present(); + Ok(()) + } + + fn create_texture_mutable(&mut self, width: u16, height: u16) -> GameResult> { + let texture = self.ctx.device.create_texture(&TextureDescriptor { + label: None, + size: Extent3d { width: width as _, height: height as _, depth_or_array_layers: 1 }, + mip_level_count: 1, + sample_count: 1, + dimension: TextureDimension::D2, + format: TextureFormat::Rgba8Unorm, + usage: TextureUsages::TEXTURE_BINDING | TextureUsages::RENDER_ATTACHMENT, + view_formats: &[], + }); + + Ok(Box::new(WGPUTexture::new(Rc::clone(&self.ctx), texture))) + } + + fn create_texture(&mut self, width: u16, height: u16, data: &[u8]) -> GameResult> { + let texture = self.ctx.device.create_texture_with_data( + &self.ctx.queue, + &TextureDescriptor { + label: None, + size: Extent3d { width: width as _, height: height as _, depth_or_array_layers: 1 }, + mip_level_count: 1, + sample_count: 1, + dimension: TextureDimension::D2, + format: TextureFormat::Rgba8Unorm, + usage: TextureUsages::TEXTURE_BINDING, + view_formats: &[], + }, + TextureDataOrder::LayerMajor, + data, + ); + + Ok(Box::new(WGPUTexture::new(Rc::clone(&self.ctx), texture))) + } + + fn set_blend_mode(&mut self, _blend: BlendMode) -> GameResult { + Ok(()) + } + + fn set_render_target(&mut self, texture: Option<&Box>) -> GameResult { + if let Some(texture) = texture { + let wgpu_texture = texture + .as_any() + .downcast_ref::() + .ok_or_else(|| GameError::RenderError("This texture was not created by WGPU backend.".to_string()))?; + + let view = wgpu_texture.image.create_view(&wgpu::TextureViewDescriptor::default()); + self.ctx.render_target.replace(Some(view)); + } else { + let surf_tex = self.ctx.surface_texture.borrow(); + if let Some(surf_tex) = surf_tex.as_ref() { + let view = surf_tex.texture.create_view(&wgpu::TextureViewDescriptor::default()); + self.ctx.render_target.replace(Some(view)); + } + } + Ok(()) + } + + fn draw_rect(&mut self, _rect: Rect, _color: Color) -> GameResult { + Ok(()) + } + + fn draw_outline_rect(&mut self, _rect: Rect, _line_width: usize, _color: Color) -> GameResult { + Ok(()) + } + + fn set_clip_rect(&mut self, _rect: Option) -> GameResult { + Ok(()) + } + + fn imgui(&self) -> GameResult>> { + Ok(self.imgui.clone()) + } + + fn imgui_texture_id(&self, _texture: &Box) -> GameResult { + Ok(TextureId::from(0)) + } + + fn prepare_imgui(&mut self, _ui: &Ui) -> GameResult { + Ok(()) + } + + fn render_imgui(&mut self, _draw_data: &DrawData) -> GameResult { + Ok(()) + } + + fn draw_triangle_list( + &mut self, + _vertices: &[VertexData], + _texture: Option<&Box>, + _shader: BackendShader, + ) -> GameResult<()> { + Ok(()) + } + + fn as_any(&self) -> &dyn Any { + self + } +} diff --git a/src/framework/shaders/wgpu/basic.wgsl b/src/framework/shaders/wgpu/basic.wgsl new file mode 100644 index 0000000..0c94215 --- /dev/null +++ b/src/framework/shaders/wgpu/basic.wgsl @@ -0,0 +1,42 @@ +struct CameraUniform { + proj_mtx: mat4x4, +} + +struct VertexInput { + @location(0) position: vec2, + @location(1) color: vec4, + @location(2) tex_coords: vec2, +} + +struct VertexOutput { + @builtin(position) clip_position: vec4, + @location(0) color: vec4, + @location(1) tex_coords: vec2, +} + +@vertex +fn vs_main(vtx: VertexInput) -> VertexOutput { + var out: VertexOutput; + out.clip_position = u_cam.proj_mtx * vec4(vtx.position, 0.0, 1.0); + out.color = vtx.color; + out.tex_coords = vtx.tex_coords; + return out; +} + +@group(0) @binding(0) +var u_texture: texture_2d; +@group(0) @binding(1) +var u_sampler: sampler; + +@group(1) @binding(0) +var u_cam: CameraUniform; + +@fragment +fn fs_main_textured(in: VertexOutput) -> @location(0) vec4 { + return textureSample(u_texture, u_sampler, in.tex_coords) * in.color; +} + +@fragment +fn fs_main_colored(in: VertexOutput) -> @location(0) vec4 { + return in.color; +}