diff --git a/Cargo.lock b/Cargo.lock index 684db1c1d6..a5b50e7838 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1061f3ff92c2f65800df1f12fc7b4ff44ee14783104187dd04dfee6f11b0fd2" +checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -502,9 +502,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", "clap_derive", @@ -512,9 +512,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", @@ -881,9 +881,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "cursor-icon" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740bb192a8e2d1350119916954f4409ee7f62f149b536911eeb78ba5a20526bf" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" @@ -931,9 +931,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "ddsfile" @@ -1025,7 +1025,7 @@ dependencies = [ "lazy-regex", "once_cell", "pmutil", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "regex", @@ -1240,9 +1240,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ "libc", "windows-sys 0.48.0", @@ -1269,9 +1269,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" dependencies = [ "simd-adler32", ] @@ -1364,9 +1364,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1793,9 +1793,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1930,9 +1930,9 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "lazy-regex" -version = "3.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e723bd417b2df60a0f6a2b6825f297ea04b245d4ba52b5a22cb679bdf58b05fa" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -1941,9 +1941,9 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "3.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0a1d9139f0ee2e862e08a9c5d0ba0470f2aa21cd1e1aa1b1562f83116c725f" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" dependencies = [ "proc-macro2", "quote", @@ -1994,6 +1994,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "libtest-mimic" version = "0.6.1" @@ -2017,9 +2028,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -2272,7 +2283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2429,7 +2440,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2441,7 +2452,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 2.0.39", @@ -2535,11 +2546,11 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "orbclient" -version = "0.3.46" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8378ac0dfbd4e7895f2d2c1f1345cab3836910baf3a300b000d04250f0c8428f" +checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "redox_syscall 0.3.5", + "libredox", ] [[package]] @@ -2559,9 +2570,9 @@ checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" [[package]] name = "owned_ttf_parser" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "706de7e2214113d63a8238d1910463cfce781129a6f263d13fdb09ff64355ba4" +checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" dependencies = [ "ttf-parser", ] @@ -2606,9 +2617,9 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" @@ -2772,7 +2783,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", ] [[package]] @@ -2879,15 +2899,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -2994,9 +3005,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ "bitflags 2.4.1", "errno", @@ -3285,9 +3296,9 @@ dependencies = [ [[package]] name = "sourcemap" -version = "7.0.0" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbecc42a2b6131acc3bf9a25c9fe4161dba438eb52131bba83c5d781b5b70be3" +checksum = "10da010a590ed2fa9ca8467b00ce7e9c5a8017742c0c09c45450efc172208c4b" dependencies = [ "data-encoding", "debugid", @@ -3420,12 +3431,11 @@ dependencies = [ [[package]] name = "thread-id" -version = "4.1.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee93aa2b8331c0fec9091548843f2c90019571814057da3b783f9de09349d73" +checksum = "f0ec81c46e9eb50deaa257be2f148adf052d1fb7701cfd55ccfab2525280b70b" dependencies = [ "libc", - "redox_syscall 0.2.16", "winapi", ] @@ -3560,6 +3570,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.40" @@ -3578,9 +3599,9 @@ checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" [[package]] name = "ttf-parser" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[package]] name = "unic-char-property" @@ -3670,9 +3691,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -3701,9 +3722,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "getrandom", "serde", @@ -4087,45 +4108,6 @@ dependencies = [ "wgpu-types", ] -[[package]] -name = "wgpu-boids-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "nanorand", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-bunnymark-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "glam", - "nanorand", - "png", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-conservative-raster-example" -version = "0.18.0" -dependencies = [ - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - [[package]] name = "wgpu-core" version = "0.18.0" @@ -4150,33 +4132,31 @@ dependencies = [ ] [[package]] -name = "wgpu-cube-example" +name = "wgpu-examples" version = "0.18.0" dependencies = [ "bytemuck", - "glam", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-example" -version = "0.18.0" -dependencies = [ "cfg-if", "console_error_panic_hook", "console_log", + "ddsfile", + "encase", "env_logger", "fern", + "flume", + "futures-intrusive", + "getrandom", + "glam", "js-sys", "log", + "nanorand", + "noise", + "obj", "png", "pollster", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-bindgen-test", "web-sys", "web-time", "wgpu", @@ -4230,101 +4210,6 @@ dependencies = [ "winit 0.29.3", ] -[[package]] -name = "wgpu-hello-compute-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "flume", - "log", - "pollster", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "wgpu", - "wgpu-test", -] - -[[package]] -name = "wgpu-hello-example" -version = "0.18.0" -dependencies = [ - "console_error_panic_hook", - "console_log", - "env_logger", - "glam", - "log", - "pollster", - "wasm-bindgen-futures", - "wgpu", - "wgpu-test", -] - -[[package]] -name = "wgpu-hello-synchronization-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "flume", - "log", - "pollster", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "web-sys", - "wgpu", - "wgpu-example", - "wgpu-test", -] - -[[package]] -name = "wgpu-hello-triangle-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "pollster", - "wasm-bindgen-futures", - "web-sys", - "wgpu", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-hello-windows-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "env_logger", - "pollster", - "wgpu", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-hello-workgroups-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "futures-intrusive", - "log", - "pollster", - "wasm-bindgen-futures", - "web-sys", - "wgpu", - "wgpu-example", -] - [[package]] name = "wgpu-info" version = "0.18.0" @@ -4348,148 +4233,6 @@ dependencies = [ "syn 2.0.39", ] -[[package]] -name = "wgpu-mipmap-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "glam", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-msaa-line-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "glam", - "log", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-render-to-texture-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "futures-intrusive", - "log", - "png", - "pollster", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu", - "wgpu-example", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-repeated-compute-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "futures-intrusive", - "getrandom", - "log", - "pollster", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "web-sys", - "wgpu", - "wgpu-example", - "wgpu-test", -] - -[[package]] -name = "wgpu-shadow-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "glam", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-skybox-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "ddsfile", - "glam", - "log", - "obj", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-srgb-blend-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "glam", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-stencil-triangle-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-storage-texture-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "futures-intrusive", - "log", - "png", - "pollster", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "web-sys", - "wgpu", - "wgpu-example", - "wgpu-test", -] - [[package]] name = "wgpu-test" version = "0.18.0" @@ -4526,36 +4269,6 @@ dependencies = [ "wgpu-types", ] -[[package]] -name = "wgpu-texture-arrays-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-timestamp-queries-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "console_error_panic_hook", - "console_log", - "env_logger", - "futures-intrusive", - "log", - "pollster", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "wgpu", - "wgpu-test", - "winit 0.29.3", -] - [[package]] name = "wgpu-types" version = "0.18.0" @@ -4567,38 +4280,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wgpu-uniform-values-example" -version = "0.18.0" -dependencies = [ - "console_error_panic_hook", - "console_log", - "encase", - "env_logger", - "glam", - "png", - "pollster", - "wasm-bindgen-futures", - "web-sys", - "wgpu", - "winit 0.29.3", -] - -[[package]] -name = "wgpu-water-example" -version = "0.18.0" -dependencies = [ - "bytemuck", - "glam", - "nanorand", - "noise", - "wasm-bindgen-test", - "wgpu", - "wgpu-example", - "wgpu-test", - "winit 0.29.3", -] - [[package]] name = "which" version = "4.4.2" @@ -4934,9 +4615,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.5.17" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -5023,18 +4704,18 @@ checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "zerocopy" -version = "0.7.15" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ba595b9f2772fbee2312de30eeb80ec773b4cb2f1e8098db024afadda6c06f" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.15" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772666c41fb6dceaf520b564b962d738a8e1a83b41bd48945f50837aed78bb1d" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index ddd0c31906..7646acdd2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ # default members "d3d12", - "examples/*", + "examples/", "naga-cli", "naga", "naga/fuzz", @@ -23,7 +23,7 @@ members = [ exclude = [] default-members = [ "d3d12", - "examples/*", + "examples/", "naga-cli", "naga", "naga/fuzz", @@ -79,12 +79,14 @@ codespan-reporting = "0.11" ctor = "0.2" # https://github.com/SiegeEngine/ddsfile/issues/15 (Updated dependencies) ddsfile = { version = "0.5.2-unstable", git = "https://github.com/SiegeEngine/ddsfile.git", rev = "9b597930edc00502391cbb1a39708dadde0fd0ff" } +encase = "0.6" env_logger = "0.10" fern = "0.6" flume = "0.11" futures-lite = "1" futures-intrusive = "0.5" rustc-hash = "1.1.0" +getrandom = "0.2" glam = "0.24.2" heck = "0.4.0" image = { version = "0.24", default-features = false, features = ["png"] } diff --git a/README.md b/README.md index 3a75ae864a..97935ad053 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,11 @@ For an overview of all the components in the gfx-rs ecosystem, see [the big pict ### Rust -Rust examples can be found at [wgpu/examples](examples). You can run the examples on native with `cargo run --bin `. See the [list of examples](examples). +Rust examples can be found at [wgpu/examples](examples). You can run the examples on native with `cargo run --bin wgpu-examples `. See the [list of examples](examples). -To run the examples on WebGPU on wasm, run `cargo xtask run-wasm --bin `. Then connect to `http://localhost:8000` in your WebGPU enabled browser. +To run the examples on WebGPU on wasm, run `cargo xtask run-wasm --bin wgpu-example`. Then connect to `http://localhost:8000` in your WebGPU enabled browser, and you can choose an example to run. -To run the examples on WebGL on wasm, run `cargo xtask run-wasm --bin --features webgl`. Then connect to `http://localhost:8000` in your WebGL enabled browser. +To run the examples on WebGL on wasm, run `cargo xtask run-wasm --bin wgpu-example --features webgl`. Then connect to `http://localhost:8000` in your WebGL enabled browser, and you can choose an example to run. If you are looking for a wgpu tutorial, look at the following: diff --git a/examples/common/Cargo.toml b/examples/Cargo.toml similarity index 61% rename from examples/common/Cargo.toml rename to examples/Cargo.toml index 55d9281791..3250db91c0 100644 --- a/examples/common/Cargo.toml +++ b/examples/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wgpu-example" +name = "wgpu-examples" version.workspace = true authors.workspace = true edition.workspace = true @@ -10,15 +10,36 @@ keywords.workspace = true license.workspace = true publish = false +[lib] +path = "src/lib.rs" +harness = false + +[[bin]] +name = "wgpu-examples" +path = "src/main.rs" +test = false + [dependencies] +bytemuck.workspace = true cfg-if.workspace = true +ddsfile.workspace = true +encase = { workspace = true, features = ["glam"] } env_logger.workspace = true +flume.workspace = true +futures-intrusive.workspace = true +getrandom.workspace = true +glam.workspace = true log.workspace = true -pollster.workspace = true +nanorand.workspace = true +noise.workspace = true +obj.workspace = true png.workspace = true +pollster.workspace = true web-time.workspace = true -winit.workspace = true wgpu.workspace = true +winit.workspace = true + +[dev-dependencies] wgpu-test.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] @@ -27,6 +48,7 @@ console_log.workspace = true fern.workspace = true js-sys.workspace = true wasm-bindgen.workspace = true +wasm-bindgen-test.workspace = true wasm-bindgen-futures.workspace = true hal = { workspace = true, optional = true } # We need these features in the framework examples and tests @@ -36,7 +58,13 @@ web-sys = { workspace = true, features = [ "RequestInit", "RequestMode", "Request", + "ImageData", "Response", + "HtmlImageElement", "WebGl2RenderingContext", - "CanvasRenderingContext2d" + "CanvasRenderingContext2d", + + # Needed for example display logic + "HtmlStyleElement", + "HtmlHeadElement", ] } diff --git a/examples/boids/Cargo.toml b/examples/boids/Cargo.toml deleted file mode 100644 index 55387b46dc..0000000000 --- a/examples/boids/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "wgpu-boids-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu boids example" -publish = false - -[[bin]] -name = "boids" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -nanorand.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -wasm-bindgen-test.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true diff --git a/examples/bunnymark/Cargo.toml b/examples/bunnymark/Cargo.toml deleted file mode 100644 index 48f3a520e7..0000000000 --- a/examples/bunnymark/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "wgpu-bunnymark-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu bunnymark example" -publish = false - -[[bin]] -name = "bunnymark" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -nanorand.workspace = true -glam.workspace = true -png.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true diff --git a/examples/common/src/lib.rs b/examples/common/src/lib.rs deleted file mode 100644 index b647b81834..0000000000 --- a/examples/common/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod framework; -pub mod utils; diff --git a/examples/conservative-raster/Cargo.toml b/examples/conservative-raster/Cargo.toml deleted file mode 100644 index 6b1387b27d..0000000000 --- a/examples/conservative-raster/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "wgpu-conservative-raster-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu conservative raster example" -publish = false - -[[bin]] -name = "conservative-raster" -path = "src/main.rs" -harness = false - -[dependencies] -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true diff --git a/examples/cube/Cargo.toml b/examples/cube/Cargo.toml deleted file mode 100644 index 5c94d61889..0000000000 --- a/examples/cube/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "wgpu-cube-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu cube example" -publish = false - -[[bin]] -name = "cube" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -glam.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -wasm-bindgen-test.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true diff --git a/examples/hello-compute/Cargo.toml b/examples/hello-compute/Cargo.toml deleted file mode 100644 index f374de7ac7..0000000000 --- a/examples/hello-compute/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "wgpu-hello-compute-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu hello compute example" -publish = false - -[[bin]] -name = "hello-compute" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -flume.workspace = true -pollster.workspace = true -wgpu.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -log.workspace = true -wasm-bindgen-futures.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true diff --git a/examples/hello-synchronization/Cargo.toml b/examples/hello-synchronization/Cargo.toml deleted file mode 100644 index ff9594b6c6..0000000000 --- a/examples/hello-synchronization/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -[package] -name = "wgpu-hello-synchronization-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu hello synchronization example" -publish = false - -[[bin]] -name = "hello-synchronization" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -flume.workspace = true -log.workspace = true -pollster.workspace = true -wgpu.workspace = true -wgpu-example.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen-futures.workspace = true -web-sys = { workspace = true, features = ["Document"] } - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/examples/hello-triangle/Cargo.toml b/examples/hello-triangle/Cargo.toml deleted file mode 100644 index 1c0d6b9a3e..0000000000 --- a/examples/hello-triangle/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "wgpu-hello-triangle-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu hello triangle example" -publish = false - -[[bin]] -name = "hello-triangle" -path = "src/main.rs" - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -pollster.workspace = true -wgpu.workspace = true -winit.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen-futures.workspace = true -web-sys.workspace = true diff --git a/examples/hello-windows/Cargo.toml b/examples/hello-windows/Cargo.toml deleted file mode 100644 index 966197f5b0..0000000000 --- a/examples/hello-windows/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "wgpu-hello-windows-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu hello windows example" -publish = false - -[[bin]] -name = "hello-windows" -path = "src/main.rs" - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -pollster.workspace = true -wgpu.workspace = true -winit.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true diff --git a/examples/hello-workgroups/Cargo.toml b/examples/hello-workgroups/Cargo.toml deleted file mode 100644 index 20183f6d48..0000000000 --- a/examples/hello-workgroups/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "wgpu-hello-workgroups-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu hello workgroups example" -publish = false - -[[bin]] -name = "hello-workgroups" -path = "src/main.rs" - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -futures-intrusive.workspace = true -log.workspace = true -pollster.workspace = true -wgpu.workspace = true -wgpu-example.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen-futures.workspace = true -web-sys = { workspace = true, features = ["Document"] } diff --git a/examples/hello/Cargo.toml b/examples/hello/Cargo.toml deleted file mode 100644 index 54b145c264..0000000000 --- a/examples/hello/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "wgpu-hello-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu hello example" -publish = false - -[[bin]] -name = "hello" -path = "src/main.rs" - -[dependencies] -env_logger.workspace = true -glam.workspace = true -log.workspace = true -pollster.workspace = true -wgpu.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen-futures.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - diff --git a/examples/mipmap/Cargo.toml b/examples/mipmap/Cargo.toml deleted file mode 100644 index 46df0175e1..0000000000 --- a/examples/mipmap/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "wgpu-mipmap-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu mipmap example" -publish = false - -[[bin]] -name = "mipmap" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -glam.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true diff --git a/examples/msaa-line/Cargo.toml b/examples/msaa-line/Cargo.toml deleted file mode 100644 index f107b00648..0000000000 --- a/examples/msaa-line/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "wgpu-msaa-line-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu msaa line example" -publish = false - -[[bin]] -name = "msaa-line" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -glam.workspace = true -log.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true diff --git a/examples/render-to-texture/Cargo.toml b/examples/render-to-texture/Cargo.toml deleted file mode 100644 index 042467de03..0000000000 --- a/examples/render-to-texture/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "wgpu-render-to-texture-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu render to texture example" -publish = false - -[[bin]] -name = "render-to-texture" -path = "src/main.rs" - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -futures-intrusive.workspace = true -log.workspace = true -pollster.workspace = true -wgpu.workspace = true -wgpu-example.workspace = true -winit.workspace = true - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -png.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen.workspace = true -wasm-bindgen-futures.workspace = true -web-sys = { workspace = true, features = [ - "HtmlCanvasElement", "Document", "CanvasRenderingContext2d", "Window", "ImageData", - "HtmlImageElement" -] } diff --git a/examples/repeated-compute/Cargo.toml b/examples/repeated-compute/Cargo.toml deleted file mode 100644 index 2a50037157..0000000000 --- a/examples/repeated-compute/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -[package] -name = "wgpu-repeated-compute-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu repeated compute example" -publish = false - -[[bin]] -name = "repeated-compute" -path = "src/main.rs" - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -futures-intrusive.workspace = true -getrandom = { version = "0.2.11", features = ["js"] } -log.workspace = true -pollster.workspace = true -wgpu.workspace = true -wgpu-example.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen-futures.workspace = true -web-sys = { workspace = true, features = ["Document"] } - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true diff --git a/examples/shadow/Cargo.toml b/examples/shadow/Cargo.toml deleted file mode 100644 index 5bcccfe9b2..0000000000 --- a/examples/shadow/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "wgpu-shadow-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu shadow example" -publish = false - -[[bin]] -name = "shadow" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -glam.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/examples/skybox/Cargo.toml b/examples/skybox/Cargo.toml deleted file mode 100644 index 584b5550e7..0000000000 --- a/examples/skybox/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "wgpu-skybox-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu skybox example" -publish = false - -[[bin]] -name = "skybox" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -ddsfile.workspace = true -glam.workspace = true -obj.workspace = true -log.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/examples/boids/README.md b/examples/src/boids/README.md similarity index 100% rename from examples/boids/README.md rename to examples/src/boids/README.md diff --git a/examples/boids/src/compute.wgsl b/examples/src/boids/compute.wgsl similarity index 100% rename from examples/boids/src/compute.wgsl rename to examples/src/boids/compute.wgsl diff --git a/examples/boids/src/draw.wgsl b/examples/src/boids/draw.wgsl similarity index 100% rename from examples/boids/src/draw.wgsl rename to examples/src/boids/draw.wgsl diff --git a/examples/boids/src/main.rs b/examples/src/boids/mod.rs similarity index 92% rename from examples/boids/src/main.rs rename to examples/src/boids/mod.rs index f81eadd426..b608394134 100644 --- a/examples/boids/src/main.rs +++ b/examples/src/boids/mod.rs @@ -24,7 +24,7 @@ struct Example { frame_num: usize, } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn required_limits() -> wgpu::Limits { wgpu::Limits::downlevel_defaults() } @@ -320,29 +320,24 @@ impl wgpu_example::framework::Example for Example { } /// run example -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("boids"); +pub fn main() { + crate::framework::run::("boids"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "boids", - // Generated on 1080ti on Vk/Windows - image_path: "examples/boids/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default() - .downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS) - .limits(wgpu::Limits::downlevel_defaults()) - // Lots of validation errors, maybe related to https://github.com/gfx-rs/wgpu/issues/3160 - .expect_fail(wgpu_test::FailureCase::molten_vk()), - comparisons: &[wgpu_test::ComparisonType::Mean(0.005)], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "boids", + // Generated on 1080ti on Vk/Windows + image_path: "/examples/src/boids/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default() + .downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS) + .limits(wgpu::Limits::downlevel_defaults()) + // Lots of validation errors, maybe related to https://github.com/gfx-rs/wgpu/issues/3160 + .expect_fail(wgpu_test::FailureCase::molten_vk()), + comparisons: &[wgpu_test::ComparisonType::Mean(0.005)], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/boids/screenshot.png b/examples/src/boids/screenshot.png similarity index 100% rename from examples/boids/screenshot.png rename to examples/src/boids/screenshot.png diff --git a/examples/bunnymark/src/main.rs b/examples/src/bunnymark/mod.rs similarity index 93% rename from examples/bunnymark/src/main.rs rename to examples/src/bunnymark/mod.rs index 40f773b9fe..c29da351ee 100644 --- a/examples/bunnymark/src/main.rs +++ b/examples/src/bunnymark/mod.rs @@ -131,7 +131,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn init( config: &wgpu::SurfaceConfiguration, _adapter: &wgpu::Adapter, @@ -375,31 +375,26 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("bunnymark"); +pub fn main() { + crate::framework::run::("bunnymark"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "bunnymark", - image_path: "/examples/bunnymark/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default(), - // We're looking for very small differences, so look in the high percentiles. - comparisons: &[ - wgpu_test::ComparisonType::Mean(0.05), - wgpu_test::ComparisonType::Percentile { - percentile: 0.99, - threshold: 0.37, - }, - ], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "bunnymark", + image_path: "/examples/src/bunnymark/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default(), + // We're looking for very small differences, so look in the high percentiles. + comparisons: &[ + wgpu_test::ComparisonType::Mean(0.05), + wgpu_test::ComparisonType::Percentile { + percentile: 0.99, + threshold: 0.37, + }, + ], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/bunnymark/screenshot.png b/examples/src/bunnymark/screenshot.png similarity index 100% rename from examples/bunnymark/screenshot.png rename to examples/src/bunnymark/screenshot.png diff --git a/examples/conservative-raster/README.md b/examples/src/conservative_raster/README.md similarity index 100% rename from examples/conservative-raster/README.md rename to examples/src/conservative_raster/README.md diff --git a/examples/conservative-raster/src/main.rs b/examples/src/conservative_raster/mod.rs similarity index 94% rename from examples/conservative-raster/src/main.rs rename to examples/src/conservative_raster/mod.rs index 580c6781b9..ce2054caa0 100644 --- a/examples/conservative-raster/src/main.rs +++ b/examples/src/conservative_raster/mod.rs @@ -63,7 +63,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn required_features() -> wgpu::Features { wgpu::Features::CONSERVATIVE_RASTERIZATION } @@ -306,24 +306,19 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("conservative-raster"); +pub fn main() { + crate::framework::run::("conservative-raster"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "conservative-raster", - image_path: "/examples/conservative-raster/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.0)], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "conservative-raster", + image_path: "/examples/src/conservative_raster/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.0)], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/conservative-raster/screenshot.png b/examples/src/conservative_raster/screenshot.png similarity index 100% rename from examples/conservative-raster/screenshot.png rename to examples/src/conservative_raster/screenshot.png diff --git a/examples/conservative-raster/src/triangle_and_lines.wgsl b/examples/src/conservative_raster/triangle_and_lines.wgsl similarity index 100% rename from examples/conservative-raster/src/triangle_and_lines.wgsl rename to examples/src/conservative_raster/triangle_and_lines.wgsl diff --git a/examples/conservative-raster/src/upscale.wgsl b/examples/src/conservative_raster/upscale.wgsl similarity index 100% rename from examples/conservative-raster/src/upscale.wgsl rename to examples/src/conservative_raster/upscale.wgsl diff --git a/examples/cube/README.md b/examples/src/cube/README.md similarity index 100% rename from examples/cube/README.md rename to examples/src/cube/README.md diff --git a/examples/cube/src/main.rs b/examples/src/cube/mod.rs similarity index 89% rename from examples/cube/src/main.rs rename to examples/src/cube/mod.rs index badeae8e5c..d21aafe5de 100644 --- a/examples/cube/src/main.rs +++ b/examples/src/cube/mod.rs @@ -102,7 +102,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn optional_features() -> wgpu::Features { wgpu::Features::POLYGON_MODE_LINE } @@ -371,49 +371,43 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("cube"); +pub fn main() { + crate::framework::run::("cube"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "cube", - // Generated on 1080ti on Vk/Windows - image_path: "/examples/cube/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[ - wgpu_test::ComparisonType::Mean(0.04), // Bounded by Intel 630 on Vk/Windows - ], - _phantom: std::marker::PhantomData::, - }; +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "cube", + // Generated on 1080ti on Vk/Windows + image_path: "/examples/src/cube/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[ + wgpu_test::ComparisonType::Mean(0.04), // Bounded by Intel 630 on Vk/Windows + ], + _phantom: std::marker::PhantomData::, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_LINES: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "cube-lines", - // Generated on 1080ti on Vk/Windows - image_path: "/examples/cube/screenshot-lines.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::POLYGON_MODE_LINE, - base_test_parameters: wgpu_test::TestParameters::default(), - // We're looking for tiny changes here, so we focus on a spike in the 95th percentile. - comparisons: &[ - wgpu_test::ComparisonType::Mean(0.05), // Bounded by Intel 630 on Vk/Windows - wgpu_test::ComparisonType::Percentile { - percentile: 0.95, - threshold: 0.36, - }, // Bounded by 1080ti on DX12 - ], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST_LINES: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "cube-lines", + // Generated on 1080ti on Vk/Windows + image_path: "/examples/src/cube/screenshot-lines.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::POLYGON_MODE_LINE, + base_test_parameters: wgpu_test::TestParameters::default(), + // We're looking for tiny changes here, so we focus on a spike in the 95th percentile. + comparisons: &[ + wgpu_test::ComparisonType::Mean(0.05), // Bounded by Intel 630 on Vk/Windows + wgpu_test::ComparisonType::Percentile { + percentile: 0.95, + threshold: 0.36, + }, // Bounded by 1080ti on DX12 + ], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/cube/screenshot-lines.png b/examples/src/cube/screenshot-lines.png similarity index 100% rename from examples/cube/screenshot-lines.png rename to examples/src/cube/screenshot-lines.png diff --git a/examples/cube/screenshot.png b/examples/src/cube/screenshot.png similarity index 100% rename from examples/cube/screenshot.png rename to examples/src/cube/screenshot.png diff --git a/examples/cube/src/shader.wgsl b/examples/src/cube/shader.wgsl similarity index 100% rename from examples/cube/src/shader.wgsl rename to examples/src/cube/shader.wgsl diff --git a/examples/common/src/framework.rs b/examples/src/framework.rs similarity index 98% rename from examples/common/src/framework.rs rename to examples/src/framework.rs index 74b89454df..0256367510 100644 --- a/examples/common/src/framework.rs +++ b/examples/src/framework.rs @@ -1,7 +1,6 @@ use std::sync::Arc; -use wgpu::{Instance, Surface, WasmNotSendSync}; -use wgpu_test::GpuTestConfiguration; +use wgpu::{Instance, Surface}; use winit::{ dpi::PhysicalSize, event::{Event, KeyEvent, StartCause, WindowEvent}, @@ -496,8 +495,10 @@ pub fn parse_url_query_string<'a>(query: &'a str, search_key: &str) -> Option<&' None } +#[cfg(test)] pub use wgpu_test::image::ComparisonType; +#[cfg(test)] #[derive(Clone)] pub struct ExampleTestParams { pub name: &'static str, @@ -512,9 +513,12 @@ pub struct ExampleTestParams { pub _phantom: std::marker::PhantomData, } -impl From> for GpuTestConfiguration { +#[cfg(test)] +impl From> + for wgpu_test::GpuTestConfiguration +{ fn from(params: ExampleTestParams) -> Self { - GpuTestConfiguration::new() + wgpu_test::GpuTestConfiguration::new() .name(params.name) .parameters({ assert_eq!(params.width % 64, 0, "width needs to be aligned 64"); @@ -604,7 +608,7 @@ impl From> for GpuTestConfigu let bytes = dst_buffer_slice.get_mapped_range().to_vec(); wgpu_test::image::compare_image_output( - env!("CARGO_MANIFEST_DIR").to_string() + "/../../" + params.image_path, + dbg!(env!("CARGO_MANIFEST_DIR").to_string() + "/../" + params.image_path), &ctx.adapter_info, params.width, params.height, diff --git a/examples/hello/README.md b/examples/src/hello/README.md similarity index 100% rename from examples/hello/README.md rename to examples/src/hello/README.md diff --git a/examples/hello/src/main.rs b/examples/src/hello/mod.rs similarity index 98% rename from examples/hello/src/main.rs rename to examples/src/hello/mod.rs index 71d947cdc6..12239e43f7 100644 --- a/examples/hello/src/main.rs +++ b/examples/src/hello/mod.rs @@ -19,7 +19,7 @@ async fn run() { log::info!("Selected adapter: {:?}", adapter.get_info()) } -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::init(); diff --git a/examples/hello-compute/README.md b/examples/src/hello_compute/README.md similarity index 100% rename from examples/hello-compute/README.md rename to examples/src/hello_compute/README.md diff --git a/examples/hello-compute/src/main.rs b/examples/src/hello_compute/mod.rs similarity index 99% rename from examples/hello-compute/src/main.rs rename to examples/src/hello_compute/mod.rs index c7d09c6a4a..f957c6333d 100644 --- a/examples/hello-compute/src/main.rs +++ b/examples/src/hello_compute/mod.rs @@ -177,8 +177,7 @@ async fn execute_gpu_inner( } } -#[cfg(not(test))] -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::init(); @@ -194,6 +193,3 @@ fn main() { #[cfg(test)] mod tests; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); diff --git a/examples/hello-compute/src/shader.wgsl b/examples/src/hello_compute/shader.wgsl similarity index 100% rename from examples/hello-compute/src/shader.wgsl rename to examples/src/hello_compute/shader.wgsl diff --git a/examples/hello-compute/src/tests.rs b/examples/src/hello_compute/tests.rs similarity index 100% rename from examples/hello-compute/src/tests.rs rename to examples/src/hello_compute/tests.rs diff --git a/examples/hello-synchronization/README.md b/examples/src/hello_synchronization/README.md similarity index 100% rename from examples/hello-synchronization/README.md rename to examples/src/hello_synchronization/README.md diff --git a/examples/hello-synchronization/src/main.rs b/examples/src/hello_synchronization/mod.rs similarity index 98% rename from examples/hello-synchronization/src/main.rs rename to examples/src/hello_synchronization/mod.rs index bcf360d577..476db4d965 100644 --- a/examples/hello-synchronization/src/main.rs +++ b/examples/src/hello_synchronization/mod.rs @@ -189,8 +189,7 @@ async fn get_data( staging_buffer.unmap(); } -#[cfg(not(test))] -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::builder() @@ -204,14 +203,11 @@ fn main() { std::panic::set_hook(Box::new(console_error_panic_hook::hook)); console_log::init_with_level(log::Level::Info).expect("could not initialize logger"); - wgpu_example::utils::add_web_nothing_to_see_msg(); + crate::utils::add_web_nothing_to_see_msg(); wasm_bindgen_futures::spawn_local(run()); } } -#[cfg(test)] -wgpu_test::gpu_test_main!(); - #[cfg(test)] mod tests; diff --git a/examples/hello-synchronization/src/shaders.wgsl b/examples/src/hello_synchronization/shaders.wgsl similarity index 100% rename from examples/hello-synchronization/src/shaders.wgsl rename to examples/src/hello_synchronization/shaders.wgsl diff --git a/examples/hello-synchronization/src/tests.rs b/examples/src/hello_synchronization/tests.rs similarity index 100% rename from examples/hello-synchronization/src/tests.rs rename to examples/src/hello_synchronization/tests.rs diff --git a/examples/hello-triangle/README.md b/examples/src/hello_triangle/README.md similarity index 100% rename from examples/hello-triangle/README.md rename to examples/src/hello_triangle/README.md diff --git a/examples/hello-triangle/src/main.rs b/examples/src/hello_triangle/mod.rs similarity index 99% rename from examples/hello-triangle/src/main.rs rename to examples/src/hello_triangle/mod.rs index 55db4eb928..0b0350700c 100644 --- a/examples/hello-triangle/src/main.rs +++ b/examples/src/hello_triangle/mod.rs @@ -148,7 +148,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) { .unwrap(); } -fn main() { +pub fn main() { let event_loop = EventLoop::new().unwrap(); let window = winit::window::Window::new(&event_loop).unwrap(); #[cfg(not(target_arch = "wasm32"))] diff --git a/examples/hello-triangle/screenshot.png b/examples/src/hello_triangle/screenshot.png similarity index 100% rename from examples/hello-triangle/screenshot.png rename to examples/src/hello_triangle/screenshot.png diff --git a/examples/hello-triangle/src/shader.wgsl b/examples/src/hello_triangle/shader.wgsl similarity index 100% rename from examples/hello-triangle/src/shader.wgsl rename to examples/src/hello_triangle/shader.wgsl diff --git a/examples/hello-windows/README.md b/examples/src/hello_windows/README.md similarity index 100% rename from examples/hello-windows/README.md rename to examples/src/hello_windows/README.md diff --git a/examples/hello-windows/src/main.rs b/examples/src/hello_windows/mod.rs similarity index 99% rename from examples/hello-windows/src/main.rs rename to examples/src/hello_windows/mod.rs index 22065e3620..1b4bbdc934 100644 --- a/examples/hello-windows/src/main.rs +++ b/examples/src/hello_windows/mod.rs @@ -161,7 +161,7 @@ async fn run(event_loop: EventLoop<()>, viewports: Vec<(Arc, wgpu::Color .unwrap(); } -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { const WINDOW_SIZE: u32 = 128; diff --git a/examples/hello-windows/screenshot.png b/examples/src/hello_windows/screenshot.png similarity index 100% rename from examples/hello-windows/screenshot.png rename to examples/src/hello_windows/screenshot.png diff --git a/examples/hello-workgroups/README.md b/examples/src/hello_workgroups/README.md similarity index 100% rename from examples/hello-workgroups/README.md rename to examples/src/hello_workgroups/README.md diff --git a/examples/hello-workgroups/src/main.rs b/examples/src/hello_workgroups/mod.rs similarity index 98% rename from examples/hello-workgroups/src/main.rs rename to examples/src/hello_workgroups/mod.rs index 53e8b2adca..c19f4437c4 100644 --- a/examples/hello-workgroups/src/main.rs +++ b/examples/src/hello_workgroups/mod.rs @@ -178,7 +178,7 @@ async fn get_data( staging_buffer.unmap(); } -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::builder() @@ -192,7 +192,7 @@ fn main() { std::panic::set_hook(Box::new(console_error_panic_hook::hook)); console_log::init_with_level(log::Level::Info).expect("could not initialize logger"); - wgpu_example::utils::add_web_nothing_to_see_msg(); + crate::utils::add_web_nothing_to_see_msg(); wasm_bindgen_futures::spawn_local(run()); } diff --git a/examples/hello-workgroups/src/shader.wgsl b/examples/src/hello_workgroups/shader.wgsl similarity index 100% rename from examples/hello-workgroups/src/shader.wgsl rename to examples/src/hello_workgroups/shader.wgsl diff --git a/examples/src/lib.rs b/examples/src/lib.rs new file mode 100644 index 0000000000..1a55631097 --- /dev/null +++ b/examples/src/lib.rs @@ -0,0 +1,29 @@ +pub mod framework; +pub mod utils; + +pub mod boids; +pub mod bunnymark; +pub mod conservative_raster; +pub mod cube; +pub mod hello; +pub mod hello_compute; +pub mod hello_synchronization; +pub mod hello_triangle; +pub mod hello_windows; +pub mod hello_workgroups; +pub mod mipmap; +pub mod msaa_line; +pub mod render_to_texture; +pub mod repeated_compute; +pub mod shadow; +pub mod skybox; +pub mod srgb_blend; +pub mod stencil_triangles; +pub mod storage_texture; +pub mod texture_arrays; +pub mod timestamp_queries; +pub mod uniform_values; +pub mod water; + +#[cfg(test)] +wgpu_test::gpu_test_main!(); diff --git a/examples/src/main.rs b/examples/src/main.rs new file mode 100644 index 0000000000..ec863827ae --- /dev/null +++ b/examples/src/main.rs @@ -0,0 +1,112 @@ +const EXAMPLES: &[(&str, fn())] = &[ + ("boids", wgpu_examples::boids::main), + ("bunnymark", wgpu_examples::bunnymark::main), + ( + "conservative_raster", + wgpu_examples::conservative_raster::main, + ), + ("cube", wgpu_examples::cube::main), + ("hello", wgpu_examples::hello::main), + ("hello_compute", wgpu_examples::hello_compute::main), + ( + "hello_synchronization", + wgpu_examples::hello_synchronization::main, + ), + ("hello_triangle", wgpu_examples::hello_triangle::main), + ("hello_windows", wgpu_examples::hello_windows::main), + ("hello_workgroups", wgpu_examples::hello_workgroups::main), + ("mipmap", wgpu_examples::mipmap::main), + ("msaa_line", wgpu_examples::msaa_line::main), + ("render_to_texture", wgpu_examples::render_to_texture::main), + ("repeated_compute", wgpu_examples::repeated_compute::main), + ("shadow", wgpu_examples::shadow::main), + ("skybox", wgpu_examples::skybox::main), + ("srgb_blend", wgpu_examples::srgb_blend::main), + ("stencil_triangles", wgpu_examples::stencil_triangles::main), + ("storage_texture", wgpu_examples::storage_texture::main), + ("texture_arrays", wgpu_examples::texture_arrays::main), + ("timestamp_queries", wgpu_examples::timestamp_queries::main), + ("uniform_values", wgpu_examples::uniform_values::main), + ("water", wgpu_examples::water::main), +]; + +fn get_example_name() -> Option { + cfg_if::cfg_if! { + if #[cfg(target_arch = "wasm32")] { + let query_string = web_sys::window()?.location().search().ok()?; + + wgpu_examples::framework::parse_url_query_string(&query_string, "example").map(String::from) + } else { + std::env::args().nth(1) + } + } +} + +fn print_unknown_example(result: Option) { + cfg_if::cfg_if! { + if #[cfg(target_arch = "wasm32")] { + use wasm_bindgen::JsCast; + use web_sys::HtmlStyleElement; + + // Get the document, header, and body elements. + let document = web_sys::window().unwrap().document().unwrap(); + let head = document.head().unwrap(); + let body = document.body().unwrap(); + + // Add a basic style sheet to center the text and remove some margin. + let style_sheet: HtmlStyleElement = document.create_element("style").unwrap().dyn_into().unwrap(); + style_sheet.set_inner_text("div { text-align: center; } p { margin: 4px }"); + head.append_child(&style_sheet).unwrap(); + + // A div to provide a container and some padding. + let div = document.create_element("div").unwrap(); + body.append_child(&div).unwrap(); + + let user_message = if let Some(example) = result { + format!("Unknown example: {example}. Please choose an example!") + } else { + String::from("Please choose an example!") + }; + + // A header to display the message to the user. + let header = document.create_element("h1").unwrap(); + header.set_text_content(Some(&user_message)); + div.append_child(&header).unwrap(); + + // Write a link for each example, wrapped in a paragraph. + for (name, _) in EXAMPLES { + let paragraph = document.create_element("p").unwrap(); + let link = document.create_element("a").unwrap(); + link.set_text_content(Some(name)); + link.set_attribute("href", &format!("?example={name}")).unwrap(); + paragraph.append_child(&link).unwrap(); + div.append_child(¶graph).unwrap(); + } + } else { + if let Some(example) = result { + println!("Unknown example: {}", example); + } else { + println!("Please specify an example as the first argument!"); + } + + println!("\nAvailable Examples:"); + for (name, _) in EXAMPLES { + println!("\t{name}"); + } + } + } +} + +fn main() { + let Some(example) = get_example_name() else { + print_unknown_example(None); + return; + }; + + let Some((_, function)) = EXAMPLES.iter().find(|(name, _)| *name == example) else { + print_unknown_example(Some(example)); + return; + }; + + function(); +} diff --git a/examples/mipmap/README.md b/examples/src/mipmap/README.md similarity index 100% rename from examples/mipmap/README.md rename to examples/src/mipmap/README.md diff --git a/examples/mipmap/src/blit.wgsl b/examples/src/mipmap/blit.wgsl similarity index 100% rename from examples/mipmap/src/blit.wgsl rename to examples/src/mipmap/blit.wgsl diff --git a/examples/mipmap/src/draw.wgsl b/examples/src/mipmap/draw.wgsl similarity index 100% rename from examples/mipmap/src/draw.wgsl rename to examples/src/mipmap/draw.wgsl diff --git a/examples/mipmap/src/main.rs b/examples/src/mipmap/mod.rs similarity index 94% rename from examples/mipmap/src/main.rs rename to examples/src/mipmap/mod.rs index 44de83560d..68d04d6706 100644 --- a/examples/mipmap/src/main.rs +++ b/examples/src/mipmap/mod.rs @@ -204,7 +204,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn optional_features() -> wgpu::Features { QUERY_FEATURES } @@ -500,38 +500,32 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("mipmap"); +pub fn main() { + crate::framework::run::("mipmap"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "mipmap", - image_path: "/examples/mipmap/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.02)], - _phantom: std::marker::PhantomData::, - }; +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "mipmap", + image_path: "/examples/src/mipmap/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.02)], + _phantom: std::marker::PhantomData::, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_QUERY: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "mipmap-query", - image_path: "/examples/mipmap/screenshot-query.png", - width: 1024, - height: 768, - optional_features: QUERY_FEATURES, - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.025)], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST_QUERY: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "mipmap-query", + image_path: "/examples/src/mipmap/screenshot-query.png", + width: 1024, + height: 768, + optional_features: QUERY_FEATURES, + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.025)], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/mipmap/screenshot-query.png b/examples/src/mipmap/screenshot-query.png similarity index 100% rename from examples/mipmap/screenshot-query.png rename to examples/src/mipmap/screenshot-query.png diff --git a/examples/mipmap/screenshot.png b/examples/src/mipmap/screenshot.png similarity index 100% rename from examples/mipmap/screenshot.png rename to examples/src/mipmap/screenshot.png diff --git a/examples/msaa-line/README.md b/examples/src/msaa_line/README.md similarity index 100% rename from examples/msaa-line/README.md rename to examples/src/msaa_line/README.md diff --git a/examples/msaa-line/src/main.rs b/examples/src/msaa_line/mod.rs similarity index 91% rename from examples/msaa-line/src/main.rs rename to examples/src/msaa_line/mod.rs index c9ab36b4e8..595bcbf17a 100644 --- a/examples/msaa-line/src/main.rs +++ b/examples/src/msaa_line/mod.rs @@ -120,7 +120,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn optional_features() -> wgpu::Features { wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES } @@ -313,32 +313,27 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("msaa-line"); +pub fn main() { + crate::framework::run::("msaa-line"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "msaa-line", - image_path: "/examples/msaa-line/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES, - base_test_parameters: wgpu_test::TestParameters::default(), - // There's a lot of natural variance so we check the weighted median too to differentiate - // real failures from variance. - comparisons: &[ - wgpu_test::ComparisonType::Mean(0.065), - wgpu_test::ComparisonType::Percentile { - percentile: 0.5, - threshold: 0.29, - }, - ], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "msaa-line", + image_path: "/examples/src/msaa_line/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES, + base_test_parameters: wgpu_test::TestParameters::default(), + // There's a lot of natural variance so we check the weighted median too to differentiate + // real failures from variance. + comparisons: &[ + wgpu_test::ComparisonType::Mean(0.065), + wgpu_test::ComparisonType::Percentile { + percentile: 0.5, + threshold: 0.29, + }, + ], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/msaa-line/screenshot.png b/examples/src/msaa_line/screenshot.png similarity index 100% rename from examples/msaa-line/screenshot.png rename to examples/src/msaa_line/screenshot.png diff --git a/examples/msaa-line/src/shader.wgsl b/examples/src/msaa_line/shader.wgsl similarity index 100% rename from examples/msaa-line/src/shader.wgsl rename to examples/src/msaa_line/shader.wgsl diff --git a/examples/render-to-texture/README.md b/examples/src/render_to_texture/README.md similarity index 100% rename from examples/render-to-texture/README.md rename to examples/src/render_to_texture/README.md diff --git a/examples/render-to-texture/src/main.rs b/examples/src/render_to_texture/mod.rs similarity index 98% rename from examples/render-to-texture/src/main.rs rename to examples/src/render_to_texture/mod.rs index cc0a191132..87ab19f6cf 100644 --- a/examples/render-to-texture/src/main.rs +++ b/examples/src/render_to_texture/mod.rs @@ -1,7 +1,7 @@ #[cfg(not(target_arch = "wasm32"))] -use wgpu_example::utils::output_image_native; +use crate::utils::output_image_native; #[cfg(target_arch = "wasm32")] -use wgpu_example::utils::output_image_wasm; +use crate::utils::output_image_wasm; const TEXTURE_DIMS: (usize, usize) = (512, 512); @@ -148,7 +148,7 @@ async fn run(_path: Option) { log::info!("Done."); } -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::builder() diff --git a/examples/render-to-texture/src/shader.wgsl b/examples/src/render_to_texture/shader.wgsl similarity index 100% rename from examples/render-to-texture/src/shader.wgsl rename to examples/src/render_to_texture/shader.wgsl diff --git a/examples/repeated-compute/README.md b/examples/src/repeated_compute/README.md similarity index 100% rename from examples/repeated-compute/README.md rename to examples/src/repeated_compute/README.md diff --git a/examples/repeated-compute/src/main.rs b/examples/src/repeated_compute/mod.rs similarity index 99% rename from examples/repeated-compute/src/main.rs rename to examples/src/repeated_compute/mod.rs index 4795756e93..3e22111ad0 100644 --- a/examples/repeated-compute/src/main.rs +++ b/examples/src/repeated_compute/mod.rs @@ -126,7 +126,7 @@ async fn compute(local_buffer: &mut [u32], context: &WgpuContext) { context.output_staging_buffer.unmap(); } -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::builder() @@ -140,7 +140,7 @@ fn main() { std::panic::set_hook(Box::new(console_error_panic_hook::hook)); console_log::init_with_level(log::Level::Info).expect("could not initialize logger"); - wgpu_example::utils::add_web_nothing_to_see_msg(); + crate::utils::add_web_nothing_to_see_msg(); wasm_bindgen_futures::spawn_local(run()); } diff --git a/examples/repeated-compute/src/shader.wgsl b/examples/src/repeated_compute/shader.wgsl similarity index 100% rename from examples/repeated-compute/src/shader.wgsl rename to examples/src/repeated_compute/shader.wgsl diff --git a/examples/shadow/README.md b/examples/src/shadow/README.md similarity index 100% rename from examples/shadow/README.md rename to examples/src/shadow/README.md diff --git a/examples/shadow/src/main.rs b/examples/src/shadow/mod.rs similarity index 97% rename from examples/shadow/src/main.rs rename to examples/src/shadow/mod.rs index 401860781c..485d0d78d6 100644 --- a/examples/shadow/src/main.rs +++ b/examples/src/shadow/mod.rs @@ -201,7 +201,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn optional_features() -> wgpu::Features { wgpu::Features::DEPTH_CLIP_CONTROL } @@ -834,30 +834,25 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("shadow"); +pub fn main() { + crate::framework::run::("shadow"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "shadow", - image_path: "/examples/shadow/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default() - .downlevel_flags(wgpu::DownlevelFlags::COMPARISON_SAMPLERS) - // rpi4 on VK doesn't work: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3916 - .expect_fail(wgpu_test::FailureCase::backend_adapter( - wgpu::Backends::VULKAN, - "V3D", - )), - comparisons: &[wgpu_test::ComparisonType::Mean(0.02)], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "shadow", + image_path: "/examples/src/shadow/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default() + .downlevel_flags(wgpu::DownlevelFlags::COMPARISON_SAMPLERS) + // rpi4 on VK doesn't work: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3916 + .expect_fail(wgpu_test::FailureCase::backend_adapter( + wgpu::Backends::VULKAN, + "V3D", + )), + comparisons: &[wgpu_test::ComparisonType::Mean(0.02)], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/shadow/screenshot.png b/examples/src/shadow/screenshot.png similarity index 100% rename from examples/shadow/screenshot.png rename to examples/src/shadow/screenshot.png diff --git a/examples/shadow/src/shader.wgsl b/examples/src/shadow/shader.wgsl similarity index 100% rename from examples/shadow/src/shader.wgsl rename to examples/src/shadow/shader.wgsl diff --git a/examples/skybox/README.md b/examples/src/skybox/README.md similarity index 100% rename from examples/skybox/README.md rename to examples/src/skybox/README.md diff --git a/examples/skybox/images/astc.dds b/examples/src/skybox/images/astc.dds similarity index 100% rename from examples/skybox/images/astc.dds rename to examples/src/skybox/images/astc.dds diff --git a/examples/skybox/images/bc1.dds b/examples/src/skybox/images/bc1.dds similarity index 100% rename from examples/skybox/images/bc1.dds rename to examples/src/skybox/images/bc1.dds diff --git a/examples/skybox/images/bgra.dds b/examples/src/skybox/images/bgra.dds similarity index 100% rename from examples/skybox/images/bgra.dds rename to examples/src/skybox/images/bgra.dds diff --git a/examples/skybox/images/etc2.dds b/examples/src/skybox/images/etc2.dds similarity index 100% rename from examples/skybox/images/etc2.dds rename to examples/src/skybox/images/etc2.dds diff --git a/examples/skybox/src/main.rs b/examples/src/skybox/mod.rs similarity index 86% rename from examples/skybox/src/main.rs rename to examples/src/skybox/mod.rs index b74b24ce51..3bb969dcfc 100644 --- a/examples/skybox/src/main.rs +++ b/examples/src/skybox/mod.rs @@ -89,7 +89,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn optional_features() -> wgpu::Features { wgpu::Features::TEXTURE_COMPRESSION_ASTC | wgpu::Features::TEXTURE_COMPRESSION_ETC2 @@ -104,7 +104,7 @@ impl wgpu_example::framework::Example for Example { ) -> Self { let mut entities = Vec::new(); { - let source = include_bytes!("../models/teslacyberv3.0.obj"); + let source = include_bytes!("models/teslacyberv3.0.obj"); let data = obj::ObjData::load_buf(&source[..]).unwrap(); let mut vertices = Vec::new(); for object in data.objects { @@ -306,10 +306,10 @@ impl wgpu_example::framework::Example for Example { wgpu::TextureFormat::Astc { block: AstcBlock::B4x4, channel: AstcChannel::UnormSrgb, - } => &include_bytes!("../images/astc.dds")[..], - wgpu::TextureFormat::Etc2Rgb8UnormSrgb => &include_bytes!("../images/etc2.dds")[..], - wgpu::TextureFormat::Bc1RgbaUnormSrgb => &include_bytes!("../images/bc1.dds")[..], - wgpu::TextureFormat::Bgra8UnormSrgb => &include_bytes!("../images/bgra.dds")[..], + } => &include_bytes!("images/astc.dds")[..], + wgpu::TextureFormat::Etc2Rgb8UnormSrgb => &include_bytes!("images/etc2.dds")[..], + wgpu::TextureFormat::Bc1RgbaUnormSrgb => &include_bytes!("images/bc1.dds")[..], + wgpu::TextureFormat::Bgra8UnormSrgb => &include_bytes!("images/bgra.dds")[..], _ => unreachable!(), }; @@ -455,68 +455,60 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("skybox"); +pub fn main() { + crate::framework::run::("skybox"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "skybox", - image_path: "/examples/skybox/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default().expect_fail( - wgpu_test::FailureCase::backend_adapter(wgpu::Backends::GL, "ANGLE"), - ), - comparisons: &[wgpu_test::ComparisonType::Mean(0.015)], - _phantom: std::marker::PhantomData::, - }; +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "skybox", + image_path: "/examples/src/skybox/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default().expect_fail( + wgpu_test::FailureCase::backend_adapter(wgpu::Backends::GL, "ANGLE"), + ), + comparisons: &[wgpu_test::ComparisonType::Mean(0.015)], + _phantom: std::marker::PhantomData::, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_BCN: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "skybox-bc1", - image_path: "/examples/skybox/screenshot-bc1.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::TEXTURE_COMPRESSION_BC, - base_test_parameters: wgpu_test::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 - comparisons: &[wgpu_test::ComparisonType::Mean(0.02)], - _phantom: std::marker::PhantomData::, - }; +static TEST_BCN: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "skybox-bc1", + image_path: "/examples/src/skybox/screenshot-bc1.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::TEXTURE_COMPRESSION_BC, + base_test_parameters: wgpu_test::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 + comparisons: &[wgpu_test::ComparisonType::Mean(0.02)], + _phantom: std::marker::PhantomData::, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_ETC2: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "skybox-etc2", - image_path: "/examples/skybox/screenshot-etc2.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::TEXTURE_COMPRESSION_ETC2, - base_test_parameters: wgpu_test::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 - comparisons: &[wgpu_test::ComparisonType::Mean(0.015)], - _phantom: std::marker::PhantomData::, - }; +static TEST_ETC2: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "skybox-etc2", + image_path: "/examples/src/skybox/screenshot-etc2.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::TEXTURE_COMPRESSION_ETC2, + base_test_parameters: wgpu_test::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 + comparisons: &[wgpu_test::ComparisonType::Mean(0.015)], + _phantom: std::marker::PhantomData::, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_ASTC: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "skybox-astc", - image_path: "/examples/skybox/screenshot-astc.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::TEXTURE_COMPRESSION_ASTC, - base_test_parameters: wgpu_test::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 - comparisons: &[wgpu_test::ComparisonType::Mean(0.016)], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST_ASTC: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "skybox-astc", + image_path: "/examples/src/skybox/screenshot-astc.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::TEXTURE_COMPRESSION_ASTC, + base_test_parameters: wgpu_test::TestParameters::default(), // https://bugs.chromium.org/p/angleproject/issues/detail?id=7056 + comparisons: &[wgpu_test::ComparisonType::Mean(0.016)], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/skybox/models/teslacyberv3.0.mtl b/examples/src/skybox/models/teslacyberv3.0.mtl similarity index 100% rename from examples/skybox/models/teslacyberv3.0.mtl rename to examples/src/skybox/models/teslacyberv3.0.mtl diff --git a/examples/skybox/models/teslacyberv3.0.obj b/examples/src/skybox/models/teslacyberv3.0.obj similarity index 100% rename from examples/skybox/models/teslacyberv3.0.obj rename to examples/src/skybox/models/teslacyberv3.0.obj diff --git a/examples/skybox/screenshot-astc.png b/examples/src/skybox/screenshot-astc.png similarity index 100% rename from examples/skybox/screenshot-astc.png rename to examples/src/skybox/screenshot-astc.png diff --git a/examples/skybox/screenshot-bc1.png b/examples/src/skybox/screenshot-bc1.png similarity index 100% rename from examples/skybox/screenshot-bc1.png rename to examples/src/skybox/screenshot-bc1.png diff --git a/examples/skybox/screenshot-etc2.png b/examples/src/skybox/screenshot-etc2.png similarity index 100% rename from examples/skybox/screenshot-etc2.png rename to examples/src/skybox/screenshot-etc2.png diff --git a/examples/skybox/screenshot.png b/examples/src/skybox/screenshot.png similarity index 100% rename from examples/skybox/screenshot.png rename to examples/src/skybox/screenshot.png diff --git a/examples/skybox/src/shader.wgsl b/examples/src/skybox/shader.wgsl similarity index 100% rename from examples/skybox/src/shader.wgsl rename to examples/src/skybox/shader.wgsl diff --git a/examples/srgb-blend/README.md b/examples/src/srgb_blend/README.md similarity index 100% rename from examples/srgb-blend/README.md rename to examples/src/srgb_blend/README.md diff --git a/examples/srgb-blend/src/main.rs b/examples/src/srgb_blend/mod.rs similarity index 83% rename from examples/srgb-blend/src/main.rs rename to examples/src/srgb_blend/mod.rs index 4c328facc1..803a43a1c2 100644 --- a/examples/srgb-blend/src/main.rs +++ b/examples/src/srgb_blend/mod.rs @@ -56,7 +56,7 @@ struct Example { pipeline: wgpu::RenderPipeline, } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { const SRGB: bool = SRGB; fn optional_features() -> wgpu::Features { @@ -211,46 +211,40 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { +pub fn main() { let mut args = std::env::args(); args.next(); if Some("linear") == args.next().as_deref() { - wgpu_example::framework::run::>("srgb-blend-linear"); + crate::framework::run::>("srgb-blend-linear"); } else { - wgpu_example::framework::run::>("srgb-blend-srg"); + crate::framework::run::>("srgb-blend-srg"); } } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_SRGB: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "srgb-blend-srg", - // Generated on WARP/Windows - image_path: "/examples/srgb-blend/screenshot-srgb.png", - width: 192, - height: 192, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.04)], - _phantom: std::marker::PhantomData::>, - }; +static TEST_SRGB: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "srgb-blend-srg", + // Generated on WARP/Windows + image_path: "/examples/src/srgb_blend/screenshot-srgb.png", + width: 192, + height: 192, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.04)], + _phantom: std::marker::PhantomData::>, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_LINEAR: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "srgb-blend-linear", - // Generated on WARP/Windows - image_path: "/examples/srgb-blend/screenshot-linear.png", - width: 192, - height: 192, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.04)], - _phantom: std::marker::PhantomData::>, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST_LINEAR: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "srgb-blend-linear", + // Generated on WARP/Windows + image_path: "/examples/src/srgb_blend/screenshot-linear.png", + width: 192, + height: 192, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.04)], + _phantom: std::marker::PhantomData::>, +}; diff --git a/examples/srgb-blend/screenshot-linear.png b/examples/src/srgb_blend/screenshot-linear.png similarity index 100% rename from examples/srgb-blend/screenshot-linear.png rename to examples/src/srgb_blend/screenshot-linear.png diff --git a/examples/srgb-blend/screenshot-srgb.png b/examples/src/srgb_blend/screenshot-srgb.png similarity index 100% rename from examples/srgb-blend/screenshot-srgb.png rename to examples/src/srgb_blend/screenshot-srgb.png diff --git a/examples/srgb-blend/src/shader.wgsl b/examples/src/srgb_blend/shader.wgsl similarity index 100% rename from examples/srgb-blend/src/shader.wgsl rename to examples/src/srgb_blend/shader.wgsl diff --git a/examples/stencil-triangles/README.md b/examples/src/stencil_triangles/README.md similarity index 100% rename from examples/stencil-triangles/README.md rename to examples/src/stencil_triangles/README.md diff --git a/examples/stencil-triangles/src/main.rs b/examples/src/stencil_triangles/mod.rs similarity index 92% rename from examples/stencil-triangles/src/main.rs rename to examples/src/stencil_triangles/mod.rs index 554c60812e..6e2ccfa51e 100644 --- a/examples/stencil-triangles/src/main.rs +++ b/examples/src/stencil_triangles/mod.rs @@ -23,7 +23,7 @@ struct Example { stencil_buffer: wgpu::Texture, } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn init( config: &wgpu::SurfaceConfiguration, _adapter: &wgpu::Adapter, @@ -224,24 +224,19 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("stencil-triangles"); +pub fn main() { + crate::framework::run::("stencil-triangles"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "stencil-triangles", - image_path: "/examples/stencil-triangles/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.03)], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "stencil-triangles", + image_path: "/examples/src/stencil_triangles/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.03)], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/stencil-triangles/screenshot.png b/examples/src/stencil_triangles/screenshot.png similarity index 100% rename from examples/stencil-triangles/screenshot.png rename to examples/src/stencil_triangles/screenshot.png diff --git a/examples/stencil-triangles/src/shader.wgsl b/examples/src/stencil_triangles/shader.wgsl similarity index 100% rename from examples/stencil-triangles/src/shader.wgsl rename to examples/src/stencil_triangles/shader.wgsl diff --git a/examples/storage-texture/README.md b/examples/src/storage_texture/README.md similarity index 100% rename from examples/storage-texture/README.md rename to examples/src/storage_texture/README.md diff --git a/examples/storage-texture/example.png b/examples/src/storage_texture/example.png similarity index 100% rename from examples/storage-texture/example.png rename to examples/src/storage_texture/example.png diff --git a/examples/storage-texture/src/main.rs b/examples/src/storage_texture/mod.rs similarity index 98% rename from examples/storage-texture/src/main.rs rename to examples/src/storage_texture/mod.rs index 2e35970123..bc17b7e555 100644 --- a/examples/storage-texture/src/main.rs +++ b/examples/src/storage_texture/mod.rs @@ -15,9 +15,9 @@ //! repeated-compute for code that is more thoroughly commented. #[cfg(not(target_arch = "wasm32"))] -use wgpu_example::utils::output_image_native; +use crate::utils::output_image_native; #[cfg(target_arch = "wasm32")] -use wgpu_example::utils::output_image_wasm; +use crate::utils::output_image_wasm; const TEXTURE_DIMS: (usize, usize) = (512, 512); @@ -160,7 +160,7 @@ async fn run(_path: Option) { log::info!("Done.") } -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::builder() diff --git a/examples/storage-texture/src/shader.wgsl b/examples/src/storage_texture/shader.wgsl similarity index 100% rename from examples/storage-texture/src/shader.wgsl rename to examples/src/storage_texture/shader.wgsl diff --git a/examples/texture-arrays/src/indexing.wgsl b/examples/src/texture_arrays/indexing.wgsl similarity index 100% rename from examples/texture-arrays/src/indexing.wgsl rename to examples/src/texture_arrays/indexing.wgsl diff --git a/examples/texture-arrays/src/main.rs b/examples/src/texture_arrays/mod.rs similarity index 91% rename from examples/texture-arrays/src/main.rs rename to examples/src/texture_arrays/mod.rs index 634f7d9605..d4fed29efc 100644 --- a/examples/texture-arrays/src/main.rs +++ b/examples/src/texture_arrays/mod.rs @@ -70,7 +70,7 @@ struct Example { uniform_workaround: bool, } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn optional_features() -> wgpu::Features { wgpu::Features::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING } @@ -400,45 +400,42 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("texture-arrays"); +pub fn main() { + crate::framework::run::("texture-arrays"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "texture-arrays", - image_path: "/examples/texture-arrays/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::empty(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.0)], - _phantom: std::marker::PhantomData::, - }; +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "texture-arrays", + image_path: "/examples/src/texture_arrays/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::empty(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.0)], + _phantom: std::marker::PhantomData::, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_UNIFORM: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "texture-arrays-uniform", - image_path: "/examples/texture-arrays/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::empty(), - base_test_parameters: wgpu_test::TestParameters::default(), - comparisons: &[wgpu_test::ComparisonType::Mean(0.0)], - _phantom: std::marker::PhantomData::, - }; +static TEST_UNIFORM: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "texture-arrays-uniform", + image_path: "/examples/src/texture_arrays/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::empty(), + base_test_parameters: wgpu_test::TestParameters::default(), + comparisons: &[wgpu_test::ComparisonType::Mean(0.0)], + _phantom: std::marker::PhantomData::, +}; #[cfg(test)] #[wgpu_test::gpu_test] -static TEST_NON_UNIFORM: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { +static TEST_NON_UNIFORM: crate::framework::ExampleTestParams = + crate::framework::ExampleTestParams { name: "texture-arrays-non-uniform", - image_path: "/examples/texture-arrays/screenshot.png", + image_path: "/examples/src/texture_arrays/screenshot.png", width: 1024, height: 768, optional_features: @@ -447,6 +444,3 @@ static TEST_NON_UNIFORM: wgpu_example::framework::ExampleTestParams = comparisons: &[wgpu_test::ComparisonType::Mean(0.0)], _phantom: std::marker::PhantomData::, }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); diff --git a/examples/texture-arrays/src/non_uniform_indexing.wgsl b/examples/src/texture_arrays/non_uniform_indexing.wgsl similarity index 100% rename from examples/texture-arrays/src/non_uniform_indexing.wgsl rename to examples/src/texture_arrays/non_uniform_indexing.wgsl diff --git a/examples/texture-arrays/screenshot.png b/examples/src/texture_arrays/screenshot.png similarity index 100% rename from examples/texture-arrays/screenshot.png rename to examples/src/texture_arrays/screenshot.png diff --git a/examples/timestamp-queries/README.md b/examples/src/timestamp_queries/README.md similarity index 100% rename from examples/timestamp-queries/README.md rename to examples/src/timestamp_queries/README.md diff --git a/examples/timestamp-queries/src/main.rs b/examples/src/timestamp_queries/mod.rs similarity index 99% rename from examples/timestamp-queries/src/main.rs rename to examples/src/timestamp_queries/mod.rs index b10d54cc70..0f53d18b34 100644 --- a/examples/timestamp-queries/src/main.rs +++ b/examples/src/timestamp_queries/mod.rs @@ -405,8 +405,7 @@ fn render_pass( rpass.draw(0..3, 0..1); } -#[cfg(not(test))] -fn main() { +pub fn main() { #[cfg(not(target_arch = "wasm32"))] { env_logger::init(); @@ -420,14 +419,11 @@ fn main() { } } -#[cfg(test)] -wgpu_test::gpu_test_main!(); - #[cfg(test)] mod tests { use wgpu_test::{gpu_test, GpuTestConfiguration}; - use crate::{submit_render_and_compute_pass_with_queries, QueryResults}; + use super::{submit_render_and_compute_pass_with_queries, QueryResults}; #[gpu_test] static TIMESTAMPS_ENCODER: GpuTestConfiguration = GpuTestConfiguration::new() diff --git a/examples/timestamp-queries/src/shader.wgsl b/examples/src/timestamp_queries/shader.wgsl similarity index 100% rename from examples/timestamp-queries/src/shader.wgsl rename to examples/src/timestamp_queries/shader.wgsl diff --git a/examples/uniform-values/README.md b/examples/src/uniform_values/README.md similarity index 100% rename from examples/uniform-values/README.md rename to examples/src/uniform_values/README.md diff --git a/examples/uniform-values/src/main.rs b/examples/src/uniform_values/mod.rs similarity index 99% rename from examples/uniform-values/src/main.rs rename to examples/src/uniform_values/mod.rs index c8895bef66..2d26dc7b3a 100644 --- a/examples/uniform-values/src/main.rs +++ b/examples/src/uniform_values/mod.rs @@ -5,7 +5,7 @@ //! 3. the bind group that will bind the uniform buffer and it's layout are created. //! 4. the bind group layout is attached to the pipeline layout. //! 5. the uniform buffer and the bind group are stored alongside the pipeline. -//! 6. an instance of [`AppState`] is created. This variable will be modified +//! 6. an instance of `AppState` is created. This variable will be modified //! to change parameters in the shader and modified by app events to preform and save //! those changes. //! 7. (7a and 7b) the `state` variable created at (6) is modified by commands such @@ -345,7 +345,7 @@ async fn run(event_loop: EventLoop<()>, window: Arc) { .unwrap(); } -fn main() { +pub fn main() { let event_loop = EventLoop::new().unwrap(); let window = winit::window::WindowBuilder::new() .with_title("Remember: Use U/D to change sample count!") diff --git a/examples/uniform-values/screenshot1.png b/examples/src/uniform_values/screenshot1.png similarity index 100% rename from examples/uniform-values/screenshot1.png rename to examples/src/uniform_values/screenshot1.png diff --git a/examples/uniform-values/screenshot2.png b/examples/src/uniform_values/screenshot2.png similarity index 100% rename from examples/uniform-values/screenshot2.png rename to examples/src/uniform_values/screenshot2.png diff --git a/examples/uniform-values/screenshot3.png b/examples/src/uniform_values/screenshot3.png similarity index 100% rename from examples/uniform-values/screenshot3.png rename to examples/src/uniform_values/screenshot3.png diff --git a/examples/uniform-values/src/shader.wgsl b/examples/src/uniform_values/shader.wgsl similarity index 100% rename from examples/uniform-values/src/shader.wgsl rename to examples/src/uniform_values/shader.wgsl diff --git a/examples/common/src/utils.rs b/examples/src/utils.rs similarity index 100% rename from examples/common/src/utils.rs rename to examples/src/utils.rs diff --git a/examples/water/README.md b/examples/src/water/README.md similarity index 100% rename from examples/water/README.md rename to examples/src/water/README.md diff --git a/examples/water/src/main.rs b/examples/src/water/mod.rs similarity index 97% rename from examples/water/src/main.rs rename to examples/src/water/mod.rs index 2b25415911..e1a80b1e4f 100644 --- a/examples/water/src/main.rs +++ b/examples/src/water/mod.rs @@ -265,7 +265,7 @@ impl Example { } } -impl wgpu_example::framework::Example for Example { +impl crate::framework::Example for Example { fn init( config: &wgpu::SurfaceConfiguration, _adapter: &wgpu::Adapter, @@ -813,25 +813,20 @@ impl wgpu_example::framework::Example for Example { } } -#[cfg(not(test))] -fn main() { - wgpu_example::framework::run::("water"); +pub fn main() { + crate::framework::run::("water"); } #[cfg(test)] #[wgpu_test::gpu_test] -static TEST: wgpu_example::framework::ExampleTestParams = - wgpu_example::framework::ExampleTestParams { - name: "water", - image_path: "/examples/water/screenshot.png", - width: 1024, - height: 768, - optional_features: wgpu::Features::default(), - base_test_parameters: wgpu_test::TestParameters::default() - .downlevel_flags(wgpu::DownlevelFlags::READ_ONLY_DEPTH_STENCIL), - comparisons: &[wgpu_test::ComparisonType::Mean(0.01)], - _phantom: std::marker::PhantomData::, - }; - -#[cfg(test)] -wgpu_test::gpu_test_main!(); +static TEST: crate::framework::ExampleTestParams = crate::framework::ExampleTestParams { + name: "water", + image_path: "/examples/src/water/screenshot.png", + width: 1024, + height: 768, + optional_features: wgpu::Features::default(), + base_test_parameters: wgpu_test::TestParameters::default() + .downlevel_flags(wgpu::DownlevelFlags::READ_ONLY_DEPTH_STENCIL), + comparisons: &[wgpu_test::ComparisonType::Mean(0.01)], + _phantom: std::marker::PhantomData::, +}; diff --git a/examples/water/src/point_gen.rs b/examples/src/water/point_gen.rs similarity index 100% rename from examples/water/src/point_gen.rs rename to examples/src/water/point_gen.rs diff --git a/examples/water/screenshot.png b/examples/src/water/screenshot.png similarity index 100% rename from examples/water/screenshot.png rename to examples/src/water/screenshot.png diff --git a/examples/water/src/terrain.wgsl b/examples/src/water/terrain.wgsl similarity index 100% rename from examples/water/src/terrain.wgsl rename to examples/src/water/terrain.wgsl diff --git a/examples/water/src/water.wgsl b/examples/src/water/water.wgsl similarity index 100% rename from examples/water/src/water.wgsl rename to examples/src/water/water.wgsl diff --git a/examples/srgb-blend/Cargo.toml b/examples/srgb-blend/Cargo.toml deleted file mode 100644 index d21fbcee0f..0000000000 --- a/examples/srgb-blend/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "wgpu-srgb-blend-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu sRGB blend example" -publish = false - -[[bin]] -name = "srgb-blend" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -glam.workspace = true -wasm-bindgen-test.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true diff --git a/examples/stencil-triangles/Cargo.toml b/examples/stencil-triangles/Cargo.toml deleted file mode 100644 index 091523cb63..0000000000 --- a/examples/stencil-triangles/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "wgpu-stencil-triangle-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu stencil triangles example" -publish = false - -[[bin]] -name = "stencil-triangles" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/examples/storage-texture/Cargo.toml b/examples/storage-texture/Cargo.toml deleted file mode 100644 index 8df9bdab8e..0000000000 --- a/examples/storage-texture/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[package] -name = "wgpu-storage-texture-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu storage texture example" -publish = false - -[[bin]] -name = "storage-texture" -path = "src/main.rs" - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -futures-intrusive.workspace = true -log.workspace = true -pollster.workspace = true -wgpu.workspace = true -wgpu-example.workspace = true - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -png.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen.workspace = true -wasm-bindgen-futures.workspace = true -web-sys = { workspace = true, features = [ - "HtmlCanvasElement", "Document", "CanvasRenderingContext2d", "Window", "ImageData", - "HtmlImageElement" -] } - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/examples/texture-arrays/Cargo.toml b/examples/texture-arrays/Cargo.toml deleted file mode 100644 index 50d242b90b..0000000000 --- a/examples/texture-arrays/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "wgpu-texture-arrays-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu texture arrays example" -publish = false - -[[bin]] -name = "texture-arrays" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/examples/timestamp-queries/Cargo.toml b/examples/timestamp-queries/Cargo.toml deleted file mode 100644 index bbcc52e3e0..0000000000 --- a/examples/timestamp-queries/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "wgpu-timestamp-queries-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu timestamp query example" -publish = false - -[[bin]] -name = "timestamp-queries" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -env_logger.workspace = true -futures-intrusive.workspace = true -pollster.workspace = true -wgpu.workspace = true -winit.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -log.workspace = true -wasm-bindgen-futures.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/examples/uniform-values/Cargo.toml b/examples/uniform-values/Cargo.toml deleted file mode 100644 index 86e3b64a4b..0000000000 --- a/examples/uniform-values/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "wgpu-uniform-values-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu uniform vaules example" -publish = false - -[[bin]] -name = "uniform-values" -path = "src/main.rs" - -[dependencies] -encase = { version = "0.6.1", features = ["glam"] } -env_logger.workspace = true -glam = "0.24" -pollster.workspace = true -wgpu.workspace = true -winit.workspace = true - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -png.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dependencies] -console_error_panic_hook.workspace = true -console_log.workspace = true -wasm-bindgen-futures.workspace = true -web-sys.workspace = true diff --git a/examples/water/Cargo.toml b/examples/water/Cargo.toml deleted file mode 100644 index 2344496876..0000000000 --- a/examples/water/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "wgpu-water-example" -version.workspace = true -license.workspace = true -edition.workspace = true -description = "wgpu water example" -publish = false - -[[bin]] -name = "water" -path = "src/main.rs" -harness = false - -[dependencies] -bytemuck.workspace = true -nanorand.workspace = true -glam.workspace = true -noise.workspace = true -wgpu-example.workspace = true -wgpu.workspace = true -winit.workspace = true - -[dev-dependencies] -wgpu-test.workspace = true - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test.workspace = true \ No newline at end of file diff --git a/naga-cli/Cargo.toml b/naga-cli/Cargo.toml index b58170282c..ad58d03b57 100644 --- a/naga-cli/Cargo.toml +++ b/naga-cli/Cargo.toml @@ -8,6 +8,11 @@ repository = "https://github.com/gfx-rs/wgpu/tree/trunk/naga-cli" keywords = ["shader", "SPIR-V", "GLSL", "MSL"] license = "MIT OR Apache-2.0" +[[bin]] +name = "naga" +path = "src/bin/naga.rs" +test = false + [dependencies] bincode = "1" log = "0.4" diff --git a/naga/Cargo.toml b/naga/Cargo.toml index 3224133c91..20b5bd5d25 100644 --- a/naga/Cargo.toml +++ b/naga/Cargo.toml @@ -10,6 +10,11 @@ license = "MIT OR Apache-2.0" exclude = ["bin/**/*", "tests/**/*", "Cargo.lock", "target/**/*"] resolver = "2" rust-version = "1.65" +autotests = false + +[[test]] +name = "naga-test" +path = "tests/root.rs" [package.metadata.docs.rs] all-features = true diff --git a/naga/hlsl-snapshots/Cargo.toml b/naga/hlsl-snapshots/Cargo.toml index 39df45b5ed..09104adfbc 100644 --- a/naga/hlsl-snapshots/Cargo.toml +++ b/naga/hlsl-snapshots/Cargo.toml @@ -5,6 +5,11 @@ edition = "2021" publish = false license = "MIT OR Apache-2.0" +[lib] +name = "hlsl_snapshots" +path = "src/lib.rs" +test = false + [dependencies] anyhow = "1" nanoserde = "0.1.32" diff --git a/tests/tests/example_wgsl.rs b/naga/tests/example_wgsl.rs similarity index 100% rename from tests/tests/example_wgsl.rs rename to naga/tests/example_wgsl.rs diff --git a/naga/tests/root.rs b/naga/tests/root.rs new file mode 100644 index 0000000000..fece3ddd7e --- /dev/null +++ b/naga/tests/root.rs @@ -0,0 +1,4 @@ +mod example_wgsl; +mod snapshots; +mod spirv_capabilities; +mod wgsl_errors; diff --git a/naga/tests/spirv-capabilities.rs b/naga/tests/spirv_capabilities.rs similarity index 100% rename from naga/tests/spirv-capabilities.rs rename to naga/tests/spirv_capabilities.rs diff --git a/naga/tests/wgsl-errors.rs b/naga/tests/wgsl_errors.rs similarity index 100% rename from naga/tests/wgsl-errors.rs rename to naga/tests/wgsl_errors.rs diff --git a/player/Cargo.toml b/player/Cargo.toml index a379306ff8..8e05346e2c 100644 --- a/player/Cargo.toml +++ b/player/Cargo.toml @@ -10,6 +10,16 @@ keywords.workspace = true license.workspace = true publish = false +[lib] +name = "player" +path = "src/lib.rs" +test = false + +[[bin]] +name = "play" +path = "src/bin/play.rs" +test = false + [dependencies] env_logger.workspace = true log.workspace = true diff --git a/tests/Cargo.toml b/tests/Cargo.toml index f3096f7d92..f3d8a739bc 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -12,14 +12,10 @@ autotests = false publish = false [[test]] -name = "gpu-tests" -path = "tests/gpu.rs" +name = "wgpu-test" +path = "tests/root.rs" harness = false -[[test]] -name = "cpu-tests" -path = "tests/cpu.rs" - [features] webgl = ["wgpu/webgl"] diff --git a/tests/src/image.rs b/tests/src/image.rs index d555332bf7..3b075e710a 100644 --- a/tests/src/image.rs +++ b/tests/src/image.rs @@ -11,7 +11,7 @@ async fn read_png(path: impl AsRef, width: u32, height: u32) -> Option f, Err(e) => { log::warn!( - "image comparison invalid: file io error when comparing {}: {}", + "image comparison invalid: file io error when 3comparing {}: {}", path.as_ref().display(), e ); diff --git a/tests/tests/cpu.rs b/tests/tests/cpu.rs deleted file mode 100644 index e7858ddb07..0000000000 --- a/tests/tests/cpu.rs +++ /dev/null @@ -1 +0,0 @@ -mod example_wgsl; diff --git a/tests/tests/root.rs b/tests/tests/root.rs new file mode 100644 index 0000000000..fbb56a7b2f --- /dev/null +++ b/tests/tests/root.rs @@ -0,0 +1,40 @@ +mod regression { + mod issue_3349; + mod issue_3457; + mod issue_4024; + mod issue_4122; +} + +mod bgra8unorm_storage; +mod bind_group_layout_dedup; +mod buffer; +mod buffer_copy; +mod buffer_usages; +mod clear_texture; +mod create_surface_error; +mod device; +mod encoder; +mod external_texture; +mod instance; +mod life_cycle; +mod mem_leaks; +mod occlusion_query; +mod partially_bounded_arrays; +mod pipeline; +mod poll; +mod push_constants; +mod query_set; +mod queue_transfer; +mod resource_descriptor_accessor; +mod resource_error; +mod scissor_tests; +mod shader; +mod shader_primitive_index; +mod shader_view_format; +mod texture_bounds; +mod transfer; +mod vertex_indices; +mod write_texture; +mod zero_init_texture_after_discard; + +wgpu_test::gpu_test_main!();