PackBinding
인터페이스, 리플렉션 분류
리소스 슬롯 하나입니다. name, space, group, binding, access, type은 packModule()이 항상 제공한 필드이고, 나머지는 스키마 1에서 추가되었습니다.
import type { PackBinding } from 'typeshade'
설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.
구문
interface PackBinding { readonly name: string; readonly emitted: string; readonly emittedGlsl: string; readonly space: string; readonly group: number; readonly binding: number; readonly access?: 'read' | 'read_write'; readonly type: string; readonly resource: PackResource; readonly stages: readonly ('vertex' | 'fragment' | 'compute')[]; readonly layout?: PackLayout; readonly rule?: 'std140' | 'std430'; readonly noLayout?: string; readonly injected?: true; readonly dataTexture?: PackDataTexture;}인스턴스 속성
name읽기 전용string호스트가 바인딩할 때 쓰는, 작성한 이름입니다.
emitted읽기 전용string생성된 텍스트에서 이 바인딩을 선언하는 이름입니다(규칙 11.10).
emittedGlsl읽기 전용stringGLSL 표기이며, 항상 있습니다. 두 대상의 표기가 같은 곳에서는
emitted와 같습니다.space읽기 전용stringgroup읽기 전용numberbinding읽기 전용numberaccess선택 사항읽기 전용'read' | 'read_write'type읽기 전용stringtypeKey가 만드는 표기입니다:vec4<f32>,array<f32>,texture_2d<f32>.resource읽기 전용PackResourcestages읽기 전용readonly ('vertex' | 'fragment' | 'compute')[]이 리소스에 닿는 진입점이 속한 스테이지입니다. 바인드 그룹 레이아웃의 visibility가 이를 지정합니다.
layout선택 사항읽기 전용PackLayout버퍼의 바이트 레이아웃이며,
rule을 따릅니다. 핸들에는 이 필드가 없습니다.rule선택 사항읽기 전용'std140' | 'std430'noLayout선택 사항읽기 전용string버퍼에 호스트 레이아웃이 없는 이유입니다.
bool이거나, 유니폼 안의 두 행짜리 행렬입니다.injected선택 사항읽기 전용true생성 과정이 추가하는 바인딩입니다. 호스트는 다른 바인딩과 똑같이 이를 바인딩합니다. 추가되는 바인딩은
_fp64가드, 값 1.0을 담은 1 × 1 텍스처, 기록된 변형의_console버퍼입니다.dataTexture선택 사항읽기 전용PackDataTextureWebGL2에서 GLSL ES 3.00 프로그램이 스토리지 배열을 데이터 텍스처로 읽는 경우, 그 배열의 데이터 텍스처입니다.
소스
src/core/manifest-types.ts, 176행, 커밋 af54ddad5 기준