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

# SDL\_BeginGPUComputePass(3)

Begins a compute pass on a command buffer.

## NAME

SDL\_BeginGPUComputePass - Begins a compute pass on a command buffer.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

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

**SDL\_GPUComputePass \* SDL\_BeginGPUComputePass(**     **SDL\_GPUCommandBuffer \*command\_buffer,**     **const SDL\_GPUStorageTextureReadWriteBinding \*storage\_texture\_bindings,**     **Uint32 num\_storage\_texture\_bindings,**     **const SDL\_GPUStorageBufferReadWriteBinding \*storage\_buffer\_bindings,**     **Uint32 num\_storage\_buffer\_bindings);**

## DESCRIPTION

A compute pass is defined by a set of texture subresources and buffers that may be written to by compute pipelines. These textures and buffers must have been created with the COMPUTE\_STORAGE\_WRITE bit or the COMPUTE\_STORAGE\_SIMULTANEOUS\_READ\_WRITE bit. If you do not create a texture with COMPUTE\_STORAGE\_SIMULTANEOUS\_READ\_WRITE, you must not read from the texture in the compute pass. All operations related to compute pipelines must take place inside of a compute pass. You must not begin another compute pass, or a render pass or copy pass before ending the compute pass.

A VERY IMPORTANT NOTE - Reads and writes in compute passes are NOT implicitly synchronized. This means you may cause data races by both reading and writing a resource region in a compute pass, or by writing multiple times to a resource region. If your compute work depends on reading the completed output from a previous dispatch, you MUST end the current compute pass and begin a new one before you can safely access the data. Otherwise you will receive unexpected results. Reading and writing a texture in the same compute pass is only supported by specific texture formats. Make sure you check the format support!

## FUNCTION PARAMETERS

- *command\_buffer*

  a command buffer.

- *storage\_texture\_bindings*

  an array of writeable storage texture binding structs.

- *num\_storage\_texture\_bindings*

  the number of storage textures to bind from the array.

- *storage\_buffer\_bindings*

  an array of writeable storage buffer binding structs.

- *num\_storage\_buffer\_bindings*

  the number of storage buffers to bind from the array.

## RETURN VALUE

( **SDL\_GPUComputePass**\
  \*) Returns a compute pass handle.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_EndGPUComputePass**(3)](/SDL_EndGPUComputePass/3.md)
