---
title: "Pack: TypeShade 셰이더 API의 리플렉션 분류 인터페이스 참조 문서"
description: "Pack, TypeShade API의 리플렉션 분류에 속하는 인터페이스입니다. buildManifest가 만드는, 직렬화할 수 있는 결과입니다. 자세한 내용은 buildManifest 항목에서 설명합니다."
url: https://typeshade.dev/ko/api/pack/
language: ko
---

# `Pack`

인터페이스, 리플렉션 분류

buildManifest가 만드는, 직렬화할 수 있는 결과입니다. 자세한 내용은 buildManifest 항목에서 설명합니다.

`import type { Pack } from 'typeshade'`
`import type { Pack } from 'typeshade/runtime'`

설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.

## 구문

```ts
interface Pack<E extends PackBindings = PackBindings> {
  readonly schema: typeof PACK_SCHEMA;
  readonly compiler: string;
  readonly emit?: { readonly level?: 'O0' | 'O1' | 'O2'; readonly parens?: 'full' | 'minimal'; readonly fp64Flavor?: 'float' | 'integer'; };
  readonly wgsl: string;
  readonly glsl?: { readonly vertex: string; readonly fragment: string };
  readonly bindings: readonly PackBinding[];
  readonly vertexLayout?: GpuVertexLayout;
  readonly entries: readonly PackEntry[];
  readonly structs: readonly { readonly name: string; readonly emitted: string; readonly fields: readonly { name: string; emitted: string; type: string }[]; }[];
  readonly overrides: readonly PackOverride[];
  readonly features: readonly string[];
  readonly console?: PackConsole;
  readonly variants?: { readonly console?: PackConsole };
  readonly ir?: PortableIr;
  readonly gl?: { /** Each vertex entry's vertex program on WebGL2 (change 0054), or why it has none. */ readonly vertices?: Readonly<Record<string, PackGlVertex | { readonly none: string }>>; /** Each fragment entry's fragment program on WebGL2, or why it has none: a render * pipeline links it with a vertex entry's, and a full-screen draw with the tier's own. */ readonly draws?: Readonly<Record<string, PackGlDraw | { readonly none: string }>>; /** Each compute entry's pass program on WebGL2 (change 0054), or why it has none. */ readonly computes?: Readonly<Record<string, PackGlCompute | { readonly none: string }>>; };
  readonly [entryBindings]?: E;
}
```

## 설명

`E`는 각 항목이 닿는 바인딩이다(change 0030). 모듈의 호스트 뷰는 기본 내보내기의 타입을 이 바인딩으로 지정하고, 프로그램 런타임은 이를 각 드로우와 디스패치에 실어 보냅니다. JSON에서 읽었거나 실행 중에 만든 매니페스트는 인자 없는 `Pack`입니다. 이 형태는 어떤 바인딩이든 받습니다. 실행 중에는 `E`를 담는 값이 없습니다.

## 인스턴스 속성

**`schema` 읽기 전용 `typeof PACK_SCHEMA`**

매니페스트의 스키마입니다. 읽는 쪽은 이를 가장 먼저 확인한다([Rule 11.10](https://typeshade.dev/ko/reference/rules/11-10/)).

**`compiler` 읽기 전용 `string`**

이를 쓴 패키지 버전입니다.

**`emit` 선택 사항 읽기 전용 `{ readonly level?: 'O0' | 'O1' | 'O2'; readonly parens?: 'full' | 'minimal'; readonly fp64Flavor?: 'float' | 'integer'; }`**

프로그램을 생성할 때 쓴 옵션입니다. 빌드가 `packModule(m, { emit })`로 아래 세 옵션 가운데 하나라도 넘기면 매니페스트가 이를 기록할 수 있습니다. 세 옵션은 최적화 `level`, `parens`, `fp64Flavor`이다. `plugins`는 매니페스트가 기록할 수 없으므로 제외합니다. 빌드가 넘기지 않은 옵션은 없는 상태이며, 기본값(`'O2'`, `'full'`, `'float'`)을 나타냅니다. 아무 옵션도 없이 만든 매니페스트에는 `emit`이 없습니다. 로드 시점의 생성기가 이 옵션으로 프로그램을 다시 생성한다([Rule 11.10](https://typeshade.dev/ko/reference/rules/11-10/)).

**`wgsl` 읽기 전용 `string`**

**`glsl` 선택 사항 읽기 전용 `{ readonly vertex: string; readonly fragment: string }`**

**`bindings` 읽기 전용 `readonly PackBinding[]`**

**`vertexLayout` 선택 사항 읽기 전용 `GpuVertexLayout`**

첫 번째 버텍스 진입점의 버텍스 버퍼입니다. `entries[].vertex`가 각 버퍼에 준 그대로입니다.

**`entries` 읽기 전용 `readonly PackEntry[]`**

**`structs` 읽기 전용 `readonly { readonly name: string; readonly emitted: string; readonly fields: readonly { name: string; emitted: string; type: string }[]; }[]`**

**`overrides` 읽기 전용 `readonly PackOverride[]`**

**`features` 읽기 전용 `readonly string[]`**

디바이스가 프로그램의 파이프라인을 만들려면 가져야 하는 `GPUFeatureName` 목록입니다.

**`console` 선택 사항 읽기 전용 `PackConsole`**

기본으로 켜져 있는, 기록하는 변형입니다. 예전에 기록하는 빌드를 위해 유지됩니다.

**`variants` 선택 사항 읽기 전용 `{ readonly console?: PackConsole }`**

사용할 수 있는 변형이며, 로드 시점에 명시적으로 선택합니다. 이 필드가 있다고 해서 아무것도 켜지지 않습니다.

**`ir` 선택 사항 읽기 전용 `PortableIr`**

빌드가 요청한 경우에 프로그램을 이식 가능한 IR로 담습니다. 이 IR은 `repack()`이 다시 생성하는 내용입니다. IR은 이를 쓴 패키지 버전만 읽습니다.

**`gl` 선택 사항 읽기 전용 `{ /** Each vertex entry's vertex program on WebGL2 (change 0054), or why it has none. */ readonly vertices?: Readonly<Record<string, PackGlVertex | { readonly none: string }>>; /** Each fragment entry's fragment program on WebGL2, or why it has none: a render * pipeline links it with a vertex entry's, and a full-screen draw with the tier's own. */ readonly draws?: Readonly<Record<string, PackGlDraw | { readonly none: string }>>; /** Each compute entry's pass program on WebGL2 (change 0054), or why it has none. */ readonly computes?: Readonly<Record<string, PackGlCompute | { readonly none: string }>>; }`**

WebGL2 tier가 쓰는 값입니다. 전체 화면 프래그먼트 진입점마다 드로우가 있으면 그 드로우를 담고, 없으면 없는 이유를 담습니다.

## 소스

[`src/core/manifest-types.ts`, 292행](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/manifest-types.ts#L292), 커밋 af54ddad5 기준
