Repository navigation
[0011] Use variable syntax instead of function syntax for SPIR-V builtin - #129
Merged
Steven Perron (s-perron) merged 2 commits intoNov 29, 2023
Merged
Steven Perron (s-perron) merged 2 commits into
Steven Perron (s-perron) merged 2 commits into
Conversation
Contributor
Author
|
Steven Perron (@s-perron) for your perusal |
| ``` | ||
| [[vk::ext_builtin_input(/* NumWorkgroups */ 24)]] | ||
| uint3 gl_NumWorkGroups(); | ||
| static uint3 gl_NumWorkGroups; |
Collaborator
There was a problem hiding this comment.
Since we cannot write to the builtin input, do we want to make the variable const as well? Then we can get all of the checks that it cannot be written to for free.
Contributor
Author
There was a problem hiding this comment.
Sure, that seems like a good idea. Updated.
Cassandra Beckley (cassiebeckley)
added a commit
to microsoft/DirectXShaderCompiler
that referenced
this pull request
Nov 23, 2023
#6052) `ext_extension` and `ext_capability` can only be added to functions at the moment. This PR enables adding them to variable declarations, so that using the variable results in the extensions and capabilities being added to the module. This is useful for the builtin variable syntax proposed in microsoft/hlsl-specs#129. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Steven Perron (s-perron)
approved these changes
Nov 23, 2023
Collaborator
Steven Perron (s-perron)
requested review from
Chris B (llvm-beanz) and
Gregory Roth (pow2clk)
November 28, 2023 19:02
Chris B (llvm-beanz)
approved these changes
Nov 28, 2023
Chris B (llvm-beanz)
pushed a commit
to llvm-beanz/hlsl-specs
that referenced
this pull request
Feb 9, 2025
…tin (microsoft#129) * [0011] Use variable syntax instead of function syntax for SPIR-V builtin * Require const for input
This file contains hidden or 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
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.
In order to better match the semantics of builtin variables, use static variables instead of functions in order to get and set builtins.