StructDecl
On this page

StructDecl

Interface in IR

A ModuleDecl.structs entry: a WGSL struct declaration.

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

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

Syntax

interface StructDecl {
readonly name: string;
readonly fields: readonly StructField[];
}

Description

On GLSL it becomes a plain struct, or a flattened set of in/out globals when its fields carry location/builtin (see StructField). Use uniformStruct or ioStruct to derive one together with its binding and typed field access instead of writing this shape by hand.

Instance properties

nameread only string
fieldsread only readonly StructField[]

See also

Source

src/core/ir/nodes/struct-decl.ts, line 63, at commit af54ddad5

Edit this page Report a problem