---
name: "SDL_CreateGPUComputePipeline"
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_CreateGPUComputePipeline"
---

# SDL\_CreateGPUComputePipeline(3)

Creates a pipeline object to be used in a compute workflow.

## NAME

SDL\_CreateGPUComputePipeline - Creates a pipeline object to be used in a compute workflow.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

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

**SDL\_GPUComputePipeline \* SDL\_CreateGPUComputePipeline(**     **SDL\_GPUDevice \*device,**     **const SDL\_GPUComputePipelineCreateInfo \*createinfo);**

## DESCRIPTION

Shader resource bindings must be authored to follow a particular order depending on the shader format.

For SPIR-V shaders, use the following resource sets:

• 0: Sampled textures, followed by read-only storage textures, followed by\
   read-only storage buffers

• 1: Read-write storage textures, followed by read-write storage buffers

• 2: Uniform buffers

For DXBC and DXIL shaders, use the following register order:

• (t\[n\], space0): Sampled textures, followed by read-only storage textures,\
   followed by read-only storage buffers

• (u\[n\], space1): Read-write storage textures, followed by read-write\
   storage buffers

• (b\[n\], space2): Uniform buffers

For MSL/metallib, use the following order:

• \[\[buffer\]\]: Uniform buffers, followed by read-only storage buffers,\
   followed by read-write storage buffers

• \[\[texture\]\]: Sampled textures, followed by read-only storage textures,\
   followed by read-write storage textures

There are optional properties that can be provided through **props** . These are the supported properties:

•  **SDL\_PROP\_GPU\_COMPUTEPIPELINE\_CREATE\_NAME\_STRING** :\
   a name that can be displayed in debugging tools.

## FUNCTION PARAMETERS

- *device*

  a GPU Context.

- *createinfo*

  a struct describing the state of the compute pipeline to create.

## RETURN VALUE

( **SDL\_GPUComputePipeline**\
  \*) Returns a compute pipeline object on success, or NULL on failure; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_BindGPUComputePipeline**(3)](/SDL_BindGPUComputePipeline/3.md), **•**(3), [**SDL\_ReleaseGPUComputePipeline**(3)](/SDL_ReleaseGPUComputePipeline/3.md)
