logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_CreateGPUDeviceWithProperties - Creates a GPU context.

Availability

       This function is available since SDL 3.2.0.

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.

Name

       SDL_CreateGPUDeviceWithProperties - Creates a GPU context.

Return Value

       Returns a GPU context on success or NULL on failure; call SDL_GetError() for more information.

See Also

SDL_GetGPUShaderFormats(3),              SDL_GetGPUDeviceDriver(3),              SDL_DestroyGPUDevice(3),
       SDL_GPUSupportsProperties(3)

Simple Directmedia Layer                           SDL 3.2.20               SDL_CreateGPUDeviceWithProperties(3)

Synopsis

#include<SDL3/SDL_gpu.h>SDL_GPUDevice*SDL_CreateGPUDeviceWithProperties(SDL_PropertiesIDprops);

See Also