-
Notifications
You must be signed in to change notification settings - Fork 344
wgsl: support swizzle assignment #5268
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
base: main
Are you sure you want to change the base?
Conversation
fe9ba88 to
d7c5282
Compare
|
Previews, as seen when this build job started (f17717e): |
d7c5282 to
c984105
Compare
abeafa1 to
9aa6e7f
Compare
GPU Web WG 2025-07-30 Atlantic-time
|
Add language extension 'swizzle_assignment' Example: var v:vec4u; v.yz = vec2(1,2); Issue: gpuweb#737
9aa6e7f to
f17717e
Compare
| 3. Evaluate |e2|. | ||
|
|
||
| 4. Compute |update| by performing the specified binary operation on |viewed_contents| and |e2|. | ||
| * For example, if the swizzle assignment is `v += w` then the specified operation is addition. |
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.
This isn't actually a swizzle assignment. Should this be v.wx += w to make clearer it's a swizzle assign?
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.
There is an interaction with 15.2.5 Function Scope Variable Value Analysis, where a swizzle view should sometimes be considered a full reference. It would be if the root variable is of vector type, because a swizzle assignment is deemed to be overwriting the entire vector.
|
@dneto0 I gather that, since this is a draft, it's not ready for committee discussion? |
Add language extension 'swizzle_assignment'
Example:
var v:vec4u;
v.yz = vec2(1,2);
Issue: #737