---
name: "SDL_CreateGPUDeviceWithProperties"
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_CreateGPUDeviceWithProperties"
---

# SDL\_CreateGPUDeviceWithProperties(3)

Creates a GPU context.

## NAME

SDL\_CreateGPUDeviceWithProperties - Creates a GPU context.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

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

**SDL\_GPUDevice \* SDL\_CreateGPUDeviceWithProperties(**     **SDL\_PropertiesID props);**

## DESCRIPTION

These are the supported properties:

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_DEBUGMODE\_BOOLEAN** :\
   enable debug mode properties and validations, defaults to true.

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_PREFERLOWPOWER\_BOOLEAN** :\
   enable to prefer energy efficiency over maximum GPU performance, defaults\
   to false.

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_NAME\_STRING** :\
   the name of the GPU driver to use, if a specific one is desired.

These are the current shader format properties:

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_SHADERS\_PRIVATE\_BOOLEAN** :\
   The app is able to provide shaders for an NDA platform.

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_SHADERS\_SPIRV\_BOOLEAN** :\
   The app is able to provide SPIR-V shaders if applicable.

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_SHADERS\_DXBC\_BOOLEAN** :\
   The app is able to provide DXBC shaders if applicable

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_SHADERS\_DXIL\_BOOLEAN** :\
   The app is able to provide DXIL shaders if applicable.

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_SHADERS\_MSL\_BOOLEAN** :\
   The app is able to provide MSL shaders if applicable.

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_SHADERS\_METALLIB\_BOOLEAN** :\
   The app is able to provide Metal shader libraries if applicable.

With the D3D12 renderer:

•  **SDL\_PROP\_GPU\_DEVICE\_CREATE\_D3D12\_SEMANTIC\_NAME\_STRING** :\
   the prefix to use for all vertex semantics, default is "TEXCOORD".

## FUNCTION PARAMETERS

- *props*

  the properties to use.

## RETURN VALUE

( **SDL\_GPUDevice**\
  \*) Returns a GPU context 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\_GetGPUShaderFormats**(3)](/SDL_GetGPUShaderFormats/3.md), **•**(3), [**SDL\_GetGPUDeviceDriver**(3)](/SDL_GetGPUDeviceDriver/3.md), **•**(3), [**SDL\_DestroyGPUDevice**(3)](/SDL_DestroyGPUDevice/3.md), **•**(3), [**SDL\_GPUSupportsProperties**(3)](/SDL_GPUSupportsProperties/3.md)
