StructDecl
인터페이스, IR 분류
ModuleDecl.structs의 항목 하나로, WGSL 구조체 선언입니다.
import type { StructDecl } from 'typeshade'import type { StructDecl } from 'typeshade/core/ir'
설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.
구문
interface StructDecl { readonly name: string; readonly fields: readonly StructField[];}설명
GLSL에서는 일반 구조체가 됩니다. 필드에 location이나 builtin이 붙어 있으면 in/out 전역 변수 집합으로 펼쳐진다(StructField 참고). 이 형태를 손으로 쓰는 대신 uniformStruct 또는 ioStruct를 사용합니다. 두 함수는 구조체를 바인딩 및 타입이 지정된 필드 접근과 함께 만들어 줍니다.
인스턴스 속성
name읽기 전용stringfields읽기 전용readonly StructField[]
함께 보기
소스
src/core/ir/nodes/struct-decl.ts, 63행, 커밋 af54ddad5 기준