Functions and operators
A call carries one neutral name through the compiler and each backend writes its own spelling, so the name to write is the one in the right column. These are the ones a GLSL author goes looking for.
dFdx(a)dpdx(a)The same derivative under the WGSL name.
dFdy(a)dpdy(a)The same, along the other axis.
dFdx(a)dpdxCoarse(a)The coarse and fine variants keep their names on WGSL and collapse here, since this target has one derivative per axis.
dFdy(a)dpdyFine(a)The same collapse.
mod(a, b)mod(a, b)The floor remainder, which is what this target's mod already is. The % operator is the other one.
texture(a, c)textureSample(a, b, c)The sampler argument goes, because the combined sampler already holds it.
texelFetch(a, b, int(c))textureLoad(a, b, c)A texel read at an integer coordinate and a mip level.
uvec2(textureSize(a, 0))textureDimensions(a)The size comes back unsigned, so the writer wraps this target's signed answer.
faceforward(a, b, c)faceForward(a, b, c)A spelling difference and nothing more.
inversesqrt(a)inverseSqrt(a)A spelling difference and nothing more.
roundEven(a)round(a)The rounding both targets share is the one that sends a half to the even neighbour.
_popcnt(a)countOneBits(a)This target has none of the bit builtins, so the writer defines a small function over the shifts and masks it does have.
_msb(a)firstLeadingBit(a)Another of those, defined only in a module that calls it.
The operators divide the same way. A comparison of two vectors is written with the operator and reaches this target as the function it has, and a per-component choice is select on both.
float floorMod = mod(uv.x, 0.5);const floorMod = mod(uv.x, 0.5)The floor remainder, whose sign follows the divisor.
float truncMod = (uv.x - 0.5 * trunc(uv.x / 0.5));const truncMod = uv.x % 0.5The truncating remainder, whose sign follows the dividend. This target has no % on floats, so the writer spells it out.
bvec2 below = lessThan(uv, vec2(0.5, 0.25));const below: vec2b = uv < vec2(0.5, 0.25)A vector comparison is a function on this target and an operator on the other, so it is written as the operator.
bvec2 same = equal(uv, vec2(0.75, 0.125));const same: vec2b = uv === vec2(0.75, 0.125)The same, and the strict form is the one TypeScript takes.
float picked = (below.x ? uv.y : uv.x);const picked = select(uv.x, uv.y, below.x)A scalar choice is the ternary here and select on WGSL, so one name serves both.
vec2 blended = mix(vec2(0.0, 0.0), vec2(1.0, 1.0), below);select(vec2(0., 0.), vec2(1., 1.), below)A per-component choice over a boolean vector is mix on this target, which is the shape a GLSL author already writes.
Every builtin the compiler can spell, with the text it writes for each one on both targets, is on the builtin table.