-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
print: always print attributes inline and with per-attribute
#[...]
…
… syntax. (#35) This moves us from my ad-hoc `#{A, B, C}` to a Rust-style `#[A] #[B] #[C]` attribute syntax, and removes the idea of a "attribute set shorthand" (`attrs123 = #{...}` followed by uses of `#attrs123`), which was more annoying than useful (attributes can't refer to other attributes so there was no "exponential deduplication" need for it). With `#[...]` syntax, it also makes sense to never say e.g. `OpDecorate` (as the operand itself will contain the word `Decoration`), or to use `#[name = "..."]` Rust-style syntax for `OpName`. (I didn't touch `OpMember{Name,Decorate}`, might be worth having a SPIR-T `struct` type declaration syntax just to clean those up but it feels even more ad-hoc than usual - maybe it might make more sense after #36?) Comparison (using Kajiya's `assets/shaders/raster_simple_ps.hlsl`, compiled by DXC, like #33): |[**Before**](https://htmlpreview.github.io/?https://gist.github.com/eddyb/124d807950059893678ad55f51ee5107/raw/0-before-spirt%252335-raster_simple_ps.hlsl.structured.spirt.html)<br><sub>(click for complete pretty HTML example)</sub>|[**After**](https://htmlpreview.github.io/?https://gist.github.com/eddyb/124d807950059893678ad55f51ee5107/raw/1-after-spirt%252335-raster_simple_ps.hlsl.structured.spirt.html)<br><sub>(click for complete pretty HTML example)</sub>| |-|-| |![image](https://github.com/EmbarkStudios/spirt/assets/77424/82ee846a-0ed7-4f6b-be4f-7c6ccd1ba2fa)|![image](https://github.com/EmbarkStudios/spirt/assets/77424/f725b9bd-7715-4c96-8e4e-e573e41a8478)|
- Loading branch information
Showing
3 changed files
with
64 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters