Commit 95a7553
authored
0.7.0: the Slang rule takes the project's arguments, per-file ones, and a storage (#17)
Three things a real Slang project needed and the rule could not say, found by
transcribing xrgui's shader config (17 shaders, five common slangc flags, one
shader with a flag of its own, `.spv` files loaded at run time):
options::extra_args slangc takes some two hundred options; the rule keeps
the ones that decide WHAT is produced and passes the
rest through verbatim, after its own and before `-o`.
options::per_file what one shader gets that the others do not. One
`compile()` call writes one surface, so calling it
twice with two option sets rewrote the generated
module with only the second call's shaders. A table
keyed by the path the constrained glob names keeps
the one call. A key naming no shader is refused,
listing the shaders seen: a typo that silently
applied nothing is the failure the table would
otherwise hide.
options::storage the axis `rules-spirv` already had. header embeds
(`-source-embed-style u32`, as before and still the
default); object and sidecar ask slangc for a bare
`.spv`, and the surface does the rest. Measured under
all three; the consumer's source is the same.
`profile_for` gains the 1.4 row: Vulkan 1.4 requires SPIR-V 1.6, and without
the row a 1.4 build fell to spirv_1_0.
The fixture grows a second shader and reads the ENTRY POINT'S NAME out of the
SPIR-V bytes: `-fvk-use-entrypoint-name` through extra_args makes both modules
carry their function's name, `-DOFFSET_ENTRY` through per_file switches one of
them again, and `scale.slang` would report `wrongMain` if the per-file macro
had leaked. CI adds the negative leg (a mistyped key refuses the build by name)
and a `slang-sidecar` fixture with the wrong-directory half.
No engine floor moves: everything here is spelling inside the rule.1 parent 9064107 commit 95a7553
13 files changed
Lines changed: 370 additions & 27 deletions
File tree
- .github/workflows
- rules
- src
- tests
- slang-consumer
- shaders
- src
- slang-sidecar
- shaders
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
898 | 907 | | |
899 | 908 | | |
900 | 909 | | |
| |||
904 | 913 | | |
905 | 914 | | |
906 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
907 | 961 | | |
908 | 962 | | |
909 | 963 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
| 325 | + | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments