ScalarCastSource
On this page

ScalarCastSource

Type in Types

The scalar keys a cast reads: every native scalar, plus the emulated double.

import type { ScalarCastSource } from 'typeshade'

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

Syntax

type ScalarCastSource = 'f32' | 'i32' | 'u32' | 'f64' | 'bool';

Description

WGSL converts between all of them — f32(true) is 1.0 — and none of them is a vector, which is the point: f32(someVec3) used to type-check on both authoring surfaces and emit f32(v), which no target compiles.

Source

src/core/ir/node.ts, line 904, at commit 26de7be8

Edit this page Report a problem