---
title: "PassTargets: interface in Runtime, TypeShade API reference"
description: "PassTargets, an interface in Runtime. A render pass's attachments: textures, or a canvas context the host configured."
url: https://typeshade.dev/api/passtargets/
language: en
---

# `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

```ts
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

**`color` optional read only ``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'; } )[]``**

Escape hatch ([Rule 11.17](https://typeshade.dev/reference/rules/11-17/)): a host `GPUTexture` or `GPUTextureView`. A canvas context is also a target (WebGPU; on WebGL2 only the runtime’s own context or canvas).

**`depth` optional read only `Texture | DepthAttachment`**

## Source

[`src/runtime/runtime.ts`, line 101](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/runtime.ts#L101), at commit af54ddad5
