PassTargets
이 페이지에서

PassTargets

인터페이스, 런타임 분류

렌더 패스의 어태치먼트입니다. 텍스처 또는 호스트가 설정한 캔버스 컨텍스트입니다.

import type { PassTargets } from 'typeshade/runtime'

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

구문

interface PassTargets {
readonly color?: readonly ( | Texture | (object & { readonly target?: never }) | { readonly target: Texture | object; /** clearValue. The colour a `'clear'` load writes. Default `[0, 0, 0, 0]`. */ readonly clear?: readonly [number, number, number, number]; /** loadOp. Default `'clear'`. */ readonly load?: 'clear' | 'load'; /** storeOp. Default `'store'`. `'discard'` reads as zero afterwards on both tiers. On WebGL2 it costs one clear of the attachment at pass end. That clear may cost the bandwidth that `'discard'` saves on a tile-based or integrated GPU. The cost is not measured on a device yet. A canvas target refuses `'discard'`. */ readonly store?: 'store' | 'discard'; } )[];
readonly depth?: Texture | DepthAttachment;
}

설명

색상 대상은 Texture, 컨텍스트, 또는 { target, clear, load, store }이다. load의 기본값은 'clear'이고, clear의 기본값은 투명한 검정, [0, 0, 0, 0]입니다. store의 기본값은 'store'입니다. 깊이 대상은 Texture 또는 DepthAttachment입니다. 그 clear의 기본값은 1이며, 역방향 투영은 이 값을 0으로 둡니다. load의 기본값은 'clear'이고 store의 기본값은 'store'입니다.

인스턴스 속성

color선택 사항읽기 전용 readonly ( | Texture | (object & { readonly target?: never }) | { readonly target: Texture | object; /** clearValue. The colour a `'clear'` load writes. Default `[0, 0, 0, 0]`. */ readonly clear?: readonly [number, number, number, number]; /** loadOp. Default `'clear'`. */ readonly load?: 'clear' | 'load'; /** storeOp. Default `'store'`. `'discard'` reads as zero afterwards on both tiers. On WebGL2 it costs one clear of the attachment at pass end. That clear may cost the bandwidth that `'discard'` saves on a tile-based or integrated GPU. The cost is not measured on a device yet. A canvas target refuses `'discard'`. */ readonly store?: 'store' | 'discard'; } )[]

탈출구(Rule 11.17)입니다. 호스트의 GPUTexture 또는 GPUTextureView입니다. 캔버스 컨텍스트도 타깃이 될 수 있다(WebGPU. WebGL2에서는 런타임 자신의 컨텍스트나 캔버스만 해당합니다).

depth선택 사항읽기 전용 Texture | DepthAttachment

소스

src/runtime/runtime.ts, 101행, 커밋 af54ddad5 기준

이 페이지 편집 문제 보고