PassTargets
Interface in Runtime
A render pass's attachments: textures, or a canvas context the host configured.
import type { PassTargets } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
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;}Description
A colour target
is a Texture, a context, or { target, clear, load, store }. load defaults to 'clear',
clear to transparent black, [0, 0, 0, 0], and store to 'store'. The depth target is a
Texture or a DepthAttachment. Its clear defaults to 1, which a reversed projection sets to
0, its load to 'clear' and its store to 'store'.
Instance properties
coloroptionalread onlyreadonly ( | 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'; } )[]Escape hatch (Rule 11.17): a host
GPUTextureorGPUTextureView. A canvas context is also a target (WebGPU; on WebGL2 only the runtime’s own context or canvas).depthoptionalread onlyTexture | DepthAttachment
Source
src/runtime/runtime.ts, line 101, at commit af54ddad5