-
Notifications
You must be signed in to change notification settings - Fork 353
Add section for "Constant Identifier Expression" #1586
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
Conversation
That was pulled out to gpuweb#1586
That was pulled out to gpuweb#1586
kvark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks good overall! Just a few notes.
alan-baker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit about undefined values.
| <td>If pipeline creation specified a value for the [=pipeline constant ID|constant ID=], | ||
| then the result is that value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the spec constant is not specified at pipeline creation and the constant has not initializer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion in the meeting: Add a note for the "no value supplied" case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New commit added, after rebase. PTAL.
This captures the case of pipeline-overridable constants as well. TODO: modify this when the 'const' -> 'let' change lands.
Also, add cross-reference to "pipeline constant ID"
It never happens because pipeline creation fails.
WGSL meeting minutes 2021-04-06
|
* WGSL: describe ref ptr - Add "memory view types" section - Defines reference type and pointer type - gives use cases and examples - Compares to other lanaguages - Adds: - composite reference sub-expressions - address-of expression (unary &) - indirection expression (unary *) - variable identifier expression - const identifier expression - formal parmaeter identifier expression TODO: grammar update for unary * and unary & Alternate to #1368 Fixes: #1456 * Remove -> void from the newer examples * Apply review feedback Addressed feedback from @alan-baker and @ben-clayton Fixed typos, examples, links, and added an example showing what happens when the expression in a return statement is a reference. * Fix word * Fix types in comments in examples * Add grammar rule for unary &, unary *; address feedback - Added the grammar rule for address-of and indirection - Fixed algorithm name text (was copypasta) - Fixed example in the assignment-statement section. * Fix typo in the add_one example * Make address-of, indirection defined terms Improve cross-linking. * Add missing access qualifier in example * One more rename of "composite reference component expression" * Fix caption on structure-member reference expression * Convert ptr syntax examples to use a function declaration Applies feedback from @kvark review. Using a complete and valid function definition allows the example to be valid WGSL. - changed the pointer-to-uniform example to pointer-to-function, because pointer-to-uniform arguments won't be valid. (Sorry, that's a restriction from baseline SPIR-V in Vulkan restriction.) * Remove "Const identifier expression" That was pulled out to #1586 * For assignment statement, spell out memory *locations* * Add cross-reference to function-param expression
This captures the case of pipeline-overridable constants as well.
TODO: modify this when the 'const' -> 'let' change lands.