diff --git a/Cargo.lock b/Cargo.lock index 80e6fe53..c0c61c4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,11 +31,6 @@ dependencies = [ "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "arrayref" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "arrayvec" version = "0.5.1" @@ -94,25 +89,11 @@ name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "block-buffer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bumpalo" version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "byte-tools" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "bytemuck" version = "1.2.0" @@ -123,14 +104,6 @@ name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "c2-chacha" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "calloop" version = "0.4.4" @@ -354,14 +327,6 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "digest" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "dispatch" version = "0.1.4" @@ -410,11 +375,6 @@ dependencies = [ "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "foreign-types" version = "0.3.2" @@ -436,8 +396,8 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "tobj 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -552,24 +512,6 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "generic-array" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "getrandom" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "gfx-auxil" version = "0.3.0" @@ -719,23 +661,13 @@ dependencies = [ "framework 0.1.0", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "tobj 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "glsl-to-spirv" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "hermit-abi" version = "0.1.6" @@ -1164,11 +1096,6 @@ dependencies = [ "inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ppv-lite86" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "proc-macro-hack" version = "0.5.15" @@ -1229,18 +1156,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_chacha" version = "0.1.1" @@ -1250,15 +1165,6 @@ dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_chacha" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_core" version = "0.3.1" @@ -1272,14 +1178,6 @@ name = "rand_core" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_hc" version = "0.1.0" @@ -1288,14 +1186,6 @@ dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_isaac" version = "0.1.1" @@ -1400,14 +1290,6 @@ name = "redox_syscall" version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "remove_dir_all" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustc-demangle" version = "0.1.16" @@ -1472,14 +1354,21 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "sha2" -version = "0.7.1" +name = "shaderc" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "shaderc-sys" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1564,19 +1453,6 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tempfile" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tiff" version = "0.3.1" @@ -1614,8 +1490,8 @@ version = "0.1.0" dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1628,8 +1504,8 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.23.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "tobj 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1643,8 +1519,8 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.23.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "tobj 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1656,8 +1532,8 @@ version = "0.1.0" dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1668,8 +1544,8 @@ version = "0.1.0" dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1681,8 +1557,8 @@ dependencies = [ "bytemuck 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1695,8 +1571,8 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1709,8 +1585,8 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1723,8 +1599,8 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.23.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1737,8 +1613,8 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.23.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "tobj 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1752,18 +1628,13 @@ dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.23.4 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "tobj 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "typenum" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-xid" version = "0.1.0" @@ -1794,11 +1665,6 @@ dependencies = [ "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "wasm-bindgen" version = "0.2.58" @@ -2009,9 +1875,9 @@ version = "0.1.0" dependencies = [ "cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2124,7 +1990,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum andrew 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" "checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" "checksum approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum ash 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "69daec0742947f33a85931fa3cb0ce5f07929159dcbd1f0cbb5b2912e2978509" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" @@ -2134,12 +1999,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4" -"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum bytemuck 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37fa13df2292ecb479ec23aa06f4507928bef07839be9ef15281411076629431" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum calloop 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" @@ -2165,7 +2027,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum d3d12 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc7ed48e89905e5e146bcc1951cc3facb9e44aea9adf5dc01078cda1bd24b662" "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" "checksum deflate 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e7e5d2a2273fed52a7f947ee55b092c4057025d7a3e04e5ecdbd25d6c3fb1bd7" -"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" "checksum dispatch 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e93ca78226c51902d7aa8c12c988338aadd9e85ed9c6be8aaac39192ff3605" "checksum dispatch 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" @@ -2173,7 +2034,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" "checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" -"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" @@ -2189,8 +2049,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" "checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" -"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum gfx-auxil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b46e6f0031330a0be08d17820f2dcaaa91cb36710a97a9500cb4f1c36e785c8" "checksum gfx-backend-dx11 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b148219292624126f78245e50a9720d95ea149a415ce8ce73ab7014205301b88" "checksum gfx-backend-dx12 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0e526746379e974501551b08958947e67a81b5ea8cdc717a000cdd72577da05" @@ -2201,7 +2059,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gfx-hal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc96180204064c9493e0fe4a9efeb721e0ac59fe8e1906d0c659142a93114fb1" "checksum gfx-memory 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c2eed6cda674d9cd4d92229102dbd544292124533d236904f987e9afab456137" "checksum gif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af" -"checksum glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "28caebc98746d507603a2d3df66dcbe04e41d4febad0320f3eec1ef72b6bbef1" "checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum image 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)" = "53cb19c4e35102e5c6fb9ade5e0e236c5588424dc171a849af3141bf0b47768a" @@ -2250,7 +2107,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" "checksum png 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef859a23054bbfee7811284275ae522f0434a3c8e7f4b74bd4a35ae7e1c4a283" "checksum png 0.16.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2c68a431ed29933a4eb5709aca9800989758c97759345860fa5db3cfced0b65d" -"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" "checksum proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" @@ -2258,14 +2114,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" -"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" "checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" @@ -2278,7 +2130,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" @@ -2288,7 +2139,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" +"checksum shaderc 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ed344938df2d7fa3cc6bfb4af0b578f00f9b389d5fe7be0250fa657c442a8281" +"checksum shaderc-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30075c712b08798cb2b5e54e4434970a4a3a3a3e838b0642590c74605d3cc528" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" "checksum smithay-client-toolkit 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" @@ -2298,18 +2150,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" "checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" -"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d" "checksum tiff 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "002351e428db1eb1d8656d4ca61947c3519ac3191e1c804d4600cd32093b77ad" "checksum tobj 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "1ed6f4ec3b7c466b7a72471179e55e2b6a7452b53691b6115185132fc2e06b1c" "checksum tobj 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2b9d0bafde95a2f8f50dd3c10bc127b462efa8c3c0b60dfa276b7e032100e21d" -"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" -"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "5205e9afdf42282b192e2310a5b463a6d1c1d774e30dc3c791ac37ab42d2616c" "checksum wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "11cdb95816290b525b32587d76419facd99662a07e59d3cdb560488a819d9a45" "checksum wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "574094772ce6921576fb6f2e3f7497b8a76273b6db092be18fc48a082de09dc3" diff --git a/code/beginner/tutorial1-window/Cargo.toml b/code/beginner/tutorial1-window/Cargo.toml index 393146ee..d619e217 100644 --- a/code/beginner/tutorial1-window/Cargo.toml +++ b/code/beginner/tutorial1-window/Cargo.toml @@ -14,7 +14,7 @@ path = "src/main.rs" [dependencies] image = "0.22" winit = "0.20" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" wgpu = "0.5.0" futures = "0.3.4" diff --git a/code/beginner/tutorial2-swapchain/Cargo.toml b/code/beginner/tutorial2-swapchain/Cargo.toml index 7a9b53ef..e81e597f 100644 --- a/code/beginner/tutorial2-swapchain/Cargo.toml +++ b/code/beginner/tutorial2-swapchain/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.22" winit = "0.20" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" wgpu = "0.5.0" futures = "0.3.4" diff --git a/code/beginner/tutorial3-pipeline/Cargo.toml b/code/beginner/tutorial3-pipeline/Cargo.toml index ffa813cc..e7b5259c 100644 --- a/code/beginner/tutorial3-pipeline/Cargo.toml +++ b/code/beginner/tutorial3-pipeline/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.22" winit = "0.20" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" wgpu = "0.5.0" futures = "0.3.4" diff --git a/code/beginner/tutorial3-pipeline/src/challenge.rs b/code/beginner/tutorial3-pipeline/src/challenge.rs index c003da11..a076c7c3 100644 --- a/code/beginner/tutorial3-pipeline/src/challenge.rs +++ b/code/beginner/tutorial3-pipeline/src/challenge.rs @@ -50,10 +50,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); @@ -99,10 +100,10 @@ impl State { let vs_src = include_str!("challenge.vert"); let fs_src = include_str!("challenge.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "challenge.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "challenge.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial3-pipeline/src/main.rs b/code/beginner/tutorial3-pipeline/src/main.rs index 96511ef0..1c130fc6 100644 --- a/code/beginner/tutorial3-pipeline/src/main.rs +++ b/code/beginner/tutorial3-pipeline/src/main.rs @@ -48,10 +48,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial4-buffer/Cargo.toml b/code/beginner/tutorial4-buffer/Cargo.toml index 15719394..fd500e79 100644 --- a/code/beginner/tutorial4-buffer/Cargo.toml +++ b/code/beginner/tutorial4-buffer/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.22" winit = "0.20" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" wgpu = "0.5.0" futures = "0.3.4" diff --git a/code/beginner/tutorial4-buffer/src/challenge.rs b/code/beginner/tutorial4-buffer/src/challenge.rs index f9b83296..12f50f3f 100644 --- a/code/beginner/tutorial4-buffer/src/challenge.rs +++ b/code/beginner/tutorial4-buffer/src/challenge.rs @@ -103,10 +103,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial4-buffer/src/main.rs b/code/beginner/tutorial4-buffer/src/main.rs index f2a144c4..0e2481d4 100644 --- a/code/beginner/tutorial4-buffer/src/main.rs +++ b/code/beginner/tutorial4-buffer/src/main.rs @@ -98,10 +98,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial5-textures/Cargo.toml b/code/beginner/tutorial5-textures/Cargo.toml index a21c6a97..7d02f2d5 100644 --- a/code/beginner/tutorial5-textures/Cargo.toml +++ b/code/beginner/tutorial5-textures/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.22" winit = "0.20.0-alpha3" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" failure = "0.1" wgpu = "0.5.0" diff --git a/code/beginner/tutorial5-textures/src/challenge.rs b/code/beginner/tutorial5-textures/src/challenge.rs index 0c611af5..2f50c2b4 100644 --- a/code/beginner/tutorial5-textures/src/challenge.rs +++ b/code/beginner/tutorial5-textures/src/challenge.rs @@ -176,10 +176,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial5-textures/src/main.rs b/code/beginner/tutorial5-textures/src/main.rs index add3c45b..6ca707cf 100644 --- a/code/beginner/tutorial5-textures/src/main.rs +++ b/code/beginner/tutorial5-textures/src/main.rs @@ -150,10 +150,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial6-uniforms/Cargo.toml b/code/beginner/tutorial6-uniforms/Cargo.toml index 7d631698..924667df 100644 --- a/code/beginner/tutorial6-uniforms/Cargo.toml +++ b/code/beginner/tutorial6-uniforms/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.22" winit = "0.20" -glsl-to-spirv = "0.1" +shaderc = "0.6" failure = "0.1" cgmath = "0.17" wgpu = "0.5.0" diff --git a/code/beginner/tutorial6-uniforms/src/challenge.rs b/code/beginner/tutorial6-uniforms/src/challenge.rs index 7a2abe59..981f0141 100644 --- a/code/beginner/tutorial6-uniforms/src/challenge.rs +++ b/code/beginner/tutorial6-uniforms/src/challenge.rs @@ -347,10 +347,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial6-uniforms/src/main.rs b/code/beginner/tutorial6-uniforms/src/main.rs index 2fa751a1..f14045e0 100644 --- a/code/beginner/tutorial6-uniforms/src/main.rs +++ b/code/beginner/tutorial6-uniforms/src/main.rs @@ -337,10 +337,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial7-instancing/Cargo.toml b/code/beginner/tutorial7-instancing/Cargo.toml index 58453605..37c52b91 100644 --- a/code/beginner/tutorial7-instancing/Cargo.toml +++ b/code/beginner/tutorial7-instancing/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.23.4" winit = "0.22.1" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" failure = "0.1" wgpu = "0.5.0" diff --git a/code/beginner/tutorial7-instancing/examples/array_instances.rs b/code/beginner/tutorial7-instancing/examples/array_instances.rs index f6ead106..6762c64d 100644 --- a/code/beginner/tutorial7-instancing/examples/array_instances.rs +++ b/code/beginner/tutorial7-instancing/examples/array_instances.rs @@ -349,10 +349,11 @@ impl State { let vs_src = include_str!("arrays.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "arrays.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial7-instancing/examples/naive.rs b/code/beginner/tutorial7-instancing/examples/naive.rs index 181d3386..461b8dee 100644 --- a/code/beginner/tutorial7-instancing/examples/naive.rs +++ b/code/beginner/tutorial7-instancing/examples/naive.rs @@ -345,10 +345,11 @@ impl State { let vs_src = include_str!("naive.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "naive.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial7-instancing/examples/storage_instances.rs b/code/beginner/tutorial7-instancing/examples/storage_instances.rs index b348c2b9..ed9a16f4 100644 --- a/code/beginner/tutorial7-instancing/examples/storage_instances.rs +++ b/code/beginner/tutorial7-instancing/examples/storage_instances.rs @@ -404,10 +404,11 @@ impl State { let vs_src = include_str!("storage.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "storage.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial7-instancing/examples/texture_instances.rs b/code/beginner/tutorial7-instancing/examples/texture_instances.rs index 93d106fd..018f4a17 100644 --- a/code/beginner/tutorial7-instancing/examples/texture_instances.rs +++ b/code/beginner/tutorial7-instancing/examples/texture_instances.rs @@ -499,10 +499,11 @@ impl State { let vs_src = include_str!("texture.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "texture.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial7-instancing/examples/vertex_instances.rs b/code/beginner/tutorial7-instancing/examples/vertex_instances.rs index 84b53c3f..0bcfd669 100644 --- a/code/beginner/tutorial7-instancing/examples/vertex_instances.rs +++ b/code/beginner/tutorial7-instancing/examples/vertex_instances.rs @@ -423,10 +423,11 @@ impl State { let vs_src = include_str!("vertex.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "vertex.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial7-instancing/src/challenge.rs b/code/beginner/tutorial7-instancing/src/challenge.rs index fdd32031..3927339c 100644 --- a/code/beginner/tutorial7-instancing/src/challenge.rs +++ b/code/beginner/tutorial7-instancing/src/challenge.rs @@ -433,10 +433,11 @@ impl State { let vs_src = include_str!("challenge.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "challenge.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial7-instancing/src/main.rs b/code/beginner/tutorial7-instancing/src/main.rs index 0871cbae..931c29d6 100644 --- a/code/beginner/tutorial7-instancing/src/main.rs +++ b/code/beginner/tutorial7-instancing/src/main.rs @@ -420,10 +420,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial8-depth/Cargo.toml b/code/beginner/tutorial8-depth/Cargo.toml index 1f197229..0e1eda28 100644 --- a/code/beginner/tutorial8-depth/Cargo.toml +++ b/code/beginner/tutorial8-depth/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.23" winit = "0.22" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" failure = "0.1" tobj = "1.0.0" diff --git a/code/beginner/tutorial8-depth/src/challenge.rs b/code/beginner/tutorial8-depth/src/challenge.rs index ebfb1252..7799b5c9 100644 --- a/code/beginner/tutorial8-depth/src/challenge.rs +++ b/code/beginner/tutorial8-depth/src/challenge.rs @@ -271,10 +271,11 @@ impl DepthPass { let vs_src = include_str!("challenge.vert"); let fs_src = include_str!("challenge.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "challenge.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "challenge.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); @@ -534,10 +535,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial8-depth/src/main.rs b/code/beginner/tutorial8-depth/src/main.rs index 484135ef..0c584bcc 100644 --- a/code/beginner/tutorial8-depth/src/main.rs +++ b/code/beginner/tutorial8-depth/src/main.rs @@ -406,10 +406,11 @@ impl State { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/beginner/tutorial9-models/Cargo.toml b/code/beginner/tutorial9-models/Cargo.toml index 0c31d7db..5708e12c 100644 --- a/code/beginner/tutorial9-models/Cargo.toml +++ b/code/beginner/tutorial9-models/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.23" winit = "0.22" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" failure = "0.1" tobj = "1.0.0" diff --git a/code/beginner/tutorial9-models/src/main.rs b/code/beginner/tutorial9-models/src/main.rs index 46aa60f9..a46ad69b 100644 --- a/code/beginner/tutorial9-models/src/main.rs +++ b/code/beginner/tutorial9-models/src/main.rs @@ -346,10 +346,11 @@ impl State { queue.submit(&cmds); let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/intermediate/tutorial10-lighting/Cargo.toml b/code/intermediate/tutorial10-lighting/Cargo.toml index f2fbf3ad..5b19a39f 100644 --- a/code/intermediate/tutorial10-lighting/Cargo.toml +++ b/code/intermediate/tutorial10-lighting/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.23" winit = "0.22" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" failure = "0.1" tobj = "1" diff --git a/code/intermediate/tutorial10-lighting/src/main.rs b/code/intermediate/tutorial10-lighting/src/main.rs index e5840dde..7a4901c3 100644 --- a/code/intermediate/tutorial10-lighting/src/main.rs +++ b/code/intermediate/tutorial10-lighting/src/main.rs @@ -220,10 +220,11 @@ fn create_render_pipeline( vs_src: &str, fs_src: &str, ) -> wgpu::RenderPipeline { - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/intermediate/tutorial11-normals/Cargo.toml b/code/intermediate/tutorial11-normals/Cargo.toml index 96b3d279..77a4afce 100644 --- a/code/intermediate/tutorial11-normals/Cargo.toml +++ b/code/intermediate/tutorial11-normals/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.23" winit = "0.22" -glsl-to-spirv = "0.1" +shaderc = "0.6" # cgmath = "0.17" failure = "0.1" tobj = "1" diff --git a/code/intermediate/tutorial11-normals/src/main.rs b/code/intermediate/tutorial11-normals/src/main.rs index 7ed6d645..0f270608 100644 --- a/code/intermediate/tutorial11-normals/src/main.rs +++ b/code/intermediate/tutorial11-normals/src/main.rs @@ -219,10 +219,11 @@ fn create_render_pipeline( vs_src: &str, fs_src: &str, ) -> wgpu::RenderPipeline { - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/showcase/framework/Cargo.toml b/code/showcase/framework/Cargo.toml index cc58c025..4ee72967 100644 --- a/code/showcase/framework/Cargo.toml +++ b/code/showcase/framework/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.22.4" winit = "0.20.0" -glsl-to-spirv = "0.1.7" +shaderc = "0.6" cgmath = "0.17.0" failure = "0.1" futures = "0.3.4" diff --git a/code/showcase/gifs/Cargo.toml b/code/showcase/gifs/Cargo.toml index 6f4c9a2a..fd26ddeb 100644 --- a/code/showcase/gifs/Cargo.toml +++ b/code/showcase/gifs/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.22.4" winit = "0.20.0" -glsl-to-spirv = "0.1.7" +shaderc = "0.6" cgmath = "0.17.0" failure = "0.1" tobj = "0.1" diff --git a/code/showcase/gifs/src/main.rs b/code/showcase/gifs/src/main.rs index 5f33ed3e..1d927952 100644 --- a/code/showcase/gifs/src/main.rs +++ b/code/showcase/gifs/src/main.rs @@ -172,10 +172,11 @@ fn save_gif_old(path: &str, frames: &mut Vec>, speed: i32, size: u16) -> fn create_render_pipeline(device: &wgpu::Device, target: &framework::Texture) -> wgpu::RenderPipeline { let vs_src = include_str!("res/shader.vert"); let fs_src = include_str!("res/shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/code/showcase/windowless/Cargo.toml b/code/showcase/windowless/Cargo.toml index 6433b37b..fc007d88 100644 --- a/code/showcase/windowless/Cargo.toml +++ b/code/showcase/windowless/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" image = "0.22" raw-window-handle = "0.1" winit = "0.20.0-alpha3" -glsl-to-spirv = "0.1" +shaderc = "0.6" cgmath = "0.17" wgpu = "0.5.0" futures = "0.3.4" diff --git a/code/showcase/windowless/src/main.rs b/code/showcase/windowless/src/main.rs index 868c00ea..99c451d5 100644 --- a/code/showcase/windowless/src/main.rs +++ b/code/showcase/windowless/src/main.rs @@ -43,10 +43,11 @@ async fn run() { let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/docs/beginner/tutorial3-pipeline/README.md b/docs/beginner/tutorial3-pipeline/README.md index 0756cad1..ea70c93f 100644 --- a/docs/beginner/tutorial3-pipeline/README.md +++ b/docs/beginner/tutorial3-pipeline/README.md @@ -110,11 +110,12 @@ Now let's move to the `new()` method, and start making the pipeline. We'll have let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); -let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); -let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); +let mut compiler = shaderc::Compiler::new().unwrap(); +let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); +let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); -let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); -let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); +let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); +let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/docs/intermediate/tutorial10-lighting/README.md b/docs/intermediate/tutorial10-lighting/README.md index fb463af6..b5c98856 100644 --- a/docs/intermediate/tutorial10-lighting/README.md +++ b/docs/intermediate/tutorial10-lighting/README.md @@ -120,10 +120,13 @@ fn create_render_pipeline( vs_src: &str, fs_src: &str, ) -> wgpu::RenderPipeline { - let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); - let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); - let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); - let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); + let mut compiler = shaderc::Compiler::new().unwrap(); + let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); + let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); + + let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); + let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); + let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data); diff --git a/docs/showcase/windowless/README.md b/docs/showcase/windowless/README.md index 5af8f055..506f6cbf 100644 --- a/docs/showcase/windowless/README.md +++ b/docs/showcase/windowless/README.md @@ -97,10 +97,11 @@ Using that we'll create a simple `RenderPipeline`. ```rust let vs_src = include_str!("shader.vert"); let fs_src = include_str!("shader.frag"); -let vs_spirv = glsl_to_spirv::compile(vs_src, glsl_to_spirv::ShaderType::Vertex).unwrap(); -let fs_spirv = glsl_to_spirv::compile(fs_src, glsl_to_spirv::ShaderType::Fragment).unwrap(); -let vs_data = wgpu::read_spirv(vs_spirv).unwrap(); -let fs_data = wgpu::read_spirv(fs_spirv).unwrap(); +let mut compiler = shaderc::Compiler::new().unwrap(); +let vs_spirv = compiler.compile_into_spirv(vs_src, shaderc::ShaderKind::Vertex, "shader.vert", "main", None).unwrap(); +let fs_spirv = compiler.compile_into_spirv(fs_src, shaderc::ShaderKind::Fragment, "shader.frag", "main", None).unwrap(); +let vs_data = wgpu::read_spirv(std::io::Cursor::new(vs_spirv.as_binary_u8())).unwrap(); +let fs_data = wgpu::read_spirv(std::io::Cursor::new(fs_spirv.as_binary_u8())).unwrap(); let vs_module = device.create_shader_module(&vs_data); let fs_module = device.create_shader_module(&fs_data);