SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]

SDL_CreateGPUDeviceWithProperties

Creates a GPU context.

Header File

Defined in <SDL3/SDL_gpu.h>

Syntax

SDL_GPUDevice * SDL_CreateGPUDeviceWithProperties(
    SDL_PropertiesID props);

Function Parameters

SDL_PropertiesID 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.

Remarks

These are the supported properties:

These are the current shader format properties:

With the D3D12 backend:

With the Vulkan backend:

With the Metal backend: - SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1_BOOLEAN: By default, macOS support requires what Apple calls "MTLGPUFamilyMac2" hardware or newer. However, an application can set this property to true to enable support for "MTLGPUFamilyMac1" hardware, if (and only if) the application does not write to sRGB textures. (For history's sake: MacFamily1 also does not support indirect command buffers, MSAA depth resolve, and stencil resolve/feedback, but these are not exposed features in SDL_GPU.)

Version

This function is available since SDL 3.2.0.

See Also


CategoryAPI, CategoryAPIFunction, CategoryGPU


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.