Builtin functions
A builtin is a function the GPU already has. A call carries one neutral name through the compiler, and each backend writes its own spelling for that name, so the call is written once and emitted twice. The registry holds 163 names.
How to read a row
The first column is the name the call carries, with a placeholder argument in each position it takes. The next two are the text the WGSL backend and the GLSL ES 3.00 backend write for that call, run from the compiler's own spelling table at the pinned commit. 44 of the names are spelled the same way on both targets, and 43 have no GLSL ES 3.00 form at all, where the cell carries the compiler's own message. 27 answer to a Math. name as well, which the last column of the maths and cast tables shows.
A few of these names are chosen by the compiler and never written by hand. A layered texture read, a depth comparison, a storage fetch and a texel read at an unsigned coordinate each take a name of their own, so the argument order of a call never depends on the texture it landed on. An abs of an unsigned value and an integer dot take one too, because GLSL ES 3.00 has no overload for either.
A name the file declares
A function the file declares wins over a builtin of the same name. Such a name meant the author's own function before it was a builtin, and an addition does not change what a program already means.
Maths
absU(a) abs(a)aldexp(a, b)(a * intBitsToFloat(((b >> 1) + 127) << 23) * intBitsToFloat(((b - (b >> 1)) + 127) << 23))quantizeToF16Vec2(a) quantizeToF16(a)vec2(unpackHalf2x16(packHalf2x16(vec2(a.x, 0.0))).x, unpackHalf2x16(packHalf2x16(vec2(a.y, 0.0))).x)quantizeToF16Vec3(a) quantizeToF16(a)vec3(unpackHalf2x16(packHalf2x16(vec2(a.x, 0.0))).x, unpackHalf2x16(packHalf2x16(vec2(a.y, 0.0))).x, unpackHalf2x16(packHalf2x16(vec2(a.z, 0.0))).x)quantizeToF16Vec4(a) quantizeToF16(a)vec4(unpackHalf2x16(packHalf2x16(vec2(a.x, 0.0))).x, unpackHalf2x16(packHalf2x16(vec2(a.y, 0.0))).x, unpackHalf2x16(packHalf2x16(vec2(a.z, 0.0))).x, unpackHalf2x16(packHalf2x16(vec2(a.w, 0.0))).x)Geometry
dotI(a, b) dot(a, b)_idot(a, b)dotU(a, b) dot(a, b)_idot(a, b)Derivatives
Bit operations
GLSL ES 3.00 has none of the bit builtins, so the column above names a small function the GLSL writer defines over the shifts, masks and comparisons that target does have. A module that calls none of them carries none of the definitions.
Packing
pack4x8snorm(a)(uint(int(floor(0.5 + clamp(a.x, -1.0, 1.0) * 127.0)) & 0xFF) | (uint(int(floor(0.5 + clamp(a.y, -1.0, 1.0) * 127.0)) & 0xFF) << 8) | (uint(int(floor(0.5 + clamp(a.z, -1.0, 1.0) * 127.0)) & 0xFF) << 16) | (uint(int(floor(0.5 + clamp(a.w, -1.0, 1.0) * 127.0)) & 0xFF) << 24))pack4x8unorm(a)(uint(floor(0.5 + clamp(a.x, 0.0, 1.0) * 255.0)) | (uint(floor(0.5 + clamp(a.y, 0.0, 1.0) * 255.0)) << 8) | (uint(floor(0.5 + clamp(a.z, 0.0, 1.0) * 255.0)) << 16) | (uint(floor(0.5 + clamp(a.w, 0.0, 1.0) * 255.0)) << 24))unpack4x8snorm(a)max(vec4(ivec4(uvec4(a, a >> 8, a >> 16, a >> 24) << 24) >> 24) / 127.0, vec4(-1.0))Casts
Textures and storage
arrayLength(&a)arrayLength has no GLSL ES 3.00 spelling (no storage buffers, no runtime-sized arrays)
storageFetchF32(a, b) storageFetchF32(a, b)_sfetch(a, int(b))storageFetchI32(a, b) storageFetchI32(a, b)_sfetchI(a, int(b))storageFetchU32(a, b) storageFetchU32(a, b)_sfetchU(a, int(b))textureDimensions1d(a) textureDimensions(a)textureDimensions on a texture_1d has no GLSL ES 3.00 spelling
textureDimensions3d(a) textureDimensions(a)uvec3(textureSize(a, 0))textureDimensionsMs(a) textureDimensions(a)textureDimensions on a multisampled texture has no GLSL ES 3.00 spelling
textureGather(a, b, c, d)textureGather has no GLSL ES 3.00 spelling (textureGather is ES 3.10)
textureGatherArray(a, b, c, d, e) textureGather(a, b, c, d, e)textureGather has no GLSL ES 3.00 spelling (textureGather is ES 3.10)
textureGatherCompare(a, b, c, d)textureGatherCompare has no GLSL ES 3.00 spelling (textureGather is ES 3.10)
textureGatherCompareArray(a, b, c, d, e) textureGatherCompare(a, b, c, d, e)textureGatherCompare has no GLSL ES 3.00 spelling (textureGather is ES 3.10)
textureGatherDepth(a, b, c) textureGather(a, b, c)textureGather has no GLSL ES 3.00 spelling (textureGather is ES 3.10)
textureGatherDepthArray(a, b, c, d) textureGather(a, b, c, d)textureGather has no GLSL ES 3.00 spelling (textureGather is ES 3.10)
textureLoad3dU(a, b, c) textureLoad(a, b, c)texelFetch(a, ivec3(b), int(c))textureLoadArray(a, b, c, d) textureLoad(a, b, c, d)texelFetch(a, ivec3(b, int(c)), int(d))textureLoadArrayU(a, b, c, d) textureLoad(a, b, c, d)texelFetch(a, ivec3(ivec2(b), int(c)), int(d))textureLoadDepthMs(a, b, c) textureLoad(a, b, c)a multisampled depth load has no GLSL ES 3.00 spelling (sampler2DMS is ES 3.10)
textureLoadMs(a, b, c) textureLoad(a, b, c)a multisampled load has no GLSL ES 3.00 spelling (sampler2DMS is ES 3.10)
textureLoadU(a, b, c) textureLoad(a, b, c)texelFetch(a, ivec2(b), int(c))textureNumLayersStorage(a) textureNumLayers(a)a storage texture has no GLSL ES 3.00 spelling (image load/store is ES 3.10)
textureNumSamples(a)textureNumSamples has no GLSL ES 3.00 spelling (textureSamples is ES 3.10)
textureSampleArray(a, b, c, d) textureSample(a, b, c, d)texture(a, vec3(c, float(d)))textureSampleBiasArray(a, b, c, d, e) textureSampleBias(a, b, c, d, e)texture(a, vec3(c, float(d)), e)textureSampleBiasCubeArray(a, b, c, d, e) textureSampleBias(a, b, c, d, e)textureSampleBias on a cube array has no GLSL ES 3.00 spelling (no samplerCubeArray)
textureSampleCompareArray(a, b, c, d, e) textureSampleCompare(a, b, c, d, e)texture(a, vec4(c, float(d), e))textureSampleCompareCube(a, b, c, d) textureSampleCompare(a, b, c, d)texture(a, vec4(c, d))textureSampleCompareCubeArray(a, b, c, d, e) textureSampleCompare(a, b, c, d, e)textureSampleCompare on a cube array has no GLSL ES 3.00 spelling (no samplerCubeArray)
textureSampleCompareLevel(a, b, c, d)textureLod(a, vec3(c, d), 0.0)textureSampleCompareLevelArray(a, b, c, d, e) textureSampleCompareLevel(a, b, c, d, e)textureGrad(a, vec4(c, float(d), e), vec2(0.0), vec2(0.0))textureSampleCompareLevelCube(a, b, c, d) textureSampleCompareLevel(a, b, c, d)textureGrad(a, vec4(c, d), vec3(0.0), vec3(0.0))textureSampleCompareLevelCubeArray(a, b, c, d, e) textureSampleCompareLevel(a, b, c, d, e)textureSampleCompareLevel on a cube array has no GLSL ES 3.00 spelling (no samplerCubeArray)
textureSampleCubeArray(a, b, c, d) textureSample(a, b, c, d)textureSample on a cube array has no GLSL ES 3.00 spelling (no samplerCubeArray)
textureSampleGradArray(a, b, c, d, e, f) textureSampleGrad(a, b, c, d, e, f)textureGrad(a, vec3(c, float(d)), e, f)textureSampleGradCubeArray(a, b, c, d, e, f) textureSampleGrad(a, b, c, d, e, f)textureSampleGrad on a cube array has no GLSL ES 3.00 spelling (no samplerCubeArray)
textureSampleLevelArray(a, b, c, d, e) textureSampleLevel(a, b, c, d, e)textureLod(a, vec3(c, float(d)), e)textureSampleLevelCubeArray(a, b, c, d, e) textureSampleLevel(a, b, c, d, e)textureSampleLevel on a cube array has no GLSL ES 3.00 spelling (no samplerCubeArray)
textureStore(a, b, c)textureStore has no GLSL ES 3.00 spelling (image load/store is ES 3.10)
Atomics
atomicAdd(&a, b)atomicAdd has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicAnd(&a, b)atomicAnd has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicCompareExchangeWeak(&a, b, c)atomicCompareExchangeWeak has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicExchange(&a, b)atomicExchange has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicLoad(&a)atomicLoad has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicMax(&a, b)atomicMax has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicMin(&a, b)atomicMin has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicOr(&a, b)atomicOr has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicStore(&a, b)atomicStore has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicSub(&a, b)atomicSub has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
atomicXor(&a, b)atomicXor has no GLSL ES 3.00 spelling (no storage buffers, no atomics)
Barriers
workgroupBarrier()workgroupBarrier has no GLSL ES 3.00 spelling (no compute stage)
workgroupUniformLoad(&a)workgroupUniformLoad has no GLSL ES 3.00 spelling (no compute stage)
Emulated double
Rewritten into a pair of f32 lanes before either backend runs.
Rewritten into a pair of f32 lanes before either backend runs.
Rewritten into a pair of f32 lanes before either backend runs.
Rewritten into a pair of f32 lanes before either backend runs.
f64Guard() textureLoad(_fp64, vec2<i32>(0, 0), 0).xtexelFetch(_fp64, ivec2(0, 0), 0).xRewritten into a pair of f32 lanes before either backend runs.
Rewritten into a pair of f32 lanes before either backend runs.
GLSL helper functions
A storage buffer has no GLSL ES 3.00 form, so a read of one is rewritten into a read from a data texture. These are the functions that read stands for, and the GLSL writer emits the definition of each one a module calls.
storageFetchF32 _sfetch storageFetchU32 _sfetchU storageFetchI32 _sfetchI Every row on this page is read from the spelling registry at the pinned commit, and none of it is typed here.