StructDecl
On this page

StructDecl

Interface in IR

A ModuleDecl.structs entry: a WGSL struct declaration.

import type { StructDecl } from 'typeshade'

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

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.ts, line 492, at commit 26de7be8

Edit this page Report a problem