-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print: use spv.OpFoo(A: imm, B: ID, C: imm, ...)
instead of spv.OpFoo<imms>(IDs)
.
#33
Merged
Conversation
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
eddyb
added a commit
that referenced
this pull request
Jun 11, 2023
…dth back to 120. (#37) *Originally found/fixed during the #33/#34/#35/#36 series of pretty-printing PRs.* Before this PR, we were treating all text the same, regardless of style, but this PR introduces the concept of "fractional columns" (integer multiples of `0.1ch`, because our `font-size`s are always integer multiples of `0.1em`). The result is much more accurate, and so far appears to perfectly match browser behavior (i.e. the transition of `MAX_LINE_WIDTH` from `N-1` to `N`, where multi-line layout gets replaced with single-line layout, results in a line that "tightly fits" in a `max-width: Nch` container, with no spurious gaps or overflows). Note however that the increased accuracy makes the layout favor HTML over plaintext (and we don't have a plaintext-vs-HTML "simultaneous layout", nor a way to hint what the output of pretty layout will be used for), so the plaintext output may feel more inconsistent as a result (but its aesthetics are of dubious value anyway).
eddyb
added a commit
that referenced
this pull request
Jun 13, 2023
…printed SPIR-T is up to date in CI. (#34) *Originally found while working on #33, and also used to contain #37 before splitting that off.* The pretty-printing fix here (not showing `OpTypePointer` that are used internally in `GlobalVarDecl`/`PtrToGlobalVar` but never actually meant to be printed) is relatively small, the main change is the new CI check, which should ensure we don't forget to update `README.md`.
eddyb
added a commit
that referenced
this pull request
Jun 13, 2023
… 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)|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's two main changes here:
<...>
) from SPIR-T pretty-printingfoo:
before an operand)<...>
distinction was removed, specifically)Comparison (using Kajiya's
assets/shaders/raster_simple_ps.hlsl
, compiled by DXC):(click for complete pretty HTML example)
(click for complete pretty HTML example)