-
Notifications
You must be signed in to change notification settings - Fork 353
Describe discard as demoting to a helper invocation #3176
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
dneto0
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.
Partial review
wgsl/index.bs
Outdated
|
|
||
| ## Fragment Shaders and Helper Invocations ## {#fragment-shaders-helper-invocations} | ||
|
|
||
| Invocations in the [=fragment shader stage=] are divided into 2x2 grids of neighbouring invocations. |
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.
Should say in what sense they are "neighbouring".
Suggest
of invocations with neighboring framebuffer positions in the X and Y dimensions.
(I filed separate issue #3177 so we can make 'position' a cross-reference)
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.
I rebased on top of the definitions and made this a link.
wgsl/index.bs
Outdated
| [[#texturestore|textureStore]] function calls performed by helper invocations | ||
| will have no effect on the texture. | ||
| [[#atomic-builtin-functions|Atomic built-in funtions]] performed by helper | ||
| invocations will return undefined results. |
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.
And atomic operations don't write.
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.
That's covered by the write access restriction above.
dneto0
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.
Overall looking good.
|
Previews, as seen when this build job started (ec6c376): |
|
Previews, as seen when this build job started (94ba932): |
|
Previews, as seen when this build job started (5adf1b5): |
Fixes gpuweb#921 * Change the behavior of `discard` to convert the invocation into a helper invocation * Update behavior analysis to remove the Discard behavior * Additionally remove the analysis of expressions since functions can only have the behaviors {} (an error) or {Next} * Add a section describing helper invocations in fragment shdaers
* remove discard bullet about entry point return evaluation * better introduce helper invocations in terms of rasterization * fix typos
5adf1b5 to
3452b77
Compare
|
Previews, as seen when this build job started (3452b77): |
dneto0
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.
Very tidy and compact!
| This repetition can be interrupted by a [=statement/break=], [=statement/return=], or | ||
| [=statement/discard=] statement. | ||
| This repetition can be interrupted by a [=statement/break=], or | ||
| [=statement/return=] statement. |
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.
The repetition may be interrupted if all invocations in the quad discard and get demoted to helper?
| The compound statement [=shader-creation error|must not=] contain a [=statement/return=] at any compound statement nesting level. | ||
|
|
||
| The compound statement [=shader-creation error|must not=] contain a [=statement/discard=] at any compound statement nesting level nor through function calls. | ||
| See [[#behaviors]] for a more formal description of this rule. |
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 about if all invocations discard? Is that valid or invalid?
* Describe discard as demoting to a helper invocation Fixes gpuweb#921 * Change the behavior of `discard` to convert the invocation into a helper invocation * Update behavior analysis to remove the Discard behavior * Additionally remove the analysis of expressions since functions can only have the behaviors {} (an error) or {Next} * Add a section describing helper invocations in fragment shdaers * Clarify textureStore and entry point returns don't happen for helpers * Address review feedback * remove discard bullet about entry point return evaluation * better introduce helper invocations in terms of rasterization * fix typos * Improve restriction wording * fix typo * Add link to position
Fixes #921
discardto convert the invocation into ahelper invocation
only have the behaviors {} (an error) or {Next}