From 639733902a7a63505bfaa26cbb0b5191c736f636 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Thu, 19 Mar 2026 08:11:22 -0700 Subject: [PATCH] update graphics to wgpu 29.0.0 --- Cargo.lock | 497 ++++++++++++++++++++++++++++++------ Cargo.toml | 4 +- lib/src/graphics.rs | 4 +- native-player/src/player.rs | 2 +- native-player/src/setup.rs | 5 +- native-player/src/window.rs | 3 +- video-encoder/src/encode.rs | 6 +- wasm-module/src/lib.rs | 16 +- 8 files changed, 438 insertions(+), 99 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a789e8..5e10230 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -198,7 +198,16 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec", + "bit-vec 0.8.0", +] + +[[package]] +name = "bit-set" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ddef2995421ab6a5c779542c81ee77c115206f4ad9d5a8e05f4ff49716a3dd" +dependencies = [ + "bit-vec 0.9.1", ] [[package]] @@ -207,6 +216,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +[[package]] +name = "bit-vec" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" + [[package]] name = "bitflags" version = "1.3.2" @@ -237,7 +252,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2", + "objc2 0.5.2", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2 0.6.4", ] [[package]] @@ -391,6 +415,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "codespan-reporting" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" +dependencies = [ + "serde", + "termcolor", + "unicode-width", +] + [[package]] name = "colorchoice" version = "1.0.4" @@ -524,6 +559,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.11.0", + "objc2 0.6.4", +] + [[package]] name = "dlib" version = "0.5.3" @@ -584,7 +629,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -725,6 +770,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glow" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29038e1c483364cc6bb3cf78feee1816002e127c331a1eec55a4d202b9e1adb5" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "glutin_wgl_sys" version = "0.6.1" @@ -1100,11 +1157,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "618f667225063219ddfc61251087db8a9aec3c3f0950c916b614e403486f1135" dependencies = [ "arrayvec", - "bit-set", + "bit-set 0.8.0", "bitflags 2.11.0", "cfg-if", "cfg_aliases", - "codespan-reporting", + "codespan-reporting 0.12.0", "half", "hashbrown 0.16.1", "hexf-parse", @@ -1114,7 +1171,33 @@ dependencies = [ "num-traits", "once_cell", "rustc-hash 1.1.0", - "spirv", + "spirv 0.3.0+sdk-1.3.268.0", + "thiserror 2.0.18", + "unicode-ident", +] + +[[package]] +name = "naga" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b4372fed0bd362d646d01b6926df0e837859ccc522fed720c395e0460f29c8" +dependencies = [ + "arrayvec", + "bit-set 0.9.1", + "bitflags 2.11.0", + "cfg-if", + "cfg_aliases", + "codespan-reporting 0.13.1", + "half", + "hashbrown 0.16.1", + "hexf-parse", + "indexmap", + "libm", + "log", + "num-traits", + "once_cell", + "rustc-hash 1.1.0", + "spirv 0.4.0+sdk-1.4.341.0", "thiserror 2.0.18", "unicode-ident", ] @@ -1237,6 +1320,15 @@ dependencies = [ "objc2-encode", ] +[[package]] +name = "objc2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +dependencies = [ + "objc2-encode", +] + [[package]] name = "objc2-app-kit" version = "0.2.2" @@ -1244,13 +1336,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ "bitflags 2.11.0", - "block2", + "block2 0.5.1", "libc", - "objc2", + "objc2 0.5.2", "objc2-core-data", "objc2-core-image", - "objc2-foundation", - "objc2-quartz-core", + "objc2-foundation 0.2.2", + "objc2-quartz-core 0.2.2", ] [[package]] @@ -1260,10 +1352,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ "bitflags 2.11.0", - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -1272,9 +1364,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -1284,9 +1376,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ "bitflags 2.11.0", - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.11.0", + "dispatch2", + "objc2 0.6.4", ] [[package]] @@ -1295,10 +1398,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ - "block2", - "objc2", - "objc2-foundation", - "objc2-metal", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", ] [[package]] @@ -1307,10 +1410,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-contacts", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -1326,10 +1429,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ "bitflags 2.11.0", - "block2", + "block2 0.5.1", "dispatch", "libc", - "objc2", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.11.0", + "objc2 0.6.4", + "objc2-core-foundation", ] [[package]] @@ -1338,10 +1452,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -1351,9 +1465,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ "bitflags 2.11.0", - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-metal" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794" +dependencies = [ + "bitflags 2.11.0", + "block2 0.6.2", + "objc2 0.6.4", + "objc2-foundation 0.3.2", ] [[package]] @@ -1363,10 +1489,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ "bitflags 2.11.0", - "block2", - "objc2", - "objc2-foundation", - "objc2-metal", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.11.0", + "objc2 0.6.4", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", ] [[package]] @@ -1375,8 +1514,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -1386,15 +1525,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ "bitflags 2.11.0", - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-cloud-kit", "objc2-core-data", "objc2-core-image", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-link-presentation", - "objc2-quartz-core", + "objc2-quartz-core 0.2.2", "objc2-symbols", "objc2-uniform-type-identifiers", "objc2-user-notifications", @@ -1406,9 +1545,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" dependencies = [ - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -1418,10 +1557,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ "bitflags 2.11.0", - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -1650,6 +1789,18 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +[[package]] +name = "raw-window-metal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135" +dependencies = [ + "objc2 0.6.4", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -1728,7 +1879,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1884,6 +2035,15 @@ dependencies = [ "bitflags 2.11.0", ] +[[package]] +name = "spirv" +version = "0.4.0+sdk-1.4.341.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9571ea910ebd84c86af4b3ed27f9dbdc6ad06f17c5f96146b2b671e2976744f" +dependencies = [ + "bitflags 2.11.0", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -1907,16 +2067,16 @@ dependencies = [ [[package]] name = "strafesnet_graphics" -version = "0.0.7" +version = "0.0.8" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "5b0afe15871f8205f3387dd5816e797c0576429d3013a33a3daed293bcaeedef" +checksum = "ef1bd36d55941fbeafa93a230c4fdbedbc7b0c20d286b9aa3451cfcee47f02d4" dependencies = [ "bytemuck", "ddsfile", "glam", "id", "strafesnet_common", - "wgpu", + "wgpu 29.0.0", ] [[package]] @@ -1939,7 +2099,7 @@ dependencies = [ "strafesnet_graphics", "strafesnet_roblox_bot_file", "thiserror 2.0.18", - "wgpu", + "wgpu 29.0.0", ] [[package]] @@ -1953,7 +2113,7 @@ dependencies = [ "strafesnet_roblox_bot_file", "strafesnet_roblox_bot_player", "strafesnet_snf", - "wgpu", + "wgpu 29.0.0", "winit", ] @@ -1970,7 +2130,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "wgpu", + "wgpu 29.0.0", ] [[package]] @@ -2202,7 +2362,7 @@ dependencies = [ "strafesnet_roblox_bot_player", "strafesnet_snf", "vk-video", - "wgpu", + "wgpu 29.0.0", ] [[package]] @@ -2232,7 +2392,7 @@ dependencies = [ "thiserror 1.0.69", "tracing", "vk-mem", - "wgpu", + "wgpu 28.0.0", ] [[package]] @@ -2457,7 +2617,7 @@ dependencies = [ "hashbrown 0.16.1", "js-sys", "log", - "naga", + "naga 28.0.0", "parking_lot", "portable-atomic", "profiling", @@ -2467,9 +2627,39 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "wgpu-core", - "wgpu-hal", - "wgpu-types", + "wgpu-core 28.0.1", + "wgpu-hal 28.0.1", + "wgpu-types 28.0.0", +] + +[[package]] +name = "wgpu" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f9f386699b1fb8b8a05bfe82169b24d151f05702d2905a0bf93bc454fcc825" +dependencies = [ + "arrayvec", + "bitflags 2.11.0", + "bytemuck", + "cfg-if", + "cfg_aliases", + "document-features", + "hashbrown 0.16.1", + "js-sys", + "log", + "naga 29.0.0", + "parking_lot", + "portable-atomic", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core 29.0.0", + "wgpu-hal 29.0.0", + "wgpu-types 29.0.0", ] [[package]] @@ -2479,8 +2669,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23f4642f53f666adcfd2d3218ab174d1e6681101aef18696b90cbe64d1c10f9" dependencies = [ "arrayvec", - "bit-set", - "bit-vec", + "bit-set 0.8.0", + "bit-vec 0.8.0", "bitflags 2.11.0", "bytemuck", "cfg_aliases", @@ -2488,7 +2678,7 @@ dependencies = [ "hashbrown 0.16.1", "indexmap", "log", - "naga", + "naga 28.0.0", "once_cell", "parking_lot", "portable-atomic", @@ -2497,12 +2687,45 @@ dependencies = [ "rustc-hash 1.1.0", "smallvec", "thiserror 2.0.18", - "wgpu-core-deps-apple", - "wgpu-core-deps-emscripten", + "wgpu-core-deps-apple 28.0.0", + "wgpu-core-deps-emscripten 28.0.0", + "wgpu-core-deps-windows-linux-android 28.0.0", + "wgpu-hal 28.0.1", + "wgpu-types 28.0.0", +] + +[[package]] +name = "wgpu-core" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c34181b0acb8f98168f78f8e57ec66f57df5522b39143dbe5f2f45d7ca927c" +dependencies = [ + "arrayvec", + "bit-set 0.9.1", + "bit-vec 0.9.1", + "bitflags 2.11.0", + "bytemuck", + "cfg_aliases", + "document-features", + "hashbrown 0.16.1", + "indexmap", + "log", + "naga 29.0.0", + "once_cell", + "parking_lot", + "portable-atomic", + "profiling", + "raw-window-handle", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 2.0.18", + "wgpu-core-deps-apple 29.0.0", + "wgpu-core-deps-emscripten 29.0.0", "wgpu-core-deps-wasm", - "wgpu-core-deps-windows-linux-android", - "wgpu-hal", - "wgpu-types", + "wgpu-core-deps-windows-linux-android 29.0.0", + "wgpu-hal 29.0.0", + "wgpu-naga-bridge", + "wgpu-types 29.0.0", ] [[package]] @@ -2511,7 +2734,16 @@ version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87b7b696b918f337c486bf93142454080a32a37832ba8a31e4f48221890047da" dependencies = [ - "wgpu-hal", + "wgpu-hal 28.0.1", +] + +[[package]] +name = "wgpu-core-deps-apple" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43acd053312501689cd92a01a9638d37f3e41a5fd9534875efa8917ee2d11ac0" +dependencies = [ + "wgpu-hal 29.0.0", ] [[package]] @@ -2520,16 +2752,25 @@ version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34b251c331f84feac147de3c4aa3aa45112622a95dd7ee1b74384fa0458dbd79" dependencies = [ - "wgpu-hal", + "wgpu-hal 28.0.1", +] + +[[package]] +name = "wgpu-core-deps-emscripten" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef043bf135cc68b6f667c55ff4e345ce2b5924d75bad36a47921b0287ca4b24a" +dependencies = [ + "wgpu-hal 29.0.0", ] [[package]] name = "wgpu-core-deps-wasm" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12a2cf578ce8d7d50d0e63ddc2345c7dcb599f6eb90b888813406ea78b9b7010" +checksum = "2f7b75e72f49035f000dd5262e4126242e92a090a4fd75931ecfe7e60784e6fa" dependencies = [ - "wgpu-hal", + "wgpu-hal 29.0.0", ] [[package]] @@ -2538,7 +2779,16 @@ version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68ca976e72b2c9964eb243e281f6ce7f14a514e409920920dcda12ae40febaae" dependencies = [ - "wgpu-hal", + "wgpu-hal 28.0.1", +] + +[[package]] +name = "wgpu-core-deps-windows-linux-android" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "725d5c006a8c02967b6d93ef04f6537ec4593313e330cfe86d9d3f946eb90f28" +dependencies = [ + "wgpu-hal 29.0.0", ] [[package]] @@ -2550,14 +2800,14 @@ dependencies = [ "android_system_properties", "arrayvec", "ash", - "bit-set", + "bit-set 0.8.0", "bitflags 2.11.0", "block", "bytemuck", "cfg-if", "cfg_aliases", "core-graphics-types 0.2.0", - "glow", + "glow 0.16.0", "glutin_wgl_sys", "gpu-allocator", "gpu-descriptor", @@ -2568,7 +2818,7 @@ dependencies = [ "libloading", "log", "metal", - "naga", + "naga 28.0.0", "ndk-sys", "objc", "once_cell", @@ -2584,11 +2834,74 @@ dependencies = [ "thiserror 2.0.18", "wasm-bindgen", "web-sys", - "wgpu-types", + "wgpu-types 28.0.0", "windows", "windows-core", ] +[[package]] +name = "wgpu-hal" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058b6047337cf323a4f092486443a9337f3d81325347e5d77deed7e563aeaedc" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set 0.9.1", + "bitflags 2.11.0", + "block2 0.6.2", + "bytemuck", + "cfg-if", + "cfg_aliases", + "glow 0.17.0", + "glutin_wgl_sys", + "gpu-allocator", + "gpu-descriptor", + "hashbrown 0.16.1", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "naga 29.0.0", + "ndk-sys", + "objc2 0.6.4", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", + "objc2-quartz-core 0.3.2", + "once_cell", + "ordered-float", + "parking_lot", + "portable-atomic", + "portable-atomic-util", + "profiling", + "range-alloc", + "raw-window-handle", + "raw-window-metal", + "renderdoc-sys", + "smallvec", + "thiserror 2.0.18", + "wasm-bindgen", + "wayland-sys", + "web-sys", + "wgpu-naga-bridge", + "wgpu-types 29.0.0", + "windows", + "windows-core", +] + +[[package]] +name = "wgpu-naga-bridge" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0b8e1e505095f24cb4a578f04b1421d456257dca7fac114d9d9dd3d978c34b8" +dependencies = [ + "naga 29.0.0", + "wgpu-types 29.0.0", +] + [[package]] name = "wgpu-types" version = "28.0.0" @@ -2602,13 +2915,27 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wgpu-types" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15ece45db77dd5451f11c0ce898334317ce8502d304a20454b531fdc0652fae" +dependencies = [ + "bitflags 2.11.0", + "bytemuck", + "js-sys", + "log", + "raw-window-handle", + "web-sys", +] + [[package]] name = "winapi-util" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2888,7 +3215,7 @@ dependencies = [ "android-activity", "atomic-waker", "bitflags 2.11.0", - "block2", + "block2 0.5.1", "bytemuck", "calloop", "cfg_aliases", @@ -2901,9 +3228,9 @@ dependencies = [ "libc", "memmap2", "ndk", - "objc2", + "objc2 0.5.2", "objc2-app-kit", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-ui-kit", "orbclient", "percent-encoding", diff --git a/Cargo.toml b/Cargo.toml index 1e5079c..cf28ed0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,10 @@ codegen-units = 1 [workspace.dependencies] glam = "0.32.0" -wgpu = "28.0.0" +wgpu = "29.0.0" strafesnet_common = { version = "0.8.6", registry = "strafesnet" } -strafesnet_graphics = { version = "0.0.7", registry = "strafesnet" } +strafesnet_graphics = { version = "0.0.8", registry = "strafesnet" } strafesnet_roblox_bot_file = { version = "0.9.4", registry = "strafesnet" } strafesnet_snf = { version = "0.3.2", registry = "strafesnet" } diff --git a/lib/src/graphics.rs b/lib/src/graphics.rs index a262494..e35bf4e 100644 --- a/lib/src/graphics.rs +++ b/lib/src/graphics.rs @@ -14,8 +14,8 @@ pub struct Graphics{ start_offset:glam::Vec3, } impl Graphics{ - pub fn new(device:&wgpu::Device,queue:&wgpu::Queue,size:glam::UVec2,view_format:wgpu::TextureFormat)->Self{ - let graphics=strafesnet_graphics::graphics::GraphicsState::new(device,queue,size,view_format); + pub fn new(device:&wgpu::Device,queue:&wgpu::Queue,size:glam::UVec2,view_format:wgpu::TextureFormat,limits:wgpu::Limits)->Self{ + let graphics=strafesnet_graphics::graphics::GraphicsState::new(device,queue,size,view_format,limits); Self{ graphics, start_offset:glam::Vec3::ZERO, diff --git a/native-player/src/player.rs b/native-player/src/player.rs index 2a53d3f..9abc0e1 100644 --- a/native-player/src/player.rs +++ b/native-player/src/player.rs @@ -80,7 +80,7 @@ impl<'a> PlayerWorker<'a>{ let (pos,angles)=playback.playback_head.get_position_angles(&playback.bot,ins.time); //this has to go deeper somehow - let frame=self.surface.new_frame(device); + let frame=self.surface.new_frame(device).expect("Error creating new frame"); let mut encoder=device.create_command_encoder(&wgpu::CommandEncoderDescriptor{label:None}); diff --git a/native-player/src/setup.rs b/native-player/src/setup.rs index 5e36738..95aeb45 100644 --- a/native-player/src/setup.rs +++ b/native-player/src/setup.rs @@ -1,5 +1,7 @@ use strafesnet_graphics::setup; +const LIMITS:wgpu::Limits=wgpu::Limits::defaults(); + fn create_window(title:&str,event_loop:&winit::event_loop::EventLoop<()>)->Result{ let mut attr=winit::window::WindowAttributes::default(); attr=attr.with_title(title); @@ -19,7 +21,7 @@ pub async fn setup_and_start(title:&str){ let adapter=setup::step3::pick_adapter(&instance,&surface).await.expect("No suitable GPU adapters found on the system!"); - let (device,queue)=setup::step4::request_device(&adapter).await.unwrap(); + let (device,queue)=setup::step4::request_device(&adapter,LIMITS).await.unwrap(); let size=window.inner_size(); let surface=setup::step5::configure_surface(&adapter,&device,surface,(size.width,size.height)).unwrap(); @@ -32,6 +34,7 @@ pub async fn setup_and_start(title:&str){ device, queue, surface, + LIMITS, ); for arg in std::env::args().skip(1){ diff --git a/native-player/src/window.rs b/native-player/src/window.rs index 1c7db8c..83ce160 100644 --- a/native-player/src/window.rs +++ b/native-player/src/window.rs @@ -127,9 +127,10 @@ impl WindowContext<'_>{ device:wgpu::Device, queue:wgpu::Queue, surface:strafesnet_graphics::surface::Surface<'a>, + limits:wgpu::Limits, )->WindowContext<'a>{ let size=surface.size(); - let graphics=strafesnet_roblox_bot_player::graphics::Graphics::new(&device,&queue,size,surface.view_format()); + let graphics=strafesnet_roblox_bot_player::graphics::Graphics::new(&device,&queue,size,surface.view_format(),limits); WindowContext{ simulation_paused:false, window, diff --git a/video-encoder/src/encode.rs b/video-encoder/src/encode.rs index a4747b0..c6e13c0 100644 --- a/video-encoder/src/encode.rs +++ b/video-encoder/src/encode.rs @@ -90,6 +90,8 @@ struct EncodeParams{ output_file:PathBuf, } +const LIMITS:wgpu::Limits=wgpu::Limits::defaults(); + fn encode(params:EncodeParams)->Result<(),EncodeError>{ let size = glam::uvec2(params.width.get(),params.height.get()); let target_framerate = params.target_framerate; @@ -244,7 +246,7 @@ impl WgpuState { size: glam::UVec2, ) -> WgpuState { const FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8UnormSrgb; - let graphics = strafesnet_roblox_bot_player::graphics::Graphics::new(&device,&queue,size,FORMAT); + let graphics = strafesnet_roblox_bot_player::graphics::Graphics::new(&device,&queue,size,FORMAT,LIMITS); let shader = wgpu::include_wgsl!("../shaders/rgb_to_yuv.wgsl"); let shader = device.create_shader_module(shader); @@ -319,7 +321,7 @@ impl WgpuState { let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("wgpu pipeline layout"), bind_group_layouts: &[ - &graphics_texture_bind_group_layout + Some(&graphics_texture_bind_group_layout), ], immediate_size: 0, }); diff --git a/wasm-module/src/lib.rs b/wasm-module/src/lib.rs index 90974d0..7f96dcb 100644 --- a/wasm-module/src/lib.rs +++ b/wasm-module/src/lib.rs @@ -19,6 +19,12 @@ impl From for wgpu::SurfaceTarget<'static>{ } } +// select limits based on presence of webgl feature +#[cfg(not(feature="webgl"))] +const LIMITS:wgpu::Limits=wgpu::Limits::defaults(); +#[cfg(feature="webgl")] +const LIMITS:wgpu::Limits=wgpu::Limits::downlevel_webgl2_defaults(); + #[wasm_bindgen] pub struct Graphics{ graphics:graphics::Graphics, @@ -30,18 +36,18 @@ pub struct Graphics{ pub async fn setup_graphics(canvas:web_sys::HtmlCanvasElement)->Result{ let size=glam::uvec2(canvas.width(),canvas.height()); - let instance_desc=wgpu::InstanceDescriptor::from_env_or_default(); - let instance=wgpu::util::new_instance_with_webgpu_detection(&instance_desc).await; + let instance_desc=wgpu::InstanceDescriptor::new_without_display_handle_from_env(); + let instance=wgpu::util::new_instance_with_webgpu_detection(instance_desc).await; let surface=setup::step2::create_surface(&instance,ToSurfaceTarget(canvas)).map_err(|e|JsError::new(&e.to_string()))?; let adapter=instance.request_adapter(&wgpu::RequestAdapterOptions{ power_preference:wgpu::PowerPreference::HighPerformance, force_fallback_adapter:false, compatible_surface:Some(&surface), }).await.map_err(|e|JsError::new(&e.to_string()))?; - let (device,queue)=setup::step4::request_device(&adapter).await.map_err(|e|JsError::new(&e.to_string()))?; + let (device,queue)=setup::step4::request_device(&adapter,LIMITS).await.map_err(|e|JsError::new(&e.to_string()))?; let surface=setup::step5::configure_surface(&adapter,&device,surface,(size.x,size.y)).map_err(|e|JsError::new(&e.to_string()))?; Ok(Graphics{ - graphics:graphics::Graphics::new(&device,&queue,size,surface.view_format()), + graphics:graphics::Graphics::new(&device,&queue,size,surface.view_format(),LIMITS), surface, device, queue, @@ -53,7 +59,7 @@ impl Graphics{ pub fn render(&mut self,bot:&CompleteBot,head:&PlaybackHead,time:f64){ let time=time::from_float(time).unwrap(); let (pos,angles)=head.head.get_position_angles(&bot.bot,time); - let frame=self.surface.new_frame(&self.device); + let frame=self.surface.new_frame(&self.device).expect("Error creating new frame"); let mut encoder=self.device.create_command_encoder(&wgpu::CommandEncoderDescriptor{label:None}); self.graphics.encode_commands(&mut encoder,frame.view(),pos,angles); self.queue.submit([encoder.finish()]);