update to 0.16

pull/480/head
Benjamin Hansen 11 months ago
parent a1f5995f49
commit 8b8e844b76

296
Cargo.lock generated

@ -98,7 +98,7 @@ version = "0.37.2+1.3.238"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28bf19c1f0a470be5fbf7522a308a05df06610252c5bcf5143e1b23f629a9a03"
dependencies = [
"libloading",
"libloading 0.7.3",
]
[[package]]
@ -272,6 +272,12 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84"
[[package]]
name = "block"
version = "0.1.6"
@ -409,7 +415,7 @@ version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"block",
"cocoa-foundation",
"core-foundation",
@ -425,7 +431,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"block",
"core-foundation",
"core-graphics-types",
@ -527,7 +533,7 @@ version = "0.22.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation",
"core-graphics-types",
"foreign-types 0.3.2",
@ -540,7 +546,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation",
"foreign-types 0.3.2",
"libc",
@ -705,8 +711,8 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da"
dependencies = [
"bitflags",
"libloading",
"bitflags 1.3.2",
"libloading 0.7.3",
"winapi",
]
@ -763,7 +769,7 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794"
dependencies = [
"libloading",
"libloading 0.7.3",
]
[[package]]
@ -989,7 +995,7 @@ version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"freetype-sys",
"libc",
]
@ -1082,15 +1088,6 @@ dependencies = [
"pin-utils",
]
[[package]]
name = "fxhash"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
dependencies = [
"byteorder",
]
[[package]]
name = "getrandom"
version = "0.2.7"
@ -1159,9 +1156,9 @@ dependencies = [
[[package]]
name = "glow"
version = "0.12.0"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8edf6019dff2d92ad27c1e3ff82ad50a0aea5b01370353cc928bfdc33e95925c"
checksum = "807edf58b70c0b5b2181dd39fe1839dbdb3ba02645630dc5f753e23da307f762"
dependencies = [
"js-sys",
"slotmap",
@ -1175,7 +1172,7 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"gpu-alloc-types",
]
@ -1185,14 +1182,14 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
name = "gpu-allocator"
version = "0.21.0"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "434618454f74b63f9b39328298097256977c41ea0ba9d75a47238b77790b6163"
checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8"
dependencies = [
"backtrace",
"log",
@ -1207,7 +1204,7 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"gpu-descriptor-types",
"hashbrown",
]
@ -1218,7 +1215,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -1260,14 +1257,14 @@ dependencies = [
[[package]]
name = "hassle-rs"
version = "0.9.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85"
checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"com-rs",
"libc",
"libloading",
"libloading 0.7.3",
"thiserror",
"widestring",
"winapi",
@ -1450,9 +1447,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.9.1"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
@ -1521,9 +1518,9 @@ dependencies = [
[[package]]
name = "js-sys"
version = "0.3.60"
version = "0.3.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"
dependencies = [
"wasm-bindgen",
]
@ -1535,7 +1532,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3"
dependencies = [
"libc",
"libloading",
"libloading 0.7.3",
"pkg-config",
]
@ -1582,6 +1579,16 @@ dependencies = [
"winapi",
]
[[package]]
name = "libloading"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb"
dependencies = [
"cfg-if",
"windows-sys 0.48.0",
]
[[package]]
name = "link-cplusplus"
version = "1.0.7"
@ -1675,7 +1682,7 @@ version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"block",
"core-graphics-types",
"foreign-types 0.3.2",
@ -1758,7 +1765,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f50357e1167a3ab92d6b3c7f4bf5f7fd13fde3f4b28bf0d5ea07b5100fdb6c0"
dependencies = [
"bit-set",
"bitflags",
"bitflags 1.3.2",
"indexmap",
"log",
"num-traits",
@ -1771,12 +1778,12 @@ dependencies = [
[[package]]
name = "naga"
version = "0.11.0"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eafe22a23b797c9bc227c6c896419b26b5bb88fa903417a3adaed08778850d5"
checksum = "80cd00bd6180a8790f1c020ed258a46b8d73dd5bd6af104a238c9d71f806938e"
dependencies = [
"bit-set",
"bitflags",
"bitflags 1.3.2",
"codespan-reporting",
"hexf-parse",
"indexmap",
@ -1823,7 +1830,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"jni-sys",
"ndk-sys",
"num_enum",
@ -1881,7 +1888,7 @@ version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cfg-if",
"libc",
"memoffset",
@ -1998,7 +2005,7 @@ version = "0.10.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cfg-if",
"foreign-types 0.3.2",
"libc",
@ -2157,7 +2164,7 @@ version = "0.17.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"crc32fast",
"flate2",
"miniz_oxide 0.5.4",
@ -2287,7 +2294,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -2327,9 +2334,9 @@ dependencies = [
[[package]]
name = "renderdoc-sys"
version = "0.7.1"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157"
checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b"
[[package]]
name = "reqwest"
@ -2402,7 +2409,7 @@ version = "0.36.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"errno",
"io-lifetimes",
"libc",
@ -2483,7 +2490,7 @@ version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation",
"core-foundation-sys",
"libc",
@ -2624,7 +2631,7 @@ version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"calloop",
"dlib",
"lazy_static",
@ -2670,7 +2677,7 @@ version = "0.2.0+1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"num-traits",
]
@ -3472,9 +3479,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.33"
version = "0.4.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454"
dependencies = [
"cfg-if",
"js-sys",
@ -3594,7 +3601,7 @@ version = "0.29.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"downcast-rs",
"libc",
"nix",
@ -3633,7 +3640,7 @@ version = "0.29.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"wayland-client",
"wayland-commons",
"wayland-scanner",
@ -3663,9 +3670,9 @@ dependencies = [
[[package]]
name = "web-sys"
version = "0.3.60"
version = "0.3.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97"
dependencies = [
"js-sys",
"wasm-bindgen",
@ -3688,15 +3695,15 @@ dependencies = [
[[package]]
name = "wgpu"
version = "0.15.0"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d14c6bfcf3b10f4273f522a95994553c0a5f2934976e62e61a720ae4bc2eb8f2"
checksum = "3059ea4ddec41ca14f356833e2af65e7e38c0a8f91273867ed526fb9bafcca95"
dependencies = [
"arrayvec 0.7.2",
"cfg-if",
"js-sys",
"log",
"naga 0.11.0",
"naga 0.12.2",
"parking_lot 0.12.1",
"profiling",
"raw-window-handle 0.5.0",
@ -3712,20 +3719,20 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.15.0"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be1f61be28e557a6ecb2506cac06c63fae3b6d302a006f38195a7a80995abeb9"
checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2"
dependencies = [
"arrayvec 0.7.2",
"bit-vec",
"bitflags",
"bitflags 2.3.1",
"codespan-reporting",
"fxhash",
"log",
"naga 0.11.0",
"naga 0.12.2",
"parking_lot 0.12.1",
"profiling",
"raw-window-handle 0.5.0",
"rustc-hash",
"smallvec",
"thiserror",
"web-sys",
@ -3735,20 +3742,19 @@ dependencies = [
[[package]]
name = "wgpu-hal"
version = "0.15.1"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82e95792925fe3d58950b9a5c2a191caa145e2bc570e2d233f0d7320f6a8e814"
checksum = "74851c2c8e5d97652e74c241d41b0656b31c924a45dcdecde83975717362cfa4"
dependencies = [
"android_system_properties",
"arrayvec 0.7.2",
"ash",
"bit-set",
"bitflags",
"bitflags 2.3.1",
"block",
"core-graphics-types",
"d3d12",
"foreign-types 0.3.2",
"fxhash",
"glow",
"gpu-alloc",
"gpu-allocator",
@ -3757,16 +3763,17 @@ dependencies = [
"js-sys",
"khronos-egl",
"libc",
"libloading",
"libloading 0.8.0",
"log",
"metal",
"naga 0.11.0",
"naga 0.12.2",
"objc",
"parking_lot 0.12.1",
"profiling",
"range-alloc",
"raw-window-handle 0.5.0",
"renderdoc-sys",
"rustc-hash",
"smallvec",
"thiserror",
"wasm-bindgen",
@ -3790,20 +3797,20 @@ dependencies = [
[[package]]
name = "wgpu-types"
version = "0.15.0"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecf8cfcbf98f94cc8bd5981544c687140cf9d3948e2ab83849367ead2cd737cf"
checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b"
dependencies = [
"bitflags",
"bitflags 2.3.1",
"js-sys",
"web-sys",
]
[[package]]
name = "widestring"
version = "0.5.1"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983"
checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8"
[[package]]
name = "winapi"
@ -3849,17 +3856,11 @@ dependencies = [
[[package]]
name = "windows"
version = "0.43.0"
version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244"
checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc 0.42.0",
"windows_i686_gnu 0.42.0",
"windows_i686_msvc 0.42.0",
"windows_x86_64_gnu 0.42.0",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc 0.42.0",
"windows-targets 0.42.2",
]
[[package]]
@ -3881,20 +3882,65 @@ version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc 0.42.0",
"windows_i686_gnu 0.42.0",
"windows_i686_msvc 0.42.0",
"windows_x86_64_gnu 0.42.0",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc 0.42.0",
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets 0.48.0",
]
[[package]]
name = "windows-targets"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
dependencies = [
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-targets"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
dependencies = [
"windows_aarch64_gnullvm 0.48.0",
"windows_aarch64_msvc 0.48.0",
"windows_i686_gnu 0.48.0",
"windows_i686_msvc 0.48.0",
"windows_x86_64_gnu 0.48.0",
"windows_x86_64_gnullvm 0.48.0",
"windows_x86_64_msvc 0.48.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.0"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_msvc"
@ -3904,9 +3950,15 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.0"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_i686_gnu"
@ -3916,9 +3968,15 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.42.0"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
name = "windows_i686_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_msvc"
@ -3928,9 +3986,15 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.42.0"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
name = "windows_i686_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_x86_64_gnu"
@ -3940,15 +4004,27 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.0"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.0"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
[[package]]
name = "windows_x86_64_msvc"
@ -3958,9 +4034,15 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.0"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "winit"
@ -3968,7 +4050,7 @@ version = "0.27.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37f64802920c4c35d12a53dad5e0c55bbc3004d8dc4f2e4dd64ad02c5665d7aa"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cocoa",
"core-foundation",
"core-graphics",

@ -16,13 +16,13 @@ cfg-if = "1"
winit = "0.27"
env_logger = "0.10"
log = "0.4"
wgpu = "0.15"
wgpu = "0.16"
pollster = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "0.2.0"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "=0.2.84"
wasm-bindgen-futures = "0.4.30"
web-sys = { version = "0.3.53", features = [

@ -4,10 +4,10 @@ use winit::{
window::WindowBuilder,
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -19,9 +19,7 @@ pub fn run() {
}
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.build(&event_loop)
.unwrap();
let window = WindowBuilder::new().build(&event_loop).unwrap();
#[cfg(target_arch = "wasm32")]
{
@ -29,7 +27,7 @@ pub fn run() {
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())

@ -2,4 +2,4 @@ use tutorial1_window::run;
fn main() {
run();
}
}

@ -12,13 +12,13 @@ cfg-if = "1"
winit = "0.27"
env_logger = "0.10"
log = "0.4"
wgpu = "0.15"
wgpu = "0.16"
pollster = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "0.2.0"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -30,7 +30,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -68,9 +68,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -208,7 +210,9 @@ async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -34,7 +34,7 @@ impl State {
// The surface needs to live as long as the window that created it.
// State owns the window so this should be safe.
let surface = unsafe { instance.create_surface(&window) }.unwrap();
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::default(),
@ -67,9 +67,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -222,10 +224,12 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
Err(wgpu::SurfaceError::Timeout) => log::warn!("Surface timeout"),
}
}

@ -2,4 +2,4 @@ use tutorial2_surface::run;
fn main() {
pollster::block_on(run());
}
}

@ -12,13 +12,13 @@ cfg-if = "1"
winit = "0.27"
env_logger = "0.10"
log = "0.4"
wgpu = "0.15"
wgpu = "0.16"
pollster = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "0.2.0"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -28,7 +28,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -66,9 +66,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -320,7 +322,9 @@ async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -6,7 +6,7 @@ use winit::{
window::{Window, WindowBuilder},
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
struct State {
@ -30,7 +30,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -68,9 +68,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -212,7 +214,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -232,7 +234,7 @@ pub async fn run() {
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -244,7 +246,7 @@ pub async fn run() {
})
.expect("Couldn't append canvas to document body.");
}
// State::new uses async code, so we're going to wait for it to finish
let mut state = State::new(window).await;
@ -282,7 +284,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial3_pipeline::run;
fn main() {
pollster::block_on(run());
}
}

@ -11,7 +11,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
cfg-if = "1"
winit = "0.27"
wgpu = "0.15"
wgpu = "0.16"
env_logger = "0.10"
log = "0.4"
pollster = "0.2"
@ -21,7 +21,7 @@ bytemuck = { version = "1.12", features = [ "derive" ] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -91,7 +91,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -129,9 +129,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -397,7 +399,9 @@ async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -7,7 +7,7 @@ use winit::{
window::{Window, WindowBuilder},
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
#[repr(C)]
@ -87,7 +87,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -125,9 +125,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -286,7 +288,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -306,7 +308,7 @@ pub async fn run() {
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -356,7 +358,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial4_buffer::run;
fn main() {
pollster::block_on(run());
}
}

@ -14,7 +14,7 @@ bytemuck = { version = "1.12", features = [ "derive" ] }
env_logger = "0.10"
log = "0.4"
pollster = "0.2"
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
[dependencies.image]
@ -25,7 +25,7 @@ features = ["png", "jpeg"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -93,7 +93,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -130,9 +130,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -424,7 +426,9 @@ async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -7,7 +7,7 @@ use winit::{
window::{Window, WindowBuilder},
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
mod texture;
@ -93,7 +93,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -130,9 +130,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -336,7 +338,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -356,7 +358,7 @@ pub async fn run() {
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -368,7 +370,7 @@ pub async fn run() {
})
.expect("Couldn't append canvas to document body.");
}
// State::new uses async code, so we're going to wait for it to finish
let mut state = State::new(window).await;
@ -406,7 +408,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial5_textures::run;
fn main() {
pollster::block_on(run());
}
}

@ -56,8 +56,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -15,7 +15,7 @@ cgmath = "0.18"
env_logger = "0.10"
log = "0.4"
pollster = "0.2"
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
[dependencies.image]
@ -26,7 +26,7 @@ features = ["png", "jpeg"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -243,7 +243,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -280,9 +280,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -595,7 +597,9 @@ async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -7,7 +7,7 @@ use winit::{
window::{Window, WindowBuilder},
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
mod texture;
@ -243,7 +243,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -280,9 +280,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -545,7 +547,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -565,7 +567,7 @@ pub async fn run() {
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -615,7 +617,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial6_uniforms::run;
fn main() {
pollster::block_on(run());
}
}

@ -56,8 +56,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -15,7 +15,7 @@ cgmath = "0.18"
env_logger = "0.10"
log = "0.4"
pollster = "0.2"
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
[dependencies.image]
@ -26,7 +26,7 @@ features = ["png", "jpeg"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -297,7 +297,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -334,9 +334,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -696,7 +698,9 @@ async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -8,7 +8,7 @@ use winit::{
window::{Window, WindowBuilder},
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
mod texture;
@ -304,7 +304,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -341,9 +341,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -663,7 +665,7 @@ pub async fn run() {
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -713,7 +715,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial7_instancing::run;
fn main() {
pollster::block_on(run());
}
}

@ -56,8 +56,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -15,7 +15,7 @@ cgmath = "0.18"
env_logger = "0.10"
pollster = "0.2"
log = "0.4"
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
[dependencies.image]
@ -26,7 +26,7 @@ features = ["png", "jpeg"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -1,7 +1,7 @@
use std::iter;
use cgmath::prelude::*;
use wgpu::{include_spirv_raw};
use wgpu::include_spirv_raw;
use wgpu::util::DeviceExt;
use winit::{
event::*,
@ -296,7 +296,11 @@ struct DepthPass {
impl DepthPass {
fn new(device: &wgpu::Device, config: &wgpu::SurfaceConfiguration) -> Self {
let texture = texture::Texture::create_depth_texture_non_comparison_sampler(device, config, "depth_texture");
let texture = texture::Texture::create_depth_texture_non_comparison_sampler(
device,
config,
"depth_texture",
);
let layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: Some("Depth Pass Layout"),
@ -413,7 +417,11 @@ impl DepthPass {
}
fn resize(&mut self, device: &wgpu::Device, config: &wgpu::SurfaceConfiguration) {
self.texture = texture::Texture::create_depth_texture_non_comparison_sampler(device, config, "depth_texture");
self.texture = texture::Texture::create_depth_texture_non_comparison_sampler(
device,
config,
"depth_texture",
);
self.bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
layout: &self.layout,
entries: &[
@ -486,7 +494,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -523,9 +531,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -893,7 +903,9 @@ async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -8,7 +8,7 @@ use winit::{
window::{Window, WindowBuilder},
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
mod texture;
@ -314,7 +314,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -351,9 +351,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -670,7 +672,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -690,7 +692,7 @@ pub async fn run() {
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -702,7 +704,7 @@ pub async fn run() {
})
.expect("Couldn't append canvas to document body.");
}
// State::new uses async code, so we're going to wait for it to finish
let mut state = State::new(window).await;
@ -740,7 +742,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial8_depth::run;
fn main() {
pollster::block_on(run());
}
}

@ -142,8 +142,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -16,7 +16,7 @@ env_logger = "0.10"
pollster = "0.2"
log = "0.4"
tobj = { version = "3.2", features = ["async"]}
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
[dependencies.image]
@ -28,7 +28,7 @@ features = ["png", "jpeg"]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -8,12 +8,12 @@ use winit::{
window::Window,
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
mod model;
mod texture;
mod resources;
mod texture;
use model::{DrawModel, Vertex};
@ -254,7 +254,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -294,9 +294,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -408,12 +410,10 @@ impl State {
});
log::warn!("Load model");
let obj_model = resources::load_model(
"cube.obj",
&device,
&queue,
&texture_bind_group_layout,
).await.unwrap();
let obj_model =
resources::load_model("cube.obj", &device, &queue, &texture_bind_group_layout)
.await
.unwrap();
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("shader.wgsl"),
@ -583,7 +583,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -601,14 +601,13 @@ pub async fn run() {
.build(&event_loop)
.unwrap();
#[cfg(target_arch = "wasm32")]
{
// Winit prevents sizing with CSS, so we have to set
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -659,7 +658,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial9_models::run;
fn main() {
pollster::block_on(run());
}
}

@ -100,8 +100,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -16,7 +16,7 @@ env_logger = "0.10"
pollster = "0.2"
log = "0.4"
tobj = { version = "3.2", features = ["async"]}
wgpu = { version = "0.15"}
wgpu = { version = "0.16"}
winit = "0.27"
[dependencies.image]
@ -28,7 +28,7 @@ features = ["png", "jpeg"]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -8,7 +8,7 @@ use winit::{
window::Window,
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
mod model;
@ -349,7 +349,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -386,9 +386,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -500,12 +502,10 @@ impl State {
label: Some("camera_bind_group"),
});
let obj_model = resources::load_model(
"cube.obj",
&device,
&queue,
&texture_bind_group_layout,
).await.unwrap();
let obj_model =
resources::load_model("cube.obj", &device, &queue, &texture_bind_group_layout)
.await
.unwrap();
let light_uniform = LightUniform {
position: [2.0, 2.0, 2.0],
@ -720,7 +720,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -738,14 +738,13 @@ pub async fn run() {
.build(&event_loop)
.unwrap();
#[cfg(target_arch = "wasm32")]
{
// Winit prevents sizing with CSS, so we have to set
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -799,7 +798,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial10_lighting::run;
fn main() {
pollster::block_on(run());
}
}

@ -140,7 +140,13 @@ where
) {
for mesh in &model.meshes {
let material = &model.materials[mesh.material];
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}
@ -218,7 +224,12 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_light_mesh_instanced(mesh, instances.clone(), camera_bind_group, light_bind_group);
self.draw_light_mesh_instanced(
mesh,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}

@ -100,8 +100,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -16,7 +16,7 @@ env_logger = "0.10"
pollster = "0.2"
log = "0.4"
tobj = { version = "3.2", features = ["async"]}
wgpu = { version = "0.15"}
wgpu = { version = "0.16"}
winit = "0.27"
[dependencies.image]
@ -28,7 +28,7 @@ features = ["png", "jpeg"]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -8,7 +8,7 @@ use winit::{
window::Window,
};
#[cfg(target_arch="wasm32")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
mod model;
@ -349,7 +349,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -386,9 +386,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -517,12 +519,10 @@ impl State {
label: Some("camera_bind_group"),
});
let obj_model = resources::load_model(
"cube.obj",
&device,
&queue,
&texture_bind_group_layout,
).await.unwrap();
let obj_model =
resources::load_model("cube.obj", &device, &queue, &texture_bind_group_layout)
.await
.unwrap();
let light_uniform = LightUniform {
position: [2.0, 2.0, 2.0],
@ -771,7 +771,7 @@ impl State {
}
}
#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
pub async fn run() {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
@ -789,14 +789,13 @@ pub async fn run() {
.build(&event_loop)
.unwrap();
#[cfg(target_arch = "wasm32")]
{
// Winit prevents sizing with CSS, so we have to set
// the size manually when on web.
use winit::dpi::PhysicalSize;
window.set_inner_size(PhysicalSize::new(450, 400));
use winit::platform::web::WindowExtWebSys;
web_sys::window()
.and_then(|win| win.document())
@ -847,7 +846,9 @@ pub async fn run() {
match state.render() {
Ok(_) => {}
// Reconfigure the surface if it's lost or outdated
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => state.resize(state.size),
Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => {
state.resize(state.size)
}
// The system is out of memory, we should probably quit
Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
// We're ignoring timeouts

@ -2,4 +2,4 @@ use tutorial11_normals::run;
fn main() {
pollster::block_on(run());
}
}

@ -203,7 +203,13 @@ where
) {
for mesh in &model.meshes {
let material = &model.materials[mesh.material];
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
@ -216,7 +222,13 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}
@ -294,7 +306,12 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_light_mesh_instanced(mesh, instances.clone(), camera_bind_group, light_bind_group);
self.draw_light_mesh_instanced(
mesh,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}

@ -105,8 +105,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -16,7 +16,7 @@ env_logger = "0.10"
pollster = "0.2"
log = "0.4"
tobj = { version = "3.2", features = ["async"]}
wgpu = { version = "0.15"}
wgpu = { version = "0.16"}
winit = "0.27"
instant = "0.1"
@ -29,7 +29,7 @@ features = ["png", "jpeg"]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -229,7 +229,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -266,9 +266,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,

@ -2,4 +2,4 @@ use tutorial12_camera::run;
fn main() {
pollster::block_on(run());
}
}

@ -202,7 +202,13 @@ where
) {
for mesh in &model.meshes {
let material = &model.materials[mesh.material];
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
@ -215,7 +221,13 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}
@ -293,7 +305,12 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_light_mesh_instanced(mesh, instances.clone(), camera_bind_group, light_bind_group);
self.draw_light_mesh_instanced(
mesh,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}

@ -106,8 +106,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -16,7 +16,7 @@ env_logger = "0.10"
pollster = "0.2"
log = "0.4"
tobj = { version = "3.2", features = ["async"]}
wgpu = { version = "0.15"}
wgpu = { version = "0.16"}
winit = "0.27"
instant = "0.1"
@ -29,7 +29,7 @@ features = ["png", "jpeg"]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -14,8 +14,8 @@ use wasm_bindgen::prelude::*;
mod camera;
mod model;
mod resources;
mod texture;
mod terrain;
mod texture;
use model::{DrawLight, DrawModel, Vertex};
@ -231,7 +231,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -268,9 +268,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -540,9 +542,24 @@ impl State {
let mut terrain = terrain::Terrain::new(chunk_size, min_max_height);
terrain.gen_chunk(&device, &queue, &terrain_pipeline, cgmath::Vector3::zero());
terrain.gen_chunk(&device, &queue, &terrain_pipeline, (0.0, 0.0, -(chunk_size.y as f32)).into());
terrain.gen_chunk(&device, &queue, &terrain_pipeline, (-(chunk_size.x as f32), 0.0, -(chunk_size.y as f32)).into());
terrain.gen_chunk(&device, &queue, &terrain_pipeline, (-(chunk_size.x as f32), 0.0, 0.0).into());
terrain.gen_chunk(
&device,
&queue,
&terrain_pipeline,
(0.0, 0.0, -(chunk_size.y as f32)).into(),
);
terrain.gen_chunk(
&device,
&queue,
&terrain_pipeline,
(-(chunk_size.x as f32), 0.0, -(chunk_size.y as f32)).into(),
);
terrain.gen_chunk(
&device,
&queue,
&terrain_pipeline,
(-(chunk_size.x as f32), 0.0, 0.0).into(),
);
Self {
window,
@ -699,7 +716,12 @@ impl State {
// &self.light_bind_group,
// );
self.terrain_pipeline.render(&mut render_pass, &self.terrain, &self.camera_bind_group, &self.light_bind_group);
self.terrain_pipeline.render(
&mut render_pass,
&self.terrain,
&self.camera_bind_group,
&self.light_bind_group,
);
}
self.queue.submit(iter::once(encoder.finish()));
output.present();

@ -2,4 +2,4 @@ use tutorial13_terrain::run;
fn main() {
pollster::block_on(run());
}
}

@ -203,7 +203,13 @@ where
) {
for mesh in &model.meshes {
let material = &model.materials[mesh.material];
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
@ -216,7 +222,13 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}
@ -294,7 +306,12 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_light_mesh_instanced(mesh, instances.clone(), camera_bind_group, light_bind_group);
self.draw_light_mesh_instanced(
mesh,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}

@ -256,7 +256,7 @@ pub async fn load_model(
// println!("data.len(): {}", data.len());
// let data_t: &[T] = bytemuck::cast_slice(&data[..]);
// output.extend(data_t.iter().map(f));
// });
// device.poll(wgpu::Maintain::Wait);
@ -264,4 +264,4 @@ pub async fn load_model(
// }
// buffer.unmap();
// output
// }
// }

@ -568,8 +568,8 @@ impl GenerateChunk for TerrainHackPipeline {
buffer: &chunk.mesh.vertex_buffer,
layout: wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: std::num::NonZeroU32::new(std::mem::size_of::<u32>() as u32 * self.texture_size),
rows_per_image: std::num::NonZeroU32::new(self.texture_size),
bytes_per_row: Some(std::mem::size_of::<u32>() as u32 * self.texture_size),
rows_per_image: Some(self.texture_size),
},
},
wgpu::Extent3d {
@ -589,8 +589,8 @@ impl GenerateChunk for TerrainHackPipeline {
buffer: &chunk.mesh.index_buffer,
layout: wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: std::num::NonZeroU32::new(std::mem::size_of::<u32>() as u32 * self.texture_size),
rows_per_image: std::num::NonZeroU32::new(self.texture_size),
bytes_per_row: Some(std::mem::size_of::<u32>() as u32 * self.texture_size),
rows_per_image: Some(self.texture_size),
},
},
wgpu::Extent3d {
@ -613,15 +613,28 @@ impl GenerateChunk for TerrainHackPipeline {
let data = bs.get_mapped_range();
let indices: &[u32] = bytemuck::cast_slice(&data);
let mut f = std::fs::File::create(format!("Chunk ({}, {}) Indices.txt", chunk.corner.x, chunk.corner.y)).unwrap();
let mut f = std::fs::File::create(format!(
"Chunk ({}, {}) Indices.txt",
chunk.corner.x, chunk.corner.y
))
.unwrap();
use std::io::Write;
for quad in indices.chunks(6) {
writeln!(f, "{:?}", quad);
}
drop(f);
let img = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(self.texture_size, self.texture_size, data).unwrap();
img.save(format!("Chunk ({}, {}) Vertex Data.png", chunk.corner.x, chunk.corner.y)).unwrap();
let img = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
self.texture_size,
self.texture_size,
data,
)
.unwrap();
img.save(format!(
"Chunk ({}, {}) Vertex Data.png",
chunk.corner.x, chunk.corner.y
))
.unwrap();
}
chunk.mesh.index_buffer.unmap();

@ -106,8 +106,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);
@ -129,4 +129,4 @@ impl Texture {
sampler,
})
}
}
}

@ -0,0 +1,11 @@
[package]
name = "md-builder"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
markdown = "0.3.0"
rayon = "1.7.0"
thiserror = "1.0.40"

@ -0,0 +1,28 @@
use std::path::Path;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Error processing file: {0}")]
Io(#[from] std::io::Error),
}
fn main() -> Result<(), Error> {
let dir_path = match std::env::args().skip(1).next() {
Some(s) => s,
None => {
println!("Usage: md-builder 'directory with markdown'");
std::process::exit(1);
}
};
let dir = std::fs::read_dir(dir_path)?;
Ok(())
}
fn process_file<P: AsRef<Path>>(path: P) -> Result<(), Error> {
let path = path.as_ref();
Ok(())
}

@ -14,7 +14,7 @@ image = "0.24"
log = "0.4"
rayon = "1.4"
tobj = "2.0"
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
[build-dependencies]

@ -7,8 +7,8 @@ use naga::front::glsl::Options;
use naga::front::glsl::Parser;
use rayon::prelude::*;
use std::env;
use std::{fs::read_to_string, path::PathBuf};
use std::result::Result::Ok;
use std::{fs::read_to_string, path::PathBuf};
pub fn load_shader(src_path: PathBuf) -> Result<()> {
let extension = src_path
@ -48,7 +48,6 @@ pub fn load_shader(src_path: PathBuf) -> Result<()> {
let flags = wgsl::WriterFlags::empty();
std::fs::write(wgsl_path, wgsl::write_string(&module, &info, flags)?)?;
Ok(())
}

@ -168,7 +168,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -205,9 +205,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,

@ -472,7 +472,13 @@ where
) {
for mesh in &model.meshes {
let material = &model.materials[mesh.material];
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
@ -485,7 +491,13 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}
@ -563,7 +575,12 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_light_mesh_instanced(mesh, instances.clone(), camera_bind_group, light_bind_group);
self.draw_light_mesh_instanced(
mesh,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}

@ -120,8 +120,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -14,7 +14,7 @@ pollster = "0.2"
image = "0.24.2"
log = "0.4"
tobj = "2.0"
wgpu = "0.15"
wgpu = "0.16"
wgpu-subscriber = "0.1"
winit = "0.27"

@ -1,10 +1,10 @@
use anyhow::Context;
use glob::glob;
use naga::back::wgsl;
use naga::front::glsl::Options;
use naga::front::glsl::Parser;
use rayon::prelude::*;
use std::{fs::read_to_string, path::PathBuf};
use anyhow::Context;
pub fn load_shader(src_path: PathBuf) -> anyhow::Result<()> {
let extension = src_path

@ -68,9 +68,11 @@ impl Display {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,

@ -331,7 +331,13 @@ where
) {
for mesh in &model.meshes {
let material = &model.materials[mesh.material];
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
@ -344,7 +350,13 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}
@ -422,7 +434,12 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_light_mesh_instanced(mesh, instances.clone(), camera_bind_group, light_bind_group);
self.draw_light_mesh_instanced(
mesh,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}

@ -107,7 +107,6 @@ pub struct ShaderCanvasBuilder<'a> {
impl<'a> ShaderCanvasBuilder<'a> {
pub fn new() -> Self {
Self {
canvas_size: [256.0; 2],
clear_color: [0.0, 0.0, 0.0, 1.0],

@ -105,8 +105,8 @@ impl<'a> Texture<'a> {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -14,7 +14,7 @@ pollster = "0.2"
image = "0.24.2"
log = "0.4"
tobj = "3.1"
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
gif = "0.11.4"
futures-intrusive = "0.4"

@ -5,9 +5,9 @@ use std::{iter, mem, num::NonZeroU32};
async fn run() {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions::default())
.await
@ -18,12 +18,12 @@ async fn run() {
label: Some("Device"),
features: wgpu::Features::empty(),
// WebGL doesn't support all of wgpu's features, so if
// we're building for the web we'll have to disable some.
limits: if cfg!(target_arch = "wasm32") {
wgpu::Limits::downlevel_webgl2_defaults()
} else {
wgpu::Limits::default()
},
// we're building for the web we'll have to disable some.
limits: if cfg!(target_arch = "wasm32") {
wgpu::Limits::downlevel_webgl2_defaults()
} else {
wgpu::Limits::default()
},
},
None, // Trace path
)
@ -122,8 +122,8 @@ async fn run() {
buffer: &output_buffer,
layout: wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(padded_bytes_per_row),
rows_per_image: NonZeroU32::new(texture_size),
bytes_per_row: Some(padded_bytes_per_row),
rows_per_image: Some(texture_size),
},
},
render_target.desc.size,

@ -8,7 +8,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
wgpu = "0.15"
wgpu = "0.16"
pollster = "0.2"
imgui = "0.7"
imgui-wgpu = "0.17"

@ -7,6 +7,6 @@ edition = "2021"
[dependencies]
anyhow = "1"
wgpu = "0.15"
wgpu = "0.16"
winit = "0.27"
pollster = "0.2"

@ -16,7 +16,7 @@ env_logger = "0.10"
pollster = "0.2"
log = "0.4"
tobj = { version = "3.2", features = ["async"]}
wgpu = { version = "0.15"}
wgpu = { version = "0.16"}
winit = "0.27"
instant = "0.1"
@ -29,7 +29,7 @@ features = ["png", "jpeg"]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -234,7 +234,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -271,9 +271,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -621,7 +623,12 @@ impl State {
self.mouse_ray = Ray::with_start_end(mouse_world_pos, self.camera.position.to_vec());
self.selected_mesh = None;
if self.obj_model.bounding_box.intersect(&self.mouse_ray).is_some() {
if self
.obj_model
.bounding_box
.intersect(&self.mouse_ray)
.is_some()
{
let mut t = f32::NEG_INFINITY;
for (i, mesh) in self.obj_model.meshes.iter().enumerate() {
if let Some((_, ti)) = mesh.bounding_box.intersect(&self.mouse_ray) {

@ -2,4 +2,4 @@ use mouse_picking::run;
fn main() {
pollster::block_on(run());
}
}

@ -1,11 +1,7 @@
use cgmath::InnerSpace;
fn vmul(a: cgmath::Vector3<f32>, b: cgmath::Vector3<f32>) -> cgmath::Vector3<f32> {
cgmath::Vector3::new(
a.x * b.x,
a.y * b.y,
a.z * b.z,
)
cgmath::Vector3::new(a.x * b.x, a.y * b.y, a.z * b.z)
}
pub struct BoundingBox {
@ -79,11 +75,7 @@ pub struct Ray {
impl Ray {
pub fn new(dir: cgmath::Vector3<f32>, orig: cgmath::Vector3<f32>) -> Self {
let invdir = 1.0 / dir;
Self {
dir,
orig,
invdir,
}
Self { dir, orig, invdir }
}
pub fn with_start_end(start: cgmath::Vector3<f32>, end: cgmath::Vector3<f32>) -> Self {
@ -97,14 +89,22 @@ mod tests {
use super::*;
fn vec3(x: f32, y: f32, z: f32) -> cgmath::Vector3<f32> {
return cgmath::Vector3 { x, y, z }
return cgmath::Vector3 { x, y, z };
}
#[test]
fn box_ray_intersect() {
let b = BoundingBox {
min: cgmath::Vector3 { x: -1.0, y: -1.0, z: -1.0 },
max: cgmath::Vector3 { x: 1.0, y: 1.0, z: 1.0 },
min: cgmath::Vector3 {
x: -1.0,
y: -1.0,
z: -1.0,
},
max: cgmath::Vector3 {
x: 1.0,
y: 1.0,
z: 1.0,
},
};
let test_data = [
@ -116,4 +116,4 @@ mod tests {
assert_eq!(b.intersect(&r).is_some(), expected);
}
}
}
}

@ -206,7 +206,13 @@ where
) {
for mesh in &model.meshes {
let material = &model.materials[mesh.material];
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
@ -219,7 +225,13 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_mesh_instanced(mesh, material, instances.clone(), camera_bind_group, light_bind_group);
self.draw_mesh_instanced(
mesh,
material,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}
@ -297,7 +309,12 @@ where
light_bind_group: &'b wgpu::BindGroup,
) {
for mesh in &model.meshes {
self.draw_light_mesh_instanced(mesh, instances.clone(), camera_bind_group, light_bind_group);
self.draw_light_mesh_instanced(
mesh,
instances.clone(),
camera_bind_group,
light_bind_group,
);
}
}
}

@ -106,8 +106,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -15,7 +15,7 @@ anyhow = "1.0"
bytemuck = { version = "1.12", features = [ "derive" ] }
cgmath = "0.18"
pollster = "0.2"
wgpu = { version = "0.15", features = ["spirv"]}
wgpu = { version = "0.16", features = ["spirv"]}
wgpu_glyph = "0.18"
rand = "0.8"
rodio = { version = "0.16", default-features = false, features = ["wav"] }
@ -34,7 +34,7 @@ web-sys = { version = "0.3.53", features = [
"Window",
"Element",
]}
wgpu = { version = "0.15", features = ["spirv", "webgl"]}
wgpu = { version = "0.16", features = ["spirv", "webgl"]}
[build-dependencies]
anyhow = "1.0"

@ -77,7 +77,7 @@ impl Render {
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,

@ -1,31 +1,19 @@
use anyhow::{Result, Error};
use anyhow::{Error, Result};
struct Snow {
}
struct Snow {}
impl framework::Demo for Snow {
fn init(display: &framework::Display) -> Result<Self, Error> {
Ok(Self {
})
Ok(Self {})
}
fn process_mouse(&mut self, dx: f64, dy: f64) {
}
fn process_mouse(&mut self, dx: f64, dy: f64) {}
fn resize(&mut self, display: &framework::Display) {
}
fn resize(&mut self, display: &framework::Display) {}
fn update(&mut self, display: &framework::Display, dt: std::time::Duration) {
}
fn update(&mut self, display: &framework::Display, dt: std::time::Duration) {}
fn render(&mut self, display: &mut framework::Display) {
}
fn render(&mut self, display: &mut framework::Display) {}
}
fn main() {

@ -17,7 +17,7 @@ pollster = "0.2"
log = "0.4"
rayon = "1.4" # NEW!
tobj = { version = "3.2", features = ["async"]}
wgpu = { version = "0.15"}
wgpu = { version = "0.16"}
winit = "0.27"
instant = "0.1"
async-std = "1"
@ -31,7 +31,7 @@ features = ["png", "jpeg"]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -228,7 +228,7 @@ impl State {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
// # Safety
//
// The surface needs to live as long as the window that created it.
@ -265,9 +265,11 @@ impl State {
// Shader code in this tutorial assumes an Srgb surface texture. Using a different
// one will result all the colors comming out darker. If you want to support non
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
let surface_format = surface_caps
.formats
.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,

@ -2,4 +2,4 @@ use threading::run;
fn main() {
async_std::task::block_on(run());
}
}

@ -106,8 +106,8 @@ impl Texture {
&rgba,
wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(4 * dimensions.0),
rows_per_image: NonZeroU32::new(dimensions.1),
bytes_per_row: Some(4 * dimensions.0),
rows_per_image: Some(dimensions.1),
},
size,
);

@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
image = "0.24"
shaderc = "0.8"
wgpu = { version = "0.15", features = ["spirv"] }
wgpu = { version = "0.16", features = ["spirv"] }
pollster = "0.2"
futures-intrusive = "0.4"

@ -2,9 +2,9 @@ use std::num::NonZeroU32;
async fn run() {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
backends: wgpu::Backends::all(),
dx12_shader_compiler: Default::default(),
});
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::default(),
@ -169,8 +169,8 @@ async fn run() {
buffer: &output_buffer,
layout: wgpu::ImageDataLayout {
offset: 0,
bytes_per_row: NonZeroU32::new(u32_size * texture_size),
rows_per_image: NonZeroU32::new(texture_size),
bytes_per_row: Some(u32_size * texture_size),
rows_per_image: Some(texture_size),
},
},
texture_desc.size,
@ -198,10 +198,8 @@ async fn run() {
let buffer =
ImageBuffer::<Rgba<u8>, _>::from_raw(texture_size, texture_size, data).unwrap();
buffer.save("image.png").unwrap();
}
output_buffer.unmap();
}
fn main() {

@ -1,4 +1,4 @@
use std::{process::Command, path::PathBuf};
use std::{path::PathBuf, process::Command};
use rayon::prelude::{IntoParallelRefIterator, ParallelIterator};
use wasm_bindgen_cli_support::Bindgen;
@ -69,7 +69,11 @@ fn main() -> anyhow::Result<()> {
}
let time_taken = std::time::Instant::now() - start_time;
log::info!("Success fully processed {} target(s) in {:?}", targets.len(), time_taken);
log::info!(
"Success fully processed {} target(s) in {:?}",
targets.len(),
time_taken
);
Ok(())
}

@ -11,7 +11,7 @@ For the beginner stuff, we're going to keep things very simple, we'll add things
winit = "0.27"
env_logger = "0.10"
log = "0.4"
wgpu = "0.15"
wgpu = "0.16"
```
## Using Rust's new resolver
@ -110,7 +110,7 @@ cfg-if = "1"
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "0.2.0"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4.30"
web-sys = { version = "0.3", features = [

@ -158,7 +158,7 @@ The `limits` field describes the limit of certain types of resources that we can
// sRGB surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
.copied()
.find(|f| f.describe().srgb)
.find(|f| f.is_srgb())
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
@ -261,13 +261,13 @@ cfg-if = "1"
winit = "0.27"
env_logger = "0.10"
log = "0.4"
wgpu = "0.15"
wgpu = "0.16"
pollster = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
console_log = "0.2.0"
wgpu = { version = "0.15", features = ["webgl"]}
wgpu = { version = "0.16", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [

@ -450,7 +450,7 @@ winit = "0.27"
env_logger = "0.10"
log = "0.4"
pollster = "0.2"
wgpu = "0.15"
wgpu = "0.16"
bytemuck = { version = "1.12", features = [ "derive" ] }
anyhow = "1.0" # NEW!
```

@ -20,7 +20,7 @@ let surface_caps = surface.get_capabilities(&adapter);
// Srgb surfaces, you'll need to account for that when drawing to the frame.
let surface_format = surface_caps.formats.iter()
.copied()
.filter(|f| f.describe().srgb)
.filter(|f| f.is_srgb())
.next()
.unwrap_or(surface_caps.formats[0]);
let config = wgpu::SurfaceConfiguration {

@ -14,7 +14,7 @@ This is not an in-depth guide on how to use Imgui. But here are some of the basi
```toml
imgui = "0.7"
imgui-wgpu = "0.15"
imgui-wgpu = "0.16"
imgui-winit-support = "0.7"
```

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save