Types

Types

65 names

The scalar, vector, matrix and memory types a declaration names.

The signature and the sentence under each name are the compiler's own text at commit 26de7be8.

f32
32-bit floating-point value.
f64
64-bit floating-point value, emulated in software on both GPU targets.
i32
32-bit signed integer value.
u32
32-bit unsigned integer value.
bool
Boolean value.
workgroup
A module variable one workgroup shares, let tile: workgroup<array<f32, 64>>: zero at the start of each workgroup, read and written by every invocation of the workgroup, and a compute entry's alone.
atomic
An atomic<u32> or atomic<i32>: an integer location in a read-write storage binding that many invocations update at once through atomicAdd, atomicLoad and the other atomic builtins.
vec2
A two-component vector of f32.
vec3
A three-component vector of f32.
vec4
A four-component vector of f32.
vec2f
A two-component vector of f32, same type as vec2.
vec3f
A three-component vector of f32, same type as vec3.
vec4f
A four-component vector of f32, same type as vec4.
vec2i
A two-component vector of i32.
vec3i
A three-component vector of i32.
vec4i
A four-component vector of i32.
vec2u
A two-component vector of u32.
vec3u
A three-component vector of u32.
vec4u
A four-component vector of u32.
vec2b
A two-component vector of bool: what comparing two vec2 values yields, componentwise.
vec3b
A three-component vector of bool: what comparing two vec3 values yields, componentwise.
vec4b
A four-component vector of bool: what comparing two vec4 values yields, componentwise.
vec2d
A two-component vector of f64, same type as vec2f64.
vec3d
A three-component vector of f64, same type as vec3f64.
vec4d
A four-component vector of f64, same type as vec4f64.
vec2f64
A two-component vector of f64.
vec3f64
A three-component vector of f64.
vec4f64
A four-component vector of f64.
mat2x2
2x2 matrix of f32 (or f64 as mat2x2<f64>), column-major.
mat2
2x2 matrix of f32, column-major, same type as mat2x2.
mat2x3
2x3 matrix of f32, column-major: 2 columns of vec3.
mat2x4
2x4 matrix of f32, column-major: 2 columns of vec4.
mat3x2
3x2 matrix of f32, column-major: 3 columns of vec2.
mat3x3
3x3 matrix of f32 (or f64 as mat3x3<f64>), column-major.
mat3
3x3 matrix of f32, column-major, same type as mat3x3.
mat3x4
3x4 matrix of f32, column-major: 3 columns of vec4.
mat4x2
4x2 matrix of f32, column-major: 4 columns of vec2.
mat4x3
4x3 matrix of f32, column-major: 4 columns of vec3.
mat4x4
4x4 matrix of f32 (or f64 as mat4x4<f64>), column-major.
mat4
4x4 matrix of f32, column-major, same type as mat4x4.
mat2x2f
2x2 matrix of f32, column-major, same type as mat2x2: WGSL's predeclared alias.
mat2x3f
2x3 matrix of f32, column-major, same type as mat2x3: WGSL's predeclared alias.
mat2x4f
2x4 matrix of f32, column-major, same type as mat2x4: WGSL's predeclared alias.
mat3x2f
3x2 matrix of f32, column-major, same type as mat3x2: WGSL's predeclared alias.
mat3x3f
3x3 matrix of f32, column-major, same type as mat3x3: WGSL's predeclared alias.
mat3x4f
3x4 matrix of f32, column-major, same type as mat3x4: WGSL's predeclared alias.
mat4x2f
4x2 matrix of f32, column-major, same type as mat4x2: WGSL's predeclared alias.
mat4x3f
4x3 matrix of f32, column-major, same type as mat4x3: WGSL's predeclared alias.
mat4x4f
4x4 matrix of f32, column-major, same type as mat4x4: WGSL's predeclared alias.
sampler
A sampler: how a sampled texture is filtered and addressed when textureSample reads it.
sampler_comparison
A comparison sampler: compares a reference depth against a depth texture in textureSampleCompare, the read a shadow map takes.
texture_2d
A sampled 2D texture of f32, i32 or u32 texels, read with textureLoad, or filtered with textureSample when its texels are f32.
texture_2d_array
An array of sampled 2D textures in one binding, picked by an integer layer after the coordinate.
texture_cube
A sampled cube texture, looked up by a vec3 direction, as an environment map is.
texture_3d
A sampled 3D texture, looked up by a vec3 coordinate, as a volume is.
texture_1d
A sampled 1D texture, looked up by one f32 coordinate, as a colour ramp is.
texture_cube_array
An array of sampled cube textures in one binding, looked up by a direction and a layer.
texture_multisampled_2d
A multisampled 2D texture, read one sample at a time with textureLoad(t, coords, sampleIndex) and never filtered.
texture_depth_2d
A 2D depth texture, single-channel float, read with textureSampleCompare through a sampler_comparison or with textureLoad.
texture_depth_2d_array
An array of 2D depth textures in one binding, picked by an integer layer, as shadow cascades are.
texture_depth_cube
A cube depth texture, looked up by a vec3 direction, the shadow map of a point light.
texture_depth_cube_array
An array of cube depth textures in one binding, looked up by a direction and a layer.
texture_depth_multisampled_2d
The depth attachment of a multisampled target, read one sample at a time with textureLoad.
texture_storage_2d
A 2D storage texture, read and written by texel coordinate with textureLoad and textureStore, with no sampler.
texture_storage_2d_array
An array of 2D storage textures in one binding, read and written by texel coordinate and an integer layer.

Every entry on these pages is read from the compiler at the pinned commit, and none of it is typed here.

Edit this page Report a problem