demo · v143

Swizzle

Pick a per-channel swizzle. The right canvas re-samples the source image with that swizzle — same texture, no re-upload, no copy. WebGPU probes below show whether your browser exposes the optional texture-component-swizzle feature.

WebGPU support

checking…
checking swizzle feature…

swizzle controls (componentSwizzle)

source (no swizzle)

swizzled view (same texture)

shader-side WGSL the swizzle replaces


  

the call

const view = texture.createView({
  componentSwizzle: { r: "g", g: "r", b: "b", a: "a" }
});
// Sample as if R and G were swapped, no re-upload.

see also