---
title: "DepthAttachment: type in Runtime, TypeShade API reference"
description: "DepthAttachment, a type in Runtime. A depth attachment: the depth aspect of one texture, and its stencil object when the format has a stencil aspect."
url: https://typeshade.dev/api/depthattachment/
language: en
---

# `DepthAttachment`

Type in Runtime

A depth attachment: the depth aspect of one texture, and its stencil object when the format has a stencil aspect.

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

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
type DepthAttachment = { readonly target: Texture } & DepthAspect & {
    readonly stencil?: StencilAspect;
  };
```

## Description

A depth format with no stencil aspect takes no `stencil`. The `stencil` object follows the depth aspect for each field it omits. A read-only depth makes the stencil object read-only with load `'load'`. `stencil: { readOnly: false }` differs from `stencil: {}`.

## Source

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