Commit f0b0da7
committed
Features to allow
Fixes #19
Previously we couldn't compile shaders dependent on pre-`cargo-gpu`
versions of `spirv-builder`, because of incompatible `SpirvBuilder`
interfaces. Here we introduce some Cargo features on the
`spirv-builder-cli` crate that gate calls to `SpirvBuilder` depending on
the required version of `spirv-builder`.
Notable changes:
* `spirv-builder-cli` should be buildable on its own now. This is mainly
for development, as it should help with getting better in-editor
feedback from LSP etc. But it also made it possible to move `cargo-gpu`'s
`lib.rs` to `spirv-builder` because `spirv-builder` is now a "real"
crate that can be compiled to a library.
* Related to the previous point, a `rust-toolchain.toml` has been added
to the root of `spirv-builder-cli`, again this is purely for
development. Because of the new feature gates its not even needed to
compile it to a library. Its merely a convenience to get a working
crate that lends itself to direct development rather than always
watching for log output in `cargo gpu` runs.
TODO:
- [ ] Download the actual `rust-gpu` repo as pinned in the shader's `Cargo.lock` and get the
`spirv-builder` version from there.
- [ ] Warn the user that certain `cargo-gpu` features aren't available when building with
older versions of `spirv-builder`, eg setting the target spec.
- [ ] An integration test.spirv-builder backwards compat1 parent 4623ccb commit f0b0da7
File tree
11 files changed
+349
-113
lines changed- crates
- cargo-gpu
- src
- spirv-builder-cli
- src
11 files changed
+349
-113
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
| 11 | + | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | | - | |
| 355 | + | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
360 | 370 | | |
361 | 371 | | |
362 | 372 | | |
| |||
382 | 392 | | |
383 | 393 | | |
384 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
385 | 417 | | |
386 | 418 | | |
387 | 419 | | |
| |||
428 | 460 | | |
429 | 461 | | |
430 | 462 | | |
431 | | - | |
| 463 | + | |
432 | 464 | | |
433 | 465 | | |
434 | 466 | | |
| |||
0 commit comments