tangled
alpha
login
or
join now
j0.lol
/
bl0ck
0
fork
atom
WebGPU Voxel Game
0
fork
atom
overview
issues
4
pulls
pipelines
Update to Winit 0.30 Large refactor!
j0.lol
1 year ago
eec4e60e
6a8970fe
+1164
-847
6 changed files
expand all
collapse all
unified
split
Cargo.lock
Cargo.toml
src
app
gfx_state.rs
app.rs
camera.rs
lib.rs
+508
-271
Cargo.lock
···
4
4
5
5
[[package]]
6
6
name = "ab_glyph"
7
7
-
version = "0.2.28"
7
7
+
version = "0.2.29"
8
8
source = "registry+https://github.com/rust-lang/crates.io-index"
9
9
-
checksum = "79faae4620f45232f599d9bc7b290f88247a0834162c4495ab2f02d60004adfb"
9
9
+
checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0"
10
10
dependencies = [
11
11
"ab_glyph_rasterizer",
12
12
"owned_ttf_parser",
···
40
40
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
41
41
dependencies = [
42
42
"cfg-if",
43
43
-
"getrandom",
43
43
+
"getrandom 0.2.15",
44
44
"once_cell",
45
45
"version_check",
46
46
"zerocopy",
···
56
56
]
57
57
58
58
[[package]]
59
59
-
name = "allocator-api2"
60
60
-
version = "0.2.18"
61
61
-
source = "registry+https://github.com/rust-lang/crates.io-index"
62
62
-
checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
63
63
-
64
64
-
[[package]]
65
59
name = "android-activity"
66
66
-
version = "0.5.2"
60
60
+
version = "0.6.0"
67
61
source = "registry+https://github.com/rust-lang/crates.io-index"
68
68
-
checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289"
62
62
+
checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046"
69
63
dependencies = [
70
64
"android-properties",
71
71
-
"bitflags 2.6.0",
65
65
+
"bitflags 2.8.0",
72
66
"cc",
73
67
"cesu8",
74
68
"jni",
···
77
71
"log",
78
72
"ndk",
79
73
"ndk-context",
80
80
-
"ndk-sys",
74
74
+
"ndk-sys 0.6.0+11769913",
81
75
"num_enum",
82
82
-
"thiserror 1.0.64",
76
76
+
"thiserror 1.0.69",
83
77
]
84
78
85
79
[[package]]
···
132
126
133
127
[[package]]
134
128
name = "autocfg"
135
135
-
version = "1.3.0"
129
129
+
version = "1.4.0"
136
130
source = "registry+https://github.com/rust-lang/crates.io-index"
137
137
-
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
131
131
+
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
138
132
139
133
[[package]]
140
134
name = "backtrace"
···
180
174
181
175
[[package]]
182
176
name = "bitflags"
183
183
-
version = "2.6.0"
177
177
+
version = "2.8.0"
184
178
source = "registry+https://github.com/rust-lang/crates.io-index"
185
185
-
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
179
179
+
checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
186
180
187
181
[[package]]
188
182
name = "bl0ck"
···
218
212
checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
219
213
220
214
[[package]]
221
221
-
name = "block-sys"
222
222
-
version = "0.2.1"
223
223
-
source = "registry+https://github.com/rust-lang/crates.io-index"
224
224
-
checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7"
225
225
-
dependencies = [
226
226
-
"objc-sys",
227
227
-
]
228
228
-
229
229
-
[[package]]
230
215
name = "block2"
231
231
-
version = "0.3.0"
216
216
+
version = "0.5.1"
232
217
source = "registry+https://github.com/rust-lang/crates.io-index"
233
233
-
checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68"
218
218
+
checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f"
234
219
dependencies = [
235
235
-
"block-sys",
236
220
"objc2",
237
221
]
238
222
239
223
[[package]]
240
224
name = "bumpalo"
241
241
-
version = "3.16.0"
225
225
+
version = "3.17.0"
242
226
source = "registry+https://github.com/rust-lang/crates.io-index"
243
243
-
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
227
227
+
checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
244
228
245
229
[[package]]
246
230
name = "bytemuck"
247
247
-
version = "1.18.0"
231
231
+
version = "1.21.0"
248
232
source = "registry+https://github.com/rust-lang/crates.io-index"
249
249
-
checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae"
233
233
+
checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3"
250
234
dependencies = [
251
235
"bytemuck_derive",
252
236
]
253
237
254
238
[[package]]
255
239
name = "bytemuck_derive"
256
256
-
version = "1.7.1"
240
240
+
version = "1.8.1"
257
241
source = "registry+https://github.com/rust-lang/crates.io-index"
258
258
-
checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26"
242
242
+
checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a"
259
243
dependencies = [
260
244
"proc-macro2",
261
245
"quote",
262
262
-
"syn 2.0.96",
246
246
+
"syn 2.0.98",
263
247
]
264
248
265
249
[[package]]
···
270
254
271
255
[[package]]
272
256
name = "bytes"
273
273
-
version = "1.7.2"
257
257
+
version = "1.10.0"
274
258
source = "registry+https://github.com/rust-lang/crates.io-index"
275
275
-
checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3"
259
259
+
checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9"
276
260
277
261
[[package]]
278
262
name = "calloop"
279
279
-
version = "0.12.4"
263
263
+
version = "0.13.0"
280
264
source = "registry+https://github.com/rust-lang/crates.io-index"
281
281
-
checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
265
265
+
checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec"
282
266
dependencies = [
283
283
-
"bitflags 2.6.0",
267
267
+
"bitflags 2.8.0",
284
268
"log",
285
269
"polling",
286
270
"rustix",
287
271
"slab",
288
288
-
"thiserror 1.0.64",
272
272
+
"thiserror 1.0.69",
289
273
]
290
274
291
275
[[package]]
292
276
name = "calloop-wayland-source"
293
293
-
version = "0.2.0"
277
277
+
version = "0.3.0"
294
278
source = "registry+https://github.com/rust-lang/crates.io-index"
295
295
-
checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
279
279
+
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
296
280
dependencies = [
297
281
"calloop",
298
282
"rustix",
···
302
286
303
287
[[package]]
304
288
name = "cc"
305
305
-
version = "1.1.21"
289
289
+
version = "1.2.11"
306
290
source = "registry+https://github.com/rust-lang/crates.io-index"
307
307
-
checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0"
291
291
+
checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf"
308
292
dependencies = [
309
293
"jobserver",
310
294
"libc",
···
328
312
version = "0.1.1"
329
313
source = "registry+https://github.com/rust-lang/crates.io-index"
330
314
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
315
315
+
316
316
+
[[package]]
317
317
+
name = "cfg_aliases"
318
318
+
version = "0.2.1"
319
319
+
source = "registry+https://github.com/rust-lang/crates.io-index"
320
320
+
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
331
321
332
322
[[package]]
333
323
name = "codespan-reporting"
···
460
450
461
451
[[package]]
462
452
name = "crossbeam-utils"
463
463
-
version = "0.8.20"
453
453
+
version = "0.8.21"
464
454
source = "registry+https://github.com/rust-lang/crates.io-index"
465
465
-
checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
455
455
+
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
466
456
467
457
[[package]]
468
458
name = "cursor-icon"
···
476
466
source = "registry+https://github.com/rust-lang/crates.io-index"
477
467
checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017"
478
468
dependencies = [
479
479
-
"bitflags 2.6.0",
469
469
+
"bitflags 2.8.0",
480
470
"libloading",
481
471
"winapi",
482
472
]
···
495
485
dependencies = [
496
486
"proc-macro2",
497
487
"quote",
498
498
-
"syn 2.0.96",
488
488
+
"syn 2.0.98",
499
489
]
500
490
501
491
[[package]]
···
521
511
version = "1.2.1"
522
512
source = "registry+https://github.com/rust-lang/crates.io-index"
523
513
checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
514
514
+
515
515
+
[[package]]
516
516
+
name = "dpi"
517
517
+
version = "0.1.1"
518
518
+
source = "registry+https://github.com/rust-lang/crates.io-index"
519
519
+
checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53"
524
520
525
521
[[package]]
526
522
name = "either"
···
558
554
559
555
[[package]]
560
556
name = "errno"
561
561
-
version = "0.3.9"
557
557
+
version = "0.3.10"
562
558
source = "registry+https://github.com/rust-lang/crates.io-index"
563
563
-
checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
559
559
+
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
564
560
dependencies = [
565
561
"libc",
566
566
-
"windows-sys 0.52.0",
562
562
+
"windows-sys 0.59.0",
567
563
]
568
564
569
565
[[package]]
···
598
594
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
599
595
600
596
[[package]]
597
597
+
name = "foldhash"
598
598
+
version = "0.1.4"
599
599
+
source = "registry+https://github.com/rust-lang/crates.io-index"
600
600
+
checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f"
601
601
+
602
602
+
[[package]]
601
603
name = "foreign-types"
602
604
version = "0.3.2"
603
605
source = "registry+https://github.com/rust-lang/crates.io-index"
···
624
626
dependencies = [
625
627
"proc-macro2",
626
628
"quote",
627
627
-
"syn 2.0.96",
629
629
+
"syn 2.0.98",
628
630
]
629
631
630
632
[[package]]
···
710
712
dependencies = [
711
713
"proc-macro2",
712
714
"quote",
713
713
-
"syn 2.0.96",
715
715
+
"syn 2.0.98",
714
716
]
715
717
716
718
[[package]]
···
761
763
dependencies = [
762
764
"cfg-if",
763
765
"libc",
764
764
-
"wasi",
766
766
+
"wasi 0.11.0+wasi-snapshot-preview1",
767
767
+
]
768
768
+
769
769
+
[[package]]
770
770
+
name = "getrandom"
771
771
+
version = "0.3.1"
772
772
+
source = "registry+https://github.com/rust-lang/crates.io-index"
773
773
+
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
774
774
+
dependencies = [
775
775
+
"cfg-if",
776
776
+
"libc",
777
777
+
"wasi 0.13.3+wasi-0.2.2",
778
778
+
"windows-targets 0.52.6",
765
779
]
766
780
767
781
[[package]]
···
810
824
811
825
[[package]]
812
826
name = "glutin_wgl_sys"
813
813
-
version = "0.6.0"
827
827
+
version = "0.6.1"
814
828
source = "registry+https://github.com/rust-lang/crates.io-index"
815
815
-
checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c"
829
829
+
checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e"
816
830
dependencies = [
817
831
"gl_generator",
818
832
]
···
823
837
source = "registry+https://github.com/rust-lang/crates.io-index"
824
838
checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
825
839
dependencies = [
826
826
-
"bitflags 2.6.0",
840
840
+
"bitflags 2.8.0",
827
841
"gpu-alloc-types",
828
842
]
829
843
···
833
847
source = "registry+https://github.com/rust-lang/crates.io-index"
834
848
checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
835
849
dependencies = [
836
836
-
"bitflags 2.6.0",
850
850
+
"bitflags 2.8.0",
837
851
]
838
852
839
853
[[package]]
···
844
858
dependencies = [
845
859
"log",
846
860
"presser",
847
847
-
"thiserror 1.0.64",
861
861
+
"thiserror 1.0.69",
848
862
"winapi",
849
863
"windows",
850
864
]
851
865
852
866
[[package]]
853
867
name = "gpu-descriptor"
854
854
-
version = "0.3.0"
868
868
+
version = "0.3.1"
855
869
source = "registry+https://github.com/rust-lang/crates.io-index"
856
856
-
checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557"
870
870
+
checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca"
857
871
dependencies = [
858
858
-
"bitflags 2.6.0",
872
872
+
"bitflags 2.8.0",
859
873
"gpu-descriptor-types",
860
874
"hashbrown",
861
875
]
···
866
880
source = "registry+https://github.com/rust-lang/crates.io-index"
867
881
checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91"
868
882
dependencies = [
869
869
-
"bitflags 2.6.0",
883
883
+
"bitflags 2.8.0",
870
884
]
871
885
872
886
[[package]]
···
890
904
891
905
[[package]]
892
906
name = "hashbrown"
893
893
-
version = "0.14.5"
907
907
+
version = "0.15.2"
894
908
source = "registry+https://github.com/rust-lang/crates.io-index"
895
895
-
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
909
909
+
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
896
910
dependencies = [
897
897
-
"ahash",
898
898
-
"allocator-api2",
911
911
+
"foldhash",
899
912
]
900
913
901
914
[[package]]
···
904
917
source = "registry+https://github.com/rust-lang/crates.io-index"
905
918
checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890"
906
919
dependencies = [
907
907
-
"bitflags 2.6.0",
920
920
+
"bitflags 2.8.0",
908
921
"com",
909
922
"libc",
910
923
"libloading",
911
911
-
"thiserror 1.0.64",
924
924
+
"thiserror 1.0.69",
912
925
"widestring",
913
926
"winapi",
914
927
]
···
1003
1016
]
1004
1017
1005
1018
[[package]]
1006
1006
-
name = "icrate"
1007
1007
-
version = "0.0.4"
1008
1008
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1009
1009
-
checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319"
1010
1010
-
dependencies = [
1011
1011
-
"block2",
1012
1012
-
"dispatch",
1013
1013
-
"objc2",
1014
1014
-
]
1015
1015
-
1016
1016
-
[[package]]
1017
1019
name = "icu_collections"
1018
1020
version = "1.5.0"
1019
1021
source = "registry+https://github.com/rust-lang/crates.io-index"
···
1128
1130
dependencies = [
1129
1131
"proc-macro2",
1130
1132
"quote",
1131
1131
-
"syn 2.0.96",
1133
1133
+
"syn 2.0.98",
1132
1134
]
1133
1135
1134
1136
[[package]]
···
1168
1170
1169
1171
[[package]]
1170
1172
name = "indexmap"
1171
1171
-
version = "2.5.0"
1173
1173
+
version = "2.7.1"
1172
1174
source = "registry+https://github.com/rust-lang/crates.io-index"
1173
1173
-
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
1175
1175
+
checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652"
1174
1176
dependencies = [
1175
1177
"equivalent",
1176
1178
"hashbrown",
···
1184
1186
1185
1187
[[package]]
1186
1188
name = "is-terminal"
1187
1187
-
version = "0.4.13"
1189
1189
+
version = "0.4.15"
1188
1190
source = "registry+https://github.com/rust-lang/crates.io-index"
1189
1189
-
checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b"
1191
1191
+
checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37"
1190
1192
dependencies = [
1191
1193
"hermit-abi",
1192
1194
"libc",
1193
1193
-
"windows-sys 0.52.0",
1195
1195
+
"windows-sys 0.59.0",
1194
1196
]
1195
1197
1196
1198
[[package]]
···
1219
1221
"combine",
1220
1222
"jni-sys",
1221
1223
"log",
1222
1222
-
"thiserror 1.0.64",
1224
1224
+
"thiserror 1.0.69",
1223
1225
"walkdir",
1224
1226
"windows-sys 0.45.0",
1225
1227
]
···
1241
1243
1242
1244
[[package]]
1243
1245
name = "js-sys"
1244
1244
-
version = "0.3.70"
1246
1246
+
version = "0.3.77"
1245
1247
source = "registry+https://github.com/rust-lang/crates.io-index"
1246
1246
-
checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
1248
1248
+
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
1247
1249
dependencies = [
1250
1250
+
"once_cell",
1248
1251
"wasm-bindgen",
1249
1252
]
1250
1253
···
1267
1270
1268
1271
[[package]]
1269
1272
name = "libc"
1270
1270
-
version = "0.2.159"
1273
1273
+
version = "0.2.169"
1271
1274
source = "registry+https://github.com/rust-lang/crates.io-index"
1272
1272
-
checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
1275
1275
+
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
1273
1276
1274
1277
[[package]]
1275
1278
name = "libloading"
1276
1276
-
version = "0.8.5"
1279
1279
+
version = "0.8.6"
1277
1280
source = "registry+https://github.com/rust-lang/crates.io-index"
1278
1278
-
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
1281
1281
+
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
1279
1282
dependencies = [
1280
1283
"cfg-if",
1281
1284
"windows-targets 0.52.6",
···
1283
1286
1284
1287
[[package]]
1285
1288
name = "libredox"
1286
1286
-
version = "0.0.2"
1289
1289
+
version = "0.1.3"
1287
1290
source = "registry+https://github.com/rust-lang/crates.io-index"
1288
1288
-
checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607"
1291
1291
+
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
1289
1292
dependencies = [
1290
1290
-
"bitflags 2.6.0",
1293
1293
+
"bitflags 2.8.0",
1291
1294
"libc",
1292
1292
-
"redox_syscall 0.4.1",
1295
1295
+
"redox_syscall 0.5.8",
1293
1296
]
1294
1297
1295
1298
[[package]]
1296
1299
name = "linux-raw-sys"
1297
1297
-
version = "0.4.14"
1300
1300
+
version = "0.4.15"
1298
1301
source = "registry+https://github.com/rust-lang/crates.io-index"
1299
1299
-
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
1302
1302
+
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
1300
1303
1301
1304
[[package]]
1302
1305
name = "litemap"
···
1322
1325
1323
1326
[[package]]
1324
1327
name = "log"
1325
1325
-
version = "0.4.22"
1328
1328
+
version = "0.4.25"
1326
1329
source = "registry+https://github.com/rust-lang/crates.io-index"
1327
1327
-
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
1330
1330
+
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
1328
1331
1329
1332
[[package]]
1330
1333
name = "malloc_buf"
···
1356
1359
source = "registry+https://github.com/rust-lang/crates.io-index"
1357
1360
checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21"
1358
1361
dependencies = [
1359
1359
-
"bitflags 2.6.0",
1362
1362
+
"bitflags 2.8.0",
1360
1363
"block",
1361
1364
"core-graphics-types",
1362
1365
"foreign-types 0.5.0",
···
1388
1391
checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
1389
1392
dependencies = [
1390
1393
"libc",
1391
1391
-
"wasi",
1394
1394
+
"wasi 0.11.0+wasi-snapshot-preview1",
1392
1395
"windows-sys 0.52.0",
1393
1396
]
1394
1397
···
1400
1403
dependencies = [
1401
1404
"arrayvec",
1402
1405
"bit-set",
1403
1403
-
"bitflags 2.6.0",
1404
1404
-
"cfg_aliases",
1406
1406
+
"bitflags 2.8.0",
1407
1407
+
"cfg_aliases 0.1.1",
1405
1408
"codespan-reporting",
1406
1409
"hexf-parse",
1407
1410
"indexmap",
···
1409
1412
"rustc-hash",
1410
1413
"spirv",
1411
1414
"termcolor",
1412
1412
-
"thiserror 1.0.64",
1415
1415
+
"thiserror 1.0.69",
1413
1416
"unicode-xid",
1414
1417
]
1415
1418
···
1432
1435
1433
1436
[[package]]
1434
1437
name = "ndk"
1435
1435
-
version = "0.8.0"
1438
1438
+
version = "0.9.0"
1436
1439
source = "registry+https://github.com/rust-lang/crates.io-index"
1437
1437
-
checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7"
1440
1440
+
checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4"
1438
1441
dependencies = [
1439
1439
-
"bitflags 2.6.0",
1442
1442
+
"bitflags 2.8.0",
1440
1443
"jni-sys",
1441
1444
"log",
1442
1442
-
"ndk-sys",
1445
1445
+
"ndk-sys 0.6.0+11769913",
1443
1446
"num_enum",
1444
1447
"raw-window-handle 0.5.2",
1445
1448
"raw-window-handle 0.6.2",
1446
1446
-
"thiserror 1.0.64",
1449
1449
+
"thiserror 1.0.69",
1447
1450
]
1448
1451
1449
1452
[[package]]
···
1462
1465
]
1463
1466
1464
1467
[[package]]
1468
1468
+
name = "ndk-sys"
1469
1469
+
version = "0.6.0+11769913"
1470
1470
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1471
1471
+
checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873"
1472
1472
+
dependencies = [
1473
1473
+
"jni-sys",
1474
1474
+
]
1475
1475
+
1476
1476
+
[[package]]
1465
1477
name = "num-traits"
1466
1478
version = "0.2.19"
1467
1479
source = "registry+https://github.com/rust-lang/crates.io-index"
···
1488
1500
"proc-macro-crate",
1489
1501
"proc-macro2",
1490
1502
"quote",
1491
1491
-
"syn 2.0.96",
1503
1503
+
"syn 2.0.98",
1492
1504
]
1493
1505
1494
1506
[[package]]
···
1508
1520
1509
1521
[[package]]
1510
1522
name = "objc2"
1511
1511
-
version = "0.4.1"
1523
1523
+
version = "0.5.2"
1512
1524
source = "registry+https://github.com/rust-lang/crates.io-index"
1513
1513
-
checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d"
1525
1525
+
checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804"
1514
1526
dependencies = [
1515
1527
"objc-sys",
1516
1528
"objc2-encode",
1517
1529
]
1518
1530
1519
1531
[[package]]
1532
1532
+
name = "objc2-app-kit"
1533
1533
+
version = "0.2.2"
1534
1534
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1535
1535
+
checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"
1536
1536
+
dependencies = [
1537
1537
+
"bitflags 2.8.0",
1538
1538
+
"block2",
1539
1539
+
"libc",
1540
1540
+
"objc2",
1541
1541
+
"objc2-core-data",
1542
1542
+
"objc2-core-image",
1543
1543
+
"objc2-foundation",
1544
1544
+
"objc2-quartz-core",
1545
1545
+
]
1546
1546
+
1547
1547
+
[[package]]
1548
1548
+
name = "objc2-cloud-kit"
1549
1549
+
version = "0.2.2"
1550
1550
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1551
1551
+
checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009"
1552
1552
+
dependencies = [
1553
1553
+
"bitflags 2.8.0",
1554
1554
+
"block2",
1555
1555
+
"objc2",
1556
1556
+
"objc2-core-location",
1557
1557
+
"objc2-foundation",
1558
1558
+
]
1559
1559
+
1560
1560
+
[[package]]
1561
1561
+
name = "objc2-contacts"
1562
1562
+
version = "0.2.2"
1563
1563
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1564
1564
+
checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889"
1565
1565
+
dependencies = [
1566
1566
+
"block2",
1567
1567
+
"objc2",
1568
1568
+
"objc2-foundation",
1569
1569
+
]
1570
1570
+
1571
1571
+
[[package]]
1572
1572
+
name = "objc2-core-data"
1573
1573
+
version = "0.2.2"
1574
1574
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1575
1575
+
checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"
1576
1576
+
dependencies = [
1577
1577
+
"bitflags 2.8.0",
1578
1578
+
"block2",
1579
1579
+
"objc2",
1580
1580
+
"objc2-foundation",
1581
1581
+
]
1582
1582
+
1583
1583
+
[[package]]
1584
1584
+
name = "objc2-core-image"
1585
1585
+
version = "0.2.2"
1586
1586
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1587
1587
+
checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80"
1588
1588
+
dependencies = [
1589
1589
+
"block2",
1590
1590
+
"objc2",
1591
1591
+
"objc2-foundation",
1592
1592
+
"objc2-metal",
1593
1593
+
]
1594
1594
+
1595
1595
+
[[package]]
1596
1596
+
name = "objc2-core-location"
1597
1597
+
version = "0.2.2"
1598
1598
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1599
1599
+
checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781"
1600
1600
+
dependencies = [
1601
1601
+
"block2",
1602
1602
+
"objc2",
1603
1603
+
"objc2-contacts",
1604
1604
+
"objc2-foundation",
1605
1605
+
]
1606
1606
+
1607
1607
+
[[package]]
1520
1608
name = "objc2-encode"
1521
1521
-
version = "3.0.0"
1609
1609
+
version = "4.1.0"
1610
1610
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1611
1611
+
checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
1612
1612
+
1613
1613
+
[[package]]
1614
1614
+
name = "objc2-foundation"
1615
1615
+
version = "0.2.2"
1616
1616
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1617
1617
+
checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"
1618
1618
+
dependencies = [
1619
1619
+
"bitflags 2.8.0",
1620
1620
+
"block2",
1621
1621
+
"dispatch",
1622
1622
+
"libc",
1623
1623
+
"objc2",
1624
1624
+
]
1625
1625
+
1626
1626
+
[[package]]
1627
1627
+
name = "objc2-link-presentation"
1628
1628
+
version = "0.2.2"
1629
1629
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1630
1630
+
checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398"
1631
1631
+
dependencies = [
1632
1632
+
"block2",
1633
1633
+
"objc2",
1634
1634
+
"objc2-app-kit",
1635
1635
+
"objc2-foundation",
1636
1636
+
]
1637
1637
+
1638
1638
+
[[package]]
1639
1639
+
name = "objc2-metal"
1640
1640
+
version = "0.2.2"
1641
1641
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1642
1642
+
checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6"
1643
1643
+
dependencies = [
1644
1644
+
"bitflags 2.8.0",
1645
1645
+
"block2",
1646
1646
+
"objc2",
1647
1647
+
"objc2-foundation",
1648
1648
+
]
1649
1649
+
1650
1650
+
[[package]]
1651
1651
+
name = "objc2-quartz-core"
1652
1652
+
version = "0.2.2"
1653
1653
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1654
1654
+
checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a"
1655
1655
+
dependencies = [
1656
1656
+
"bitflags 2.8.0",
1657
1657
+
"block2",
1658
1658
+
"objc2",
1659
1659
+
"objc2-foundation",
1660
1660
+
"objc2-metal",
1661
1661
+
]
1662
1662
+
1663
1663
+
[[package]]
1664
1664
+
name = "objc2-symbols"
1665
1665
+
version = "0.2.2"
1666
1666
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1667
1667
+
checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc"
1668
1668
+
dependencies = [
1669
1669
+
"objc2",
1670
1670
+
"objc2-foundation",
1671
1671
+
]
1672
1672
+
1673
1673
+
[[package]]
1674
1674
+
name = "objc2-ui-kit"
1675
1675
+
version = "0.2.2"
1676
1676
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1677
1677
+
checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f"
1678
1678
+
dependencies = [
1679
1679
+
"bitflags 2.8.0",
1680
1680
+
"block2",
1681
1681
+
"objc2",
1682
1682
+
"objc2-cloud-kit",
1683
1683
+
"objc2-core-data",
1684
1684
+
"objc2-core-image",
1685
1685
+
"objc2-core-location",
1686
1686
+
"objc2-foundation",
1687
1687
+
"objc2-link-presentation",
1688
1688
+
"objc2-quartz-core",
1689
1689
+
"objc2-symbols",
1690
1690
+
"objc2-uniform-type-identifiers",
1691
1691
+
"objc2-user-notifications",
1692
1692
+
]
1693
1693
+
1694
1694
+
[[package]]
1695
1695
+
name = "objc2-uniform-type-identifiers"
1696
1696
+
version = "0.2.2"
1697
1697
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1698
1698
+
checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe"
1699
1699
+
dependencies = [
1700
1700
+
"block2",
1701
1701
+
"objc2",
1702
1702
+
"objc2-foundation",
1703
1703
+
]
1704
1704
+
1705
1705
+
[[package]]
1706
1706
+
name = "objc2-user-notifications"
1707
1707
+
version = "0.2.2"
1522
1708
source = "registry+https://github.com/rust-lang/crates.io-index"
1523
1523
-
checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666"
1709
1709
+
checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3"
1710
1710
+
dependencies = [
1711
1711
+
"bitflags 2.8.0",
1712
1712
+
"block2",
1713
1713
+
"objc2",
1714
1714
+
"objc2-core-location",
1715
1715
+
"objc2-foundation",
1716
1716
+
]
1524
1717
1525
1718
[[package]]
1526
1719
name = "object"
···
1533
1726
1534
1727
[[package]]
1535
1728
name = "once_cell"
1536
1536
-
version = "1.19.0"
1729
1729
+
version = "1.20.2"
1537
1730
source = "registry+https://github.com/rust-lang/crates.io-index"
1538
1538
-
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
1731
1731
+
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
1539
1732
1540
1733
[[package]]
1541
1734
name = "openssl"
1542
1542
-
version = "0.10.69"
1735
1735
+
version = "0.10.70"
1543
1736
source = "registry+https://github.com/rust-lang/crates.io-index"
1544
1544
-
checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e"
1737
1737
+
checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6"
1545
1738
dependencies = [
1546
1546
-
"bitflags 2.6.0",
1739
1739
+
"bitflags 2.8.0",
1547
1740
"cfg-if",
1548
1741
"foreign-types 0.3.2",
1549
1742
"libc",
···
1560
1753
dependencies = [
1561
1754
"proc-macro2",
1562
1755
"quote",
1563
1563
-
"syn 2.0.96",
1756
1756
+
"syn 2.0.98",
1564
1757
]
1565
1758
1566
1759
[[package]]
···
1571
1764
1572
1765
[[package]]
1573
1766
name = "openssl-sys"
1574
1574
-
version = "0.9.104"
1767
1767
+
version = "0.9.105"
1575
1768
source = "registry+https://github.com/rust-lang/crates.io-index"
1576
1576
-
checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741"
1769
1769
+
checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc"
1577
1770
dependencies = [
1578
1771
"cc",
1579
1772
"libc",
···
1583
1776
1584
1777
[[package]]
1585
1778
name = "orbclient"
1586
1586
-
version = "0.3.47"
1779
1779
+
version = "0.3.48"
1587
1780
source = "registry+https://github.com/rust-lang/crates.io-index"
1588
1588
-
checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166"
1781
1781
+
checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43"
1589
1782
dependencies = [
1590
1783
"libredox",
1591
1784
]
1592
1785
1593
1786
[[package]]
1594
1787
name = "owned_ttf_parser"
1595
1595
-
version = "0.24.0"
1788
1788
+
version = "0.25.0"
1596
1789
source = "registry+https://github.com/rust-lang/crates.io-index"
1597
1597
-
checksum = "490d3a563d3122bf7c911a59b0add9389e5ec0f5f0c3ac6b91ff235a0e6a7f90"
1790
1790
+
checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4"
1598
1791
dependencies = [
1599
1792
"ttf-parser",
1600
1793
]
···
1617
1810
dependencies = [
1618
1811
"cfg-if",
1619
1812
"libc",
1620
1620
-
"redox_syscall 0.5.5",
1813
1813
+
"redox_syscall 0.5.8",
1621
1814
"smallvec",
1622
1815
"windows-targets 0.52.6",
1623
1816
]
···
1635
1828
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
1636
1829
1637
1830
[[package]]
1831
1831
+
name = "pin-project"
1832
1832
+
version = "1.1.9"
1833
1833
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1834
1834
+
checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d"
1835
1835
+
dependencies = [
1836
1836
+
"pin-project-internal",
1837
1837
+
]
1838
1838
+
1839
1839
+
[[package]]
1840
1840
+
name = "pin-project-internal"
1841
1841
+
version = "1.1.9"
1842
1842
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1843
1843
+
checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67"
1844
1844
+
dependencies = [
1845
1845
+
"proc-macro2",
1846
1846
+
"quote",
1847
1847
+
"syn 2.0.98",
1848
1848
+
]
1849
1849
+
1850
1850
+
[[package]]
1638
1851
name = "pin-project-lite"
1639
1639
-
version = "0.2.14"
1852
1852
+
version = "0.2.16"
1640
1853
source = "registry+https://github.com/rust-lang/crates.io-index"
1641
1641
-
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
1854
1854
+
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
1642
1855
1643
1856
[[package]]
1644
1857
name = "pin-utils"
···
1667
1880
1668
1881
[[package]]
1669
1882
name = "polling"
1670
1670
-
version = "3.7.3"
1883
1883
+
version = "3.7.4"
1671
1884
source = "registry+https://github.com/rust-lang/crates.io-index"
1672
1672
-
checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511"
1885
1885
+
checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f"
1673
1886
dependencies = [
1674
1887
"cfg-if",
1675
1888
"concurrent-queue",
···
1712
1925
1713
1926
[[package]]
1714
1927
name = "profiling"
1715
1715
-
version = "1.0.15"
1928
1928
+
version = "1.0.16"
1716
1929
source = "registry+https://github.com/rust-lang/crates.io-index"
1717
1717
-
checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58"
1930
1930
+
checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d"
1718
1931
1719
1932
[[package]]
1720
1933
name = "quick-xml"
1721
1721
-
version = "0.36.2"
1934
1934
+
version = "0.37.2"
1722
1935
source = "registry+https://github.com/rust-lang/crates.io-index"
1723
1723
-
checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe"
1936
1936
+
checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003"
1724
1937
dependencies = [
1725
1938
"memchr",
1726
1939
]
1727
1940
1728
1941
[[package]]
1729
1942
name = "quote"
1730
1730
-
version = "1.0.37"
1943
1943
+
version = "1.0.38"
1731
1944
source = "registry+https://github.com/rust-lang/crates.io-index"
1732
1732
-
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
1945
1945
+
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
1733
1946
dependencies = [
1734
1947
"proc-macro2",
1735
1948
]
1736
1949
1737
1950
[[package]]
1738
1951
name = "range-alloc"
1739
1739
-
version = "0.1.3"
1952
1952
+
version = "0.1.4"
1740
1953
source = "registry+https://github.com/rust-lang/crates.io-index"
1741
1741
-
checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab"
1954
1954
+
checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde"
1742
1955
1743
1956
[[package]]
1744
1957
name = "raw-window-handle"
···
1754
1967
1755
1968
[[package]]
1756
1969
name = "redox_syscall"
1757
1757
-
version = "0.3.5"
1758
1758
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1759
1759
-
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
1760
1760
-
dependencies = [
1761
1761
-
"bitflags 1.3.2",
1762
1762
-
]
1763
1763
-
1764
1764
-
[[package]]
1765
1765
-
name = "redox_syscall"
1766
1970
version = "0.4.1"
1767
1971
source = "registry+https://github.com/rust-lang/crates.io-index"
1768
1972
checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
···
1772
1976
1773
1977
[[package]]
1774
1978
name = "redox_syscall"
1775
1775
-
version = "0.5.5"
1979
1979
+
version = "0.5.8"
1776
1980
source = "registry+https://github.com/rust-lang/crates.io-index"
1777
1777
-
checksum = "62871f2d65009c0256aed1b9cfeeb8ac272833c404e13d53d400cd0dad7a2ac0"
1981
1981
+
checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834"
1778
1982
dependencies = [
1779
1779
-
"bitflags 2.6.0",
1983
1983
+
"bitflags 2.8.0",
1780
1984
]
1781
1985
1782
1986
[[package]]
1783
1987
name = "regex"
1784
1784
-
version = "1.10.6"
1988
1988
+
version = "1.11.1"
1785
1989
source = "registry+https://github.com/rust-lang/crates.io-index"
1786
1786
-
checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
1990
1990
+
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
1787
1991
dependencies = [
1788
1992
"aho-corasick",
1789
1993
"memchr",
···
1793
1997
1794
1998
[[package]]
1795
1999
name = "regex-automata"
1796
1796
-
version = "0.4.7"
2000
2000
+
version = "0.4.9"
1797
2001
source = "registry+https://github.com/rust-lang/crates.io-index"
1798
1798
-
checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
2002
2002
+
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
1799
2003
dependencies = [
1800
2004
"aho-corasick",
1801
2005
"memchr",
···
1804
2008
1805
2009
[[package]]
1806
2010
name = "regex-syntax"
1807
1807
-
version = "0.8.4"
2011
2011
+
version = "0.8.5"
1808
2012
source = "registry+https://github.com/rust-lang/crates.io-index"
1809
1809
-
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
2013
2013
+
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
1810
2014
1811
2015
[[package]]
1812
2016
name = "renderdoc-sys"
···
1868
2072
1869
2073
[[package]]
1870
2074
name = "rustix"
1871
1871
-
version = "0.38.37"
2075
2075
+
version = "0.38.44"
1872
2076
source = "registry+https://github.com/rust-lang/crates.io-index"
1873
1873
-
checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
2077
2077
+
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
1874
2078
dependencies = [
1875
1875
-
"bitflags 2.6.0",
2079
2079
+
"bitflags 2.8.0",
1876
2080
"errno",
1877
2081
"libc",
1878
2082
"linux-raw-sys",
1879
1879
-
"windows-sys 0.52.0",
2083
2083
+
"windows-sys 0.59.0",
1880
2084
]
1881
2085
1882
2086
[[package]]
···
1889
2093
]
1890
2094
1891
2095
[[package]]
2096
2096
+
name = "rustversion"
2097
2097
+
version = "1.0.19"
2098
2098
+
source = "registry+https://github.com/rust-lang/crates.io-index"
2099
2099
+
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
2100
2100
+
2101
2101
+
[[package]]
1892
2102
name = "ryu"
1893
2103
version = "1.0.19"
1894
2104
source = "registry+https://github.com/rust-lang/crates.io-index"
···
1926
2136
1927
2137
[[package]]
1928
2138
name = "sctk-adwaita"
1929
1929
-
version = "0.8.3"
2139
2139
+
version = "0.10.1"
1930
2140
source = "registry+https://github.com/rust-lang/crates.io-index"
1931
1931
-
checksum = "70b31447ca297092c5a9916fc3b955203157b37c19ca8edde4f52e9843e602c7"
2141
2141
+
checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec"
1932
2142
dependencies = [
1933
2143
"ab_glyph",
1934
2144
"log",
···
1943
2153
source = "registry+https://github.com/rust-lang/crates.io-index"
1944
2154
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
1945
2155
dependencies = [
1946
1946
-
"bitflags 2.6.0",
2156
2156
+
"bitflags 2.8.0",
1947
2157
"core-foundation",
1948
2158
"core-foundation-sys",
1949
2159
"libc",
···
1962
2172
1963
2173
[[package]]
1964
2174
name = "serde"
1965
1965
-
version = "1.0.210"
2175
2175
+
version = "1.0.217"
1966
2176
source = "registry+https://github.com/rust-lang/crates.io-index"
1967
1967
-
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
2177
2177
+
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
1968
2178
dependencies = [
1969
2179
"serde_derive",
1970
2180
]
1971
2181
1972
2182
[[package]]
1973
2183
name = "serde_derive"
1974
1974
-
version = "1.0.210"
2184
2184
+
version = "1.0.217"
1975
2185
source = "registry+https://github.com/rust-lang/crates.io-index"
1976
1976
-
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
2186
2186
+
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
1977
2187
dependencies = [
1978
2188
"proc-macro2",
1979
2189
"quote",
1980
1980
-
"syn 2.0.96",
2190
2190
+
"syn 2.0.98",
1981
2191
]
1982
2192
1983
2193
[[package]]
···
2042
2252
2043
2253
[[package]]
2044
2254
name = "smithay-client-toolkit"
2045
2045
-
version = "0.18.1"
2255
2255
+
version = "0.19.2"
2046
2256
source = "registry+https://github.com/rust-lang/crates.io-index"
2047
2047
-
checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a"
2257
2257
+
checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
2048
2258
dependencies = [
2049
2049
-
"bitflags 2.6.0",
2259
2259
+
"bitflags 2.8.0",
2050
2260
"calloop",
2051
2261
"calloop-wayland-source",
2052
2262
"cursor-icon",
···
2054
2264
"log",
2055
2265
"memmap2",
2056
2266
"rustix",
2057
2057
-
"thiserror 1.0.64",
2267
2267
+
"thiserror 1.0.69",
2058
2268
"wayland-backend",
2059
2269
"wayland-client",
2060
2270
"wayland-csd-frame",
···
2090
2300
source = "registry+https://github.com/rust-lang/crates.io-index"
2091
2301
checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
2092
2302
dependencies = [
2093
2093
-
"bitflags 2.6.0",
2303
2303
+
"bitflags 2.8.0",
2094
2304
]
2095
2305
2096
2306
[[package]]
···
2124
2334
2125
2335
[[package]]
2126
2336
name = "syn"
2127
2127
-
version = "2.0.96"
2337
2337
+
version = "2.0.98"
2128
2338
source = "registry+https://github.com/rust-lang/crates.io-index"
2129
2129
-
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
2339
2339
+
checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1"
2130
2340
dependencies = [
2131
2341
"proc-macro2",
2132
2342
"quote",
···
2147
2357
dependencies = [
2148
2358
"proc-macro2",
2149
2359
"quote",
2150
2150
-
"syn 2.0.96",
2360
2360
+
"syn 2.0.98",
2151
2361
]
2152
2362
2153
2363
[[package]]
···
2173
2383
2174
2384
[[package]]
2175
2385
name = "tempfile"
2176
2176
-
version = "3.13.0"
2386
2386
+
version = "3.16.0"
2177
2387
source = "registry+https://github.com/rust-lang/crates.io-index"
2178
2178
-
checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b"
2388
2388
+
checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91"
2179
2389
dependencies = [
2180
2390
"cfg-if",
2181
2391
"fastrand",
2392
2392
+
"getrandom 0.3.1",
2182
2393
"once_cell",
2183
2394
"rustix",
2184
2395
"windows-sys 0.59.0",
···
2195
2406
2196
2407
[[package]]
2197
2408
name = "thiserror"
2198
2198
-
version = "1.0.64"
2409
2409
+
version = "1.0.69"
2199
2410
source = "registry+https://github.com/rust-lang/crates.io-index"
2200
2200
-
checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
2411
2411
+
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
2201
2412
dependencies = [
2202
2202
-
"thiserror-impl 1.0.64",
2413
2413
+
"thiserror-impl 1.0.69",
2203
2414
]
2204
2415
2205
2416
[[package]]
···
2213
2424
2214
2425
[[package]]
2215
2426
name = "thiserror-impl"
2216
2216
-
version = "1.0.64"
2427
2427
+
version = "1.0.69"
2217
2428
source = "registry+https://github.com/rust-lang/crates.io-index"
2218
2218
-
checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
2429
2429
+
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
2219
2430
dependencies = [
2220
2431
"proc-macro2",
2221
2432
"quote",
2222
2222
-
"syn 2.0.96",
2433
2433
+
"syn 2.0.98",
2223
2434
]
2224
2435
2225
2436
[[package]]
···
2230
2441
dependencies = [
2231
2442
"proc-macro2",
2232
2443
"quote",
2233
2233
-
"syn 2.0.96",
2444
2444
+
"syn 2.0.98",
2234
2445
]
2235
2446
2236
2447
[[package]]
···
2276
2487
2277
2488
[[package]]
2278
2489
name = "tokio"
2279
2279
-
version = "1.42.0"
2490
2490
+
version = "1.43.0"
2280
2491
source = "registry+https://github.com/rust-lang/crates.io-index"
2281
2281
-
checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551"
2492
2492
+
checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e"
2282
2493
dependencies = [
2283
2494
"backtrace",
2284
2495
"bytes",
···
2320
2531
2321
2532
[[package]]
2322
2533
name = "toml_edit"
2323
2323
-
version = "0.22.21"
2534
2534
+
version = "0.22.23"
2324
2535
source = "registry+https://github.com/rust-lang/crates.io-index"
2325
2325
-
checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf"
2536
2536
+
checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee"
2326
2537
dependencies = [
2327
2538
"indexmap",
2328
2539
"toml_datetime",
···
2337
2548
2338
2549
[[package]]
2339
2550
name = "tracing"
2340
2340
-
version = "0.1.40"
2551
2551
+
version = "0.1.41"
2341
2552
source = "registry+https://github.com/rust-lang/crates.io-index"
2342
2342
-
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
2553
2553
+
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
2343
2554
dependencies = [
2344
2555
"pin-project-lite",
2345
2556
"tracing-core",
···
2347
2558
2348
2559
[[package]]
2349
2560
name = "tracing-core"
2350
2350
-
version = "0.1.32"
2561
2561
+
version = "0.1.33"
2351
2562
source = "registry+https://github.com/rust-lang/crates.io-index"
2352
2352
-
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
2563
2563
+
checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
2353
2564
dependencies = [
2354
2565
"once_cell",
2355
2566
]
···
2362
2573
2363
2574
[[package]]
2364
2575
name = "ttf-parser"
2365
2365
-
version = "0.24.1"
2576
2576
+
version = "0.25.1"
2366
2577
source = "registry+https://github.com/rust-lang/crates.io-index"
2367
2367
-
checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a"
2578
2578
+
checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"
2368
2579
2369
2580
[[package]]
2370
2581
name = "unicode-ident"
2371
2371
-
version = "1.0.13"
2582
2582
+
version = "1.0.16"
2372
2583
source = "registry+https://github.com/rust-lang/crates.io-index"
2373
2373
-
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
2584
2584
+
checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034"
2374
2585
2375
2586
[[package]]
2376
2587
name = "unicode-segmentation"
···
2451
2662
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
2452
2663
2453
2664
[[package]]
2665
2665
+
name = "wasi"
2666
2666
+
version = "0.13.3+wasi-0.2.2"
2667
2667
+
source = "registry+https://github.com/rust-lang/crates.io-index"
2668
2668
+
checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
2669
2669
+
dependencies = [
2670
2670
+
"wit-bindgen-rt",
2671
2671
+
]
2672
2672
+
2673
2673
+
[[package]]
2454
2674
name = "wasm-bindgen"
2455
2455
-
version = "0.2.93"
2675
2675
+
version = "0.2.100"
2456
2676
source = "registry+https://github.com/rust-lang/crates.io-index"
2457
2457
-
checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
2677
2677
+
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
2458
2678
dependencies = [
2459
2679
"cfg-if",
2460
2680
"once_cell",
2681
2681
+
"rustversion",
2461
2682
"wasm-bindgen-macro",
2462
2683
]
2463
2684
2464
2685
[[package]]
2465
2686
name = "wasm-bindgen-backend"
2466
2466
-
version = "0.2.93"
2687
2687
+
version = "0.2.100"
2467
2688
source = "registry+https://github.com/rust-lang/crates.io-index"
2468
2468
-
checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
2689
2689
+
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
2469
2690
dependencies = [
2470
2691
"bumpalo",
2471
2692
"log",
2472
2472
-
"once_cell",
2473
2693
"proc-macro2",
2474
2694
"quote",
2475
2475
-
"syn 2.0.96",
2695
2695
+
"syn 2.0.98",
2476
2696
"wasm-bindgen-shared",
2477
2697
]
2478
2698
2479
2699
[[package]]
2480
2700
name = "wasm-bindgen-futures"
2481
2481
-
version = "0.4.43"
2701
2701
+
version = "0.4.50"
2482
2702
source = "registry+https://github.com/rust-lang/crates.io-index"
2483
2483
-
checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed"
2703
2703
+
checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
2484
2704
dependencies = [
2485
2705
"cfg-if",
2486
2706
"js-sys",
2707
2707
+
"once_cell",
2487
2708
"wasm-bindgen",
2488
2709
"web-sys",
2489
2710
]
2490
2711
2491
2712
[[package]]
2492
2713
name = "wasm-bindgen-macro"
2493
2493
-
version = "0.2.93"
2714
2714
+
version = "0.2.100"
2494
2715
source = "registry+https://github.com/rust-lang/crates.io-index"
2495
2495
-
checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
2716
2716
+
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
2496
2717
dependencies = [
2497
2718
"quote",
2498
2719
"wasm-bindgen-macro-support",
···
2500
2721
2501
2722
[[package]]
2502
2723
name = "wasm-bindgen-macro-support"
2503
2503
-
version = "0.2.93"
2724
2724
+
version = "0.2.100"
2504
2725
source = "registry+https://github.com/rust-lang/crates.io-index"
2505
2505
-
checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
2726
2726
+
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
2506
2727
dependencies = [
2507
2728
"proc-macro2",
2508
2729
"quote",
2509
2509
-
"syn 2.0.96",
2730
2730
+
"syn 2.0.98",
2510
2731
"wasm-bindgen-backend",
2511
2732
"wasm-bindgen-shared",
2512
2733
]
2513
2734
2514
2735
[[package]]
2515
2736
name = "wasm-bindgen-shared"
2516
2516
-
version = "0.2.93"
2737
2737
+
version = "0.2.100"
2517
2738
source = "registry+https://github.com/rust-lang/crates.io-index"
2518
2518
-
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
2739
2739
+
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
2740
2740
+
dependencies = [
2741
2741
+
"unicode-ident",
2742
2742
+
]
2519
2743
2520
2744
[[package]]
2521
2745
name = "wayland-backend"
2522
2522
-
version = "0.3.7"
2746
2746
+
version = "0.3.8"
2523
2747
source = "registry+https://github.com/rust-lang/crates.io-index"
2524
2524
-
checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6"
2748
2748
+
checksum = "b7208998eaa3870dad37ec8836979581506e0c5c64c20c9e79e9d2a10d6f47bf"
2525
2749
dependencies = [
2526
2750
"cc",
2527
2751
"downcast-rs",
···
2533
2757
2534
2758
[[package]]
2535
2759
name = "wayland-client"
2536
2536
-
version = "0.31.6"
2760
2760
+
version = "0.31.8"
2537
2761
source = "registry+https://github.com/rust-lang/crates.io-index"
2538
2538
-
checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d"
2762
2762
+
checksum = "c2120de3d33638aaef5b9f4472bff75f07c56379cf76ea320bd3a3d65ecaf73f"
2539
2763
dependencies = [
2540
2540
-
"bitflags 2.6.0",
2764
2764
+
"bitflags 2.8.0",
2541
2765
"rustix",
2542
2766
"wayland-backend",
2543
2767
"wayland-scanner",
···
2549
2773
source = "registry+https://github.com/rust-lang/crates.io-index"
2550
2774
checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
2551
2775
dependencies = [
2552
2552
-
"bitflags 2.6.0",
2776
2776
+
"bitflags 2.8.0",
2553
2777
"cursor-icon",
2554
2778
"wayland-backend",
2555
2779
]
2556
2780
2557
2781
[[package]]
2558
2782
name = "wayland-cursor"
2559
2559
-
version = "0.31.6"
2783
2783
+
version = "0.31.8"
2560
2784
source = "registry+https://github.com/rust-lang/crates.io-index"
2561
2561
-
checksum = "3a94697e66e76c85923b0d28a0c251e8f0666f58fc47d316c0f4da6da75d37cb"
2785
2785
+
checksum = "a93029cbb6650748881a00e4922b076092a6a08c11e7fbdb923f064b23968c5d"
2562
2786
dependencies = [
2563
2787
"rustix",
2564
2788
"wayland-client",
···
2567
2791
2568
2792
[[package]]
2569
2793
name = "wayland-protocols"
2570
2570
-
version = "0.31.2"
2794
2794
+
version = "0.32.6"
2571
2795
source = "registry+https://github.com/rust-lang/crates.io-index"
2572
2572
-
checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4"
2796
2796
+
checksum = "0781cf46869b37e36928f7b432273c0995aa8aed9552c556fb18754420541efc"
2573
2797
dependencies = [
2574
2574
-
"bitflags 2.6.0",
2798
2798
+
"bitflags 2.8.0",
2575
2799
"wayland-backend",
2576
2800
"wayland-client",
2577
2801
"wayland-scanner",
···
2579
2803
2580
2804
[[package]]
2581
2805
name = "wayland-protocols-plasma"
2582
2582
-
version = "0.2.0"
2806
2806
+
version = "0.3.6"
2583
2807
source = "registry+https://github.com/rust-lang/crates.io-index"
2584
2584
-
checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479"
2808
2808
+
checksum = "7ccaacc76703fefd6763022ac565b590fcade92202492381c95b2edfdf7d46b3"
2585
2809
dependencies = [
2586
2586
-
"bitflags 2.6.0",
2810
2810
+
"bitflags 2.8.0",
2587
2811
"wayland-backend",
2588
2812
"wayland-client",
2589
2813
"wayland-protocols",
···
2592
2816
2593
2817
[[package]]
2594
2818
name = "wayland-protocols-wlr"
2595
2595
-
version = "0.2.0"
2819
2819
+
version = "0.3.6"
2596
2820
source = "registry+https://github.com/rust-lang/crates.io-index"
2597
2597
-
checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6"
2821
2821
+
checksum = "248a02e6f595aad796561fa82d25601bd2c8c3b145b1c7453fc8f94c1a58f8b2"
2598
2822
dependencies = [
2599
2599
-
"bitflags 2.6.0",
2823
2823
+
"bitflags 2.8.0",
2600
2824
"wayland-backend",
2601
2825
"wayland-client",
2602
2826
"wayland-protocols",
···
2605
2829
2606
2830
[[package]]
2607
2831
name = "wayland-scanner"
2608
2608
-
version = "0.31.5"
2832
2832
+
version = "0.31.6"
2609
2833
source = "registry+https://github.com/rust-lang/crates.io-index"
2610
2610
-
checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3"
2834
2834
+
checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484"
2611
2835
dependencies = [
2612
2836
"proc-macro2",
2613
2837
"quick-xml",
···
2616
2840
2617
2841
[[package]]
2618
2842
name = "wayland-sys"
2619
2619
-
version = "0.31.5"
2843
2843
+
version = "0.31.6"
2620
2844
source = "registry+https://github.com/rust-lang/crates.io-index"
2621
2621
-
checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09"
2845
2845
+
checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615"
2622
2846
dependencies = [
2623
2847
"dlib",
2624
2848
"log",
···
2628
2852
2629
2853
[[package]]
2630
2854
name = "web-sys"
2631
2631
-
version = "0.3.70"
2855
2855
+
version = "0.3.77"
2632
2856
source = "registry+https://github.com/rust-lang/crates.io-index"
2633
2633
-
checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0"
2857
2857
+
checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
2634
2858
dependencies = [
2635
2859
"js-sys",
2636
2860
"wasm-bindgen",
···
2638
2862
2639
2863
[[package]]
2640
2864
name = "web-time"
2641
2641
-
version = "0.2.4"
2865
2865
+
version = "1.1.0"
2642
2866
source = "registry+https://github.com/rust-lang/crates.io-index"
2643
2643
-
checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0"
2867
2867
+
checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
2644
2868
dependencies = [
2645
2869
"js-sys",
2646
2870
"wasm-bindgen",
···
2653
2877
checksum = "e1d1c4ba43f80542cf63a0a6ed3134629ae73e8ab51e4b765a67f3aa062eb433"
2654
2878
dependencies = [
2655
2879
"arrayvec",
2656
2656
-
"cfg_aliases",
2880
2880
+
"cfg_aliases 0.1.1",
2657
2881
"document-features",
2658
2882
"js-sys",
2659
2883
"log",
···
2679
2903
dependencies = [
2680
2904
"arrayvec",
2681
2905
"bit-vec",
2682
2682
-
"bitflags 2.6.0",
2683
2683
-
"cfg_aliases",
2906
2906
+
"bitflags 2.8.0",
2907
2907
+
"cfg_aliases 0.1.1",
2684
2908
"document-features",
2685
2909
"indexmap",
2686
2910
"log",
···
2691
2915
"raw-window-handle 0.6.2",
2692
2916
"rustc-hash",
2693
2917
"smallvec",
2694
2694
-
"thiserror 1.0.64",
2918
2918
+
"thiserror 1.0.69",
2695
2919
"wgpu-hal",
2696
2920
"wgpu-types",
2697
2921
]
···
2706
2930
"arrayvec",
2707
2931
"ash",
2708
2932
"bit-set",
2709
2709
-
"bitflags 2.6.0",
2933
2933
+
"bitflags 2.8.0",
2710
2934
"block",
2711
2711
-
"cfg_aliases",
2935
2935
+
"cfg_aliases 0.1.1",
2712
2936
"core-graphics-types",
2713
2937
"d3d12",
2714
2938
"glow",
···
2724
2948
"log",
2725
2949
"metal",
2726
2950
"naga",
2727
2727
-
"ndk-sys",
2951
2951
+
"ndk-sys 0.5.0+25.2.9519653",
2728
2952
"objc",
2729
2953
"once_cell",
2730
2954
"parking_lot",
···
2734
2958
"renderdoc-sys",
2735
2959
"rustc-hash",
2736
2960
"smallvec",
2737
2737
-
"thiserror 1.0.64",
2961
2961
+
"thiserror 1.0.69",
2738
2962
"wasm-bindgen",
2739
2963
"web-sys",
2740
2964
"wgpu-types",
···
2747
2971
source = "registry+https://github.com/rust-lang/crates.io-index"
2748
2972
checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d"
2749
2973
dependencies = [
2750
2750
-
"bitflags 2.6.0",
2974
2974
+
"bitflags 2.8.0",
2751
2975
"js-sys",
2752
2976
"web-sys",
2753
2977
]
···
3024
3248
3025
3249
[[package]]
3026
3250
name = "winit"
3027
3027
-
version = "0.29.15"
3251
3251
+
version = "0.30.8"
3028
3252
source = "registry+https://github.com/rust-lang/crates.io-index"
3029
3029
-
checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca"
3253
3253
+
checksum = "f5d74280aabb958072864bff6cfbcf9025cf8bfacdde5e32b5e12920ef703b0f"
3030
3254
dependencies = [
3031
3255
"ahash",
3032
3256
"android-activity",
3033
3257
"atomic-waker",
3034
3034
-
"bitflags 2.6.0",
3258
3258
+
"bitflags 2.8.0",
3259
3259
+
"block2",
3035
3260
"bytemuck",
3036
3261
"calloop",
3037
3037
-
"cfg_aliases",
3262
3262
+
"cfg_aliases 0.2.1",
3263
3263
+
"concurrent-queue",
3038
3264
"core-foundation",
3039
3265
"core-graphics",
3040
3266
"cursor-icon",
3041
3041
-
"icrate",
3267
3267
+
"dpi",
3042
3268
"js-sys",
3043
3269
"libc",
3044
3044
-
"log",
3045
3270
"memmap2",
3046
3271
"ndk",
3047
3047
-
"ndk-sys",
3048
3272
"objc2",
3049
3049
-
"once_cell",
3273
3273
+
"objc2-app-kit",
3274
3274
+
"objc2-foundation",
3275
3275
+
"objc2-ui-kit",
3050
3276
"orbclient",
3051
3277
"percent-encoding",
3278
3278
+
"pin-project",
3052
3279
"raw-window-handle 0.5.2",
3053
3280
"raw-window-handle 0.6.2",
3054
3054
-
"redox_syscall 0.3.5",
3281
3281
+
"redox_syscall 0.4.1",
3055
3282
"rustix",
3056
3283
"sctk-adwaita",
3057
3284
"smithay-client-toolkit",
3058
3285
"smol_str",
3286
3286
+
"tracing",
3059
3287
"unicode-segmentation",
3060
3288
"wasm-bindgen",
3061
3289
"wasm-bindgen-futures",
···
3065
3293
"wayland-protocols-plasma",
3066
3294
"web-sys",
3067
3295
"web-time",
3068
3068
-
"windows-sys 0.48.0",
3296
3296
+
"windows-sys 0.52.0",
3069
3297
"x11-dl",
3070
3298
"x11rb",
3071
3299
"xkbcommon-dl",
···
3073
3301
3074
3302
[[package]]
3075
3303
name = "winnow"
3076
3076
-
version = "0.6.18"
3304
3304
+
version = "0.7.0"
3077
3305
source = "registry+https://github.com/rust-lang/crates.io-index"
3078
3078
-
checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
3306
3306
+
checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419"
3079
3307
dependencies = [
3080
3308
"memchr",
3081
3309
]
···
3088
3316
dependencies = [
3089
3317
"cfg-if",
3090
3318
"windows-sys 0.48.0",
3319
3319
+
]
3320
3320
+
3321
3321
+
[[package]]
3322
3322
+
name = "wit-bindgen-rt"
3323
3323
+
version = "0.33.0"
3324
3324
+
source = "registry+https://github.com/rust-lang/crates.io-index"
3325
3325
+
checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
3326
3326
+
dependencies = [
3327
3327
+
"bitflags 2.8.0",
3091
3328
]
3092
3329
3093
3330
[[package]]
···
3146
3383
source = "registry+https://github.com/rust-lang/crates.io-index"
3147
3384
checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
3148
3385
dependencies = [
3149
3149
-
"bitflags 2.6.0",
3386
3386
+
"bitflags 2.8.0",
3150
3387
"dlib",
3151
3388
"log",
3152
3389
"once_cell",
···
3161
3398
3162
3399
[[package]]
3163
3400
name = "xml-rs"
3164
3164
-
version = "0.8.22"
3401
3401
+
version = "0.8.25"
3165
3402
source = "registry+https://github.com/rust-lang/crates.io-index"
3166
3166
-
checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26"
3403
3403
+
checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4"
3167
3404
3168
3405
[[package]]
3169
3406
name = "yoke"
···
3185
3422
dependencies = [
3186
3423
"proc-macro2",
3187
3424
"quote",
3188
3188
-
"syn 2.0.96",
3425
3425
+
"syn 2.0.98",
3189
3426
"synstructure",
3190
3427
]
3191
3428
···
3206
3443
dependencies = [
3207
3444
"proc-macro2",
3208
3445
"quote",
3209
3209
-
"syn 2.0.96",
3446
3446
+
"syn 2.0.98",
3210
3447
]
3211
3448
3212
3449
[[package]]
···
3226
3463
dependencies = [
3227
3464
"proc-macro2",
3228
3465
"quote",
3229
3229
-
"syn 2.0.96",
3466
3466
+
"syn 2.0.98",
3230
3467
"synstructure",
3231
3468
]
3232
3469
···
3249
3486
dependencies = [
3250
3487
"proc-macro2",
3251
3488
"quote",
3252
3252
-
"syn 2.0.96",
3489
3489
+
"syn 2.0.98",
3253
3490
]
3254
3491
3255
3492
[[package]]
+1
-1
Cargo.toml
···
4
4
edition = "2021"
5
5
6
6
[dependencies]
7
7
-
winit = { version = "0.29", features = ["rwh_05"] }
7
7
+
winit = { version = "0.30", features = ["rwh_05"] }
8
8
env_logger = "0.10"
9
9
log = "0.4"
10
10
wgpu = "22.0"
+136
src/app.rs
···
1
1
+
mod gfx_state;
2
2
+
3
3
+
use gfx_state::{Gfx, GfxBuilder, MaybeGfx};
4
4
+
use std::sync::Arc;
5
5
+
use winit::{
6
6
+
application::ApplicationHandler,
7
7
+
event::{ElementState, KeyEvent, WindowEvent},
8
8
+
event_loop::{ActiveEventLoop, EventLoop},
9
9
+
keyboard::{KeyCode, PhysicalKey},
10
10
+
window::{Window, WindowAttributes, WindowId},
11
11
+
};
12
12
+
13
13
+
const WASM_WIN_SIZE: (u32, u32) = (640, 480);
14
14
+
15
15
+
// TODO citation:
16
16
+
// https://github.com/Bentebent/rita/ for winit 29.0->30.0 migration
17
17
+
// https://github.com/erer1243/wgpu-0.20-winit-0.30-web-example/blob/master/src/lib.rs For better winit 30.0 impl
18
18
+
19
19
+
pub struct Application {
20
20
+
window_attributes: WindowAttributes,
21
21
+
gfx_state: MaybeGfx,
22
22
+
window: Option<Arc<Window>>,
23
23
+
}
24
24
+
25
25
+
impl Application {
26
26
+
pub fn new(event_loop: &EventLoop<Gfx>, title: &str) -> Self {
27
27
+
Self {
28
28
+
window_attributes: Window::default_attributes().with_title(title),
29
29
+
gfx_state: MaybeGfx::Builder(GfxBuilder::new(event_loop.create_proxy())),
30
30
+
window: None,
31
31
+
}
32
32
+
}
33
33
+
}
34
34
+
35
35
+
impl ApplicationHandler<Gfx> for Application {
36
36
+
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
37
37
+
log::info!("hi web!");
38
38
+
event_loop.set_control_flow(winit::event_loop::ControlFlow::Poll);
39
39
+
let window = Arc::new(
40
40
+
event_loop
41
41
+
.create_window(self.window_attributes.clone())
42
42
+
.unwrap(),
43
43
+
);
44
44
+
45
45
+
if let MaybeGfx::Builder(builder) = &mut self.gfx_state {
46
46
+
builder.build_and_send(window.clone());
47
47
+
}
48
48
+
49
49
+
#[cfg(target_arch = "wasm32")]
50
50
+
{
51
51
+
// Winit prevents sizing with CSS, so we have to set
52
52
+
// the size manually when on web.
53
53
+
use winit::dpi::PhysicalSize;
54
54
+
let _ = window.request_inner_size(PhysicalSize::new(WASM_WIN_SIZE.0, WASM_WIN_SIZE.1));
55
55
+
56
56
+
use winit::platform::web::WindowExtWebSys;
57
57
+
web_sys::window()
58
58
+
.and_then(|win| win.document())
59
59
+
.and_then(|doc| {
60
60
+
let dst = doc.get_element_by_id("wasm-example")?;
61
61
+
let canvas = web_sys::Element::from(window.canvas()?);
62
62
+
dst.append_child(&canvas).ok()?;
63
63
+
Some(())
64
64
+
})
65
65
+
.expect("Couldn't append canvas to document body.");
66
66
+
}
67
67
+
68
68
+
window.request_redraw();
69
69
+
70
70
+
self.window = Some(window);
71
71
+
}
72
72
+
73
73
+
fn user_event(&mut self, _event_loop: &ActiveEventLoop, gfx: Gfx) {
74
74
+
self.gfx_state = MaybeGfx::Graphics(gfx);
75
75
+
}
76
76
+
77
77
+
fn window_event(
78
78
+
&mut self,
79
79
+
event_loop: &ActiveEventLoop,
80
80
+
_window_id: WindowId,
81
81
+
event: WindowEvent,
82
82
+
) {
83
83
+
let MaybeGfx::Graphics(gfx) = &mut self.gfx_state else {
84
84
+
if let (WindowEvent::RedrawRequested, Some(ref window)) = (event, &self.window) {
85
85
+
window.request_redraw();
86
86
+
}
87
87
+
return;
88
88
+
};
89
89
+
90
90
+
if let Some(ref window) = &self.window {
91
91
+
gfx.input(&event, window.inner_size());
92
92
+
}
93
93
+
94
94
+
match event {
95
95
+
WindowEvent::CloseRequested => event_loop.exit(),
96
96
+
97
97
+
WindowEvent::KeyboardInput { event, .. } => {
98
98
+
if matches!(
99
99
+
event,
100
100
+
KeyEvent {
101
101
+
state: ElementState::Pressed,
102
102
+
physical_key: PhysicalKey::Code(KeyCode::Escape),
103
103
+
..
104
104
+
}
105
105
+
) {
106
106
+
event_loop.exit()
107
107
+
}
108
108
+
}
109
109
+
WindowEvent::Resized(physical_size) => {
110
110
+
gfx.resize(physical_size);
111
111
+
}
112
112
+
WindowEvent::RedrawRequested => {
113
113
+
// Some horrible nesting here! Don't tell Linus...
114
114
+
if let Some(ref window) = &self.window {
115
115
+
window.request_redraw();
116
116
+
match gfx.render() {
117
117
+
Ok(_) => {
118
118
+
gfx.update();
119
119
+
}
120
120
+
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
121
121
+
gfx.resize(window.inner_size());
122
122
+
}
123
123
+
Err(wgpu::SurfaceError::OutOfMemory) => {
124
124
+
log::error!("Out of memory!");
125
125
+
event_loop.exit();
126
126
+
}
127
127
+
Err(wgpu::SurfaceError::Timeout) => {
128
128
+
log::warn!("Surface timeout!");
129
129
+
}
130
130
+
}
131
131
+
}
132
132
+
}
133
133
+
_ => {}
134
134
+
}
135
135
+
}
136
136
+
}
+502
src/app/gfx_state.rs
···
1
1
+
use std::sync::Arc;
2
2
+
3
3
+
use glam::{vec3, Quat, Vec3};
4
4
+
use wgpu::util::DeviceExt;
5
5
+
use winit::{dpi::PhysicalSize, event::{ElementState, KeyEvent, WindowEvent}, event_loop::EventLoopProxy, keyboard::{KeyCode, PhysicalKey}, window::Window};
6
6
+
7
7
+
use crate::{
8
8
+
app::WASM_WIN_SIZE, camera, model::{self, Vertex}, resources, texture, Instance, InstanceRaw, NUM_INSTANCES_PER_ROW
9
9
+
};
10
10
+
11
11
+
struct CameraState {
12
12
+
positioning: camera::Camera,
13
13
+
controller: camera::CameraController,
14
14
+
uniform: camera::CameraUniform,
15
15
+
buffer: wgpu::Buffer,
16
16
+
bind_group: wgpu::BindGroup,
17
17
+
}
18
18
+
struct InteractState {
19
19
+
clear_color: wgpu::Color,
20
20
+
wireframe: bool,
21
21
+
}
22
22
+
struct ObjectState {
23
23
+
model: model::Model,
24
24
+
instances: Vec<Instance>,
25
25
+
instance_buffer: wgpu::Buffer,
26
26
+
diffuse_bind_group: wgpu::BindGroup,
27
27
+
diffuse_texture: texture::Texture,
28
28
+
}
29
29
+
30
30
+
pub enum MaybeGfx {
31
31
+
Builder(GfxBuilder),
32
32
+
Graphics(Gfx),
33
33
+
}
34
34
+
35
35
+
36
36
+
pub struct GfxBuilder {
37
37
+
event_loop_proxy: Option<EventLoopProxy<Gfx>>,
38
38
+
}
39
39
+
40
40
+
impl GfxBuilder {
41
41
+
pub fn new(event_loop_proxy: EventLoopProxy<Gfx>) -> Self {
42
42
+
Self {
43
43
+
event_loop_proxy: Some(event_loop_proxy),
44
44
+
}
45
45
+
}
46
46
+
47
47
+
pub fn build_and_send(&mut self, window: Arc<Window>) {
48
48
+
let Some(event_loop_proxy) = self.event_loop_proxy.take() else {
49
49
+
// event_loop_proxy is already spent - we already constructed Graphics
50
50
+
return;
51
51
+
};
52
52
+
53
53
+
#[cfg(target_arch = "wasm32")]
54
54
+
{
55
55
+
//let gfx_fut = create_graphics(event_loop);
56
56
+
let gfx_fut = Gfx::new(window);
57
57
+
wasm_bindgen_futures::spawn_local(async move {
58
58
+
let gfx = gfx_fut.await;
59
59
+
assert!(event_loop_proxy.send_event(gfx).is_ok());
60
60
+
});
61
61
+
}
62
62
+
63
63
+
#[cfg(not(target_arch = "wasm32"))]
64
64
+
{
65
65
+
let gfx = pollster::block_on(Gfx::new(window));
66
66
+
assert!(event_loop_proxy.send_event(gfx).is_ok());
67
67
+
}
68
68
+
}
69
69
+
}
70
70
+
71
71
+
pub struct Gfx {
72
72
+
surface: wgpu::Surface<'static>,
73
73
+
device: wgpu::Device,
74
74
+
queue: wgpu::Queue,
75
75
+
surface_config: wgpu::SurfaceConfiguration,
76
76
+
render_pipeline: (wgpu::RenderPipeline, Option<wgpu::RenderPipeline>),
77
77
+
depth_texture: texture::Texture,
78
78
+
79
79
+
object: ObjectState,
80
80
+
camera: CameraState,
81
81
+
interact: InteractState,
82
82
+
}
83
83
+
impl Gfx {
84
84
+
pub async fn new(window: std::sync::Arc<winit::window::Window>) -> Self {
85
85
+
// 0 size can cause web-app to crash, better to enforce this than not.
86
86
+
let size = if cfg!(target_arch = "wasm32") {
87
87
+
winit::dpi::PhysicalSize {
88
88
+
width: WASM_WIN_SIZE.0,
89
89
+
height: WASM_WIN_SIZE.1,
90
90
+
}
91
91
+
} else {
92
92
+
window.inner_size()
93
93
+
};
94
94
+
95
95
+
// Handle to our GPU backends
96
96
+
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
97
97
+
#[cfg(not(target_arch = "wasm32"))]
98
98
+
backends: wgpu::Backends::PRIMARY,
99
99
+
100
100
+
// WebGPU is sadly not supported in most browsers (yet!)
101
101
+
#[cfg(target_arch = "wasm32")]
102
102
+
backends: wgpu::Backends::BROWSER_WEBGPU | wgpu::Backends::GL,
103
103
+
104
104
+
..Default::default()
105
105
+
});
106
106
+
107
107
+
let surface = instance.create_surface(window).unwrap();
108
108
+
109
109
+
let adapter = instance
110
110
+
.request_adapter(&wgpu::RequestAdapterOptions {
111
111
+
// lo-power or hi-perf
112
112
+
power_preference: wgpu::PowerPreference::default(),
113
113
+
compatible_surface: Some(&surface),
114
114
+
force_fallback_adapter: false,
115
115
+
})
116
116
+
.await
117
117
+
.unwrap();
118
118
+
119
119
+
let (device, queue) = adapter
120
120
+
.request_device(
121
121
+
&wgpu::DeviceDescriptor {
122
122
+
required_features: if adapter.get_info().backend == wgpu::Backend::Gl {
123
123
+
wgpu::Features::empty()
124
124
+
} else {
125
125
+
wgpu::Features::POLYGON_MODE_LINE
126
126
+
},
127
127
+
128
128
+
// WebGL does not support all of wgpu's features
129
129
+
required_limits: if adapter.get_info().backend == wgpu::Backend::Gl {
130
130
+
wgpu::Limits::downlevel_webgl2_defaults()
131
131
+
} else {
132
132
+
wgpu::Limits::default()
133
133
+
},
134
134
+
label: None,
135
135
+
memory_hints: Default::default(),
136
136
+
},
137
137
+
None,
138
138
+
)
139
139
+
.await
140
140
+
.unwrap();
141
141
+
142
142
+
let surface_caps = surface.get_capabilities(&adapter);
143
143
+
144
144
+
// sRGB surface textures assumed
145
145
+
let surface_format = surface_caps
146
146
+
.formats
147
147
+
.iter()
148
148
+
.find(|f| f.is_srgb())
149
149
+
.copied()
150
150
+
.unwrap_or(surface_caps.formats[0]);
151
151
+
152
152
+
let surface_config = wgpu::SurfaceConfiguration {
153
153
+
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
154
154
+
format: surface_format,
155
155
+
width: size.width,
156
156
+
height: size.height,
157
157
+
present_mode: surface_caps.present_modes[0], // eg vsync
158
158
+
alpha_mode: surface_caps.alpha_modes[0],
159
159
+
view_formats: vec![],
160
160
+
desired_maximum_frame_latency: 2,
161
161
+
};
162
162
+
163
163
+
surface.configure(&device, &surface_config);
164
164
+
165
165
+
let depth_texture =
166
166
+
texture::Texture::create_depth_texture(&device, &surface_config, "depth_texture");
167
167
+
168
168
+
let diffuse_bytes = include_bytes!("../happy-tree.png");
169
169
+
let diffuse_texture =
170
170
+
texture::Texture::from_bytes(&device, &queue, diffuse_bytes, "happy_tree.png").unwrap();
171
171
+
172
172
+
let texture_bind_group_layout =
173
173
+
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
174
174
+
entries: &[
175
175
+
wgpu::BindGroupLayoutEntry {
176
176
+
binding: 0,
177
177
+
visibility: wgpu::ShaderStages::FRAGMENT,
178
178
+
ty: wgpu::BindingType::Texture {
179
179
+
multisampled: false,
180
180
+
view_dimension: wgpu::TextureViewDimension::D2,
181
181
+
sample_type: wgpu::TextureSampleType::Float { filterable: true },
182
182
+
},
183
183
+
count: None,
184
184
+
},
185
185
+
wgpu::BindGroupLayoutEntry {
186
186
+
binding: 1,
187
187
+
visibility: wgpu::ShaderStages::FRAGMENT,
188
188
+
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
189
189
+
count: None,
190
190
+
},
191
191
+
],
192
192
+
label: Some("texture_bind_group_layout"),
193
193
+
});
194
194
+
195
195
+
let diffuse_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
196
196
+
layout: &texture_bind_group_layout,
197
197
+
entries: &[
198
198
+
wgpu::BindGroupEntry {
199
199
+
binding: 0,
200
200
+
resource: wgpu::BindingResource::TextureView(&diffuse_texture.view),
201
201
+
},
202
202
+
wgpu::BindGroupEntry {
203
203
+
binding: 1,
204
204
+
resource: wgpu::BindingResource::Sampler(&diffuse_texture.sampler),
205
205
+
},
206
206
+
],
207
207
+
label: Some("diffuse_bind_group"),
208
208
+
});
209
209
+
210
210
+
let camera = camera::Camera {
211
211
+
eye: vec3(0., 1., 2.),
212
212
+
target: Vec3::ZERO,
213
213
+
up: Vec3::Y,
214
214
+
aspect: surface_config.width as f32 / surface_config.height as f32,
215
215
+
fovy: 45.0,
216
216
+
znear: 0.1,
217
217
+
zfar: 100.0,
218
218
+
};
219
219
+
let camera_controller = camera::CameraController::new(0.2);
220
220
+
let mut camera_uniform = camera::CameraUniform::new();
221
221
+
camera_uniform.update_view_proj(&camera);
222
222
+
let camera_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
223
223
+
label: Some("Camera Buffer"),
224
224
+
contents: bytemuck::cast_slice(&[camera_uniform]),
225
225
+
usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST,
226
226
+
});
227
227
+
let camera_bind_group_layout =
228
228
+
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
229
229
+
entries: &[wgpu::BindGroupLayoutEntry {
230
230
+
binding: 0,
231
231
+
visibility: wgpu::ShaderStages::VERTEX,
232
232
+
ty: wgpu::BindingType::Buffer {
233
233
+
ty: wgpu::BufferBindingType::Uniform,
234
234
+
has_dynamic_offset: false,
235
235
+
min_binding_size: None,
236
236
+
},
237
237
+
count: None,
238
238
+
}],
239
239
+
label: Some("camera_bind_group_layout"),
240
240
+
});
241
241
+
let camera_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
242
242
+
layout: &camera_bind_group_layout,
243
243
+
entries: &[wgpu::BindGroupEntry {
244
244
+
binding: 0,
245
245
+
resource: camera_buffer.as_entire_binding(),
246
246
+
}],
247
247
+
label: Some("camera_bind_group"),
248
248
+
});
249
249
+
let camera_state = CameraState {
250
250
+
positioning: camera,
251
251
+
controller: camera_controller,
252
252
+
uniform: camera_uniform,
253
253
+
buffer: camera_buffer,
254
254
+
bind_group: camera_bind_group,
255
255
+
};
256
256
+
257
257
+
const SPACE_BETWEEN: f32 = 3.0;
258
258
+
let instances = itertools::iproduct!(0..NUM_INSTANCES_PER_ROW, 0..NUM_INSTANCES_PER_ROW)
259
259
+
.map(|(x, z)| {
260
260
+
let mapping = |n| SPACE_BETWEEN * (n as f32 - NUM_INSTANCES_PER_ROW as f32 / 2.0);
261
261
+
let position = vec3(mapping(x), 0.0, mapping(z));
262
262
+
263
263
+
// this is needed so an object at (0, 0, 0) won't get scaled to zero
264
264
+
// as Quaternions can affect scale if they're not created correctly
265
265
+
let rotation = match position.try_normalize() {
266
266
+
Some(position) => Quat::from_axis_angle(position, 45.0),
267
267
+
_ => Quat::from_axis_angle(Vec3::Z, 0.0),
268
268
+
};
269
269
+
270
270
+
Instance { position, rotation }
271
271
+
})
272
272
+
.collect::<Vec<_>>();
273
273
+
274
274
+
let instance_data = instances.iter().map(Instance::to_raw).collect::<Vec<_>>();
275
275
+
let instance_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
276
276
+
label: Some("Instance Buffer"),
277
277
+
contents: bytemuck::cast_slice(&instance_data),
278
278
+
usage: wgpu::BufferUsages::VERTEX,
279
279
+
});
280
280
+
281
281
+
let obj_model =
282
282
+
resources::load_model("cube.obj", &device, &queue, &texture_bind_group_layout)
283
283
+
.await
284
284
+
.unwrap();
285
285
+
286
286
+
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
287
287
+
label: Some("Shader"),
288
288
+
source: wgpu::ShaderSource::Wgsl(include_str!("../shader.wgsl").into()),
289
289
+
});
290
290
+
291
291
+
let render_pipeline_layout =
292
292
+
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
293
293
+
label: Some("Render Pipeline Layout"),
294
294
+
bind_group_layouts: &[&texture_bind_group_layout, &camera_bind_group_layout],
295
295
+
push_constant_ranges: &[],
296
296
+
});
297
297
+
298
298
+
let render_pipeline = |polygon_mode: wgpu::PolygonMode| {
299
299
+
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
300
300
+
label: Some("Render Pipeline"),
301
301
+
layout: Some(&render_pipeline_layout),
302
302
+
vertex: wgpu::VertexState {
303
303
+
module: &shader,
304
304
+
entry_point: "vs_main",
305
305
+
buffers: &[model::ModelVertex::desc(), InstanceRaw::desc()],
306
306
+
compilation_options: wgpu::PipelineCompilationOptions::default(),
307
307
+
},
308
308
+
fragment: Some(wgpu::FragmentState {
309
309
+
module: &shader,
310
310
+
entry_point: "fs_main",
311
311
+
targets: &[Some(wgpu::ColorTargetState {
312
312
+
format: surface_config.format,
313
313
+
blend: Some(wgpu::BlendState::REPLACE),
314
314
+
write_mask: wgpu::ColorWrites::ALL,
315
315
+
})],
316
316
+
compilation_options: wgpu::PipelineCompilationOptions::default(),
317
317
+
}),
318
318
+
primitive: wgpu::PrimitiveState {
319
319
+
topology: wgpu::PrimitiveTopology::TriangleList,
320
320
+
strip_index_format: None,
321
321
+
front_face: wgpu::FrontFace::Ccw,
322
322
+
cull_mode: Some(wgpu::Face::Back),
323
323
+
polygon_mode,
324
324
+
unclipped_depth: false,
325
325
+
conservative: false,
326
326
+
},
327
327
+
depth_stencil: Some(wgpu::DepthStencilState {
328
328
+
format: texture::Texture::DEPTH_FORMAT,
329
329
+
depth_write_enabled: true,
330
330
+
depth_compare: wgpu::CompareFunction::Less,
331
331
+
stencil: wgpu::StencilState::default(),
332
332
+
bias: wgpu::DepthBiasState::default(),
333
333
+
}),
334
334
+
multisample: wgpu::MultisampleState {
335
335
+
count: 1,
336
336
+
mask: !0,
337
337
+
alpha_to_coverage_enabled: false,
338
338
+
},
339
339
+
multiview: None,
340
340
+
cache: None,
341
341
+
})
342
342
+
};
343
343
+
344
344
+
let fill_pipeline = render_pipeline(wgpu::PolygonMode::Fill);
345
345
+
let wireframe_render_pipeline = if (device.features() & wgpu::Features::POLYGON_MODE_LINE)
346
346
+
== wgpu::Features::POLYGON_MODE_LINE
347
347
+
{
348
348
+
Some(render_pipeline(wgpu::PolygonMode::Line))
349
349
+
} else {
350
350
+
None
351
351
+
};
352
352
+
353
353
+
Self {
354
354
+
surface,
355
355
+
device,
356
356
+
queue,
357
357
+
surface_config,
358
358
+
depth_texture,
359
359
+
camera: camera_state,
360
360
+
interact: InteractState {
361
361
+
wireframe: false,
362
362
+
clear_color: wgpu::Color {
363
363
+
r: 0.1,
364
364
+
g: 0.2,
365
365
+
b: 0.3,
366
366
+
a: 1.0,
367
367
+
},
368
368
+
},
369
369
+
render_pipeline: (fill_pipeline, wireframe_render_pipeline),
370
370
+
object: ObjectState {
371
371
+
model: obj_model,
372
372
+
instances,
373
373
+
instance_buffer,
374
374
+
diffuse_bind_group,
375
375
+
diffuse_texture,
376
376
+
},
377
377
+
}
378
378
+
}
379
379
+
380
380
+
pub(crate) fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
381
381
+
if new_size.width == 0 || new_size.height == 0 {
382
382
+
return;
383
383
+
}
384
384
+
385
385
+
self.surface_config.width = new_size.width;
386
386
+
self.surface_config.height = new_size.height;
387
387
+
// self.depth_texture =
388
388
+
// texture::Texture::create_depth_texture(&self.device, &self.config, "depth_texture");
389
389
+
self.surface.configure(&self.device, &self.surface_config);
390
390
+
}
391
391
+
392
392
+
pub(crate) fn render(&self) -> Result<(), wgpu::SurfaceError> {
393
393
+
let output = self.surface.get_current_texture()?;
394
394
+
395
395
+
let view = output
396
396
+
.texture
397
397
+
.create_view(&wgpu::TextureViewDescriptor::default());
398
398
+
399
399
+
let mut encoder = self
400
400
+
.device
401
401
+
.create_command_encoder(&wgpu::CommandEncoderDescriptor {
402
402
+
label: Some("Render Encoder"),
403
403
+
});
404
404
+
405
405
+
let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
406
406
+
label: Some("Render Pass"),
407
407
+
color_attachments: &[Some(wgpu::RenderPassColorAttachment {
408
408
+
view: &view,
409
409
+
resolve_target: None,
410
410
+
ops: wgpu::Operations {
411
411
+
load: wgpu::LoadOp::Clear(self.interact.clear_color),
412
412
+
store: wgpu::StoreOp::Store,
413
413
+
},
414
414
+
})],
415
415
+
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
416
416
+
view: &self.depth_texture.view,
417
417
+
depth_ops: Some(wgpu::Operations {
418
418
+
load: wgpu::LoadOp::Clear(1.0),
419
419
+
store: wgpu::StoreOp::Store,
420
420
+
}),
421
421
+
stencil_ops: None,
422
422
+
}),
423
423
+
occlusion_query_set: None,
424
424
+
timestamp_writes: None,
425
425
+
});
426
426
+
427
427
+
render_pass.set_vertex_buffer(1, self.object.instance_buffer.slice(..));
428
428
+
render_pass.set_pipeline(if self.interact.wireframe {
429
429
+
self.render_pipeline.1
430
430
+
.as_ref()
431
431
+
.unwrap_or(&self.render_pipeline.0)
432
432
+
} else {
433
433
+
&self.render_pipeline.0
434
434
+
});
435
435
+
436
436
+
use crate::model::DrawModel;
437
437
+
render_pass.draw_model_instanced(
438
438
+
&self.object.model,
439
439
+
0..self.object.instances.len() as u32,
440
440
+
&self.camera.bind_group,
441
441
+
);
442
442
+
443
443
+
log::debug!("render");
444
444
+
445
445
+
// drop render pass before we submit to drop the mut borrow on encoder
446
446
+
drop(render_pass);
447
447
+
448
448
+
self.queue.submit(std::iter::once(encoder.finish()));
449
449
+
output.present();
450
450
+
451
451
+
Ok(())
452
452
+
}
453
453
+
454
454
+
455
455
+
pub fn update(&mut self) {
456
456
+
self.camera.controller.update_camera(&mut self.camera.positioning);
457
457
+
self.camera.uniform.update_view_proj(&self.camera.positioning);
458
458
+
self.queue.write_buffer(
459
459
+
&self.camera.buffer,
460
460
+
0,
461
461
+
bytemuck::cast_slice(&[self.camera.uniform]),
462
462
+
);
463
463
+
}
464
464
+
465
465
+
pub fn input(&mut self, event: &WindowEvent, window_size: PhysicalSize<u32>) -> bool {
466
466
+
467
467
+
self.camera.controller.process_events(event);
468
468
+
469
469
+
match event {
470
470
+
WindowEvent::CursorMoved {
471
471
+
device_id: _,
472
472
+
position,
473
473
+
} => {
474
474
+
self.interact.clear_color = wgpu::Color {
475
475
+
r: position.x / (window_size.width as f64),
476
476
+
g: 0.2,
477
477
+
b: position.y / (window_size.height as f64),
478
478
+
a: 0.1,
479
479
+
};
480
480
+
return true;
481
481
+
}
482
482
+
WindowEvent::KeyboardInput {
483
483
+
event:
484
484
+
KeyEvent {
485
485
+
state,
486
486
+
physical_key: PhysicalKey::Code(keycode),
487
487
+
..
488
488
+
},
489
489
+
..
490
490
+
} => {
491
491
+
let is_pressed = *state == ElementState::Pressed;
492
492
+
if *keycode == KeyCode::KeyL && is_pressed {
493
493
+
self.interact.wireframe = !self.interact.wireframe;
494
494
+
return true;
495
495
+
}
496
496
+
}
497
497
+
_ => {}
498
498
+
}
499
499
+
500
500
+
false
501
501
+
}
502
502
+
}
+1
-1
src/camera.rs
···
20
20
let view = Mat4::look_at_rh(self.eye, self.target, self.up);
21
21
let proj = Mat4::perspective_rh(self.fovy, self.aspect, self.znear, self.zfar);
22
22
23
23
-
return proj * view;
23
23
+
proj * view
24
24
}
25
25
}
26
26
+16
-574
src/lib.rs
···
4
4
mod model;
5
5
mod resources;
6
6
mod texture;
7
7
+
mod app;
7
8
8
8
-
use model::Vertex;
9
9
-
use wgpu::util::DeviceExt;
9
9
+
use wasm_bindgen::UnwrapThrowExt;
10
10
use winit::{
11
11
-
event::*,
12
11
event_loop::EventLoop,
13
13
-
keyboard::{KeyCode, PhysicalKey},
14
14
-
window::{Window, WindowBuilder},
15
12
};
16
16
-
17
13
#[cfg(target_arch = "wasm32")]
18
14
use wasm_bindgen::prelude::*;
19
19
-
20
20
-
const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4];
21
21
-
22
22
-
use glam::{vec3, Quat, Vec3};
15
15
+
use glam::{Quat, Vec3};
23
16
24
17
struct Instance {
25
18
position: Vec3,
···
75
68
}
76
69
77
70
const NUM_INSTANCES_PER_ROW: u32 = 100;
78
78
-
const INSTANCE_DISPLACEMENT: Vec3 = vec3(
79
79
-
NUM_INSTANCES_PER_ROW as f32 * 0.1,
80
80
-
0.0,
81
81
-
NUM_INSTANCES_PER_ROW as f32 * 0.1,
82
82
-
);
83
71
84
84
-
struct State<'srfc> {
85
85
-
surface: wgpu::Surface<'srfc>,
86
86
-
device: wgpu::Device,
87
87
-
queue: wgpu::Queue,
88
88
-
config: wgpu::SurfaceConfiguration,
89
89
-
size: winit::dpi::PhysicalSize<u32>,
90
90
-
render_pipeline: wgpu::RenderPipeline,
91
91
-
wireframe_render_pipeline: Option<wgpu::RenderPipeline>,
92
92
-
diffuse_bind_group: wgpu::BindGroup,
93
93
-
diffuse_texture: texture::Texture,
94
94
-
depth_texture: texture::Texture,
95
95
-
camera: camera::Camera,
96
96
-
camera_controller: camera::CameraController,
97
97
-
camera_uniform: camera::CameraUniform,
98
98
-
camera_buffer: wgpu::Buffer,
99
99
-
camera_bind_group: wgpu::BindGroup,
100
100
-
instances: Vec<Instance>,
101
101
-
instance_buffer: wgpu::Buffer,
102
102
-
wireframe: bool,
103
103
-
104
104
-
// Window must be declared after surface
105
105
-
// so it gets dropped after it
106
106
-
// The surface contains unsafe references to the
107
107
-
// window's resources.
108
108
-
// src: learn wgpu
109
109
-
window: &'srfc Window,
110
110
-
111
111
-
clear_color: wgpu::Color,
112
112
-
obj_model: model::Model,
113
113
-
}
114
114
-
115
115
-
impl<'a> State<'a> {
116
116
-
async fn new(window: &'a Window) -> State<'a> {
117
117
-
#[cfg(not(target_arch = "wasm32"))]
118
118
-
let size = window.inner_size();
119
119
-
#[cfg(target_arch = "wasm32")]
120
120
-
let size = winit::dpi::PhysicalSize {
121
121
-
width: 400,
122
122
-
height: 300,
123
123
-
};
124
124
-
125
125
-
// 0 size can cause app to crash, better to enforce this maybe.
126
126
-
// crashes on webgl??
127
127
-
// assert!(size.width != 0 && size.height != 0);
128
128
-
129
129
-
// Handle to our GPU backends
130
130
-
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
131
131
-
#[cfg(not(target_arch = "wasm32"))]
132
132
-
backends: wgpu::Backends::PRIMARY,
133
133
-
134
134
-
// WebGPU is sadly not supported in most browsers (yet!)
135
135
-
#[cfg(target_arch = "wasm32")]
136
136
-
backends: wgpu::Backends::BROWSER_WEBGPU | wgpu::Backends::GL,
137
137
-
138
138
-
..Default::default()
139
139
-
});
140
140
-
141
141
-
let surface = instance.create_surface(window).unwrap();
142
142
-
143
143
-
let adapter = instance
144
144
-
.request_adapter(&wgpu::RequestAdapterOptions {
145
145
-
// lo-power or hi-perf
146
146
-
power_preference: wgpu::PowerPreference::default(),
147
147
-
compatible_surface: Some(&surface),
148
148
-
force_fallback_adapter: false,
149
149
-
})
150
150
-
.await
151
151
-
.unwrap();
152
152
-
153
153
-
let (device, queue) = adapter
154
154
-
.request_device(
155
155
-
&wgpu::DeviceDescriptor {
156
156
-
required_features: if adapter.get_info().backend == wgpu::Backend::Gl {
157
157
-
wgpu::Features::empty()
158
158
-
} else {
159
159
-
wgpu::Features::POLYGON_MODE_LINE
160
160
-
},
161
161
-
162
162
-
// WebGL does not support all of wgpu's features
163
163
-
required_limits: if adapter.get_info().backend == wgpu::Backend::Gl {
164
164
-
wgpu::Limits::downlevel_webgl2_defaults()
165
165
-
} else {
166
166
-
wgpu::Limits::default()
167
167
-
},
168
168
-
label: None,
169
169
-
memory_hints: Default::default(),
170
170
-
},
171
171
-
None,
172
172
-
)
173
173
-
.await
174
174
-
.unwrap();
175
175
-
176
176
-
let surface_caps = surface.get_capabilities(&adapter);
177
177
-
178
178
-
// sRGB surface textures assumed
179
179
-
let surface_format = surface_caps
180
180
-
.formats
181
181
-
.iter()
182
182
-
.find(|f| f.is_srgb())
183
183
-
.copied()
184
184
-
.unwrap_or(surface_caps.formats[0]);
185
185
-
186
186
-
let config = wgpu::SurfaceConfiguration {
187
187
-
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
188
188
-
format: surface_format,
189
189
-
width: size.width,
190
190
-
height: size.height,
191
191
-
present_mode: surface_caps.present_modes[0], // eg vsync
192
192
-
alpha_mode: surface_caps.alpha_modes[0],
193
193
-
view_formats: vec![],
194
194
-
desired_maximum_frame_latency: 2,
195
195
-
};
196
196
-
197
197
-
surface.configure(&device, &config);
198
198
-
199
199
-
let depth_texture =
200
200
-
texture::Texture::create_depth_texture(&device, &config, "depth_texture");
201
201
-
202
202
-
let diffuse_bytes = include_bytes!("happy-tree.png");
203
203
-
let diffuse_texture =
204
204
-
texture::Texture::from_bytes(&device, &queue, diffuse_bytes, "happy_tree.png").unwrap();
205
205
-
206
206
-
let texture_bind_group_layout =
207
207
-
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
208
208
-
entries: &[
209
209
-
wgpu::BindGroupLayoutEntry {
210
210
-
binding: 0,
211
211
-
visibility: wgpu::ShaderStages::FRAGMENT,
212
212
-
ty: wgpu::BindingType::Texture {
213
213
-
multisampled: false,
214
214
-
view_dimension: wgpu::TextureViewDimension::D2,
215
215
-
sample_type: wgpu::TextureSampleType::Float { filterable: true },
216
216
-
},
217
217
-
count: None,
218
218
-
},
219
219
-
wgpu::BindGroupLayoutEntry {
220
220
-
binding: 1,
221
221
-
visibility: wgpu::ShaderStages::FRAGMENT,
222
222
-
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
223
223
-
count: None,
224
224
-
},
225
225
-
],
226
226
-
label: Some("texture_bind_group_layout"),
227
227
-
});
228
228
-
229
229
-
let diffuse_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
230
230
-
layout: &texture_bind_group_layout,
231
231
-
entries: &[
232
232
-
wgpu::BindGroupEntry {
233
233
-
binding: 0,
234
234
-
resource: wgpu::BindingResource::TextureView(&diffuse_texture.view),
235
235
-
},
236
236
-
wgpu::BindGroupEntry {
237
237
-
binding: 1,
238
238
-
resource: wgpu::BindingResource::Sampler(&diffuse_texture.sampler),
239
239
-
},
240
240
-
],
241
241
-
label: Some("diffuse_bind_group"),
242
242
-
});
243
243
-
244
244
-
let camera = camera::Camera {
245
245
-
eye: vec3(0., 1., 2.),
246
246
-
target: Vec3::ZERO,
247
247
-
up: Vec3::Y,
248
248
-
aspect: config.width as f32 / config.height as f32,
249
249
-
fovy: 45.0,
250
250
-
znear: 0.1,
251
251
-
zfar: 100.0,
252
252
-
};
253
253
-
254
254
-
let camera_controller = camera::CameraController::new(0.2);
255
255
-
let mut camera_uniform = camera::CameraUniform::new();
256
256
-
camera_uniform.update_view_proj(&camera);
257
257
-
258
258
-
let camera_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
259
259
-
label: Some("Camera Buffer"),
260
260
-
contents: bytemuck::cast_slice(&[camera_uniform]),
261
261
-
usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST,
262
262
-
});
263
263
-
264
264
-
let camera_bind_group_layout =
265
265
-
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
266
266
-
entries: &[wgpu::BindGroupLayoutEntry {
267
267
-
binding: 0,
268
268
-
visibility: wgpu::ShaderStages::VERTEX,
269
269
-
ty: wgpu::BindingType::Buffer {
270
270
-
ty: wgpu::BufferBindingType::Uniform,
271
271
-
has_dynamic_offset: false,
272
272
-
min_binding_size: None,
273
273
-
},
274
274
-
count: None,
275
275
-
}],
276
276
-
label: Some("camera_bind_group_layout"),
277
277
-
});
278
278
-
279
279
-
let camera_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
280
280
-
layout: &camera_bind_group_layout,
281
281
-
entries: &[wgpu::BindGroupEntry {
282
282
-
binding: 0,
283
283
-
resource: camera_buffer.as_entire_binding(),
284
284
-
}],
285
285
-
label: Some("camera_bind_group"),
286
286
-
});
287
287
-
288
288
-
const SPACE_BETWEEN: f32 = 3.0;
289
289
-
let instances = itertools::iproduct!(0..NUM_INSTANCES_PER_ROW, 0..NUM_INSTANCES_PER_ROW)
290
290
-
.map(|(x, z)| {
291
291
-
let mapping = |n| SPACE_BETWEEN * (n as f32 - NUM_INSTANCES_PER_ROW as f32 / 2.0);
292
292
-
let position = vec3(mapping(x), 0.0, mapping(z));
293
293
-
294
294
-
// this is needed so an object at (0, 0, 0) won't get scaled to zero
295
295
-
// as Quaternions can affect scale if they're not created correctly
296
296
-
let rotation = match position.try_normalize() {
297
297
-
Some(position) => Quat::from_axis_angle(position, 45.0),
298
298
-
None => Quat::from_axis_angle(Vec3::Z, 0.0),
299
299
-
};
300
300
-
301
301
-
Instance { position, rotation }
302
302
-
})
303
303
-
.collect::<Vec<_>>();
304
304
-
305
305
-
let instance_data = instances.iter().map(Instance::to_raw).collect::<Vec<_>>();
306
306
-
let instance_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
307
307
-
label: Some("Instance Buffer"),
308
308
-
contents: bytemuck::cast_slice(&instance_data),
309
309
-
usage: wgpu::BufferUsages::VERTEX,
310
310
-
});
311
311
-
312
312
-
let obj_model =
313
313
-
resources::load_model("cube.obj", &device, &queue, &texture_bind_group_layout)
314
314
-
.await
315
315
-
.unwrap();
316
316
-
317
317
-
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
318
318
-
label: Some("Shader"),
319
319
-
source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()),
320
320
-
});
321
321
-
322
322
-
let render_pipeline_layout =
323
323
-
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
324
324
-
label: Some("Render Pipeline Layout"),
325
325
-
bind_group_layouts: &[&texture_bind_group_layout, &camera_bind_group_layout],
326
326
-
push_constant_ranges: &[],
327
327
-
});
328
328
-
329
329
-
let render_pipeline = |polygon_mode: wgpu::PolygonMode| {
330
330
-
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
331
331
-
label: Some("Render Pipeline"),
332
332
-
layout: Some(&render_pipeline_layout),
333
333
-
vertex: wgpu::VertexState {
334
334
-
module: &shader,
335
335
-
entry_point: "vs_main",
336
336
-
buffers: &[model::ModelVertex::desc(), InstanceRaw::desc()],
337
337
-
compilation_options: wgpu::PipelineCompilationOptions::default(),
338
338
-
},
339
339
-
fragment: Some(wgpu::FragmentState {
340
340
-
module: &shader,
341
341
-
entry_point: "fs_main",
342
342
-
targets: &[Some(wgpu::ColorTargetState {
343
343
-
format: config.format,
344
344
-
blend: Some(wgpu::BlendState::REPLACE),
345
345
-
write_mask: wgpu::ColorWrites::ALL,
346
346
-
})],
347
347
-
compilation_options: wgpu::PipelineCompilationOptions::default(),
348
348
-
}),
349
349
-
primitive: wgpu::PrimitiveState {
350
350
-
topology: wgpu::PrimitiveTopology::TriangleList,
351
351
-
strip_index_format: None,
352
352
-
front_face: wgpu::FrontFace::Ccw,
353
353
-
cull_mode: Some(wgpu::Face::Back),
354
354
-
polygon_mode,
355
355
-
unclipped_depth: false,
356
356
-
conservative: false,
357
357
-
},
358
358
-
depth_stencil: Some(wgpu::DepthStencilState {
359
359
-
format: texture::Texture::DEPTH_FORMAT,
360
360
-
depth_write_enabled: true,
361
361
-
depth_compare: wgpu::CompareFunction::Less,
362
362
-
stencil: wgpu::StencilState::default(),
363
363
-
bias: wgpu::DepthBiasState::default(),
364
364
-
}),
365
365
-
multisample: wgpu::MultisampleState {
366
366
-
count: 1,
367
367
-
mask: !0,
368
368
-
alpha_to_coverage_enabled: false,
369
369
-
},
370
370
-
multiview: None,
371
371
-
cache: None,
372
372
-
})
373
373
-
};
374
374
-
375
375
-
let fill_pipeline = render_pipeline(wgpu::PolygonMode::Fill);
376
376
-
let wireframe_render_pipeline = if (device.features() & wgpu::Features::POLYGON_MODE_LINE)
377
377
-
== wgpu::Features::POLYGON_MODE_LINE
378
378
-
{
379
379
-
Some(render_pipeline(wgpu::PolygonMode::Line))
72
72
+
fn init_logger() {
73
73
+
cfg_if::cfg_if! {
74
74
+
if #[cfg(target_arch = "wasm32")] {
75
75
+
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
76
76
+
console_log::init_with_level(log::Level::Debug).expect("Couldn't initialize logger");
380
77
} else {
381
381
-
None
382
382
-
};
383
383
-
384
384
-
// let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
385
385
-
// label: Some("Vertex Buffer"),
386
386
-
// contents: bytemuck::cast_slice(VERTICES),
387
387
-
// usage: wgpu::BufferUsages::VERTEX,
388
388
-
// });
389
389
-
//
390
390
-
// let index_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
391
391
-
// label: Some("Index Buffer"),
392
392
-
// contents: bytemuck::cast_slice(INDICES),
393
393
-
// usage: wgpu::BufferUsages::INDEX,
394
394
-
// });
395
395
-
396
396
-
let num_indices = INDICES.len() as u32;
397
397
-
398
398
-
Self {
399
399
-
window,
400
400
-
surface,
401
401
-
device,
402
402
-
queue,
403
403
-
config,
404
404
-
size,
405
405
-
render_pipeline: fill_pipeline,
406
406
-
wireframe_render_pipeline,
407
407
-
diffuse_bind_group,
408
408
-
diffuse_texture,
409
409
-
obj_model,
410
410
-
camera,
411
411
-
camera_controller,
412
412
-
camera_uniform,
413
413
-
camera_buffer,
414
414
-
camera_bind_group,
415
415
-
instances,
416
416
-
instance_buffer,
417
417
-
depth_texture,
418
418
-
wireframe: false,
419
419
-
clear_color: wgpu::Color {
420
420
-
r: 0.1,
421
421
-
g: 0.2,
422
422
-
b: 0.3,
423
423
-
a: 1.0,
424
424
-
},
425
425
-
}
426
426
-
}
427
427
-
428
428
-
pub fn window(&self) -> &Window {
429
429
-
&self.window
430
430
-
}
431
431
-
432
432
-
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
433
433
-
if !(new_size.width > 0 && new_size.height > 0) {
434
434
-
return;
435
435
-
}
436
436
-
437
437
-
self.size = new_size;
438
438
-
self.config.width = new_size.width;
439
439
-
self.config.height = new_size.height;
440
440
-
self.depth_texture =
441
441
-
texture::Texture::create_depth_texture(&self.device, &self.config, "depth_texture");
442
442
-
self.surface.configure(&self.device, &self.config);
443
443
-
}
444
444
-
445
445
-
fn input(&mut self, event: &WindowEvent) -> bool {
446
446
-
self.camera_controller.process_events(event);
447
447
-
448
448
-
match event {
449
449
-
WindowEvent::CursorMoved {
450
450
-
device_id: _,
451
451
-
position,
452
452
-
} => {
453
453
-
self.clear_color = wgpu::Color {
454
454
-
r: position.x / (self.window.inner_size().width as f64),
455
455
-
g: 0.2,
456
456
-
b: position.y / (self.window.inner_size().height as f64),
457
457
-
a: 0.1,
458
458
-
};
459
459
-
return true;
460
460
-
}
461
461
-
WindowEvent::KeyboardInput {
462
462
-
event:
463
463
-
KeyEvent {
464
464
-
state,
465
465
-
physical_key: PhysicalKey::Code(keycode),
466
466
-
..
467
467
-
},
468
468
-
..
469
469
-
} => {
470
470
-
let is_pressed = *state == ElementState::Pressed;
471
471
-
match *keycode {
472
472
-
KeyCode::KeyL => {
473
473
-
if is_pressed {
474
474
-
self.wireframe = !self.wireframe;
475
475
-
return true;
476
476
-
}
477
477
-
}
478
478
-
_ => {}
479
479
-
}
480
480
-
}
481
481
-
_ => {}
78
78
+
//env_logger::init();
79
79
+
env_logger::builder().filter_level(log::LevelFilter::Info).init();
482
80
}
483
483
-
484
484
-
false
485
485
-
}
486
486
-
487
487
-
fn update(&mut self) {
488
488
-
self.camera_controller.update_camera(&mut self.camera);
489
489
-
self.camera_uniform.update_view_proj(&self.camera);
490
490
-
self.queue.write_buffer(
491
491
-
&self.camera_buffer,
492
492
-
0,
493
493
-
bytemuck::cast_slice(&[self.camera_uniform]),
494
494
-
);
495
495
-
}
496
496
-
497
497
-
fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
498
498
-
let output = self.surface.get_current_texture()?;
499
499
-
500
500
-
let view = output
501
501
-
.texture
502
502
-
.create_view(&wgpu::TextureViewDescriptor::default());
503
503
-
504
504
-
let mut encoder = self
505
505
-
.device
506
506
-
.create_command_encoder(&wgpu::CommandEncoderDescriptor {
507
507
-
label: Some("Render Encoder"),
508
508
-
});
509
509
-
510
510
-
let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
511
511
-
label: Some("Render Pass"),
512
512
-
color_attachments: &[Some(wgpu::RenderPassColorAttachment {
513
513
-
view: &view,
514
514
-
resolve_target: None,
515
515
-
ops: wgpu::Operations {
516
516
-
load: wgpu::LoadOp::Clear(self.clear_color),
517
517
-
store: wgpu::StoreOp::Store,
518
518
-
},
519
519
-
})],
520
520
-
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
521
521
-
view: &self.depth_texture.view,
522
522
-
depth_ops: Some(wgpu::Operations {
523
523
-
load: wgpu::LoadOp::Clear(1.0),
524
524
-
store: wgpu::StoreOp::Store,
525
525
-
}),
526
526
-
stencil_ops: None,
527
527
-
}),
528
528
-
occlusion_query_set: None,
529
529
-
timestamp_writes: None,
530
530
-
});
531
531
-
532
532
-
render_pass.set_vertex_buffer(1, self.instance_buffer.slice(..));
533
533
-
render_pass.set_pipeline(if self.wireframe {
534
534
-
self.wireframe_render_pipeline
535
535
-
.as_ref()
536
536
-
.unwrap_or(&self.render_pipeline)
537
537
-
} else {
538
538
-
&self.render_pipeline
539
539
-
});
540
540
-
541
541
-
use model::DrawModel;
542
542
-
render_pass.draw_model_instanced(
543
543
-
&self.obj_model,
544
544
-
0..self.instances.len() as u32,
545
545
-
&self.camera_bind_group,
546
546
-
);
547
547
-
548
548
-
// drop render pass before we submit to drop the mut borrow on encoder
549
549
-
drop(render_pass);
550
550
-
551
551
-
self.queue.submit(std::iter::once(encoder.finish()));
552
552
-
output.present();
553
553
-
554
554
-
Ok(())
555
81
}
556
82
}
557
557
-
558
83
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
559
84
pub async fn run() {
560
560
-
cfg_if::cfg_if! {
561
561
-
if #[cfg(target_arch = "wasm32")] {
562
562
-
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
563
563
-
console_log::init_with_level(log::Level::Warn).expect("Couldn't initialize logger");
564
564
-
} else {
565
565
-
env_logger::init();
566
566
-
}
567
567
-
}
85
85
+
init_logger();
568
86
569
569
-
let event_loop = EventLoop::new().unwrap();
570
570
-
let window = WindowBuilder::new().build(&event_loop).unwrap();
571
571
-
572
572
-
// Window setup
87
87
+
log::info!("Hello world!");
88
88
+
let event_loop = EventLoop::with_user_event().build().unwrap_throw();
573
89
574
574
-
#[cfg(target_arch = "wasm32")]
575
575
-
{
576
576
-
// Winit prevents sizing with CSS, so we have to set
577
577
-
// the size manually when on web.
578
578
-
use winit::dpi::PhysicalSize;
579
579
-
580
580
-
use winit::platform::web::WindowExtWebSys;
581
581
-
web_sys::window()
582
582
-
.and_then(|win| win.document())
583
583
-
.and_then(|doc| {
584
584
-
let dst = doc.get_element_by_id("wasm-example")?;
585
585
-
let canvas = web_sys::Element::from(window.canvas()?);
586
586
-
dst.append_child(&canvas).ok()?;
587
587
-
Some(())
588
588
-
})
589
589
-
.expect("Couldn't append canvas to document body.");
590
590
-
591
591
-
let _ = window.request_inner_size(PhysicalSize::new(450, 400));
592
592
-
}
593
593
-
594
594
-
let mut state = State::new(&window).await;
595
595
-
let mut surface_configured = false;
596
596
-
597
597
-
event_loop
598
598
-
.run(move |event, control_flow| match event {
599
599
-
Event::WindowEvent {
600
600
-
ref event,
601
601
-
window_id,
602
602
-
} if window_id == state.window().id() => {
603
603
-
if !state.input(event) {
604
604
-
match event {
605
605
-
WindowEvent::CloseRequested
606
606
-
| WindowEvent::KeyboardInput {
607
607
-
event:
608
608
-
KeyEvent {
609
609
-
state: ElementState::Pressed,
610
610
-
physical_key: PhysicalKey::Code(KeyCode::Escape),
611
611
-
..
612
612
-
},
613
613
-
..
614
614
-
} => control_flow.exit(),
615
615
-
WindowEvent::Resized(physical_size) => {
616
616
-
surface_configured = true;
617
617
-
state.resize(*physical_size);
618
618
-
}
619
619
-
WindowEvent::RedrawRequested => {
620
620
-
state.window().request_redraw();
621
621
-
622
622
-
if !surface_configured {
623
623
-
return;
624
624
-
}
625
625
-
626
626
-
state.update();
627
627
-
match state.render() {
628
628
-
Ok(_) => {}
629
629
-
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
630
630
-
state.resize(state.size)
631
631
-
}
632
632
-
Err(wgpu::SurfaceError::OutOfMemory) => {
633
633
-
log::error!("Out of memory!");
634
634
-
control_flow.exit();
635
635
-
}
636
636
-
Err(wgpu::SurfaceError::Timeout) => {
637
637
-
log::warn!("Surface timeout!");
638
638
-
}
639
639
-
}
640
640
-
}
641
641
-
_ => {}
642
642
-
}
643
643
-
}
644
644
-
}
645
645
-
Event::AboutToWait => {
646
646
-
state.window().request_redraw();
647
647
-
}
648
648
-
_ => {}
649
649
-
})
650
650
-
.unwrap();
90
90
+
let mut app = app::Application::new(&event_loop, "BL0CK");
91
91
+
// let mut app = DebugWinitApp::new();
92
92
+
event_loop.run_app(&mut app).unwrap();
651
93
}