Types
85 members
The type keys and type descriptors the authoring surface is typed by.
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
-
ALL_STORAGE_TEXTURE_FORMATSConstant - Every StorageTextureFormat, as a runtime value: the list a front end validates a written name against and a doc generator iterates.
-
ArithArgType - The operand a binary arithmetic method accepts for a receiver of key K.
-
ArrayElemKeyType - Element key of an array key:
array<f32,4>→ 'f32', array<vec3<f32>> → 'vec3<f32>', and never for a key that is not an array. -
arrayTFunction - Builds the ShaderType for an array.
-
atomicI32TConstant atomic<i32>: the signed twin of atomicU32T.-
atomicU32TConstant atomic<u32>: an unsigned 32-bit integer in storage memory that many invocations update at once through the atomic* builtins.-
boolTConstant - The bool scalar type: the type of every comparison and logical (.and, .or) result, the required return type of a boolean-returning fn, and the type an If(/api/if/) condition is checked against when the authoring code runs.
-
CAS_RESULT_STRUCTSConstant - The struct
atomicCompareExchangeWeakanswers: the contents the location held before the call, and whether the exchange happened. -
casResultTFunction - The CAS_RESULT_STRUCTS type for one atomic element kind.
-
CmpArgType - The operand a comparison method accepts for a receiver of key K: the receiver's own scalar kind, since both targets compare matching operands only, plus
f32for anf64receiver, which widens before the compare. -
ElemKeyType - Element key of a vector key; identity for scalars.
-
f32TConstant - The
f32scalar type, the DSL's default numeric type: what a bare numeric literal lifts to (lift(3) is a Node<'f32'>) and what most builtins return. -
f64TConstant - The emulated double-precision scalar type.
-
Float64KeyType - The emulated-double keys, '
f64' and thef64vectors. -
FloatKeyType - The
f32-family keys, 'f32' and thef32vectors: the argument domain of the float-only component-wise builtins. -
i32TConstant - The
i32scalar type, the DSL's signed-integer type: the result type of thei32(/api/i32/) cast, and the type a non-integer matchExpr scrutinee is cast to before emit, since WGSL's switch only accepts integer scrutinees. -
IntKeyType - The integer keys,
i32andu32scalars and vectors, for the builtins whose WGSL and GLSL domain includes integers: abs, min, max and clamp. -
isF64Function - Narrows a ShaderType to the emulated-double scalar arm (f64T).
-
isMatFunction - Narrows a ShaderType to the { kind: 'mat' } arm.
-
isMat64Function - Narrows a ShaderType to an emulated-double matrix (matNxN<
f64>, see mat2f64T), which is emitted as a struct of double-double columns. -
isScalarFunction - Narrows a ShaderType to the native { kind: 'scalar' } arm.
-
isVecFunction - Narrows a ShaderType to the native { kind: 'vec' } arm, whose elem is '
f32' | 'i32' | 'u32'. -
isVec64Function - Narrows a ShaderType to the emulated-double vector arm (vec2f64T and its 3- and 4-wide siblings).
-
KeyOfType - Turns a ShaderType literal into the precise string key that Node carries as its compile-time phantom: KeyOf<typeof vec3fT> resolves to '
vec3<f32>', so avec2andvec3operand mismatch fails tsc before the runtime SD0002 check in typeKey and typeEq would catch it. -
mat2f64TConstant - A 2×2 emulated-double matrix, logically
mat2x2<f64>. -
mat3f64TConstant - A 3×3 emulated-double matrix; see mat2f64T for how it is emitted and the matrix operations available on it.
-
mat4f64TConstant - A 4×4 emulated-double matrix; see mat2f64T for how it is emitted and the matrix operations available on it.
-
mat4x4fTConstant - A native
mat4x4<f32>, the model-view-projection or view matrix type of a typical per-frame uniform. -
matTFunction - Any matCxR<
f32> or matCxR<f64>: cols columns of rows components each, column-major as both targets are. -
NodeLikeType - Anything accepted where a node is read: any node, mutable or read-only, or a JS number, which lifts to an
f32literal. -
NonCompositeType - Maps a composite key to never and passes every other key through.
-
READ_WRITE_STORAGE_FORMATSConstant - The formats a device takes at read_write access, which is the three single-channel 32-bit ones and no others (measured, as StorageTextureFormat describes).
-
samplerComparisonTConstant - The comparison sampler
textureSampleComparetakes: it compares a reference value against the texel and yields how much of the filter footprint passed, rather than the texel itself. -
samplerTConstant - The sampler resource type.
-
ScalarType - The four native scalar kinds: the ones WGSL and GLSL ES 3.00 both represent directly in hardware, and the set a ShaderType of kind: 'scalar' can carry.
-
ScalarCastSourceType - The scalar keys a cast reads: every native scalar, plus the emulated double.
-
ScalarKeyType - The key form of Scalar without 'bool': the set accepted wherever the DSL needs an indexable or comparable native scalar, such as array indices (.at(i, elem)), bitwise-op operands, and matchExpr or Switch scrutinees.
-
ShaderTypeType - The runtime type descriptor for every value the DSL can represent: a plain, comparable discriminated union, so a switch (t.kind) over it is exhaustively checked by tsc at every site that must decide what to do with a shape (typeKey, wgslLayout, both backends' emit walkers).
-
storageFormatFeatureFunction - The device feature a format needs before any device will store to it, or undefined when the format is core.
-
storageTexelFunction - The type of one texel of a storage texture, which its format's channel kind decides: a …uint format loads and stores
vec4<u32>, a …sint formatvec4<i32>, and every other onevec4<f32>. -
StorageTextureAccessType - How a shader may touch a storage texture.
-
StorageTextureFormatType - The texel formats a storage texture may carry, which is WebGPU's set of formats every device supports with STORAGE_BINDING and no optional feature.
-
storageTextureLayoutAccessFunction - What WebGPU's GPUStorageTextureBindingLayout.access calls a WGSL access mode.
-
structTFunction - Builds the ShaderType for a named struct: the type you pass wherever a struct-typed value is authored (a b.var(name, structT('VsOut')) local, an fn parameter, an array element via arrayT).
-
SwizzleKeyType - The key of v.swizzle(S) for a vector key K: the element scalar when S has one character, otherwise vecN<elem> with N the length of S.
-
TexelKeyType - The
vec4<…>key a texel load from texture key K yields: the loaded element is the element in the texture key, sotexture_2d<u32> loads avec4<u32>. -
texture1dfTConstant - A sampled float 1D texture: a row of texels addressed by one
f32, the shape a transfer function or a colour ramp takes. -
texture2dArrayfTConstant - A sampled 2D array texture: one texture object with N independently addressable layers.
-
texture2dArrayiTConstant - A signed-integer 2D array texture: the signed twin of texture2dArrayuT.
-
texture2dArrayuTConstant - An unsigned-integer 2D array texture: texture2dArrayfT's layer model with texture2duT's exact integer texels.
-
texture2dfTConstant - A sampled 2D float texture: the ordinary single-layer binding type behind
textureSampleandtextureLoad, for colour ramps, lookup tables and atlases (resource). -
texture2diTConstant - A signed-integer 2D texture: the signed twin of texture2duT, with the same load-only contract.
-
texture2dMsfTConstant - A multisampled 2D texture: the resolve-source binding for an MSAA render target, read one sample at a time with
textureLoadinside a per-sample averaging loop. -
texture2duTConstant - An unsigned-integer 2D texture.
-
texture3dfTConstant - A sampled float 3D texture: a volume addressed by a
vec3coordinate, the shape a colour-grading lookup table or a density field takes. -
textureCubeArrayfTConstant - An array of float cube textures: N environment maps in one binding, looked up by a
vec3direction and a layer. -
textureCubefTConstant - A sampled float cube texture: six faces looked up by a
vec3Direction rather than a coordinate, the shape an environment map or a skybox takes. -
textureDepth2dArrayTConstant - An array of 2D depth textures, the shape a cascaded shadow map takes.
-
textureDepth2dTConstant - A 2D depth texture, the texture a shadow map is.
-
textureDepthCubeArrayTConstant - An array of cube depth textures: the shadow maps of N point lights in one binding.
-
textureDepthCubeTConstant - A cube depth texture: the shadow map of a point light, compared by the direction from the light.
-
textureDepthMultisampled2dTConstant - A multisampled depth texture: the depth attachment of an MSAA render target, read one sample at a time with
textureLoadand never sampled or compared. -
TextureElemType - The element type of a sampled texture: WGSL's
texture_2d<T> type parameter, or GLSL ES 3.00's sampler prefix. -
TextureLoad2dKeyType - Every non-array texture key a texel load accepts: the three sampled elements plus the multisampled
f32texture. -
TextureLoadArrayKeyType - Every 2D array texture key a texel load accepts.
-
typeEqFunction - Structural equality for ShaderType: two types are equal when their typeKey strings match, so a constant like boolT compares equal to a freshly built { kind: 'scalar', scalar: 'bool' } object even though they are different references.
-
typeKeyFunction - The runtime twin of KeyOf: turns any ShaderType value, literal or widened, into its canonical string key.
-
u32TConstant - The
u32scalar type, the DSL's unsigned-integer type: counts, indices, and the compute and vertex builtins that are unsigned by spec (builtin; the vector form is builtin). -
vec2bTConstant vec2<bool>: what a comparison of twovec2values yields, componentwise.-
vec2f64TConstant - A 2-component emulated-double vector, logically
vec2<f64>. -
vec2fTConstant - A native
vec2<f32>, the most common vector type in the DSL: screen and UV coordinates and 2D positions, such as a uv: location(0, vec2fT) fragment-input field or a resolution: vec2fT uniform. -
vec2iTConstant - A native
vec2<i32>. Build a value with thevec2iconstructor, for example a texel coordinate fortextureLoad. -
vec2uTConstant - A native
vec2<u32>, a 2-wide unsigned-integer field, such as a packed pick-ID varying declared location. -
vec3bTConstant vec3<bool>: the componentwise comparison of two three-component vectors.-
vec3f64TConstant - A 3-component emulated-double vector; see vec2f64T for how it is emitted and when to prefer the emulated-double family over plain vec3fT.
-
vec3fTConstant - A native
vec3<f32>, the usual carrier for a world-space position or direction, such as the p: vec3fT parameter of a signed-distance scene function. -
vec3iTConstant - A native
vec3<i32>, the signed-integer counterpart of vec3uT, a texel coordinate into an array texture, a signed grid cell. -
vec3uTConstant - A native
vec3<u32>, chiefly the type of the computeglobal_invocation_idbuiltin (builtin). -
vec4bTConstant vec4<bool>: the componentwise comparison of two four-component vectors.-
vec4f64TConstant - A 4-component emulated-double vector; see vec2f64T for how it is emitted and when to prefer the emulated-double family over plain vec4fT.
-
vec4fTConstant - A native
vec4<f32>: an RGBA colour or a homogeneous clip-space position. -
vec4iTConstant - A native
vec4<i32>, completing the signed-integer vector family alongside vec2iT. -
vec4uTConstant - A native
vec4<u32>, a 4-wide unsigned-integer resource or uniform field, such as the parameter block of a compute kernel (resource). -
voidTConstant - The absent-value type: the return type of an fn whose body never returns a value.
-
WRITE_ONLY_STORAGE_FORMATSConstant - The formats a device takes at write and at no other access mode, which today is bgra8unorm alone.