├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── build.rs ├── rust-toolchain ├── shaders ├── Cargo.lock ├── Cargo.toml └── src │ └── lib.rs └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /**/target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.7.6" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 10 | dependencies = [ 11 | "getrandom", 12 | "once_cell", 13 | "version_check", 14 | ] 15 | 16 | [[package]] 17 | name = "aho-corasick" 18 | version = "0.7.20" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" 21 | dependencies = [ 22 | "memchr", 23 | ] 24 | 25 | [[package]] 26 | name = "ar" 27 | version = "0.9.0" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" 30 | 31 | [[package]] 32 | name = "arrayvec" 33 | version = "0.7.2" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 36 | 37 | [[package]] 38 | name = "autocfg" 39 | version = "1.1.0" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 42 | 43 | [[package]] 44 | name = "bitflags" 45 | version = "1.3.2" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 48 | 49 | [[package]] 50 | name = "bytemuck" 51 | version = "1.13.1" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" 54 | 55 | [[package]] 56 | name = "byteorder" 57 | version = "1.4.3" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 60 | 61 | [[package]] 62 | name = "cc" 63 | version = "1.0.73" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 66 | dependencies = [ 67 | "jobserver", 68 | ] 69 | 70 | [[package]] 71 | name = "cfg-if" 72 | version = "1.0.0" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 75 | 76 | [[package]] 77 | name = "either" 78 | version = "1.8.1" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 81 | 82 | [[package]] 83 | name = "elsa" 84 | version = "1.8.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "f74077c3c3aedb99a2683919698285596662518ea13e5eedcf8bdd43b0d0453b" 87 | dependencies = [ 88 | "indexmap", 89 | "stable_deref_trait", 90 | ] 91 | 92 | [[package]] 93 | name = "fxhash" 94 | version = "0.2.1" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" 97 | dependencies = [ 98 | "byteorder", 99 | ] 100 | 101 | [[package]] 102 | name = "getrandom" 103 | version = "0.2.7" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" 106 | dependencies = [ 107 | "cfg-if", 108 | "libc", 109 | "wasi", 110 | ] 111 | 112 | [[package]] 113 | name = "hashbrown" 114 | version = "0.11.2" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 117 | dependencies = [ 118 | "ahash", 119 | ] 120 | 121 | [[package]] 122 | name = "hashbrown" 123 | version = "0.12.3" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 126 | 127 | [[package]] 128 | name = "indexmap" 129 | version = "1.9.1" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" 132 | dependencies = [ 133 | "autocfg", 134 | "hashbrown 0.12.3", 135 | ] 136 | 137 | [[package]] 138 | name = "itertools" 139 | version = "0.10.5" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 142 | dependencies = [ 143 | "either", 144 | ] 145 | 146 | [[package]] 147 | name = "itoa" 148 | version = "1.0.3" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" 151 | 152 | [[package]] 153 | name = "jobserver" 154 | version = "0.1.25" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" 157 | dependencies = [ 158 | "libc", 159 | ] 160 | 161 | [[package]] 162 | name = "lazy_static" 163 | version = "1.4.0" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 166 | 167 | [[package]] 168 | name = "libc" 169 | version = "0.2.134" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" 172 | 173 | [[package]] 174 | name = "libm" 175 | version = "0.2.5" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" 178 | 179 | [[package]] 180 | name = "memchr" 181 | version = "2.5.0" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 184 | 185 | [[package]] 186 | name = "num-traits" 187 | version = "0.2.15" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 190 | dependencies = [ 191 | "autocfg", 192 | "libm", 193 | ] 194 | 195 | [[package]] 196 | name = "once_cell" 197 | version = "1.15.0" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" 200 | 201 | [[package]] 202 | name = "proc-macro2" 203 | version = "1.0.46" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" 206 | dependencies = [ 207 | "unicode-ident", 208 | ] 209 | 210 | [[package]] 211 | name = "quote" 212 | version = "1.0.21" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 215 | dependencies = [ 216 | "proc-macro2", 217 | ] 218 | 219 | [[package]] 220 | name = "raw-string" 221 | version = "0.3.5" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "e0501e134c6905fee1f10fed25b0a7e1261bf676cffac9543a7d0730dec01af2" 224 | 225 | [[package]] 226 | name = "regex" 227 | version = "1.6.0" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" 230 | dependencies = [ 231 | "aho-corasick", 232 | "memchr", 233 | "regex-syntax", 234 | ] 235 | 236 | [[package]] 237 | name = "regex-syntax" 238 | version = "0.6.27" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" 241 | 242 | [[package]] 243 | name = "rspirv" 244 | version = "0.11.0+1.5.4" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "1503993b59ca9ae4127365c3293517576d7ce56be9f3d8abb1625c85ddc583ba" 247 | dependencies = [ 248 | "fxhash", 249 | "num-traits", 250 | "spirv", 251 | ] 252 | 253 | [[package]] 254 | name = "rust-gpu-empty" 255 | version = "0.1.0" 256 | dependencies = [ 257 | "spirv-builder", 258 | ] 259 | 260 | [[package]] 261 | name = "rustc-demangle" 262 | version = "0.1.21" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" 265 | 266 | [[package]] 267 | name = "rustc-hash" 268 | version = "1.1.0" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 271 | 272 | [[package]] 273 | name = "rustc_codegen_spirv" 274 | version = "0.6.0" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "2a5f05b5fcaa46cb4a7562171b552df03ffda56b5b7d2be95bc8add874f4a56f" 277 | dependencies = [ 278 | "ar", 279 | "either", 280 | "hashbrown 0.11.2", 281 | "indexmap", 282 | "lazy_static", 283 | "libc", 284 | "num-traits", 285 | "once_cell", 286 | "regex", 287 | "rspirv", 288 | "rustc-demangle", 289 | "rustc_codegen_spirv-types", 290 | "sanitize-filename", 291 | "serde", 292 | "serde_json", 293 | "smallvec", 294 | "spirt", 295 | "spirv-tools", 296 | "syn", 297 | ] 298 | 299 | [[package]] 300 | name = "rustc_codegen_spirv-types" 301 | version = "0.6.0" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "e7e2abcad6ba026e292502f9952f8d7105b1faf95bce4d236bc5518af103411b" 304 | dependencies = [ 305 | "rspirv", 306 | "serde", 307 | ] 308 | 309 | [[package]] 310 | name = "ryu" 311 | version = "1.0.11" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" 314 | 315 | [[package]] 316 | name = "sanitize-filename" 317 | version = "0.4.0" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | checksum = "08c502bdb638f1396509467cb0580ef3b29aa2a45c5d43e5d84928241280296c" 320 | dependencies = [ 321 | "lazy_static", 322 | "regex", 323 | ] 324 | 325 | [[package]] 326 | name = "serde" 327 | version = "1.0.145" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" 330 | dependencies = [ 331 | "serde_derive", 332 | ] 333 | 334 | [[package]] 335 | name = "serde_derive" 336 | version = "1.0.145" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" 339 | dependencies = [ 340 | "proc-macro2", 341 | "quote", 342 | "syn", 343 | ] 344 | 345 | [[package]] 346 | name = "serde_json" 347 | version = "1.0.85" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" 350 | dependencies = [ 351 | "itoa", 352 | "ryu", 353 | "serde", 354 | ] 355 | 356 | [[package]] 357 | name = "smallvec" 358 | version = "1.10.0" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 361 | dependencies = [ 362 | "serde", 363 | ] 364 | 365 | [[package]] 366 | name = "spirt" 367 | version = "0.1.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "06834ebbbbc6f86448fd5dc7ccbac80e36f52f8d66838683752e19d3cae9a459" 370 | dependencies = [ 371 | "arrayvec", 372 | "bytemuck", 373 | "elsa", 374 | "indexmap", 375 | "itertools", 376 | "lazy_static", 377 | "rustc-hash", 378 | "serde", 379 | "serde_json", 380 | "smallvec", 381 | ] 382 | 383 | [[package]] 384 | name = "spirv" 385 | version = "0.2.0+1.5.4" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" 388 | dependencies = [ 389 | "bitflags", 390 | "num-traits", 391 | ] 392 | 393 | [[package]] 394 | name = "spirv-builder" 395 | version = "0.6.0" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "8479379a6f9d3e15f6010fdb24e5ced6823bf64ac322d9f920c15df84c0bf04e" 398 | dependencies = [ 399 | "memchr", 400 | "raw-string", 401 | "rustc_codegen_spirv", 402 | "rustc_codegen_spirv-types", 403 | "serde", 404 | "serde_json", 405 | ] 406 | 407 | [[package]] 408 | name = "spirv-tools" 409 | version = "0.9.0" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "dc7c8ca2077515286505bd3ccd396e55ac5706e80322e1d6d22a82e1cad4f7c3" 412 | dependencies = [ 413 | "spirv-tools-sys", 414 | ] 415 | 416 | [[package]] 417 | name = "spirv-tools-sys" 418 | version = "0.7.0" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "b4b32d9d6469cd6b50dcd6bd841204b5946b4fb7b70a97872717cdc417659c9a" 421 | dependencies = [ 422 | "cc", 423 | ] 424 | 425 | [[package]] 426 | name = "stable_deref_trait" 427 | version = "1.2.0" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 430 | 431 | [[package]] 432 | name = "syn" 433 | version = "1.0.101" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" 436 | dependencies = [ 437 | "proc-macro2", 438 | "quote", 439 | "unicode-ident", 440 | ] 441 | 442 | [[package]] 443 | name = "unicode-ident" 444 | version = "1.0.4" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" 447 | 448 | [[package]] 449 | name = "version_check" 450 | version = "0.9.4" 451 | source = "registry+https://github.com/rust-lang/crates.io-index" 452 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 453 | 454 | [[package]] 455 | name = "wasi" 456 | version = "0.11.0+wasi-snapshot-preview1" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 459 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-gpu-empty" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [build-dependencies] 8 | spirv-builder = "0.6.0" 9 | 10 | # Compile build-dependencies in release mode with 11 | # the same settings as regular dependencies. 12 | [profile.release.build-override] 13 | opt-level = 3 14 | codegen-units = 16 15 | [profile.dev.build-override] 16 | opt-level = 3 -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | use spirv_builder::{MetadataPrintout, SpirvBuilder}; 2 | 3 | fn main() { 4 | SpirvBuilder::new("shaders", "spirv-unknown-vulkan1.1") 5 | .print_metadata(MetadataPrintout::Full) 6 | .build() 7 | .unwrap(); 8 | } -------------------------------------------------------------------------------- /rust-toolchain: -------------------------------------------------------------------------------- 1 | # If you see this, run `rustup self update` to get rustup 1.23 or newer. 2 | 3 | # NOTE: above comment is for older `rustup` (before TOML support was added), 4 | # which will treat the first line as the toolchain name, and therefore show it 5 | # to the user in the error, instead of "error: invalid channel name '[toolchain]'". 6 | 7 | [toolchain] 8 | channel = "nightly-2023-01-21" 9 | components = ["rust-src", "rustc-dev", "llvm-tools-preview"] 10 | -------------------------------------------------------------------------------- /shaders/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "autocfg" 7 | version = "1.1.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 10 | 11 | [[package]] 12 | name = "bitflags" 13 | version = "1.3.2" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 16 | 17 | [[package]] 18 | name = "glam" 19 | version = "0.22.0" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "12f597d56c1bd55a811a1be189459e8fad2bbc272616375602443bdfb37fa774" 22 | dependencies = [ 23 | "num-traits", 24 | ] 25 | 26 | [[package]] 27 | name = "libm" 28 | version = "0.2.5" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" 31 | 32 | [[package]] 33 | name = "num-traits" 34 | version = "0.2.15" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 37 | dependencies = [ 38 | "autocfg", 39 | "libm", 40 | ] 41 | 42 | [[package]] 43 | name = "proc-macro2" 44 | version = "1.0.46" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" 47 | dependencies = [ 48 | "unicode-ident", 49 | ] 50 | 51 | [[package]] 52 | name = "quote" 53 | version = "1.0.21" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 56 | dependencies = [ 57 | "proc-macro2", 58 | ] 59 | 60 | [[package]] 61 | name = "shaders" 62 | version = "0.1.0" 63 | dependencies = [ 64 | "spirv-std", 65 | ] 66 | 67 | [[package]] 68 | name = "spirv-std" 69 | version = "0.6.0" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "04f9f6a27c4d7602fb7fff4767d6df6c8ba8f030e4776957abac019cbba92383" 72 | dependencies = [ 73 | "bitflags", 74 | "glam", 75 | "num-traits", 76 | "spirv-std-macros", 77 | "spirv-std-types", 78 | ] 79 | 80 | [[package]] 81 | name = "spirv-std-macros" 82 | version = "0.6.0" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "39ce2c9450851606036f99674107a12909b940fa45bb107c2ff33995d89c1597" 85 | dependencies = [ 86 | "proc-macro2", 87 | "quote", 88 | "spirv-std-types", 89 | "syn", 90 | ] 91 | 92 | [[package]] 93 | name = "spirv-std-types" 94 | version = "0.6.0" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "bbf8de0872c6f4a6d32aeeabeb51e528a1bc84fefc3db00fc83cc886d2bc82d1" 97 | 98 | [[package]] 99 | name = "syn" 100 | version = "1.0.101" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" 103 | dependencies = [ 104 | "proc-macro2", 105 | "quote", 106 | "unicode-ident", 107 | ] 108 | 109 | [[package]] 110 | name = "unicode-ident" 111 | version = "1.0.4" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" 114 | -------------------------------------------------------------------------------- /shaders/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "shaders" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | [lib] 8 | crate-type = ["dylib"] 9 | 10 | [dependencies] 11 | spirv-std = "0.6.0" 12 | -------------------------------------------------------------------------------- /shaders/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr( 2 | target_arch = "spirv", 3 | no_std 4 | )] 5 | 6 | use spirv_std::spirv; 7 | 8 | use spirv_std::glam::{vec4, Vec4}; 9 | 10 | #[spirv(fragment)] 11 | pub fn main_fs(output: &mut Vec4) { 12 | *output = vec4(1.0, 0.0, 0.0, 1.0); 13 | } 14 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | const SHADER: &[u8] = include_bytes!(env!("shaders.spv")); 2 | 3 | fn main() { 4 | println!("Shader module: {} ({} bytes)", env!("shaders.spv"), SHADER.len()); 5 | } 6 | --------------------------------------------------------------------------------