ParamSpec
On this page

ParamSpec

Type in Authoring

The parameter record externFn takes: a plain map from parameter name to ShaderType, in declaration order.

import type { ParamSpec } from 'typeshade'
import type { ParamSpec } from 'typeshade/core/ir'

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

Syntax

type ParamSpec = Record<string, ShaderType>;

Description

An extern function is only ever called, never used as a pipeline entry point, so its record carries no stage attribute and no struct handle. FnParamSpec is the richer record fn() accepts.

Examples

Example

import { type ParamSpec } from 'typeshade'
import { externFn, f32T, vec2fT } from 'typeshade/core/ir'
const WARP_PARAMS = { x: f32T, y: f32T, scale: f32T } satisfies ParamSpec
export const warp = externFn('warp', WARP_PARAMS, vec2fT)

See also

Source

src/core/ir/builder.ts, line 54, at commit af54ddad5

Edit this page Report a problem