microZEUS
The whole stack, hand-drawn.

◄ Wiki / Graphics

swizzle

Reordering or duplicating the components of a vector or colour, like turning RGBA into BGRA.

In graphics code, values often come in small vectors (x,y,z,w or r,g,b,a), and swizzling means reading them in a rearranged order with a shorthand like .bgra or .xxy. It is a cheap, common operation for matching colour layouts or reshuffling data. The hardware supports it directly, so it costs almost nothing.

See also

  • texel / texelFetchA texel is one pixel of a texture; texelFetch grabs exactly that pixel with no smoothing.
  • texture samplingReading a smoothly-interpolated colour from a texture image inside a shader.
  • storage widthHow many bits are used to hold a single value in memory — typically 8, 16, or 32.

Referenced by

texture sampling