타입
export 85개
작성 API에 타입을 붙이는 타입 키와 타입 기술자입니다. 셰이더 값의 형태가 여기서 정해집니다.
시그니처, 설명, 예제는 커밋 26de7be8의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
-
ALL_STORAGE_TEXTURE_FORMATS상수 - Every StorageTextureFormat, as a runtime value: the list a front end validates a written name against and a doc generator iterates.
-
ArithArg타입 - The operand a binary arithmetic method accepts for a receiver of key K.
-
ArrayElemKey타입 - 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.
-
arrayT함수 - Builds the ShaderType for an array.
-
atomicI32T상수 - atomic<i32>: the signed twin of atomicU32T.
-
atomicU32T상수 - atomic<u32>: an unsigned 32-bit integer in storage memory that many invocations update at once through the atomic* builtins.
-
boolT상수 - 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_STRUCTS상수 - The struct atomicCompareExchangeWeak answers: the contents the location held before the call, and whether the exchange happened.
-
casResultT함수 - The CAS_RESULT_STRUCTS type for one atomic element kind.
-
CmpArg타입 - 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 f32 for an f64 receiver, which widens before the compare.
-
ElemKey타입 - Element key of a vector key; identity for scalars.
-
f32T상수 - The f32 scalar 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.
-
f64T상수 - The emulated double-precision scalar type.
-
Float64Key타입 - The emulated-double keys, 'f64' and the f64 vectors.
-
FloatKey타입 - The f32-family keys, 'f32' and the f32 vectors: the argument domain of the float-only component-wise builtins.
-
i32T상수 - The i32 scalar type, the DSL's signed-integer type: the result type of the i32(/api/i32/) cast, and the type a non-integer matchExpr scrutinee is cast to before emit, since WGSL's switch only accepts integer scrutinees.
-
IntKey타입 - The integer keys, i32 and u32 scalars and vectors, for the builtins whose WGSL and GLSL domain includes integers: abs, min, max and clamp.
-
isF64함수 - Narrows a ShaderType to the emulated-double scalar arm (f64T).
-
isMat함수 - Narrows a ShaderType to the { kind: 'mat' } arm.
-
isMat64함수 - Narrows a ShaderType to an emulated-double matrix (matNxN<f64>, see mat2f64T), which is emitted as a struct of double-double columns.
-
isScalar함수 - Narrows a ShaderType to the native { kind: 'scalar' } arm.
-
isVec함수 - Narrows a ShaderType to the native { kind: 'vec' } arm, whose elem is 'f32' | 'i32' | 'u32'.
-
isVec64함수 - Narrows a ShaderType to the emulated-double vector arm (vec2f64T and its 3- and 4-wide siblings).
-
KeyOf타입 - 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 a vec2 and vec3 operand mismatch fails tsc before the runtime SD0002 check in typeKey and typeEq would catch it.
-
mat2f64T상수 - A 2×2 emulated-double matrix, logically mat2x2<f64>.
-
mat3f64T상수 - A 3×3 emulated-double matrix; see mat2f64T for how it is emitted and the matrix operations available on it.
-
mat4f64T상수 - A 4×4 emulated-double matrix; see mat2f64T for how it is emitted and the matrix operations available on it.
-
mat4x4fT상수 - A native mat4x4<f32>, the model-view-projection or view matrix type of a typical per-frame uniform.
-
matT함수 - Any matCxR<f32> or matCxR<f64>: cols columns of rows components each, column-major as both targets are.
-
NodeLike타입 - Anything accepted where a node is read: any node, mutable or read-only, or a JS number, which lifts to an f32 literal.
-
NonComposite타입 - Maps a composite key to never and passes every other key through.
-
READ_WRITE_STORAGE_FORMATS상수 - 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).
-
samplerComparisonT상수 - The comparison sampler textureSampleCompare takes: it compares a reference value against the texel and yields how much of the filter footprint passed, rather than the texel itself.
-
samplerT상수 - The sampler resource type.
-
Scalar타입 - 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.
-
ScalarCastSource타입 - The scalar keys a cast reads: every native scalar, plus the emulated double.
-
ScalarKey타입 - 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.
-
ShaderType타입 - 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).
-
storageFormatFeature함수 - The device feature a format needs before any device will store to it, or undefined when the format is core.
-
storageTexel함수 - 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 format vec4<i32>, and every other one vec4<f32>.
-
StorageTextureAccess타입 - How a shader may touch a storage texture.
-
StorageTextureFormat타입 - 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.
-
storageTextureLayoutAccess함수 - What WebGPU's GPUStorageTextureBindingLayout.access calls a WGSL access mode.
-
structT함수 - 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).
-
SwizzleKey타입 - 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.
-
TexelKey타입 - The vec4<…> key a texel load from texture key K yields: the loaded element is the element in the texture key, so texture_2d<u32> loads a vec4<u32>.
-
texture1dfT상수 - A sampled float 1D texture: a row of texels addressed by one f32, the shape a transfer function or a colour ramp takes.
-
texture2dArrayfT상수 - A sampled 2D array texture: one texture object with N independently addressable layers.
-
texture2dArrayiT상수 - A signed-integer 2D array texture: the signed twin of texture2dArrayuT.
-
texture2dArrayuT상수 - An unsigned-integer 2D array texture: texture2dArrayfT's layer model with texture2duT's exact integer texels.
-
texture2dfT상수 - A sampled 2D float texture: the ordinary single-layer binding type behind textureSample and textureLoad, for colour ramps, lookup tables and atlases (resource).
-
texture2diT상수 - A signed-integer 2D texture: the signed twin of texture2duT, with the same load-only contract.
-
texture2dMsfT상수 - A multisampled 2D texture: the resolve-source binding for an MSAA render target, read one sample at a time with textureLoad inside a per-sample averaging loop.
-
texture2duT상수 - An unsigned-integer 2D texture.
-
texture3dfT상수 - A sampled float 3D texture: a volume addressed by a vec3 coordinate, the shape a colour-grading lookup table or a density field takes.
-
textureCubeArrayfT상수 - An array of float cube textures: N environment maps in one binding, looked up by a vec3 direction and a layer.
-
textureCubefT상수 - A sampled float cube texture: six faces looked up by a vec3 Direction rather than a coordinate, the shape an environment map or a skybox takes.
-
textureDepth2dArrayT상수 - An array of 2D depth textures, the shape a cascaded shadow map takes.
-
textureDepth2dT상수 - A 2D depth texture, the texture a shadow map is.
-
textureDepthCubeArrayT상수 - An array of cube depth textures: the shadow maps of N point lights in one binding.
-
textureDepthCubeT상수 - A cube depth texture: the shadow map of a point light, compared by the direction from the light.
-
textureDepthMultisampled2dT상수 - A multisampled depth texture: the depth attachment of an MSAA render target, read one sample at a time with textureLoad and never sampled or compared.
-
TextureElem타입 - The element type of a sampled texture: WGSL's texture_2d<T> type parameter, or GLSL ES 3.00's sampler prefix.
-
TextureLoad2dKey타입 - Every non-array texture key a texel load accepts: the three sampled elements plus the multisampled f32 texture.
-
TextureLoadArrayKey타입 - Every 2D array texture key a texel load accepts.
-
typeEq함수 - 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.
-
typeKey함수 - The runtime twin of KeyOf: turns any ShaderType value, literal or widened, into its canonical string key.
-
u32T상수 - The u32 scalar 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).
-
vec2bT상수 - vec2<bool>: what a comparison of two vec2 values yields, componentwise.
-
vec2f64T상수 - A 2-component emulated-double vector, logically vec2<f64>.
-
vec2fT상수 - 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.
-
vec2iT상수 - A native vec2<i32>. Build a value with the vec2i constructor, for example a texel coordinate for textureLoad.
-
vec2uT상수 - A native vec2<u32>, a 2-wide unsigned-integer field, such as a packed pick-ID varying declared location.
-
vec3bT상수 - vec3<bool>: the componentwise comparison of two three-component vectors.
-
vec3f64T상수 - A 3-component emulated-double vector; see vec2f64T for how it is emitted and when to prefer the emulated-double family over plain vec3fT.
-
vec3fT상수 - 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.
-
vec3iT상수 - A native vec3<i32>, the signed-integer counterpart of vec3uT, a texel coordinate into an array texture, a signed grid cell.
-
vec3uT상수 - A native vec3<u32>, chiefly the type of the compute global_invocation_id builtin (builtin).
-
vec4bT상수 - vec4<bool>: the componentwise comparison of two four-component vectors.
-
vec4f64T상수 - A 4-component emulated-double vector; see vec2f64T for how it is emitted and when to prefer the emulated-double family over plain vec4fT.
-
vec4fT상수 - A native vec4<f32>: an RGBA colour or a homogeneous clip-space position.
-
vec4iT상수 - A native vec4<i32>, completing the signed-integer vector family alongside vec2iT.
-
vec4uT상수 - A native vec4<u32>, a 4-wide unsigned-integer resource or uniform field, such as the parameter block of a compute kernel (resource).
-
voidT상수 - The absent-value type: the return type of an fn whose body never returns a value.
-
WRITE_ONLY_STORAGE_FORMATS상수 - The formats a device takes at write and at no other access mode, which today is bgra8unorm alone.