RawStmt
On this page

RawStmt

Type in IR

The raw statement node: a fragment of target source spliced verbatim into a function body, spelled per target.

import type { RawStmt } from 'typeshade'

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

Syntax

type RawStmt = Extract<Stmt, { s: 'raw' }>;

Description

The raw statement node: a fragment of target source spliced verbatim into a function body, spelled per target. It carries a wgsl side, a glsl side, or both, and at least one is required. A Backend receives the whole node in its rawStmt method and emits its own side; when that side is absent it throws SD0030, so a one-sided raw statement means “this module does not build for that target” and never emits the wrong text. The CPU backend throws on every raw statement, since raw text has no CPU evaluation. Build one with rawStmt.

See also

Source

src/core/ir/nodes.ts, line 357, at commit 26de7be8

Edit this page Report a problem