playcanvas / playcanvas/engine
Add support for WebGPU texture component swizzle
Open
@mvaligursky is already working on this.
Since Jun 8, 2026.
area: graphics
enhancement
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Feature
Add support for texture component swizzle, shipped in Chrome 143.
This allows rearranging or replacing a texture's RGBA channels at access time via a swizzle specification (each output channel mapped from r/g/b/a/0/1), configured on the texture view. The engine does not currently expose or apply component swizzles.
Benefit
- Adapt source texture channel layouts (e.g. BGRA vs RGBA, single-channel broadcast, fixed 0/1 channels) without extra shader code or format conversions.
- Simplifies handling of imported/compressed textures whose channel order differs from what shaders expect.
Notes
- Requires plumbing a swizzle option through texture/texture-view creation and a capability check for support.
- Ref: https://developer.chrome.com/blog/new-in-webgpu-143
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.