wgsl: support swizzle assignment by dneto0 · Pull Request #5268 · gpuweb/gpuweb

mehmetoguzderin

dj2

dneto0

copybara-service bot pushed a commit to google/dawn that referenced this pull request

Jan 22, 2026
Add a new core type called Swizzle View that is used as the type of
swizzle expressions in the resolver. This change is based on the draft
spec in: gpuweb/gpuweb#5268

Currently, there should be no functional change, it simply changes the
sem node types, which are then lowered in ProgramToIR to the expected
vector types. However, this change supports a future implementation of
swizzle assignment, where it will be necessary for swizzled objects to
be treated as memory views rather than concrete values.

Bug: 473857629
Change-Id: I34342f921e6906b599f840c10dbb455eed37cb94
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/285675
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Natalie Chouinard <chouinard@google.com>
Reviewed-by: James Price <jrprice@google.com>

@jimblandy jimblandy moved this from Future agenda to Awaiting investigation / implementation in WGSL

Feb 9, 2026

copybara-service bot pushed a commit to google/dawn that referenced this pull request

Feb 19, 2026
Add WGSL language support for swizzle assignment on vectors as a proof
of concept. This implementation is based on the draft spec and passes
all CTS tests. It is enabled behind the swizzle_assignment language
feature flag as an unsafe experimental feature.

Draft Spec: gpuweb/gpuweb#5268

Bug: 473857629
Change-Id: Ic111554c53e41a9f3305f3118258f7dd5df4a29d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/290357
Commit-Queue: Natalie Chouinard <chouinard@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>

sudonatalie

sudonatalie

alan-baker

Add language extension 'swizzle_assignment'

Example:

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

Now includes fixes on the order of evaluation.

Issue: gpuweb#737
…ions table

  We need to splite MVE memory-view expression from SVE
  swizzle-view-expression

@dneto0

@dneto0

When using a single-letter swizzle name on a pointer or reference,
the result is a reference to a component. This can be used
anywhere a reference-to-component can be used!
For reference, it's still twice.

For swizzle view, it's three times.

h/t @sudonatalie

@dneto0

@dneto0

split the tables between the case where the inner expression
is a vector vs. a memory view of a vector.

@dneto0

@dneto0

@dneto0

@dneto0

@dneto0

…zzle View

The result is always a reference, not just a memory view.

@dneto0

@dneto0

@dneto0

alan-baker

@dneto0

@dneto0