Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
dneto0 wants to merge1 commit intogpuweb:main
base:main
Choose a base branch
Loading
fromdneto0:swizzle-assignment

Conversation

@dneto0
Copy link
Contributor

@dneto0dneto0 commentedJul 28, 2025
edited
Loading

Add language extension 'swizzle_assignment'

Example:

var v:vec4u;
v.yz = vec2(1,2);

Issue:#737

@github-actions
Copy link
Contributor

github-actionsbot commentedJul 28, 2025
edited
Loading

@dneto0dneto0 added this to theMilestone 3+ milestoneJul 29, 2025
@dneto0dneto0force-pushed theswizzle-assignment branch 2 times, most recently fromabeafa1 to9aa6e7fCompareJuly 29, 2025 14:55
@Kangz
Copy link
Contributor

GPU Web WG 2025-07-30 Atlantic-time
  • (Revised)
  • DN: people have wanted swizzle assignment for a long time. We can give them what they want. Can show them what will work and what won't.
  • DN: subtle: order of operations in e.g. compound assignment. Eval of RHS can modify memory you're evaluating on the LHS. Have already spoken with Oguz and Alan about it.
    • JP: This happens today in assignment to component of a vector.

Add language extension 'swizzle_assignment'Example:   var v:vec4u;   v.yz = vec2(1,2);Issue:gpuweb#737
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.
Copy link
Member

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 bev.wx += w to make clearer it's a swizzle assign?

mwyrzykowski reacted with thumbs up emoji
@mwyrzykowskimwyrzykowski self-requested a reviewOctober 2, 2025 15:12
Copy link
ContributorAuthor

@dneto0dneto0 left a 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 afull reference. It would be if the root variable is of vector type, because a swizzle assignment is deemed to be overwriting the entire vector.

@jimblandy
Copy link
Contributor

@dneto0 I gather that, since this is a draft, it's not ready for committee discussion?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dj2dj2dj2 left review comments

@mehmetoguzderinmehmetoguzderinmehmetoguzderin left review comments

@mwyrzykowskimwyrzykowskiAwaiting requested review from mwyrzykowski

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

Milestone 4+

Development

Successfully merging this pull request may close these issues.

5 participants

@dneto0@Kangz@jimblandy@dj2@mehmetoguzderin

[8]ページ先頭

©2009-2025 Movatter.jp