isVec64
On this page

isVec64()

Function in Types

Narrows a ShaderType to the emulated-double vector arm (vec2f64T and its 3- and 4-wide siblings).

import { isVec64 } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

const isVec64: (
t: ShaderType,
) => t is Extract<ShaderType, { kind: "vec64"; }>

Parameters

t ShaderType

Return value

t is Extract<ShaderType, { kind: 'vec64' }>

Description

Narrows a ShaderType to the emulated-double vector arm (vec2f64T and its 3- and 4-wide siblings). It is distinct from isVec, which matches only the native vec kind and is false for an emulated-double vector. Component access (.comp() and swizzles) accepts either isVec(t) || isVec64(t), since both kinds support it, each through its own emitted form.

Examples

Example

import { isVec64, vec2f64T, vec2fT } from 'typeshade'
isVec64(vec2f64T) // true
isVec64(vec2fT) // false: a native vec, use isVec for that

See also

Source

src/core/ir/types.ts, line 1148, at commit 26de7be8

Edit this page Report a problem