intLit
On this page

intLit()

Function in Emit

Spell v as the body of an i32 or u32 literal (no suffix), in the form WGSL and GLSL share.

import { intLit } from 'typeshade'

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

Syntax

function intLit(v: number, scalar: 'i32' | 'u32'): string

Parameters

v number
scalar 'i32' | 'u32'

Return value

string

Exceptions

SD0017

SD0017 if v is not an integer or lies outside the 32-bit range of scalar. WGSL rejects 2147483648 as an i32 literal, and a fractional or out-of-range value printed verbatim is a compile error on both targets.

Source

src/core/backends/wgsl.ts, line 158, at commit 26de7be8

Edit this page Report a problem