---
name: "SDL_GPUTextureUsageFlags"
section: "3type"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GPUTextureUsageFlags"
---

# SDL\_GPUTextureUsageFlags(3type)

Specifies how a texture is intended to be used by the client.

## NAME

SDL\_GPUTextureUsageFlags - Specifies how a texture is intended to be used by the client.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**typedef Uint32 SDL\_GPUTextureUsageFlags;** **#define SDL\_GPU\_TEXTUREUSAGE\_SAMPLER                                 (1u \<\< 0) /\*\*\< Texture supports sampling. \*/** **#define SDL\_GPU\_TEXTUREUSAGE\_COLOR\_TARGET                            (1u \<\< 1) /\*\*\< Texture is a color render target. \*/** **#define SDL\_GPU\_TEXTUREUSAGE\_DEPTH\_STENCIL\_TARGET                    (1u \<\< 2) /\*\*\< Texture is a depth stencil target. \*/** **#define SDL\_GPU\_TEXTUREUSAGE\_GRAPHICS\_STORAGE\_READ                   (1u \<\< 3) /\*\*\< Texture supports storage reads in graphics stages. \*/** **#define SDL\_GPU\_TEXTUREUSAGE\_COMPUTE\_STORAGE\_READ                    (1u \<\< 4) /\*\*\< Texture supports storage reads in the compute stage. \*/** **#define SDL\_GPU\_TEXTUREUSAGE\_COMPUTE\_STORAGE\_WRITE                   (1u \<\< 5) /\*\*\< Texture supports storage writes in the compute stage. \*/** **#define SDL\_GPU\_TEXTUREUSAGE\_COMPUTE\_STORAGE\_SIMULTANEOUS\_READ\_WRITE (1u \<\< 6) /\*\*\< Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ \| WRITE. \*/**

## DESCRIPTION

A texture must have at least one usage flag. Note that some usage flag combinations are invalid.

With regards to compute storage usage, READ \| WRITE means that you can have shader A that only writes into the texture and shader B that only reads from the texture and bind the same texture to either shader respectively. SIMULTANEOUS means that you can do reads and writes within the same shader or compute pass. It also implies that atomic ops can be used, since those are read-modify-write operations. If you use SIMULTANEOUS, you are responsible for avoiding data races, as there is no data synchronization within a compute pass. Note that SIMULTANEOUS usage is only supported by a limited number of texture formats.

## AVAILABILITY

This datatype is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_CreateGPUTexture**(3)](/SDL_CreateGPUTexture/3.md)
