---
title: "texture_storage_2d: type in the TypeShade language reference"
description: "texture_storage_2d, a type in the TypeShade language reference. A 2D storage texture, read and written by texel coordinate with textureLoad and textureStore…"
url: https://typeshade.dev/reference/types/texture_storage_2d/
language: en
---

# `texture_storage_2d`

Type

A 2D storage texture, read and written by texel coordinate with `textureLoad` and `textureStore`, with no sampler.

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

```ts
type texture_storage_2d<
  F extends StorageFormat,
  A extends StorageAccess = 'write',
> = A extends 'write'
  ? { readonly [storageTextureTag]: readonly [F, A, false] }
  : F extends WriteOnlyStorageFormat
    ? never
    : A extends 'read_write'
      ? F extends ReadWriteStorageFormat
        ? { readonly [storageTextureTag]: readonly [F, A, false] }
        : never
      : { readonly [storageTextureTag]: readonly [F, A, false] }
```

A signature may name a type the ambient file declares for its own use. These are those declarations.

**`StorageFormat`**

`type StorageFormat = 'rgba8unorm' | 'rgba8snorm' | 'rgba8uint' | 'rgba8sint' | 'rgba16uint' | 'rgba16sint' | 'rgba16float' | 'r32uint' | 'r32sint' | 'r32float' | 'rg32uint' | 'rg32sint' | 'rg32float' | 'rgba32uint' | 'rgba32sint' | 'rgba32float' | 'bgra8unorm'`

**`StorageAccess`**

`type StorageAccess = 'write' | 'read' | 'read_write'`

**`ReadWriteStorageFormat`**

`type ReadWriteStorageFormat = 'r32uint' | 'r32sint' | 'r32float'`

**`WriteOnlyStorageFormat`**

`type WriteOnlyStorageFormat = 'bgra8unorm'`

## Parameters

- `F` `StorageFormat`
- `A` optional `StorageAccess`

## Description

Its format and access mode are its type arguments, as in `declare const dst: texture_storage_2d<"rgba8unorm", "write">`; in a render entry its GLSL lowering is not supported yet ([Rule 10.5](https://typeshade.dev/reference/rules/10-5/)), and a `@compute` entry runs it on WebGL2 as its pass program ([Rule 8.24](https://typeshade.dev/reference/rules/8-24/), [Rule 11.8](https://typeshade.dev/reference/rules/11-8/)).

## Examples

- [`gallery/kernel-image-invert/kernel-image-invert.shade.ts`](https://typeshade.dev/guide/examples/kernel-image-invert/)
- [`gallery/storage-texture/storage-texture.shade.ts`](https://typeshade.dev/guide/examples/storage-texture/)

## See also

- [Types](https://typeshade.dev/reference/types/)
