SDL_gpu.h File Reference
`#include <SDL3/SDL_stdinc.h>`
`#include <SDL3/SDL_pixels.h>`
`#include <SDL3/SDL_properties.h>`
`#include <SDL3/SDL_rect.h>`
`#include <SDL3/SDL_surface.h>`
`#include <SDL3/SDL_video.h>`
`#include <SDL3/SDL_begin_code.h>`
`#include <SDL3/SDL_close_code.h>`
Include dependency graph for SDL_gpu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | SDL_GPUViewport
struct | SDL_GPUTextureTransferInfo
struct | SDL_GPUTransferBufferLocation
struct | SDL_GPUTextureLocation
struct | SDL_GPUTextureRegion
struct | SDL_GPUBlitRegion
struct | SDL_GPUBufferLocation
struct | SDL_GPUBufferRegion
struct | SDL_GPUIndirectDrawCommand
struct | SDL_GPUIndexedIndirectDrawCommand
struct | SDL_GPUIndirectDispatchCommand
struct | SDL_GPUSamplerCreateInfo
struct | SDL_GPUVertexBufferDescription
struct | SDL_GPUVertexAttribute
struct | SDL_GPUVertexInputState
struct | SDL_GPUStencilOpState
struct | SDL_GPUColorTargetBlendState
struct | SDL_GPUShaderCreateInfo
struct | SDL_GPUTextureCreateInfo
struct | SDL_GPUBufferCreateInfo
struct | SDL_GPUTransferBufferCreateInfo
struct | SDL_GPURasterizerState
struct | SDL_GPUMultisampleState
struct | SDL_GPUDepthStencilState
struct | SDL_GPUColorTargetDescription
struct | SDL_GPUGraphicsPipelineTargetInfo
struct | SDL_GPUGraphicsPipelineCreateInfo
struct | SDL_GPUComputePipelineCreateInfo
struct | SDL_GPUColorTargetInfo
struct | SDL_GPUDepthStencilTargetInfo
struct | SDL_GPUBlitInfo
struct | SDL_GPUBufferBinding
struct | SDL_GPUTextureSamplerBinding
struct | SDL_GPUStorageBufferReadWriteBinding
struct | SDL_GPUStorageTextureReadWriteBinding

## Macros

#define | SDL_GPU_TEXTUREUSAGE_SAMPLER (1u << 0)
#define | SDL_GPU_TEXTUREUSAGE_COLOR_TARGET (1u << 1)
#define | SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET (1u << 2)
#define | SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ (1u << 3)
#define | SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ (1u << 4)
#define | SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE (1u << 5)
#define | SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE (1u << 6)
#define | SDL_GPU_BUFFERUSAGE_VERTEX (1u << 0)
#define | SDL_GPU_BUFFERUSAGE_INDEX (1u << 1)
#define | SDL_GPU_BUFFERUSAGE_INDIRECT (1u << 2)
#define | SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ (1u << 3)
#define | SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ (1u << 4)
#define | SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE (1u << 5)
#define | SDL_GPU_SHADERFORMAT_INVALID 0
#define | SDL_GPU_SHADERFORMAT_PRIVATE (1u << 0)
#define | SDL_GPU_SHADERFORMAT_SPIRV (1u << 1)
#define | SDL_GPU_SHADERFORMAT_DXBC (1u << 2)
#define | SDL_GPU_SHADERFORMAT_DXIL (1u << 3)
#define | SDL_GPU_SHADERFORMAT_MSL (1u << 4)
#define | SDL_GPU_SHADERFORMAT_METALLIB (1u << 5)
#define | SDL_GPU_COLORCOMPONENT_R (1u << 0)
#define | SDL_GPU_COLORCOMPONENT_G (1u << 1)
#define | SDL_GPU_COLORCOMPONENT_B (1u << 2)
#define | SDL_GPU_COLORCOMPONENT_A (1u << 3)
#define | SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN "SDL.gpu.device.create.debugmode"
#define | SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN "SDL.gpu.device.create.preferlowpower"
#define | SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name"
#define | SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN "SDL.gpu.device.create.shaders.private"
#define | SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN "SDL.gpu.device.create.shaders.spirv"
#define | SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN "SDL.gpu.device.create.shaders.dxbc"
#define | SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN "SDL.gpu.device.create.shaders.dxil"
#define | SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN "SDL.gpu.device.create.shaders.msl"
#define | SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN "SDL.gpu.device.create.shaders.metallib"
#define | SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic"
#define | SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING "SDL.gpu.computepipeline.create.name"
#define | SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING "SDL.gpu.graphicspipeline.create.name"
#define | SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING "SDL.gpu.sampler.create.name"
#define | SDL_PROP_GPU_SHADER_CREATE_NAME_STRING "SDL.gpu.shader.create.name"
#define | SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT "SDL.gpu.texture.create.d3d12.clear.r"
#define | SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT "SDL.gpu.texture.create.d3d12.clear.g"
#define | SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT "SDL.gpu.texture.create.d3d12.clear.b"
#define | SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT "SDL.gpu.texture.create.d3d12.clear.a"
#define | SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.texture.create.d3d12.clear.depth"
#define | SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER "SDL.gpu.texture.create.d3d12.clear.stencil"
#define | SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING "SDL.gpu.texture.create.name"
#define | SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING "SDL.gpu.buffer.create.name"
#define | SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING "SDL.gpu.transferbuffer.create.name"

## Typedefs

typedef struct SDL_GPUDevice | SDL_GPUDevice
typedef struct SDL_GPUBuffer | SDL_GPUBuffer
typedef struct SDL_GPUTransferBuffer | SDL_GPUTransferBuffer
typedef struct SDL_GPUTexture | SDL_GPUTexture
typedef struct SDL_GPUSampler | SDL_GPUSampler
typedef struct SDL_GPUShader | SDL_GPUShader
typedef struct SDL_GPUComputePipeline | SDL_GPUComputePipeline
typedef struct SDL_GPUGraphicsPipeline | SDL_GPUGraphicsPipeline
typedef struct SDL_GPUCommandBuffer | SDL_GPUCommandBuffer
typedef struct SDL_GPURenderPass | SDL_GPURenderPass
typedef struct SDL_GPUComputePass | SDL_GPUComputePass
typedef struct SDL_GPUCopyPass | SDL_GPUCopyPass
typedef struct SDL_GPUFence | SDL_GPUFence
typedef Uint32 | SDL_GPUTextureUsageFlags
typedef Uint32 | SDL_GPUBufferUsageFlags
typedef Uint32 | SDL_GPUShaderFormat
typedef Uint8 | SDL_GPUColorComponentFlags

## Enumerations

enum | SDL_GPUPrimitiveType { SDL_GPU_PRIMITIVETYPE_TRIANGLELIST , SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP , SDL_GPU_PRIMITIVETYPE_LINELIST , SDL_GPU_PRIMITIVETYPE_LINESTRIP , SDL_GPU_PRIMITIVETYPE_POINTLIST }
enum | SDL_GPULoadOp { SDL_GPU_LOADOP_LOAD , SDL_GPU_LOADOP_CLEAR , SDL_GPU_LOADOP_DONT_CARE }
enum | SDL_GPUStoreOp { SDL_GPU_STOREOP_STORE , SDL_GPU_STOREOP_DONT_CARE , SDL_GPU_STOREOP_RESOLVE , SDL_GPU_STOREOP_RESOLVE_AND_STORE }
enum | SDL_GPUIndexElementSize { SDL_GPU_INDEXELEMENTSIZE_16BIT , SDL_GPU_INDEXELEMENTSIZE_32BIT }

enum

SDL_GPUTextureFormat {
SDL_GPU_TEXTUREFORMAT_INVALID ,
SDL_GPU_TEXTUREFORMAT_A8_UNORM ,
SDL_GPU_TEXTUREFORMAT_R8_UNORM ,
SDL_GPU_TEXTUREFORMAT_R8G8_UNORM ,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM ,
SDL_GPU_TEXTUREFORMAT_R16_UNORM ,
SDL_GPU_TEXTUREFORMAT_R16G16_UNORM ,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM ,
SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM ,
SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM ,
SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM ,
SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM ,
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM ,
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM ,
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM ,
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM ,
SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM ,
SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM ,
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM ,
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT ,
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT ,
SDL_GPU_TEXTUREFORMAT_R8_SNORM ,
SDL_GPU_TEXTUREFORMAT_R8G8_SNORM ,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM ,
SDL_GPU_TEXTUREFORMAT_R16_SNORM ,
SDL_GPU_TEXTUREFORMAT_R16G16_SNORM ,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM ,
SDL_GPU_TEXTUREFORMAT_R16_FLOAT ,
SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT ,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT ,
SDL_GPU_TEXTUREFORMAT_R32_FLOAT ,
SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT ,
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT ,
SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT ,
SDL_GPU_TEXTUREFORMAT_R8_UINT ,
SDL_GPU_TEXTUREFORMAT_R8G8_UINT ,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT ,
SDL_GPU_TEXTUREFORMAT_R16_UINT ,
SDL_GPU_TEXTUREFORMAT_R16G16_UINT ,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT ,
SDL_GPU_TEXTUREFORMAT_R32_UINT ,
SDL_GPU_TEXTUREFORMAT_R32G32_UINT ,
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT ,
SDL_GPU_TEXTUREFORMAT_R8_INT ,
SDL_GPU_TEXTUREFORMAT_R8G8_INT ,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT ,
SDL_GPU_TEXTUREFORMAT_R16_INT ,
SDL_GPU_TEXTUREFORMAT_R16G16_INT ,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT ,
SDL_GPU_TEXTUREFORMAT_R32_INT ,
SDL_GPU_TEXTUREFORMAT_R32G32_INT ,
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT ,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_D16_UNORM ,
SDL_GPU_TEXTUREFORMAT_D24_UNORM ,
SDL_GPU_TEXTUREFORMAT_D32_FLOAT ,
SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT ,
SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT ,
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM ,
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB ,
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT ,
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
}

enum | SDL_GPUTextureType { SDL_GPU_TEXTURETYPE_2D , SDL_GPU_TEXTURETYPE_2D_ARRAY , SDL_GPU_TEXTURETYPE_3D , SDL_GPU_TEXTURETYPE_CUBE , SDL_GPU_TEXTURETYPE_CUBE_ARRAY }
enum | SDL_GPUSampleCount { SDL_GPU_SAMPLECOUNT_1 , SDL_GPU_SAMPLECOUNT_2 , SDL_GPU_SAMPLECOUNT_4 , SDL_GPU_SAMPLECOUNT_8 }
enum | SDL_GPUCubeMapFace { SDL_GPU_CUBEMAPFACE_POSITIVEX , SDL_GPU_CUBEMAPFACE_NEGATIVEX , SDL_GPU_CUBEMAPFACE_POSITIVEY , SDL_GPU_CUBEMAPFACE_NEGATIVEY , SDL_GPU_CUBEMAPFACE_POSITIVEZ , SDL_GPU_CUBEMAPFACE_NEGATIVEZ }
enum | SDL_GPUTransferBufferUsage { SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD , SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD }
enum | SDL_GPUShaderStage { SDL_GPU_SHADERSTAGE_VERTEX , SDL_GPU_SHADERSTAGE_FRAGMENT }

enum

SDL_GPUVertexElementFormat {
SDL_GPU_VERTEXELEMENTFORMAT_INVALID ,
SDL_GPU_VERTEXELEMENTFORMAT_INT ,
SDL_GPU_VERTEXELEMENTFORMAT_INT2 ,
SDL_GPU_VERTEXELEMENTFORMAT_INT3 ,
SDL_GPU_VERTEXELEMENTFORMAT_INT4 ,
SDL_GPU_VERTEXELEMENTFORMAT_UINT ,
SDL_GPU_VERTEXELEMENTFORMAT_UINT2 ,
SDL_GPU_VERTEXELEMENTFORMAT_UINT3 ,
SDL_GPU_VERTEXELEMENTFORMAT_UINT4 ,
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT ,
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2 ,
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3 ,
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4 ,
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2 ,
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4 ,
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2 ,
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4 ,
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2 ,
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4 ,
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2 ,
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4 ,
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM ,
SDL_GPU_VERTEXELEMENTFORMAT_HALF2 ,
SDL_GPU_VERTEXELEMENTFORMAT_HALF4
}

enum | SDL_GPUVertexInputRate { SDL_GPU_VERTEXINPUTRATE_VERTEX , SDL_GPU_VERTEXINPUTRATE_INSTANCE }
enum | SDL_GPUFillMode { SDL_GPU_FILLMODE_FILL , SDL_GPU_FILLMODE_LINE }
enum | SDL_GPUCullMode { SDL_GPU_CULLMODE_NONE , SDL_GPU_CULLMODE_FRONT , SDL_GPU_CULLMODE_BACK }
enum | SDL_GPUFrontFace { SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE , SDL_GPU_FRONTFACE_CLOCKWISE }
enum | SDL_GPUCompareOp { SDL_GPU_COMPAREOP_INVALID , SDL_GPU_COMPAREOP_NEVER , SDL_GPU_COMPAREOP_LESS , SDL_GPU_COMPAREOP_EQUAL , SDL_GPU_COMPAREOP_LESS_OR_EQUAL , SDL_GPU_COMPAREOP_GREATER , SDL_GPU_COMPAREOP_NOT_EQUAL , SDL_GPU_COMPAREOP_GREATER_OR_EQUAL , SDL_GPU_COMPAREOP_ALWAYS }
enum | SDL_GPUStencilOp { SDL_GPU_STENCILOP_INVALID , SDL_GPU_STENCILOP_KEEP , SDL_GPU_STENCILOP_ZERO , SDL_GPU_STENCILOP_REPLACE , SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP , SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP , SDL_GPU_STENCILOP_INVERT , SDL_GPU_STENCILOP_INCREMENT_AND_WRAP , SDL_GPU_STENCILOP_DECREMENT_AND_WRAP }
enum | SDL_GPUBlendOp { SDL_GPU_BLENDOP_INVALID , SDL_GPU_BLENDOP_ADD , SDL_GPU_BLENDOP_SUBTRACT , SDL_GPU_BLENDOP_REVERSE_SUBTRACT , SDL_GPU_BLENDOP_MIN , SDL_GPU_BLENDOP_MAX }

enum

SDL_GPUBlendFactor {
SDL_GPU_BLENDFACTOR_INVALID ,
SDL_GPU_BLENDFACTOR_ZERO ,
SDL_GPU_BLENDFACTOR_ONE ,
SDL_GPU_BLENDFACTOR_SRC_COLOR ,
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR ,
SDL_GPU_BLENDFACTOR_DST_COLOR ,
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR ,
SDL_GPU_BLENDFACTOR_SRC_ALPHA ,
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA ,
SDL_GPU_BLENDFACTOR_DST_ALPHA ,
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA ,
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR ,
SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR ,
SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
}

enum | SDL_GPUFilter { SDL_GPU_FILTER_NEAREST , SDL_GPU_FILTER_LINEAR }
enum | SDL_GPUSamplerMipmapMode { SDL_GPU_SAMPLERMIPMAPMODE_NEAREST , SDL_GPU_SAMPLERMIPMAPMODE_LINEAR }
enum | SDL_GPUSamplerAddressMode { SDL_GPU_SAMPLERADDRESSMODE_REPEAT , SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT , SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE }
enum | SDL_GPUPresentMode { SDL_GPU_PRESENTMODE_VSYNC , SDL_GPU_PRESENTMODE_IMMEDIATE , SDL_GPU_PRESENTMODE_MAILBOX }
enum | SDL_GPUSwapchainComposition { SDL_GPU_SWAPCHAINCOMPOSITION_SDR , SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR , SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR , SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084 }

## Functions

bool | SDL_GPUSupportsShaderFormats (SDL_GPUShaderFormat format_flags, const char *name)
bool | SDL_GPUSupportsProperties (SDL_PropertiesID props)
SDL_GPUDevice * | SDL_CreateGPUDevice (SDL_GPUShaderFormat format_flags, bool debug_mode, const char *name)
SDL_GPUDevice * | SDL_CreateGPUDeviceWithProperties (SDL_PropertiesID props)
void | SDL_DestroyGPUDevice (SDL_GPUDevice *device)
int | SDL_GetNumGPUDrivers (void)
const char * | SDL_GetGPUDriver (int index)
const char * | SDL_GetGPUDeviceDriver (SDL_GPUDevice *device)
SDL_GPUShaderFormat | SDL_GetGPUShaderFormats (SDL_GPUDevice *device)
SDL_GPUComputePipeline * | SDL_CreateGPUComputePipeline (SDL_GPUDevice *device, const SDL_GPUComputePipelineCreateInfo *createinfo)
SDL_GPUGraphicsPipeline * | SDL_CreateGPUGraphicsPipeline (SDL_GPUDevice *device, const SDL_GPUGraphicsPipelineCreateInfo *createinfo)
SDL_GPUSampler * | SDL_CreateGPUSampler (SDL_GPUDevice *device, const SDL_GPUSamplerCreateInfo *createinfo)
SDL_GPUShader * | SDL_CreateGPUShader (SDL_GPUDevice *device, const SDL_GPUShaderCreateInfo *createinfo)
SDL_GPUTexture * | SDL_CreateGPUTexture (SDL_GPUDevice *device, const SDL_GPUTextureCreateInfo *createinfo)
SDL_GPUBuffer * | SDL_CreateGPUBuffer (SDL_GPUDevice *device, const SDL_GPUBufferCreateInfo *createinfo)
SDL_GPUTransferBuffer * | SDL_CreateGPUTransferBuffer (SDL_GPUDevice *device, const SDL_GPUTransferBufferCreateInfo *createinfo)
void | SDL_SetGPUBufferName (SDL_GPUDevice *device, SDL_GPUBuffer *buffer, const char *text)
void | SDL_SetGPUTextureName (SDL_GPUDevice *device, SDL_GPUTexture *texture, const char *text)
void | SDL_InsertGPUDebugLabel (SDL_GPUCommandBuffer *command_buffer, const char *text)
void | SDL_PushGPUDebugGroup (SDL_GPUCommandBuffer *command_buffer, const char *name)
void | SDL_PopGPUDebugGroup (SDL_GPUCommandBuffer *command_buffer)
void | SDL_ReleaseGPUTexture (SDL_GPUDevice *device, SDL_GPUTexture *texture)
void | SDL_ReleaseGPUSampler (SDL_GPUDevice *device, SDL_GPUSampler *sampler)
void | SDL_ReleaseGPUBuffer (SDL_GPUDevice *device, SDL_GPUBuffer *buffer)
void | SDL_ReleaseGPUTransferBuffer (SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer)
void | SDL_ReleaseGPUComputePipeline (SDL_GPUDevice *device, SDL_GPUComputePipeline *compute_pipeline)
void | SDL_ReleaseGPUShader (SDL_GPUDevice *device, SDL_GPUShader *shader)
void | SDL_ReleaseGPUGraphicsPipeline (SDL_GPUDevice *device, SDL_GPUGraphicsPipeline *graphics_pipeline)
SDL_GPUCommandBuffer * | SDL_AcquireGPUCommandBuffer (SDL_GPUDevice *device)
void | SDL_PushGPUVertexUniformData (SDL_GPUCommandBuffer *command_buffer, Uint32 slot_index, const void *data, Uint32 length)
void | SDL_PushGPUFragmentUniformData (SDL_GPUCommandBuffer *command_buffer, Uint32 slot_index, const void *data, Uint32 length)
void | SDL_PushGPUComputeUniformData (SDL_GPUCommandBuffer *command_buffer, Uint32 slot_index, const void *data, Uint32 length)
SDL_GPURenderPass * | SDL_BeginGPURenderPass (SDL_GPUCommandBuffer *command_buffer, const SDL_GPUColorTargetInfo *color_target_infos, Uint32 num_color_targets, const SDL_GPUDepthStencilTargetInfo *depth_stencil_target_info)
void | SDL_BindGPUGraphicsPipeline (SDL_GPURenderPass *render_pass, SDL_GPUGraphicsPipeline *graphics_pipeline)
void | SDL_SetGPUViewport (SDL_GPURenderPass *render_pass, const SDL_GPUViewport *viewport)
void | SDL_SetGPUScissor (SDL_GPURenderPass *render_pass, const SDL_Rect *scissor)
void | SDL_SetGPUBlendConstants (SDL_GPURenderPass *render_pass, SDL_FColor blend_constants)
void | SDL_SetGPUStencilReference (SDL_GPURenderPass *render_pass, Uint8 reference)
void | SDL_BindGPUVertexBuffers (SDL_GPURenderPass *render_pass, Uint32 first_slot, const SDL_GPUBufferBinding *bindings, Uint32 num_bindings)
void | SDL_BindGPUIndexBuffer (SDL_GPURenderPass *render_pass, const SDL_GPUBufferBinding *binding, SDL_GPUIndexElementSize index_element_size)
void | SDL_BindGPUVertexSamplers (SDL_GPURenderPass *render_pass, Uint32 first_slot, const SDL_GPUTextureSamplerBinding *texture_sampler_bindings, Uint32 num_bindings)
void | SDL_BindGPUVertexStorageTextures (SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUTexture *const *storage_textures, Uint32 num_bindings)
void | SDL_BindGPUVertexStorageBuffers (SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUBuffer *const *storage_buffers, Uint32 num_bindings)
void | SDL_BindGPUFragmentSamplers (SDL_GPURenderPass *render_pass, Uint32 first_slot, const SDL_GPUTextureSamplerBinding *texture_sampler_bindings, Uint32 num_bindings)
void | SDL_BindGPUFragmentStorageTextures (SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUTexture *const *storage_textures, Uint32 num_bindings)
void | SDL_BindGPUFragmentStorageBuffers (SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUBuffer *const *storage_buffers, Uint32 num_bindings)
void | SDL_DrawGPUIndexedPrimitives (SDL_GPURenderPass *render_pass, Uint32 num_indices, Uint32 num_instances, Uint32 first_index, Sint32 vertex_offset, Uint32 first_instance)
void | SDL_DrawGPUPrimitives (SDL_GPURenderPass *render_pass, Uint32 num_vertices, Uint32 num_instances, Uint32 first_vertex, Uint32 first_instance)
void | SDL_DrawGPUPrimitivesIndirect (SDL_GPURenderPass *render_pass, SDL_GPUBuffer *buffer, Uint32 offset, Uint32 draw_count)
void | SDL_DrawGPUIndexedPrimitivesIndirect (SDL_GPURenderPass *render_pass, SDL_GPUBuffer *buffer, Uint32 offset, Uint32 draw_count)
void | SDL_EndGPURenderPass (SDL_GPURenderPass *render_pass)
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)
void | SDL_BindGPUComputePipeline (SDL_GPUComputePass *compute_pass, SDL_GPUComputePipeline *compute_pipeline)
void | SDL_BindGPUComputeSamplers (SDL_GPUComputePass *compute_pass, Uint32 first_slot, const SDL_GPUTextureSamplerBinding *texture_sampler_bindings, Uint32 num_bindings)
void | SDL_BindGPUComputeStorageTextures (SDL_GPUComputePass *compute_pass, Uint32 first_slot, SDL_GPUTexture *const *storage_textures, Uint32 num_bindings)
void | SDL_BindGPUComputeStorageBuffers (SDL_GPUComputePass *compute_pass, Uint32 first_slot, SDL_GPUBuffer *const *storage_buffers, Uint32 num_bindings)
void | SDL_DispatchGPUCompute (SDL_GPUComputePass *compute_pass, Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z)
void | SDL_DispatchGPUComputeIndirect (SDL_GPUComputePass *compute_pass, SDL_GPUBuffer *buffer, Uint32 offset)
void | SDL_EndGPUComputePass (SDL_GPUComputePass *compute_pass)
void * | SDL_MapGPUTransferBuffer (SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer, bool cycle)
void | SDL_UnmapGPUTransferBuffer (SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer)
SDL_GPUCopyPass * | SDL_BeginGPUCopyPass (SDL_GPUCommandBuffer *command_buffer)
void | SDL_UploadToGPUTexture (SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureTransferInfo *source, const SDL_GPUTextureRegion *destination, bool cycle)
void | SDL_UploadToGPUBuffer (SDL_GPUCopyPass *copy_pass, const SDL_GPUTransferBufferLocation *source, const SDL_GPUBufferRegion *destination, bool cycle)
void | SDL_CopyGPUTextureToTexture (SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureLocation *source, const SDL_GPUTextureLocation *destination, Uint32 w, Uint32 h, Uint32 d, bool cycle)
void | SDL_CopyGPUBufferToBuffer (SDL_GPUCopyPass *copy_pass, const SDL_GPUBufferLocation *source, const SDL_GPUBufferLocation *destination, Uint32 size, bool cycle)
void | SDL_DownloadFromGPUTexture (SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureRegion *source, const SDL_GPUTextureTransferInfo *destination)
void | SDL_DownloadFromGPUBuffer (SDL_GPUCopyPass *copy_pass, const SDL_GPUBufferRegion *source, const SDL_GPUTransferBufferLocation *destination)
void | SDL_EndGPUCopyPass (SDL_GPUCopyPass *copy_pass)
void | SDL_GenerateMipmapsForGPUTexture (SDL_GPUCommandBuffer *command_buffer, SDL_GPUTexture *texture)
void | SDL_BlitGPUTexture (SDL_GPUCommandBuffer *command_buffer, const SDL_GPUBlitInfo *info)
bool | SDL_WindowSupportsGPUSwapchainComposition (SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition)
bool | SDL_WindowSupportsGPUPresentMode (SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode present_mode)
bool | SDL_ClaimWindowForGPUDevice (SDL_GPUDevice *device, SDL_Window *window)
void | SDL_ReleaseWindowFromGPUDevice (SDL_GPUDevice *device, SDL_Window *window)
bool | SDL_SetGPUSwapchainParameters (SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition, SDL_GPUPresentMode present_mode)
bool | SDL_SetGPUAllowedFramesInFlight (SDL_GPUDevice *device, Uint32 allowed_frames_in_flight)
SDL_GPUTextureFormat | SDL_GetGPUSwapchainTextureFormat (SDL_GPUDevice *device, SDL_Window *window)
bool | SDL_AcquireGPUSwapchainTexture (SDL_GPUCommandBuffer *command_buffer, SDL_Window *window, SDL_GPUTexture **swapchain_texture, Uint32 *swapchain_texture_width, Uint32 *swapchain_texture_height)
bool | SDL_WaitForGPUSwapchain (SDL_GPUDevice *device, SDL_Window *window)
bool | SDL_WaitAndAcquireGPUSwapchainTexture (SDL_GPUCommandBuffer *command_buffer, SDL_Window *window, SDL_GPUTexture **swapchain_texture, Uint32 *swapchain_texture_width, Uint32 *swapchain_texture_height)
bool | SDL_SubmitGPUCommandBuffer (SDL_GPUCommandBuffer *command_buffer)
SDL_GPUFence * | SDL_SubmitGPUCommandBufferAndAcquireFence (SDL_GPUCommandBuffer *command_buffer)
bool | SDL_CancelGPUCommandBuffer (SDL_GPUCommandBuffer *command_buffer)
bool | SDL_WaitForGPUIdle (SDL_GPUDevice *device)
bool | SDL_WaitForGPUFences (SDL_GPUDevice *device, bool wait_all, SDL_GPUFence *const *fences, Uint32 num_fences)
bool | SDL_QueryGPUFence (SDL_GPUDevice *device, SDL_GPUFence *fence)
void | SDL_ReleaseGPUFence (SDL_GPUDevice *device, SDL_GPUFence *fence)
Uint32 | SDL_GPUTextureFormatTexelBlockSize (SDL_GPUTextureFormat format)
bool | SDL_GPUTextureSupportsFormat (SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage)
bool | SDL_GPUTextureSupportsSampleCount (SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sample_count)
Uint32 | SDL_CalculateGPUTextureFormatSize (SDL_GPUTextureFormat format, Uint32 width, Uint32 height, Uint32 depth_or_layer_count)

## Macro Definition Documentation

## SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ

#define SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ (1u << 4)

Buffer supports storage reads in the compute stage.

Definition at line 907 of file SDL_gpu.h.

## SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE

#define SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE (1u << 5)

Buffer supports storage writes in the compute stage.

Definition at line 908 of file SDL_gpu.h.

## SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ

#define SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ (1u << 3)

Buffer supports storage reads in graphics stages.

Definition at line 906 of file SDL_gpu.h.

## SDL_GPU_BUFFERUSAGE_INDEX

#define SDL_GPU_BUFFERUSAGE_INDEX (1u << 1)

Buffer is an index buffer.

Definition at line 904 of file SDL_gpu.h.

## SDL_GPU_BUFFERUSAGE_INDIRECT

#define SDL_GPU_BUFFERUSAGE_INDIRECT (1u << 2)

Buffer is an indirect buffer.

Definition at line 905 of file SDL_gpu.h.

## SDL_GPU_BUFFERUSAGE_VERTEX

#define SDL_GPU_BUFFERUSAGE_VERTEX (1u << 0)

Buffer is a vertex buffer.

Definition at line 903 of file SDL_gpu.h.

## SDL_GPU_COLORCOMPONENT_A

#define SDL_GPU_COLORCOMPONENT_A (1u << 3)

the alpha component

Definition at line 1181 of file SDL_gpu.h.

## SDL_GPU_COLORCOMPONENT_B

#define SDL_GPU_COLORCOMPONENT_B (1u << 2)

the blue component

Definition at line 1180 of file SDL_gpu.h.

## SDL_GPU_COLORCOMPONENT_G

#define SDL_GPU_COLORCOMPONENT_G (1u << 1)

the green component

Definition at line 1179 of file SDL_gpu.h.

## SDL_GPU_COLORCOMPONENT_R

#define SDL_GPU_COLORCOMPONENT_R (1u << 0)

the red component

Definition at line 1178 of file SDL_gpu.h.

## SDL_GPU_SHADERFORMAT_DXBC

#define SDL_GPU_SHADERFORMAT_DXBC (1u << 2)

DXBC SM5_1 shaders for D3D12.

Definition at line 953 of file SDL_gpu.h.

## SDL_GPU_SHADERFORMAT_DXIL

#define SDL_GPU_SHADERFORMAT_DXIL (1u << 3)

DXIL SM6_0 shaders for D3D12.

Definition at line 954 of file SDL_gpu.h.

## SDL_GPU_SHADERFORMAT_INVALID

#define SDL_GPU_SHADERFORMAT_INVALID 0

Definition at line 950 of file SDL_gpu.h.

## SDL_GPU_SHADERFORMAT_METALLIB

#define SDL_GPU_SHADERFORMAT_METALLIB (1u << 5)

Precompiled metallib shaders for Metal.

Definition at line 956 of file SDL_gpu.h.

## SDL_GPU_SHADERFORMAT_MSL

#define SDL_GPU_SHADERFORMAT_MSL (1u << 4)

MSL shaders for Metal.

Definition at line 955 of file SDL_gpu.h.

## SDL_GPU_SHADERFORMAT_PRIVATE

#define SDL_GPU_SHADERFORMAT_PRIVATE (1u << 0)

Shaders for NDA'd platforms.

Definition at line 951 of file SDL_gpu.h.

## SDL_GPU_SHADERFORMAT_SPIRV

#define SDL_GPU_SHADERFORMAT_SPIRV (1u << 1)

SPIR-V shaders for Vulkan.

Definition at line 952 of file SDL_gpu.h.

## SDL_GPU_TEXTUREUSAGE_COLOR_TARGET

#define SDL_GPU_TEXTUREUSAGE_COLOR_TARGET (1u << 1)

Texture is a color render target.

Definition at line 824 of file SDL_gpu.h.

## SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ

#define SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ (1u << 4)

Texture supports storage reads in the compute stage.

Definition at line 827 of file SDL_gpu.h.

## SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE

#define SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE (1u << 6)

Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE.

Definition at line 829 of file SDL_gpu.h.

## SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE

#define SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE (1u << 5)

Texture supports storage writes in the compute stage.

Definition at line 828 of file SDL_gpu.h.

## SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET

#define SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET (1u << 2)

Texture is a depth stencil target.

Definition at line 825 of file SDL_gpu.h.

## SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ

#define SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ (1u << 3)

Texture supports storage reads in graphics stages.

Definition at line 826 of file SDL_gpu.h.

## SDL_GPU_TEXTUREUSAGE_SAMPLER

#define SDL_GPU_TEXTUREUSAGE_SAMPLER (1u << 0)

Texture supports sampling.

Definition at line 823 of file SDL_gpu.h.

## SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING

#define SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING "SDL.gpu.buffer.create.name"

Definition at line 2554 of file SDL_gpu.h.

## SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING

#define SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING "SDL.gpu.computepipeline.create.name"

Definition at line 2304 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING

#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic"

Definition at line 2189 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN "SDL.gpu.device.create.debugmode"

Definition at line 2180 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING

#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name"

Definition at line 2182 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN "SDL.gpu.device.create.preferlowpower"

Definition at line 2181 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN "SDL.gpu.device.create.shaders.dxbc"

Definition at line 2185 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN "SDL.gpu.device.create.shaders.dxil"

Definition at line 2186 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN "SDL.gpu.device.create.shaders.metallib"

Definition at line 2188 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN "SDL.gpu.device.create.shaders.msl"

Definition at line 2187 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN "SDL.gpu.device.create.shaders.private"

Definition at line 2183 of file SDL_gpu.h.

## SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN

#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN "SDL.gpu.device.create.shaders.spirv"

Definition at line 2184 of file SDL_gpu.h.

## SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING

#define SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING "SDL.gpu.graphicspipeline.create.name"

Definition at line 2331 of file SDL_gpu.h.

## SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING

#define SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING "SDL.gpu.sampler.create.name"

Definition at line 2358 of file SDL_gpu.h.

## SDL_PROP_GPU_SHADER_CREATE_NAME_STRING

#define SDL_PROP_GPU_SHADER_CREATE_NAME_STRING "SDL.gpu.shader.create.name"

Definition at line 2437 of file SDL_gpu.h.

## SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT

#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT "SDL.gpu.texture.create.d3d12.clear.a"

Definition at line 2501 of file SDL_gpu.h.

## SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT

#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT "SDL.gpu.texture.create.d3d12.clear.b"

Definition at line 2500 of file SDL_gpu.h.

## SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT

#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.texture.create.d3d12.clear.depth"

Definition at line 2502 of file SDL_gpu.h.

## SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT

#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT "SDL.gpu.texture.create.d3d12.clear.g"

Definition at line 2499 of file SDL_gpu.h.

## SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT

#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT "SDL.gpu.texture.create.d3d12.clear.r"

Definition at line 2498 of file SDL_gpu.h.

## SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER

#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER "SDL.gpu.texture.create.d3d12.clear.stencil"

Definition at line 2503 of file SDL_gpu.h.

## SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING

#define SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING "SDL.gpu.texture.create.name"

Definition at line 2504 of file SDL_gpu.h.

## SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING

#define SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING "SDL.gpu.transferbuffer.create.name"

Definition at line 2587 of file SDL_gpu.h.

## Typedef Documentation

## SDL_GPUBuffer

typedef struct SDL_GPUBuffer SDL_GPUBuffer

An opaque handle representing a buffer.

Used for vertices, indices, indirect draw commands, and general compute data.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_CreateGPUBuffer
  SDL_UploadToGPUBuffer
  SDL_DownloadFromGPUBuffer
  SDL_CopyGPUBufferToBuffer
  SDL_BindGPUVertexBuffers
  SDL_BindGPUIndexBuffer
  SDL_BindGPUVertexStorageBuffers
  SDL_BindGPUFragmentStorageBuffers
  SDL_DrawGPUPrimitivesIndirect
  SDL_DrawGPUIndexedPrimitivesIndirect
  SDL_BindGPUComputeStorageBuffers
  SDL_DispatchGPUComputeIndirect
  SDL_ReleaseGPUBuffer

Definition at line 352 of file SDL_gpu.h.

## SDL_GPUBufferUsageFlags

typedef Uint32 SDL_GPUBufferUsageFlags

Specifies how a buffer is intended to be used by the client.

A buffer must have at least one usage flag. Note that some usage flag combinations are invalid.

Unlike textures, READ | WRITE can be used for simultaneous read-write usage. The same data synchronization concerns as textures apply.

If you use a STORAGE flag, the data in the buffer must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.

Since
  This datatype is available since SDL 3.2.0.

See also
  SDL_CreateGPUBuffer

Definition at line 901 of file SDL_gpu.h.

## SDL_GPUColorComponentFlags

typedef Uint8 SDL_GPUColorComponentFlags

Specifies which color components are written in a graphics pipeline.

Since
  This datatype is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Definition at line 1176 of file SDL_gpu.h.

## SDL_GPUCommandBuffer

typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer

An opaque handle representing a command buffer.

Most state is managed via command buffers. When setting state using a command buffer, that state is local to the command buffer.

Commands only begin execution on the GPU once SDL_SubmitGPUCommandBuffer is called. Once the command buffer is submitted, it is no longer valid to use it.

Command buffers are executed in submission order. If you submit command buffer A and then command buffer B all commands in A will begin executing before any command in B begins executing.

In multi-threading scenarios, you should only access a command buffer on the thread you acquired it from.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_AcquireGPUCommandBuffer
  SDL_SubmitGPUCommandBuffer
  SDL_SubmitGPUCommandBufferAndAcquireFence

Definition at line 464 of file SDL_gpu.h.

## SDL_GPUComputePass

typedef struct SDL_GPUComputePass SDL_GPUComputePass

An opaque handle representing a compute pass.

This handle is transient and should not be held or referenced after SDL_EndGPUComputePass is called.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_BeginGPUComputePass
  SDL_EndGPUComputePass

Definition at line 490 of file SDL_gpu.h.

## SDL_GPUComputePipeline

typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline

An opaque handle representing a compute pipeline.

Used during compute passes.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_CreateGPUComputePipeline
  SDL_BindGPUComputePipeline
  SDL_ReleaseGPUComputePipeline

Definition at line 426 of file SDL_gpu.h.

## SDL_GPUCopyPass

typedef struct SDL_GPUCopyPass SDL_GPUCopyPass

An opaque handle representing a copy pass.

This handle is transient and should not be held or referenced after SDL_EndGPUCopyPass is called.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_BeginGPUCopyPass
  SDL_EndGPUCopyPass

Definition at line 503 of file SDL_gpu.h.

## SDL_GPUDevice

typedef struct SDL_GPUDevice SDL_GPUDevice

# CategoryGPU

The GPU API offers a cross-platform way for apps to talk to modern graphics hardware. It offers both 3D graphics and compute support, in the style of Metal, Vulkan, and Direct3D 12.

A basic workflow might be something like this:

The app creates a GPU device with SDL_CreateGPUDevice(), and assigns it to a window with SDL_ClaimWindowForGPUDevice()–although strictly speaking you can render offscreen entirely, perhaps for image processing, and not use a window at all.

Next, the app prepares static data (things that are created once and used over and over). For example:

- Shaders (programs that run on the GPU): use SDL_CreateGPUShader().
- Vertex buffers (arrays of geometry data) and other rendering data: use SDL_CreateGPUBuffer() and SDL_UploadToGPUBuffer().
- Textures (images): use SDL_CreateGPUTexture() and SDL_UploadToGPUTexture().
- Samplers (how textures should be read from): use SDL_CreateGPUSampler().
- Render pipelines (precalculated rendering state): use SDL_CreateGPUGraphicsPipeline()

To render, the app creates one or more command buffers, with SDL_AcquireGPUCommandBuffer(). Command buffers collect rendering instructions that will be submitted to the GPU in batch. Complex scenes can use multiple command buffers, maybe configured across multiple threads in parallel, as long as they are submitted in the correct order, but many apps will just need one command buffer per frame.

Rendering can happen to a texture (what other APIs call a "render target") or it can happen to the swapchain texture (which is just a special texture that represents a window's contents). The app can use SDL_WaitAndAcquireGPUSwapchainTexture() to render to the window.

Rendering actually happens in a Render Pass, which is encoded into a command buffer. One can encode multiple render passes (or alternate between render and compute passes) in a single command buffer, but many apps might simply need a single render pass in a single command buffer. Render Passes can render to up to four color textures and one depth texture simultaneously. If the set of textures being rendered to needs to change, the Render Pass must be ended and a new one must be begun.

The app calls SDL_BeginGPURenderPass(). Then it sets states it needs for each draw:

- SDL_BindGPUGraphicsPipeline()
- SDL_SetGPUViewport()
- SDL_BindGPUVertexBuffers()
- SDL_BindGPUVertexSamplers()
- etc

Then, make the actual draw commands with these states:

- SDL_DrawGPUPrimitives()
- SDL_DrawGPUPrimitivesIndirect()
- SDL_DrawGPUIndexedPrimitivesIndirect()
- etc

After all the drawing commands for a pass are complete, the app should call SDL_EndGPURenderPass(). Once a render pass ends all render-related state is reset.

The app can begin new Render Passes and make new draws in the same command buffer until the entire scene is rendered.

Once all of the render commands for the scene are complete, the app calls SDL_SubmitGPUCommandBuffer() to send it to the GPU for processing.

If the app needs to read back data from texture or buffers, the API has an efficient way of doing this, provided that the app is willing to tolerate some latency. When the app uses SDL_DownloadFromGPUTexture() or SDL_DownloadFromGPUBuffer(), submitting the command buffer with SDL_SubmitGPUCommandBufferAndAcquireFence() will return a fence handle that the app can poll or wait on in a thread. Once the fence indicates that the command buffer is done processing, it is safe to read the downloaded data. Make sure to call SDL_ReleaseGPUFence() when done with the fence.

The API also has "compute" support. The app calls SDL_BeginGPUComputePass() with compute-writeable textures and/or buffers, which can be written to in a compute shader. Then it sets states it needs for the compute dispatches:

- SDL_BindGPUComputePipeline()
- SDL_BindGPUComputeStorageBuffers()
- SDL_BindGPUComputeStorageTextures()

Then, dispatch compute work:

- SDL_DispatchGPUCompute()

For advanced users, this opens up powerful GPU-driven workflows.

Graphics and compute pipelines require the use of shaders, which as mentioned above are small programs executed on the GPU. Each backend (Vulkan, Metal, D3D12) requires a different shader format. When the app creates the GPU device, the app lets the device know which shader formats the app can provide. It will then select the appropriate backend depending on the available shader formats and the backends available on the platform. When creating shaders, the app must provide the correct shader format for the selected backend. If you would like to learn more about why the API works this way, there is a detailed blog post explaining this situation.

It is optimal for apps to pre-compile the shader formats they might use, but for ease of use SDL provides a separate project, SDL_shadercross , for performing runtime shader cross-compilation. It also has a CLI interface for offline precompilation as well.

This is an extremely quick overview that leaves out several important details. Already, though, one can see that GPU programming can be quite complex! If you just need simple 2D graphics, the Render API is much easier to use but still hardware-accelerated. That said, even for 2D applications the performance benefits and expressiveness of the GPU API are significant.

The GPU API targets a feature set with a wide range of hardware support and ease of portability. It is designed so that the app won't have to branch itself by querying feature support. If you need cutting-edge features with limited hardware support, this API is probably not for you.

Examples demonstrating proper usage of this API can be found here

## Performance considerations

Here are some basic tips for maximizing your rendering performance.

- Beginning a new render pass is relatively expensive. Use as few render passes as you can.
- Minimize the amount of state changes. For example, binding a pipeline is relatively cheap, but doing it hundreds of times when you don't need to will slow the performance significantly.
- Perform your data uploads as early as possible in the frame.
- Don't churn resources. Creating and releasing resources is expensive. It's better to create what you need up front and cache it.
- Don't use uniform buffers for large amounts of data (more than a matrix or so). Use a storage buffer instead.
- Use cycling correctly. There is a detailed explanation of cycling further below.
- Use culling techniques to minimize pixel writes. The less writing the GPU has to do the better. Culling can be a very advanced topic but even simple culling techniques can boost performance significantly.

In general try to remember the golden rule of performance: doing things is more expensive than not doing things. Don't Touch The Driver!

## FAQ

Question: When are you adding more advanced features, like ray tracing or mesh shaders?

Answer: We don't have immediate plans to add more bleeding-edge features, but we certainly might in the future, when these features prove worthwhile, and reasonable to implement across several platforms and underlying APIs. So while these things are not in the "never" category, they are definitely not "near future" items either.

Question: Why is my shader not working?

Answer: A common oversight when using shaders is not properly laying out the shader resources/registers correctly. The GPU API is very strict with how it wants resources to be laid out and it's difficult for the API to automatically validate shaders to see if they have a compatible layout. See the documentation for SDL_CreateGPUShader() and SDL_CreateGPUComputePipeline() for information on the expected layout.

Another common issue is not setting the correct number of samplers, textures, and buffers in SDL_GPUShaderCreateInfo. If possible use shader reflection to extract the required information from the shader automatically instead of manually filling in the struct's values.

Question: My application isn't performing very well. Is this the GPU API's fault?

Answer: No. Long answer: The GPU API is a relatively thin layer over the underlying graphics API. While it's possible that we have done something inefficiently, it's very unlikely especially if you are relatively inexperienced with GPU rendering. Please see the performance tips above and make sure you are following them. Additionally, tools like RenderDoc can be very helpful for diagnosing incorrect behavior and performance issues.

## System Requirements

Vulkan: Supported on Windows, Linux, Nintendo Switch, and certain Android devices. Requires Vulkan 1.0 with the following extensions and device features:

- `VK_KHR_swapchain`
- `VK_KHR_maintenance1`
- `independentBlend`
- `imageCubeArray`
- `depthClamp`
- `shaderClipDistance`
- `drawIndirectFirstInstance`

D3D12: Supported on Windows 10 or newer, Xbox One (GDK), and Xbox Series X|S (GDK). Requires a GPU that supports DirectX 12 Feature Level 11_1.

Metal: Supported on macOS 10.14+ and iOS/tvOS 13.0+. Hardware requirements vary by operating system:

- macOS requires an Apple Silicon or Intel Mac2 family GPU
- iOS/tvOS requires an A9 GPU or newer
- iOS Simulator and tvOS Simulator are unsupported

## Uniform Data

Uniforms are for passing data to shaders. The uniform data will be constant across all executions of the shader.

There are 4 available uniform slots per shader stage (where the stages are vertex, fragment, and compute). Uniform data pushed to a slot on a stage keeps its value throughout the command buffer until you call the relevant Push function on that slot again.

For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0, push the camera matrix at the start of the command buffer, and that data will be used for every subsequent draw call.

It is valid to push uniform data during a render or compute pass.

Uniforms are best for pushing small amounts of data. If you are pushing more than a matrix or two per call you should consider using a storage buffer instead.

## A Note On Cycling

When using a command buffer, operations do not occur immediately - they occur some time after the command buffer is submitted.

When a resource is used in a pending or active command buffer, it is considered to be "bound". When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound".

If data resources are bound, it is unspecified when that data will be unbound unless you acquire a fence when submitting the command buffer and wait on it. However, this doesn't mean you need to track resource usage manually.

All of the functions and structs that involve writing to a resource have a "cycle" bool. SDL_GPUTransferBuffer, SDL_GPUBuffer, and SDL_GPUTexture all effectively function as ring buffers on internal resources. When cycle is true, if the resource is bound, the cycle rotates to the next unbound internal resource, or if none are available, a new one is created. This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed.

For example: you can call SDL_MapGPUTransferBuffer(), write texture data, SDL_UnmapGPUTransferBuffer(), and then SDL_UploadToGPUTexture(). The next time you write texture data to the transfer buffer, if you set the cycle param to true, you don't have to worry about overwriting any data that is not yet uploaded.

Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. If you set cycle to true in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency.

Cycling will never undefine already bound data. When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. You must take care not to read undefined data.

Note that when cycling a texture, the entire texture will be cycled, even if only part of the texture is used in the call, so you must consider the entire texture to contain undefined data after cycling.

You must also take care not to overwrite a section of data that has been referenced in a command without cycling first. It is OK to overwrite unreferenced data in a bound resource without cycling, but overwriting a section of data that has already been referenced will produce unexpected results. An opaque handle representing the SDL_GPU context.

Since
  This struct is available since SDL 3.2.0.

Definition at line 328 of file SDL_gpu.h.

## SDL_GPUFence

typedef struct SDL_GPUFence SDL_GPUFence

An opaque handle representing a fence.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_SubmitGPUCommandBufferAndAcquireFence
  SDL_QueryGPUFence
  SDL_WaitForGPUFences
  SDL_ReleaseGPUFence

Definition at line 515 of file SDL_gpu.h.

## SDL_GPUGraphicsPipeline

typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline

An opaque handle representing a graphics pipeline.

Used during render passes.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline
  SDL_BindGPUGraphicsPipeline
  SDL_ReleaseGPUGraphicsPipeline

Definition at line 439 of file SDL_gpu.h.

## SDL_GPURenderPass

typedef struct SDL_GPURenderPass SDL_GPURenderPass

An opaque handle representing a render pass.

This handle is transient and should not be held or referenced after SDL_EndGPURenderPass is called.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_BeginGPURenderPass
  SDL_EndGPURenderPass

Definition at line 477 of file SDL_gpu.h.

## SDL_GPUSampler

typedef struct SDL_GPUSampler SDL_GPUSampler

An opaque handle representing a sampler.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_CreateGPUSampler
  SDL_BindGPUVertexSamplers
  SDL_BindGPUFragmentSamplers
  SDL_ReleaseGPUSampler

Definition at line 402 of file SDL_gpu.h.

## SDL_GPUShader

typedef struct SDL_GPUShader SDL_GPUShader

An opaque handle representing a compiled shader object.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader
  SDL_CreateGPUGraphicsPipeline
  SDL_ReleaseGPUShader

Definition at line 413 of file SDL_gpu.h.

## SDL_GPUShaderFormat

typedef Uint32 SDL_GPUShaderFormat

Specifies the format of shader code.

Each format corresponds to a specific backend that accepts it.

Since
  This datatype is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

Definition at line 948 of file SDL_gpu.h.

## SDL_GPUTexture

typedef struct SDL_GPUTexture SDL_GPUTexture

An opaque handle representing a texture.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_CreateGPUTexture
  SDL_UploadToGPUTexture
  SDL_DownloadFromGPUTexture
  SDL_CopyGPUTextureToTexture
  SDL_BindGPUVertexSamplers
  SDL_BindGPUVertexStorageTextures
  SDL_BindGPUFragmentSamplers
  SDL_BindGPUFragmentStorageTextures
  SDL_BindGPUComputeStorageTextures
  SDL_GenerateMipmapsForGPUTexture
  SDL_BlitGPUTexture
  SDL_ReleaseGPUTexture

Definition at line 390 of file SDL_gpu.h.

## SDL_GPUTextureUsageFlags

typedef Uint32 SDL_GPUTextureUsageFlags

Specifies how a texture is intended to be used by the client.

A texture must have at least one usage flag. Note that some usage flag combinations are invalid.

With regards to compute storage usage, READ | WRITE means that you can have shader A that only writes into the texture and shader B that only reads from the texture and bind the same texture to either shader respectively. SIMULTANEOUS means that you can do reads and writes within the same shader or compute pass. It also implies that atomic ops can be used, since those are read-modify-write operations. If you use SIMULTANEOUS, you are responsible for avoiding data races, as there is no data synchronization within a compute pass. Note that SIMULTANEOUS usage is only supported by a limited number of texture formats.

Since
  This datatype is available since SDL 3.2.0.

See also
  SDL_CreateGPUTexture

Definition at line 821 of file SDL_gpu.h.

## SDL_GPUTransferBuffer

typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer

An opaque handle representing a transfer buffer.

Used for transferring data to and from the device.

Since
  This struct is available since SDL 3.2.0.

See also
  SDL_CreateGPUTransferBuffer
  SDL_MapGPUTransferBuffer
  SDL_UnmapGPUTransferBuffer
  SDL_UploadToGPUBuffer
  SDL_UploadToGPUTexture
  SDL_DownloadFromGPUBuffer
  SDL_DownloadFromGPUTexture
  SDL_ReleaseGPUTransferBuffer

Definition at line 370 of file SDL_gpu.h.

## Enumeration Type Documentation

## SDL_GPUBlendFactor

enum SDL_GPUBlendFactor

Specifies a blending factor to be used when pixels in a render target are blended with existing pixels in the texture.

The source color is the value written by the fragment shader. The destination color is the value currently existing in the texture.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_BLENDFACTOR_INVALID |
SDL_GPU_BLENDFACTOR_ZERO | 0
SDL_GPU_BLENDFACTOR_ONE | 1
SDL_GPU_BLENDFACTOR_SRC_COLOR | source color
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR | 1 - source color
SDL_GPU_BLENDFACTOR_DST_COLOR | destination color
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR | 1 - destination color
SDL_GPU_BLENDFACTOR_SRC_ALPHA | source alpha
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA | 1 - source alpha
SDL_GPU_BLENDFACTOR_DST_ALPHA | destination alpha
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA | 1 - destination alpha
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR | blend constant
SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR | 1 - blend constant
SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE | min(source alpha, 1 - destination alpha)

Definition at line 1151 of file SDL_gpu.h.

{
SDL_GPU_BLENDFACTOR_INVALID,
SDL_GPU_BLENDFACTOR_ZERO, /**< 0 */
SDL_GPU_BLENDFACTOR_ONE, /**< 1 */
SDL_GPU_BLENDFACTOR_SRC_COLOR, /**< source color */
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, /**< 1 - source color */
SDL_GPU_BLENDFACTOR_DST_COLOR, /**< destination color */
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, /**< 1 - destination color */
SDL_GPU_BLENDFACTOR_SRC_ALPHA, /**< source alpha */
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, /**< 1 - source alpha */
SDL_GPU_BLENDFACTOR_DST_ALPHA, /**< destination alpha */
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, /**< 1 - destination alpha */
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, /**< blend constant */
SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, /**< 1 - blend constant */
SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE /**< min(source alpha, 1 - destination alpha) */
} SDL_GPUBlendFactor;
SDL_GPUBlendFactor
SDL_GPUBlendFactor
Definition SDL_gpu.h:1152
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA
Definition SDL_gpu.h:1161
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR
@ SDL_GPU_BLENDFACTOR_CONSTANT_COLOR
Definition SDL_gpu.h:1164
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR
Definition SDL_gpu.h:1159
SDL_GPU_BLENDFACTOR_INVALID
@ SDL_GPU_BLENDFACTOR_INVALID
Definition SDL_gpu.h:1153
SDL_GPU_BLENDFACTOR_DST_ALPHA
@ SDL_GPU_BLENDFACTOR_DST_ALPHA
Definition SDL_gpu.h:1162
SDL_GPU_BLENDFACTOR_ZERO
@ SDL_GPU_BLENDFACTOR_ZERO
Definition SDL_gpu.h:1154
SDL_GPU_BLENDFACTOR_DST_COLOR
@ SDL_GPU_BLENDFACTOR_DST_COLOR
Definition SDL_gpu.h:1158
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA
Definition SDL_gpu.h:1163
SDL_GPU_BLENDFACTOR_SRC_ALPHA
@ SDL_GPU_BLENDFACTOR_SRC_ALPHA
Definition SDL_gpu.h:1160
SDL_GPU_BLENDFACTOR_SRC_COLOR
@ SDL_GPU_BLENDFACTOR_SRC_COLOR
Definition SDL_gpu.h:1156
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR
Definition SDL_gpu.h:1157
SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
@ SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
Definition SDL_gpu.h:1166
SDL_GPU_BLENDFACTOR_ONE
@ SDL_GPU_BLENDFACTOR_ONE
Definition SDL_gpu.h:1155
SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR
Definition SDL_gpu.h:1165

## SDL_GPUBlendOp

enum SDL_GPUBlendOp

Specifies the operator to be used when pixels in a render target are blended with existing pixels in the texture.

The source color is the value written by the fragment shader. The destination color is the value currently existing in the texture.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_BLENDOP_INVALID |
SDL_GPU_BLENDOP_ADD | (source * source_factor) + (destination * destination_factor)
SDL_GPU_BLENDOP_SUBTRACT | (source * source_factor) - (destination * destination_factor)
SDL_GPU_BLENDOP_REVERSE_SUBTRACT | (destination * destination_factor) - (source * source_factor)
SDL_GPU_BLENDOP_MIN | min(source, destination)
SDL_GPU_BLENDOP_MAX | max(source, destination)

Definition at line 1130 of file SDL_gpu.h.

{
SDL_GPU_BLENDOP_INVALID,
SDL_GPU_BLENDOP_ADD, /**< (source * source_factor) + (destination * destination_factor) */
SDL_GPU_BLENDOP_SUBTRACT, /**< (source * source_factor) - (destination * destination_factor) */
SDL_GPU_BLENDOP_REVERSE_SUBTRACT, /**< (destination * destination_factor) - (source * source_factor) */
SDL_GPU_BLENDOP_MIN, /**< min(source, destination) */
SDL_GPU_BLENDOP_MAX /**< max(source, destination) */
} SDL_GPUBlendOp;
SDL_GPUBlendOp
SDL_GPUBlendOp
Definition SDL_gpu.h:1131
SDL_GPU_BLENDOP_MIN
@ SDL_GPU_BLENDOP_MIN
Definition SDL_gpu.h:1136
SDL_GPU_BLENDOP_INVALID
@ SDL_GPU_BLENDOP_INVALID
Definition SDL_gpu.h:1132
SDL_GPU_BLENDOP_MAX
@ SDL_GPU_BLENDOP_MAX
Definition SDL_gpu.h:1137
SDL_GPU_BLENDOP_REVERSE_SUBTRACT
@ SDL_GPU_BLENDOP_REVERSE_SUBTRACT
Definition SDL_gpu.h:1135
SDL_GPU_BLENDOP_SUBTRACT
@ SDL_GPU_BLENDOP_SUBTRACT
Definition SDL_gpu.h:1134
SDL_GPU_BLENDOP_ADD
@ SDL_GPU_BLENDOP_ADD
Definition SDL_gpu.h:1133

## SDL_GPUCompareOp

enum SDL_GPUCompareOp

Specifies a comparison operator for depth, stencil and sampler operations.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_COMPAREOP_INVALID |
SDL_GPU_COMPAREOP_NEVER | The comparison always evaluates false.
SDL_GPU_COMPAREOP_LESS | The comparison evaluates reference < test.
SDL_GPU_COMPAREOP_EQUAL | The comparison evaluates reference == test.
SDL_GPU_COMPAREOP_LESS_OR_EQUAL | The comparison evaluates reference <= test.
SDL_GPU_COMPAREOP_GREATER | The comparison evaluates reference > test.
SDL_GPU_COMPAREOP_NOT_EQUAL | The comparison evaluates reference != test.
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL | The comparison evalutes reference >= test.
SDL_GPU_COMPAREOP_ALWAYS | The comparison always evaluates true.

Definition at line 1085 of file SDL_gpu.h.

{
SDL_GPU_COMPAREOP_INVALID,
SDL_GPU_COMPAREOP_NEVER, /**< The comparison always evaluates false. */
SDL_GPU_COMPAREOP_LESS, /**< The comparison evaluates reference < test. */
SDL_GPU_COMPAREOP_EQUAL, /**< The comparison evaluates reference == test. */
SDL_GPU_COMPAREOP_LESS_OR_EQUAL, /**< The comparison evaluates reference <= test. */
SDL_GPU_COMPAREOP_GREATER, /**< The comparison evaluates reference > test. */
SDL_GPU_COMPAREOP_NOT_EQUAL, /**< The comparison evaluates reference != test. */
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, /**< The comparison evalutes reference >= test. */
SDL_GPU_COMPAREOP_ALWAYS /**< The comparison always evaluates true. */
} SDL_GPUCompareOp;
SDL_GPUCompareOp
SDL_GPUCompareOp
Definition SDL_gpu.h:1086
SDL_GPU_COMPAREOP_NEVER
@ SDL_GPU_COMPAREOP_NEVER
Definition SDL_gpu.h:1088
SDL_GPU_COMPAREOP_INVALID
@ SDL_GPU_COMPAREOP_INVALID
Definition SDL_gpu.h:1087
SDL_GPU_COMPAREOP_GREATER
@ SDL_GPU_COMPAREOP_GREATER
Definition SDL_gpu.h:1092
SDL_GPU_COMPAREOP_LESS
@ SDL_GPU_COMPAREOP_LESS
Definition SDL_gpu.h:1089
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL
@ SDL_GPU_COMPAREOP_GREATER_OR_EQUAL
Definition SDL_gpu.h:1094
SDL_GPU_COMPAREOP_ALWAYS
@ SDL_GPU_COMPAREOP_ALWAYS
Definition SDL_gpu.h:1095
SDL_GPU_COMPAREOP_LESS_OR_EQUAL
@ SDL_GPU_COMPAREOP_LESS_OR_EQUAL
Definition SDL_gpu.h:1091
SDL_GPU_COMPAREOP_NOT_EQUAL
@ SDL_GPU_COMPAREOP_NOT_EQUAL
Definition SDL_gpu.h:1093
SDL_GPU_COMPAREOP_EQUAL
@ SDL_GPU_COMPAREOP_EQUAL
Definition SDL_gpu.h:1090

## SDL_GPUCubeMapFace

enum SDL_GPUCubeMapFace

Specifies the face of a cube map.

Can be passed in as the layer field in texture-related structs.

Since
  This enum is available since SDL 3.2.0.

Enumerator
SDL_GPU_CUBEMAPFACE_POSITIVEX |
SDL_GPU_CUBEMAPFACE_NEGATIVEX |
SDL_GPU_CUBEMAPFACE_POSITIVEY |
SDL_GPU_CUBEMAPFACE_NEGATIVEY |
SDL_GPU_CUBEMAPFACE_POSITIVEZ |
SDL_GPU_CUBEMAPFACE_NEGATIVEZ |

Definition at line 874 of file SDL_gpu.h.

{
SDL_GPU_CUBEMAPFACE_POSITIVEX,
SDL_GPU_CUBEMAPFACE_NEGATIVEX,
SDL_GPU_CUBEMAPFACE_POSITIVEY,
SDL_GPU_CUBEMAPFACE_NEGATIVEY,
SDL_GPU_CUBEMAPFACE_POSITIVEZ,
SDL_GPU_CUBEMAPFACE_NEGATIVEZ
} SDL_GPUCubeMapFace;
SDL_GPUCubeMapFace
SDL_GPUCubeMapFace
Definition SDL_gpu.h:875
SDL_GPU_CUBEMAPFACE_NEGATIVEY
@ SDL_GPU_CUBEMAPFACE_NEGATIVEY
Definition SDL_gpu.h:879
SDL_GPU_CUBEMAPFACE_POSITIVEY
@ SDL_GPU_CUBEMAPFACE_POSITIVEY
Definition SDL_gpu.h:878
SDL_GPU_CUBEMAPFACE_NEGATIVEX
@ SDL_GPU_CUBEMAPFACE_NEGATIVEX
Definition SDL_gpu.h:877
SDL_GPU_CUBEMAPFACE_NEGATIVEZ
@ SDL_GPU_CUBEMAPFACE_NEGATIVEZ
Definition SDL_gpu.h:881
SDL_GPU_CUBEMAPFACE_POSITIVEX
@ SDL_GPU_CUBEMAPFACE_POSITIVEX
Definition SDL_gpu.h:876
SDL_GPU_CUBEMAPFACE_POSITIVEZ
@ SDL_GPU_CUBEMAPFACE_POSITIVEZ
Definition SDL_gpu.h:880

## SDL_GPUCullMode

enum SDL_GPUCullMode

Specifies the facing direction in which triangle faces will be culled.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_CULLMODE_NONE | No triangles are culled.
SDL_GPU_CULLMODE_FRONT | Front-facing triangles are culled.
SDL_GPU_CULLMODE_BACK | Back-facing triangles are culled.

Definition at line 1057 of file SDL_gpu.h.

{
SDL_GPU_CULLMODE_NONE, /**< No triangles are culled. */
SDL_GPU_CULLMODE_FRONT, /**< Front-facing triangles are culled. */
SDL_GPU_CULLMODE_BACK /**< Back-facing triangles are culled. */
} SDL_GPUCullMode;
SDL_GPUCullMode
SDL_GPUCullMode
Definition SDL_gpu.h:1058
SDL_GPU_CULLMODE_FRONT
@ SDL_GPU_CULLMODE_FRONT
Definition SDL_gpu.h:1060
SDL_GPU_CULLMODE_NONE
@ SDL_GPU_CULLMODE_NONE
Definition SDL_gpu.h:1059
SDL_GPU_CULLMODE_BACK
@ SDL_GPU_CULLMODE_BACK
Definition SDL_gpu.h:1061

## SDL_GPUFillMode

enum SDL_GPUFillMode

Specifies the fill mode of the graphics pipeline.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_FILLMODE_FILL | Polygons will be rendered via rasterization.
SDL_GPU_FILLMODE_LINE | Polygon edges will be drawn as line segments.

Definition at line 1044 of file SDL_gpu.h.

{
SDL_GPU_FILLMODE_FILL, /**< Polygons will be rendered via rasterization. */
SDL_GPU_FILLMODE_LINE /**< Polygon edges will be drawn as line segments. */
} SDL_GPUFillMode;
SDL_GPUFillMode
SDL_GPUFillMode
Definition SDL_gpu.h:1045
SDL_GPU_FILLMODE_FILL
@ SDL_GPU_FILLMODE_FILL
Definition SDL_gpu.h:1046
SDL_GPU_FILLMODE_LINE
@ SDL_GPU_FILLMODE_LINE
Definition SDL_gpu.h:1047

## SDL_GPUFilter

enum SDL_GPUFilter

Specifies a filter operation used by a sampler.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUSampler

Enumerator
SDL_GPU_FILTER_NEAREST | Point filtering.
SDL_GPU_FILTER_LINEAR | Linear filtering.

Definition at line 1190 of file SDL_gpu.h.

{
SDL_GPU_FILTER_NEAREST, /**< Point filtering. */
SDL_GPU_FILTER_LINEAR /**< Linear filtering. */
} SDL_GPUFilter;
SDL_GPUFilter
SDL_GPUFilter
Definition SDL_gpu.h:1191
SDL_GPU_FILTER_NEAREST
@ SDL_GPU_FILTER_NEAREST
Definition SDL_gpu.h:1192
SDL_GPU_FILTER_LINEAR
@ SDL_GPU_FILTER_LINEAR
Definition SDL_gpu.h:1193

## SDL_GPUFrontFace

enum SDL_GPUFrontFace

Specifies the vertex winding that will cause a triangle to be determined to be front-facing.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE | A triangle with counter-clockwise vertex winding will be considered front-facing.
SDL_GPU_FRONTFACE_CLOCKWISE | A triangle with clockwise vertex winding will be considered front-facing.

Definition at line 1072 of file SDL_gpu.h.

{
SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, /**< A triangle with counter-clockwise vertex winding will be considered front-facing. */
SDL_GPU_FRONTFACE_CLOCKWISE /**< A triangle with clockwise vertex winding will be considered front-facing. */
} SDL_GPUFrontFace;
SDL_GPUFrontFace
SDL_GPUFrontFace
Definition SDL_gpu.h:1073
SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE
@ SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE
Definition SDL_gpu.h:1074
SDL_GPU_FRONTFACE_CLOCKWISE
@ SDL_GPU_FRONTFACE_CLOCKWISE
Definition SDL_gpu.h:1075

## SDL_GPUIndexElementSize

enum SDL_GPUIndexElementSize

Specifies the size of elements in an index buffer.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_INDEXELEMENTSIZE_16BIT | The index elements are 16-bit.
SDL_GPU_INDEXELEMENTSIZE_32BIT | The index elements are 32-bit.

Definition at line 585 of file SDL_gpu.h.

{
SDL_GPU_INDEXELEMENTSIZE_16BIT, /**< The index elements are 16-bit. */
SDL_GPU_INDEXELEMENTSIZE_32BIT /**< The index elements are 32-bit. */
} SDL_GPUIndexElementSize;
SDL_GPUIndexElementSize
SDL_GPUIndexElementSize
Definition SDL_gpu.h:586
SDL_GPU_INDEXELEMENTSIZE_16BIT
@ SDL_GPU_INDEXELEMENTSIZE_16BIT
Definition SDL_gpu.h:587
SDL_GPU_INDEXELEMENTSIZE_32BIT
@ SDL_GPU_INDEXELEMENTSIZE_32BIT
Definition SDL_gpu.h:588

## SDL_GPULoadOp

enum SDL_GPULoadOp

Specifies how the contents of a texture attached to a render pass are treated at the beginning of the render pass.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_BeginGPURenderPass

Enumerator
SDL_GPU_LOADOP_LOAD | The previous contents of the texture will be preserved.
SDL_GPU_LOADOP_CLEAR | The contents of the texture will be cleared to a color.
SDL_GPU_LOADOP_DONT_CARE | The previous contents of the texture need not be preserved. The contents will be undefined.

Definition at line 555 of file SDL_gpu.h.

{
SDL_GPU_LOADOP_LOAD, /**< The previous contents of the texture will be preserved. */
SDL_GPU_LOADOP_CLEAR, /**< The contents of the texture will be cleared to a color. */
SDL_GPU_LOADOP_DONT_CARE /**< The previous contents of the texture need not be preserved. The contents will be undefined. */
} SDL_GPULoadOp;
SDL_GPULoadOp
SDL_GPULoadOp
Definition SDL_gpu.h:556
SDL_GPU_LOADOP_DONT_CARE
@ SDL_GPU_LOADOP_DONT_CARE
Definition SDL_gpu.h:559
SDL_GPU_LOADOP_CLEAR
@ SDL_GPU_LOADOP_CLEAR
Definition SDL_gpu.h:558
SDL_GPU_LOADOP_LOAD
@ SDL_GPU_LOADOP_LOAD
Definition SDL_gpu.h:557

## SDL_GPUPresentMode

enum SDL_GPUPresentMode

Specifies the timing that will be used to present swapchain textures to the OS.

VSYNC mode will always be supported. IMMEDIATE and MAILBOX modes may not be supported on certain systems.

It is recommended to query SDL_WindowSupportsGPUPresentMode after claiming the window if you wish to change the present mode to IMMEDIATE or MAILBOX.

- VSYNC: Waits for vblank before presenting. No tearing is possible. If there is a pending image to present, the new image is enqueued for presentation. Disallows tearing at the cost of visual latency.
- IMMEDIATE: Immediately presents. Lowest latency option, but tearing may occur.
- MAILBOX: Waits for vblank before presenting. No tearing is possible. If there is a pending image to present, the pending image is replaced by the new image. Similar to VSYNC, but with reduced visual latency.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_SetGPUSwapchainParameters
  SDL_WindowSupportsGPUPresentMode
  SDL_WaitAndAcquireGPUSwapchainTexture

Enumerator
SDL_GPU_PRESENTMODE_VSYNC |
SDL_GPU_PRESENTMODE_IMMEDIATE |
SDL_GPU_PRESENTMODE_MAILBOX |

Definition at line 1249 of file SDL_gpu.h.

{
SDL_GPU_PRESENTMODE_VSYNC,
SDL_GPU_PRESENTMODE_IMMEDIATE,
SDL_GPU_PRESENTMODE_MAILBOX
} SDL_GPUPresentMode;
SDL_GPUPresentMode
SDL_GPUPresentMode
Definition SDL_gpu.h:1250
SDL_GPU_PRESENTMODE_VSYNC
@ SDL_GPU_PRESENTMODE_VSYNC
Definition SDL_gpu.h:1251
SDL_GPU_PRESENTMODE_IMMEDIATE
@ SDL_GPU_PRESENTMODE_IMMEDIATE
Definition SDL_gpu.h:1252
SDL_GPU_PRESENTMODE_MAILBOX
@ SDL_GPU_PRESENTMODE_MAILBOX
Definition SDL_gpu.h:1253

## SDL_GPUPrimitiveType

enum SDL_GPUPrimitiveType

Specifies the primitive topology of a graphics pipeline.

If you are using POINTLIST you must include a point size output in the vertex shader.

- For HLSL compiling to SPIRV you must decorate a float output with [[vk::builtin("PointSize")]].
- For GLSL you must set the gl_PointSize builtin.
- For MSL you must include a float output with the [[point_size]] decorator.

Note that sized point topology is totally unsupported on D3D12. Any size other than 1 will be ignored. In general, you should avoid using point topology for both compatibility and performance reasons. You WILL regret using it.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_PRIMITIVETYPE_TRIANGLELIST | A series of separate triangles.
SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP | A series of connected triangles.
SDL_GPU_PRIMITIVETYPE_LINELIST | A series of separate lines.
SDL_GPU_PRIMITIVETYPE_LINESTRIP | A series of connected lines.
SDL_GPU_PRIMITIVETYPE_POINTLIST | A series of separate points.

Definition at line 538 of file SDL_gpu.h.

{
SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, /**< A series of separate triangles. */
SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP, /**< A series of connected triangles. */
SDL_GPU_PRIMITIVETYPE_LINELIST, /**< A series of separate lines. */
SDL_GPU_PRIMITIVETYPE_LINESTRIP, /**< A series of connected lines. */
SDL_GPU_PRIMITIVETYPE_POINTLIST /**< A series of separate points. */
} SDL_GPUPrimitiveType;
SDL_GPUPrimitiveType
SDL_GPUPrimitiveType
Definition SDL_gpu.h:539
SDL_GPU_PRIMITIVETYPE_TRIANGLELIST
@ SDL_GPU_PRIMITIVETYPE_TRIANGLELIST
Definition SDL_gpu.h:540
SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP
@ SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP
Definition SDL_gpu.h:541
SDL_GPU_PRIMITIVETYPE_POINTLIST
@ SDL_GPU_PRIMITIVETYPE_POINTLIST
Definition SDL_gpu.h:544
SDL_GPU_PRIMITIVETYPE_LINESTRIP
@ SDL_GPU_PRIMITIVETYPE_LINESTRIP
Definition SDL_gpu.h:543
SDL_GPU_PRIMITIVETYPE_LINELIST
@ SDL_GPU_PRIMITIVETYPE_LINELIST
Definition SDL_gpu.h:542

## SDL_GPUSampleCount

enum SDL_GPUSampleCount

Specifies the sample count of a texture.

Used in multisampling. Note that this value only applies when the texture is used as a render target.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUTexture
  SDL_GPUTextureSupportsSampleCount

Enumerator
SDL_GPU_SAMPLECOUNT_1 | No multisampling.
SDL_GPU_SAMPLECOUNT_2 | MSAA 2x
SDL_GPU_SAMPLECOUNT_4 | MSAA 4x
SDL_GPU_SAMPLECOUNT_8 | MSAA 8x

Definition at line 858 of file SDL_gpu.h.

{
SDL_GPU_SAMPLECOUNT_1, /**< No multisampling. */
SDL_GPU_SAMPLECOUNT_2, /**< MSAA 2x */
SDL_GPU_SAMPLECOUNT_4, /**< MSAA 4x */
SDL_GPU_SAMPLECOUNT_8 /**< MSAA 8x */
} SDL_GPUSampleCount;
SDL_GPUSampleCount
SDL_GPUSampleCount
Definition SDL_gpu.h:859
SDL_GPU_SAMPLECOUNT_2
@ SDL_GPU_SAMPLECOUNT_2
Definition SDL_gpu.h:861
SDL_GPU_SAMPLECOUNT_8
@ SDL_GPU_SAMPLECOUNT_8
Definition SDL_gpu.h:863
SDL_GPU_SAMPLECOUNT_1
@ SDL_GPU_SAMPLECOUNT_1
Definition SDL_gpu.h:860
SDL_GPU_SAMPLECOUNT_4
@ SDL_GPU_SAMPLECOUNT_4
Definition SDL_gpu.h:862

## SDL_GPUSamplerAddressMode

enum SDL_GPUSamplerAddressMode

Specifies behavior of texture sampling when the coordinates exceed the 0-1 range.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUSampler

Enumerator
SDL_GPU_SAMPLERADDRESSMODE_REPEAT | Specifies that the coordinates will wrap around.
SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT | Specifies that the coordinates will wrap around mirrored.
SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE | Specifies that the coordinates will clamp to the 0-1 range.

Definition at line 1217 of file SDL_gpu.h.

{
SDL_GPU_SAMPLERADDRESSMODE_REPEAT, /**< Specifies that the coordinates will wrap around. */
SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, /**< Specifies that the coordinates will wrap around mirrored. */
SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE /**< Specifies that the coordinates will clamp to the 0-1 range. */
} SDL_GPUSamplerAddressMode;
SDL_GPUSamplerAddressMode
SDL_GPUSamplerAddressMode
Definition SDL_gpu.h:1218
SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT
@ SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT
Definition SDL_gpu.h:1220
SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE
@ SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE
Definition SDL_gpu.h:1221
SDL_GPU_SAMPLERADDRESSMODE_REPEAT
@ SDL_GPU_SAMPLERADDRESSMODE_REPEAT
Definition SDL_gpu.h:1219

## SDL_GPUSamplerMipmapMode

enum SDL_GPUSamplerMipmapMode

Specifies a mipmap mode used by a sampler.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUSampler

Enumerator
SDL_GPU_SAMPLERMIPMAPMODE_NEAREST | Point filtering.
SDL_GPU_SAMPLERMIPMAPMODE_LINEAR | Linear filtering.

Definition at line 1203 of file SDL_gpu.h.

{
SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, /**< Point filtering. */
SDL_GPU_SAMPLERMIPMAPMODE_LINEAR /**< Linear filtering. */
} SDL_GPUSamplerMipmapMode;
SDL_GPUSamplerMipmapMode
SDL_GPUSamplerMipmapMode
Definition SDL_gpu.h:1204
SDL_GPU_SAMPLERMIPMAPMODE_NEAREST
@ SDL_GPU_SAMPLERMIPMAPMODE_NEAREST
Definition SDL_gpu.h:1205
SDL_GPU_SAMPLERMIPMAPMODE_LINEAR
@ SDL_GPU_SAMPLERMIPMAPMODE_LINEAR
Definition SDL_gpu.h:1206

## SDL_GPUShaderStage

enum SDL_GPUShaderStage

Specifies which stage a shader program corresponds to.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

Enumerator
SDL_GPU_SHADERSTAGE_VERTEX |
SDL_GPU_SHADERSTAGE_FRAGMENT |

Definition at line 933 of file SDL_gpu.h.

{
SDL_GPU_SHADERSTAGE_VERTEX,
SDL_GPU_SHADERSTAGE_FRAGMENT
} SDL_GPUShaderStage;
SDL_GPUShaderStage
SDL_GPUShaderStage
Definition SDL_gpu.h:934
SDL_GPU_SHADERSTAGE_FRAGMENT
@ SDL_GPU_SHADERSTAGE_FRAGMENT
Definition SDL_gpu.h:936
SDL_GPU_SHADERSTAGE_VERTEX
@ SDL_GPU_SHADERSTAGE_VERTEX
Definition SDL_gpu.h:935

## SDL_GPUStencilOp

enum SDL_GPUStencilOp

Specifies what happens to a stored stencil value if stencil tests fail or pass.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_STENCILOP_INVALID |
SDL_GPU_STENCILOP_KEEP | Keeps the current value.
SDL_GPU_STENCILOP_ZERO | Sets the value to 0.
SDL_GPU_STENCILOP_REPLACE | Sets the value to reference.
SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP | Increments the current value and clamps to the maximum value.
SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP | Decrements the current value and clamps to 0.
SDL_GPU_STENCILOP_INVERT | Bitwise-inverts the current value.
SDL_GPU_STENCILOP_INCREMENT_AND_WRAP | Increments the current value and wraps back to 0.
SDL_GPU_STENCILOP_DECREMENT_AND_WRAP | Decrements the current value and wraps to the maximum value.

Definition at line 1106 of file SDL_gpu.h.

{
SDL_GPU_STENCILOP_INVALID,
SDL_GPU_STENCILOP_KEEP, /**< Keeps the current value. */
SDL_GPU_STENCILOP_ZERO, /**< Sets the value to 0. */
SDL_GPU_STENCILOP_REPLACE, /**< Sets the value to reference. */
SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, /**< Increments the current value and clamps to the maximum value. */
SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, /**< Decrements the current value and clamps to 0. */
SDL_GPU_STENCILOP_INVERT, /**< Bitwise-inverts the current value. */
SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, /**< Increments the current value and wraps back to 0. */
SDL_GPU_STENCILOP_DECREMENT_AND_WRAP /**< Decrements the current value and wraps to the maximum value. */
} SDL_GPUStencilOp;
SDL_GPUStencilOp
SDL_GPUStencilOp
Definition SDL_gpu.h:1107
SDL_GPU_STENCILOP_DECREMENT_AND_WRAP
@ SDL_GPU_STENCILOP_DECREMENT_AND_WRAP
Definition SDL_gpu.h:1116
SDL_GPU_STENCILOP_ZERO
@ SDL_GPU_STENCILOP_ZERO
Definition SDL_gpu.h:1110
SDL_GPU_STENCILOP_KEEP
@ SDL_GPU_STENCILOP_KEEP
Definition SDL_gpu.h:1109
SDL_GPU_STENCILOP_INVERT
@ SDL_GPU_STENCILOP_INVERT
Definition SDL_gpu.h:1114
SDL_GPU_STENCILOP_REPLACE
@ SDL_GPU_STENCILOP_REPLACE
Definition SDL_gpu.h:1111
SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP
@ SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP
Definition SDL_gpu.h:1113
SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP
@ SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP
Definition SDL_gpu.h:1112
SDL_GPU_STENCILOP_INCREMENT_AND_WRAP
@ SDL_GPU_STENCILOP_INCREMENT_AND_WRAP
Definition SDL_gpu.h:1115
SDL_GPU_STENCILOP_INVALID
@ SDL_GPU_STENCILOP_INVALID
Definition SDL_gpu.h:1108

## SDL_GPUStoreOp

enum SDL_GPUStoreOp

Specifies how the contents of a texture attached to a render pass are treated at the end of the render pass.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_BeginGPURenderPass

Enumerator
SDL_GPU_STOREOP_STORE | The contents generated during the render pass will be written to memory.
SDL_GPU_STOREOP_DONT_CARE | The contents generated during the render pass are not needed and may be discarded. The contents will be undefined.
SDL_GPU_STOREOP_RESOLVE | The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined.
SDL_GPU_STOREOP_RESOLVE_AND_STORE | The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory.

Definition at line 570 of file SDL_gpu.h.

{
SDL_GPU_STOREOP_STORE, /**< The contents generated during the render pass will be written to memory. */
SDL_GPU_STOREOP_DONT_CARE, /**< The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. */
SDL_GPU_STOREOP_RESOLVE, /**< The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. */
SDL_GPU_STOREOP_RESOLVE_AND_STORE /**< The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. */
} SDL_GPUStoreOp;
SDL_GPUStoreOp
SDL_GPUStoreOp
Definition SDL_gpu.h:571
SDL_GPU_STOREOP_RESOLVE_AND_STORE
@ SDL_GPU_STOREOP_RESOLVE_AND_STORE
Definition SDL_gpu.h:575
SDL_GPU_STOREOP_STORE
@ SDL_GPU_STOREOP_STORE
Definition SDL_gpu.h:572
SDL_GPU_STOREOP_DONT_CARE
@ SDL_GPU_STOREOP_DONT_CARE
Definition SDL_gpu.h:573
SDL_GPU_STOREOP_RESOLVE
@ SDL_GPU_STOREOP_RESOLVE
Definition SDL_gpu.h:574

## SDL_GPUSwapchainComposition

enum SDL_GPUSwapchainComposition

Specifies the texture format and colorspace of the swapchain textures.

SDR will always be supported. Other compositions may not be supported on certain systems.

It is recommended to query SDL_WindowSupportsGPUSwapchainComposition after claiming the window if you wish to change the swapchain composition from SDR.

- SDR: B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in sRGB encoding.
- SDR_LINEAR: B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are stored in memory in sRGB encoding but accessed in shaders in "linear sRGB" encoding which is sRGB but with a linear transfer function.
- HDR_EXTENDED_LINEAR: R16G16B16A16_FLOAT swapchain. Pixel values are in extended linear sRGB encoding and permits values outside of the [0, 1] range.
- HDR10_ST2084: A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in BT.2020 ST2084 (PQ) encoding.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_SetGPUSwapchainParameters
  SDL_WindowSupportsGPUSwapchainComposition
  SDL_WaitAndAcquireGPUSwapchainTexture

Enumerator
SDL_GPU_SWAPCHAINCOMPOSITION_SDR |
SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR |
SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR |
SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084 |

Definition at line 1282 of file SDL_gpu.h.

{
SDL_GPU_SWAPCHAINCOMPOSITION_SDR,
SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR,
SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR,
SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084
} SDL_GPUSwapchainComposition;
SDL_GPUSwapchainComposition
SDL_GPUSwapchainComposition
Definition SDL_gpu.h:1283
SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084
@ SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084
Definition SDL_gpu.h:1287
SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR
@ SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR
Definition SDL_gpu.h:1285
SDL_GPU_SWAPCHAINCOMPOSITION_SDR
@ SDL_GPU_SWAPCHAINCOMPOSITION_SDR
Definition SDL_gpu.h:1284
SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR
@ SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR
Definition SDL_gpu.h:1286

## SDL_GPUTextureFormat

enum SDL_GPUTextureFormat

Specifies the pixel format of a texture.

Texture format support varies depending on driver, hardware, and usage flags. In general, you should use SDL_GPUTextureSupportsFormat to query if a format is supported before using it. However, there are a few guaranteed formats.

FIXME: Check universal support for 32-bit component formats FIXME: Check universal support for SIMULTANEOUS_READ_WRITE

For SAMPLER usage, the following formats are universally supported:

- R8G8B8A8_UNORM
- B8G8R8A8_UNORM
- R8_UNORM
- R8_SNORM
- R8G8_UNORM
- R8G8_SNORM
- R8G8B8A8_SNORM
- R16_FLOAT
- R16G16_FLOAT
- R16G16B16A16_FLOAT
- R32_FLOAT
- R32G32_FLOAT
- R32G32B32A32_FLOAT
- R11G11B10_UFLOAT
- R8G8B8A8_UNORM_SRGB
- B8G8R8A8_UNORM_SRGB
- D16_UNORM

For COLOR_TARGET usage, the following formats are universally supported:

- R8G8B8A8_UNORM
- B8G8R8A8_UNORM
- R8_UNORM
- R16_FLOAT
- R16G16_FLOAT
- R16G16B16A16_FLOAT
- R32_FLOAT
- R32G32_FLOAT
- R32G32B32A32_FLOAT
- R8_UINT
- R8G8_UINT
- R8G8B8A8_UINT
- R16_UINT
- R16G16_UINT
- R16G16B16A16_UINT
- R8_INT
- R8G8_INT
- R8G8B8A8_INT
- R16_INT
- R16G16_INT
- R16G16B16A16_INT
- R8G8B8A8_UNORM_SRGB
- B8G8R8A8_UNORM_SRGB

For STORAGE usages, the following formats are universally supported:

- R8G8B8A8_UNORM
- R8G8B8A8_SNORM
- R16G16B16A16_FLOAT
- R32_FLOAT
- R32G32_FLOAT
- R32G32B32A32_FLOAT
- R8G8B8A8_UINT
- R16G16B16A16_UINT
- R8G8B8A8_INT
- R16G16B16A16_INT

For DEPTH_STENCIL_TARGET usage, the following formats are universally supported:

- D16_UNORM
- Either (but not necessarily both!) D24_UNORM or D32_FLOAT
- Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_FLOAT_S8_UINT

Unless D16_UNORM is sufficient for your purposes, always check which of D24/D32 is supported before creating a depth-stencil texture!

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUTexture
  SDL_GPUTextureSupportsFormat

Enumerator
SDL_GPU_TEXTUREFORMAT_INVALID |
SDL_GPU_TEXTUREFORMAT_A8_UNORM |
SDL_GPU_TEXTUREFORMAT_R8_UNORM |
SDL_GPU_TEXTUREFORMAT_R8G8_UNORM |
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM |
SDL_GPU_TEXTUREFORMAT_R16_UNORM |
SDL_GPU_TEXTUREFORMAT_R16G16_UNORM |
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM |
SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM |
SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM |
SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM |
SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM |
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM |
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM |
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM |
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM |
SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM |
SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM |
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM |
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT |
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT |
SDL_GPU_TEXTUREFORMAT_R8_SNORM |
SDL_GPU_TEXTUREFORMAT_R8G8_SNORM |
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM |
SDL_GPU_TEXTUREFORMAT_R16_SNORM |
SDL_GPU_TEXTUREFORMAT_R16G16_SNORM |
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM |
SDL_GPU_TEXTUREFORMAT_R16_FLOAT |
SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT |
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT |
SDL_GPU_TEXTUREFORMAT_R32_FLOAT |
SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT |
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT |
SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT |
SDL_GPU_TEXTUREFORMAT_R8_UINT |
SDL_GPU_TEXTUREFORMAT_R8G8_UINT |
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT |
SDL_GPU_TEXTUREFORMAT_R16_UINT |
SDL_GPU_TEXTUREFORMAT_R16G16_UINT |
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT |
SDL_GPU_TEXTUREFORMAT_R32_UINT |
SDL_GPU_TEXTUREFORMAT_R32G32_UINT |
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT |
SDL_GPU_TEXTUREFORMAT_R8_INT |
SDL_GPU_TEXTUREFORMAT_R8G8_INT |
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT |
SDL_GPU_TEXTUREFORMAT_R16_INT |
SDL_GPU_TEXTUREFORMAT_R16G16_INT |
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT |
SDL_GPU_TEXTUREFORMAT_R32_INT |
SDL_GPU_TEXTUREFORMAT_R32G32_INT |
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT |
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_D16_UNORM |
SDL_GPU_TEXTUREFORMAT_D24_UNORM |
SDL_GPU_TEXTUREFORMAT_D32_FLOAT |
SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT |
SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT |
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM |
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB |
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT |
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT |

Definition at line 676 of file SDL_gpu.h.

{
SDL_GPU_TEXTUREFORMAT_INVALID,
/* Unsigned Normalized Float Color Formats */
SDL_GPU_TEXTUREFORMAT_A8_UNORM,
SDL_GPU_TEXTUREFORMAT_R8_UNORM,
SDL_GPU_TEXTUREFORMAT_R8G8_UNORM,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM,
SDL_GPU_TEXTUREFORMAT_R16_UNORM,
SDL_GPU_TEXTUREFORMAT_R16G16_UNORM,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM,
SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM,
SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM,
SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM,
SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM,
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM,
/* Compressed Unsigned Normalized Float Color Formats */
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM,
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM,
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM,
SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM,
SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM,
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM,
/* Compressed Signed Float Color Formats */
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT,
/* Compressed Unsigned Float Color Formats */
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT,
/* Signed Normalized Float Color Formats */
SDL_GPU_TEXTUREFORMAT_R8_SNORM,
SDL_GPU_TEXTUREFORMAT_R8G8_SNORM,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM,
SDL_GPU_TEXTUREFORMAT_R16_SNORM,
SDL_GPU_TEXTUREFORMAT_R16G16_SNORM,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM,
/* Signed Float Color Formats */
SDL_GPU_TEXTUREFORMAT_R16_FLOAT,
SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT,
SDL_GPU_TEXTUREFORMAT_R32_FLOAT,
SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT,
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT,
/* Unsigned Float Color Formats */
SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT,
/* Unsigned Integer Color Formats */
SDL_GPU_TEXTUREFORMAT_R8_UINT,
SDL_GPU_TEXTUREFORMAT_R8G8_UINT,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT,
SDL_GPU_TEXTUREFORMAT_R16_UINT,
SDL_GPU_TEXTUREFORMAT_R16G16_UINT,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT,
SDL_GPU_TEXTUREFORMAT_R32_UINT,
SDL_GPU_TEXTUREFORMAT_R32G32_UINT,
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT,
/* Signed Integer Color Formats */
SDL_GPU_TEXTUREFORMAT_R8_INT,
SDL_GPU_TEXTUREFORMAT_R8G8_INT,
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT,
SDL_GPU_TEXTUREFORMAT_R16_INT,
SDL_GPU_TEXTUREFORMAT_R16G16_INT,
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT,
SDL_GPU_TEXTUREFORMAT_R32_INT,
SDL_GPU_TEXTUREFORMAT_R32G32_INT,
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT,
/* SRGB Unsigned Normalized Color Formats */
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB,
/* Compressed SRGB Unsigned Normalized Color Formats */
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB,
/* Depth Formats */
SDL_GPU_TEXTUREFORMAT_D16_UNORM,
SDL_GPU_TEXTUREFORMAT_D24_UNORM,
SDL_GPU_TEXTUREFORMAT_D32_FLOAT,
SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT,
SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT,
/* Compressed ASTC Normalized Float Color Formats*/
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM,
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM,
/* Compressed SRGB ASTC Normalized Float Color Formats*/
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB,
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB,
/* Compressed ASTC Signed Float Color Formats*/
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT,
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
} SDL_GPUTextureFormat;
SDL_GPUTextureFormat
SDL_GPUTextureFormat
Definition SDL_gpu.h:677
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM
@ SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM
Definition SDL_gpu.h:692
SDL_GPU_TEXTUREFORMAT_D16_UNORM
@ SDL_GPU_TEXTUREFORMAT_D16_UNORM
Definition SDL_gpu.h:749
SDL_GPU_TEXTUREFORMAT_R16G16_INT
@ SDL_GPU_TEXTUREFORMAT_R16G16_INT
Definition SDL_gpu.h:735
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT
Definition SDL_gpu.h:726
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT
Definition SDL_gpu.h:794
SDL_GPU_TEXTUREFORMAT_R8_UINT
@ SDL_GPU_TEXTUREFORMAT_R8_UINT
Definition SDL_gpu.h:721
SDL_GPU_TEXTUREFORMAT_R8G8_SNORM
@ SDL_GPU_TEXTUREFORMAT_R8G8_SNORM
Definition SDL_gpu.h:706
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM
Definition SDL_gpu.h:687
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM
Definition SDL_gpu.h:757
SDL_GPU_TEXTUREFORMAT_A8_UNORM
@ SDL_GPU_TEXTUREFORMAT_A8_UNORM
Definition SDL_gpu.h:681
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT
@ SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT
Definition SDL_gpu.h:701
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB
Definition SDL_gpu.h:774
SDL_GPU_TEXTUREFORMAT_R16_UINT
@ SDL_GPU_TEXTUREFORMAT_R16_UINT
Definition SDL_gpu.h:724
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM
Definition SDL_gpu.h:755
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM
Definition SDL_gpu.h:710
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM
Definition SDL_gpu.h:763
SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM
@ SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM
Definition SDL_gpu.h:698
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM
Definition SDL_gpu.h:758
SDL_GPU_TEXTUREFORMAT_R32_INT
@ SDL_GPU_TEXTUREFORMAT_R32_INT
Definition SDL_gpu.h:737
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT
Definition SDL_gpu.h:791
SDL_GPU_TEXTUREFORMAT_R16_INT
@ SDL_GPU_TEXTUREFORMAT_R16_INT
Definition SDL_gpu.h:734
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT
@ SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT
Definition SDL_gpu.h:729
SDL_GPU_TEXTUREFORMAT_R32G32_INT
@ SDL_GPU_TEXTUREFORMAT_R32G32_INT
Definition SDL_gpu.h:738
SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM
@ SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM
Definition SDL_gpu.h:697
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT
Definition SDL_gpu.h:797
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB
Definition SDL_gpu.h:778
SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT
@ SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT
Definition SDL_gpu.h:716
SDL_GPU_TEXTUREFORMAT_R32_UINT
@ SDL_GPU_TEXTUREFORMAT_R32_UINT
Definition SDL_gpu.h:727
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB
Definition SDL_gpu.h:773
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB
Definition SDL_gpu.h:741
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM
Definition SDL_gpu.h:707
SDL_GPU_TEXTUREFORMAT_R16_UNORM
@ SDL_GPU_TEXTUREFORMAT_R16_UNORM
Definition SDL_gpu.h:685
SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT
@ SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT
Definition SDL_gpu.h:753
SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT
@ SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT
Definition SDL_gpu.h:703
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM
@ SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM
Definition SDL_gpu.h:699
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM
Definition SDL_gpu.h:764
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM
@ SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM
Definition SDL_gpu.h:695
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT
@ SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT
Definition SDL_gpu.h:717
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT
Definition SDL_gpu.h:789
SDL_GPU_TEXTUREFORMAT_R8_SNORM
@ SDL_GPU_TEXTUREFORMAT_R8_SNORM
Definition SDL_gpu.h:705
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT
Definition SDL_gpu.h:792
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB
Definition SDL_gpu.h:781
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB
Definition SDL_gpu.h:744
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB
Definition SDL_gpu.h:777
SDL_GPU_TEXTUREFORMAT_R8_UNORM
@ SDL_GPU_TEXTUREFORMAT_R8_UNORM
Definition SDL_gpu.h:682
SDL_GPU_TEXTUREFORMAT_D24_UNORM
@ SDL_GPU_TEXTUREFORMAT_D24_UNORM
Definition SDL_gpu.h:750
SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB
Definition SDL_gpu.h:745
SDL_GPU_TEXTUREFORMAT_INVALID
@ SDL_GPU_TEXTUREFORMAT_INVALID
Definition SDL_gpu.h:678
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB
Definition SDL_gpu.h:770
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB
Definition SDL_gpu.h:772
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
Definition SDL_gpu.h:798
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB
Definition SDL_gpu.h:771
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT
Definition SDL_gpu.h:795
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT
Definition SDL_gpu.h:786
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT
Definition SDL_gpu.h:790
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB
Definition SDL_gpu.h:776
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM
@ SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM
Definition SDL_gpu.h:696
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM
Definition SDL_gpu.h:766
SDL_GPU_TEXTUREFORMAT_R16G16_SNORM
@ SDL_GPU_TEXTUREFORMAT_R16G16_SNORM
Definition SDL_gpu.h:709
SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM
Definition SDL_gpu.h:761
SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT
Definition SDL_gpu.h:796
SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM
@ SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM
Definition SDL_gpu.h:691
SDL_GPU_TEXTUREFORMAT_R8G8_INT
@ SDL_GPU_TEXTUREFORMAT_R8G8_INT
Definition SDL_gpu.h:732
SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM
Definition SDL_gpu.h:756
SDL_GPU_TEXTUREFORMAT_D32_FLOAT
@ SDL_GPU_TEXTUREFORMAT_D32_FLOAT
Definition SDL_gpu.h:751
SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT
@ SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT
Definition SDL_gpu.h:739
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM
Definition SDL_gpu.h:767
SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT
Definition SDL_gpu.h:785
SDL_GPU_TEXTUREFORMAT_R8_INT
@ SDL_GPU_TEXTUREFORMAT_R8_INT
Definition SDL_gpu.h:731
SDL_GPU_TEXTUREFORMAT_R8G8_UINT
@ SDL_GPU_TEXTUREFORMAT_R8G8_UINT
Definition SDL_gpu.h:722
SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT
@ SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT
Definition SDL_gpu.h:713
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM
Definition SDL_gpu.h:765
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM
Definition SDL_gpu.h:768
SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB
Definition SDL_gpu.h:782
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB
Definition SDL_gpu.h:775
SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM
@ SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM
Definition SDL_gpu.h:690
SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB
Definition SDL_gpu.h:746
SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM
@ SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM
Definition SDL_gpu.h:694
SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB
Definition SDL_gpu.h:747
SDL_GPU_TEXTUREFORMAT_R32_FLOAT
@ SDL_GPU_TEXTUREFORMAT_R32_FLOAT
Definition SDL_gpu.h:715
SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT
@ SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT
Definition SDL_gpu.h:752
SDL_GPU_TEXTUREFORMAT_R32G32_UINT
@ SDL_GPU_TEXTUREFORMAT_R32G32_UINT
Definition SDL_gpu.h:728
SDL_GPU_TEXTUREFORMAT_R8G8_UNORM
@ SDL_GPU_TEXTUREFORMAT_R8G8_UNORM
Definition SDL_gpu.h:683
SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT
Definition SDL_gpu.h:787
SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB
Definition SDL_gpu.h:742
SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB
Definition SDL_gpu.h:780
SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM
@ SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM
Definition SDL_gpu.h:689
SDL_GPU_TEXTUREFORMAT_R16G16_UNORM
@ SDL_GPU_TEXTUREFORMAT_R16G16_UNORM
Definition SDL_gpu.h:686
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
Definition SDL_gpu.h:684
SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT
@ SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT
Definition SDL_gpu.h:719
SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT
Definition SDL_gpu.h:793
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT
Definition SDL_gpu.h:736
SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM
Definition SDL_gpu.h:759
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT
Definition SDL_gpu.h:723
SDL_GPU_TEXTUREFORMAT_R16G16_UINT
@ SDL_GPU_TEXTUREFORMAT_R16G16_UINT
Definition SDL_gpu.h:725
SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT
Definition SDL_gpu.h:714
SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM
Definition SDL_gpu.h:762
SDL_GPU_TEXTUREFORMAT_R16_SNORM
@ SDL_GPU_TEXTUREFORMAT_R16_SNORM
Definition SDL_gpu.h:708
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT
Definition SDL_gpu.h:733
SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM
@ SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM
Definition SDL_gpu.h:688
SDL_GPU_TEXTUREFORMAT_R16_FLOAT
@ SDL_GPU_TEXTUREFORMAT_R16_FLOAT
Definition SDL_gpu.h:712
SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB
Definition SDL_gpu.h:779
SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB
@ SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB
Definition SDL_gpu.h:783
SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT
@ SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT
Definition SDL_gpu.h:788
SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM
@ SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM
Definition SDL_gpu.h:760

## SDL_GPUTextureType

enum SDL_GPUTextureType

Specifies the type of a texture.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUTexture

Enumerator
SDL_GPU_TEXTURETYPE_2D | The texture is a 2-dimensional image.
SDL_GPU_TEXTURETYPE_2D_ARRAY | The texture is a 2-dimensional array image.
SDL_GPU_TEXTURETYPE_3D | The texture is a 3-dimensional image.
SDL_GPU_TEXTURETYPE_CUBE | The texture is a cube image.
SDL_GPU_TEXTURETYPE_CUBE_ARRAY | The texture is a cube array image.

Definition at line 838 of file SDL_gpu.h.

{
SDL_GPU_TEXTURETYPE_2D, /**< The texture is a 2-dimensional image. */
SDL_GPU_TEXTURETYPE_2D_ARRAY, /**< The texture is a 2-dimensional array image. */
SDL_GPU_TEXTURETYPE_3D, /**< The texture is a 3-dimensional image. */
SDL_GPU_TEXTURETYPE_CUBE, /**< The texture is a cube image. */
SDL_GPU_TEXTURETYPE_CUBE_ARRAY /**< The texture is a cube array image. */
} SDL_GPUTextureType;
SDL_GPUTextureType
SDL_GPUTextureType
Definition SDL_gpu.h:839
SDL_GPU_TEXTURETYPE_CUBE_ARRAY
@ SDL_GPU_TEXTURETYPE_CUBE_ARRAY
Definition SDL_gpu.h:844
SDL_GPU_TEXTURETYPE_3D
@ SDL_GPU_TEXTURETYPE_3D
Definition SDL_gpu.h:842
SDL_GPU_TEXTURETYPE_CUBE
@ SDL_GPU_TEXTURETYPE_CUBE
Definition SDL_gpu.h:843
SDL_GPU_TEXTURETYPE_2D
@ SDL_GPU_TEXTURETYPE_2D
Definition SDL_gpu.h:840
SDL_GPU_TEXTURETYPE_2D_ARRAY
@ SDL_GPU_TEXTURETYPE_2D_ARRAY
Definition SDL_gpu.h:841

## SDL_GPUTransferBufferUsage

enum SDL_GPUTransferBufferUsage

Specifies how a transfer buffer is intended to be used by the client.

Note that mapping and copying FROM an upload transfer buffer or TO a download transfer buffer is undefined behavior.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUTransferBuffer

Enumerator
SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD |
SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD |

Definition at line 920 of file SDL_gpu.h.

{
SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD,
SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
} SDL_GPUTransferBufferUsage;
SDL_GPUTransferBufferUsage
SDL_GPUTransferBufferUsage
Definition SDL_gpu.h:921
SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
@ SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
Definition SDL_gpu.h:923
SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD
@ SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD
Definition SDL_gpu.h:922

## SDL_GPUVertexElementFormat

enum SDL_GPUVertexElementFormat

Specifies the format of a vertex attribute.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_VERTEXELEMENTFORMAT_INVALID |
SDL_GPU_VERTEXELEMENTFORMAT_INT |
SDL_GPU_VERTEXELEMENTFORMAT_INT2 |
SDL_GPU_VERTEXELEMENTFORMAT_INT3 |
SDL_GPU_VERTEXELEMENTFORMAT_INT4 |
SDL_GPU_VERTEXELEMENTFORMAT_UINT |
SDL_GPU_VERTEXELEMENTFORMAT_UINT2 |
SDL_GPU_VERTEXELEMENTFORMAT_UINT3 |
SDL_GPU_VERTEXELEMENTFORMAT_UINT4 |
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT |
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2 |
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3 |
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4 |
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2 |
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4 |
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2 |
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4 |
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2 |
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4 |
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2 |
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4 |
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM |
SDL_GPU_VERTEXELEMENTFORMAT_HALF2 |
SDL_GPU_VERTEXELEMENTFORMAT_HALF4 |

Definition at line 965 of file SDL_gpu.h.

{
SDL_GPU_VERTEXELEMENTFORMAT_INVALID,
/* 32-bit Signed Integers */
SDL_GPU_VERTEXELEMENTFORMAT_INT,
SDL_GPU_VERTEXELEMENTFORMAT_INT2,
SDL_GPU_VERTEXELEMENTFORMAT_INT3,
SDL_GPU_VERTEXELEMENTFORMAT_INT4,
/* 32-bit Unsigned Integers */
SDL_GPU_VERTEXELEMENTFORMAT_UINT,
SDL_GPU_VERTEXELEMENTFORMAT_UINT2,
SDL_GPU_VERTEXELEMENTFORMAT_UINT3,
SDL_GPU_VERTEXELEMENTFORMAT_UINT4,
/* 32-bit Floats */
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT,
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2,
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3,
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4,
/* 8-bit Signed Integers */
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2,
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4,
/* 8-bit Unsigned Integers */
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2,
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4,
/* 8-bit Signed Normalized */
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM,
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM,
/* 8-bit Unsigned Normalized */
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM,
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM,
/* 16-bit Signed Integers */
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2,
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4,
/* 16-bit Unsigned Integers */
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2,
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4,
/* 16-bit Signed Normalized */
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM,
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM,
/* 16-bit Unsigned Normalized */
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM,
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM,
/* 16-bit Floats */
SDL_GPU_VERTEXELEMENTFORMAT_HALF2,
SDL_GPU_VERTEXELEMENTFORMAT_HALF4
} SDL_GPUVertexElementFormat;
SDL_GPUVertexElementFormat
SDL_GPUVertexElementFormat
Definition SDL_gpu.h:966
SDL_GPU_VERTEXELEMENTFORMAT_INT4
@ SDL_GPU_VERTEXELEMENTFORMAT_INT4
Definition SDL_gpu.h:973
SDL_GPU_VERTEXELEMENTFORMAT_INT
@ SDL_GPU_VERTEXELEMENTFORMAT_INT
Definition SDL_gpu.h:970
SDL_GPU_VERTEXELEMENTFORMAT_INVALID
@ SDL_GPU_VERTEXELEMENTFORMAT_INVALID
Definition SDL_gpu.h:967
SDL_GPU_VERTEXELEMENTFORMAT_HALF2
@ SDL_GPU_VERTEXELEMENTFORMAT_HALF2
Definition SDL_gpu.h:1020
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE2
Definition SDL_gpu.h:988
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4
Definition SDL_gpu.h:993
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT4
Definition SDL_gpu.h:1009
SDL_GPU_VERTEXELEMENTFORMAT_INT2
@ SDL_GPU_VERTEXELEMENTFORMAT_INT2
Definition SDL_gpu.h:971
SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM
Definition SDL_gpu.h:996
SDL_GPU_VERTEXELEMENTFORMAT_UINT2
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT2
Definition SDL_gpu.h:977
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE4
Definition SDL_gpu.h:989
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM
Definition SDL_gpu.h:1012
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4
Definition SDL_gpu.h:985
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM
Definition SDL_gpu.h:1000
SDL_GPU_VERTEXELEMENTFORMAT_UINT3
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT3
Definition SDL_gpu.h:978
SDL_GPU_VERTEXELEMENTFORMAT_UINT
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT
Definition SDL_gpu.h:976
SDL_GPU_VERTEXELEMENTFORMAT_UINT4
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT4
Definition SDL_gpu.h:979
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM
Definition SDL_gpu.h:1016
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3
Definition SDL_gpu.h:984
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2
Definition SDL_gpu.h:992
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2
Definition SDL_gpu.h:983
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT4
Definition SDL_gpu.h:1005
SDL_GPU_VERTEXELEMENTFORMAT_FLOAT
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT
Definition SDL_gpu.h:982
SDL_GPU_VERTEXELEMENTFORMAT_SHORT2
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT2
Definition SDL_gpu.h:1004
SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM
Definition SDL_gpu.h:997
SDL_GPU_VERTEXELEMENTFORMAT_HALF4
@ SDL_GPU_VERTEXELEMENTFORMAT_HALF4
Definition SDL_gpu.h:1021
SDL_GPU_VERTEXELEMENTFORMAT_USHORT2
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT2
Definition SDL_gpu.h:1008
SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM
Definition SDL_gpu.h:1001
SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM
Definition SDL_gpu.h:1013
SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM
Definition SDL_gpu.h:1017
SDL_GPU_VERTEXELEMENTFORMAT_INT3
@ SDL_GPU_VERTEXELEMENTFORMAT_INT3
Definition SDL_gpu.h:972

## SDL_GPUVertexInputRate

enum SDL_GPUVertexInputRate

Specifies the rate at which vertex attributes are pulled from buffers.

Since
  This enum is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline

Enumerator
SDL_GPU_VERTEXINPUTRATE_VERTEX | Attribute addressing is a function of the vertex index.
SDL_GPU_VERTEXINPUTRATE_INSTANCE | Attribute addressing is a function of the instance index.

Definition at line 1031 of file SDL_gpu.h.

{
SDL_GPU_VERTEXINPUTRATE_VERTEX, /**< Attribute addressing is a function of the vertex index. */
SDL_GPU_VERTEXINPUTRATE_INSTANCE /**< Attribute addressing is a function of the instance index. */
} SDL_GPUVertexInputRate;
SDL_GPUVertexInputRate
SDL_GPUVertexInputRate
Definition SDL_gpu.h:1032
SDL_GPU_VERTEXINPUTRATE_INSTANCE
@ SDL_GPU_VERTEXINPUTRATE_INSTANCE
Definition SDL_gpu.h:1034
SDL_GPU_VERTEXINPUTRATE_VERTEX
@ SDL_GPU_VERTEXINPUTRATE_VERTEX
Definition SDL_gpu.h:1033

## Function Documentation

## SDL_AcquireGPUCommandBuffer()

SDL_GPUCommandBuffer * SDL_AcquireGPUCommandBuffer | ( | SDL_GPUDevice * | device | ) |

extern

Acquire a command buffer.

This command buffer is managed by the implementation and should not be freed by the user. The command buffer may only be used on the thread it was acquired on. The command buffer should be submitted on the thread it was acquired on.

It is valid to acquire multiple command buffers on the same thread at once. In fact a common design pattern is to acquire two command buffers per frame where one is dedicated to render and compute passes and the other is dedicated to copy passes and other preparatory work such as generating mipmaps. Interleaving commands between the two command buffers reduces the total amount of passes overall which improves rendering performance.

Parameters

  device | a GPU context.

Returns
  a command buffer, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_SubmitGPUCommandBuffer
  SDL_SubmitGPUCommandBufferAndAcquireFence

## SDL_AcquireGPUSwapchainTexture()

bool SDL_AcquireGPUSwapchainTexture | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | SDL_Window * | window,
|  | SDL_GPUTexture ** | swapchain_texture,
|  | Uint32 * | swapchain_texture_width,
|  | Uint32 * | swapchain_texture_height
| ) |  |

extern

Acquire a texture to use in presentation.

When a swapchain texture is acquired on a command buffer, it will automatically be submitted for presentation when the command buffer is submitted. The swapchain texture should only be referenced by the command buffer used to acquire it.

This function will fill the swapchain texture handle with NULL if too many frames are in flight. This is not an error.

If you use this function, it is possible to create a situation where many command buffers are allocated while the rendering context waits for the GPU to catch up, which will cause memory usage to grow. You should use SDL_WaitAndAcquireGPUSwapchainTexture() unless you know what you are doing with timing.

The swapchain texture is managed by the implementation and must not be freed by the user. You MUST NOT call this function from any thread other than the one that created the window.

Parameters

  command_buffer | a command buffer.
  window | a window that has been claimed.
  swapchain_texture | a pointer filled in with a swapchain texture handle.
  swapchain_texture_width | a pointer filled in with the swapchain texture width, may be NULL.
  swapchain_texture_height | a pointer filled in with the swapchain texture height, may be NULL.

Returns
  true on success, false on error; call SDL_GetError() for more information.

\threadsafety This function should only be called from the thread that created the window.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_ClaimWindowForGPUDevice
  SDL_SubmitGPUCommandBuffer
  SDL_SubmitGPUCommandBufferAndAcquireFence
  SDL_CancelGPUCommandBuffer
  SDL_GetWindowSizeInPixels
  SDL_WaitForGPUSwapchain
  SDL_WaitAndAcquireGPUSwapchainTexture
  SDL_SetGPUAllowedFramesInFlight

## SDL_BeginGPUComputePass()

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
| ) |  |

extern

Begins a compute pass on a command buffer.

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!

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.

Returns
  a compute pass handle.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_EndGPUComputePass

## SDL_BeginGPUCopyPass()

SDL_GPUCopyPass * SDL_BeginGPUCopyPass | ( | SDL_GPUCommandBuffer * | command_buffer | ) |

extern

Begins a copy pass on a command buffer.

All operations related to copying to or from buffers or textures take place inside a copy pass. You must not begin another copy pass, or a render pass or compute pass before ending the copy pass.

Parameters

  command_buffer | a command buffer.

Returns
  a copy pass handle.

Since
  This function is available since SDL 3.2.0.

## SDL_BeginGPURenderPass()

SDL_GPURenderPass * SDL_BeginGPURenderPass | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | const SDL_GPUColorTargetInfo * | color_target_infos,
|  | Uint32 | num_color_targets,
|  | const SDL_GPUDepthStencilTargetInfo * | depth_stencil_target_info
| ) |  |

extern

Begins a render pass on a command buffer.

A render pass consists of a set of texture subresources (or depth slices in the 3D texture case) which will be rendered to during the render pass, along with corresponding clear values and load/store operations. All operations related to graphics pipelines must take place inside of a render pass. A default viewport and scissor state are automatically set when this is called. You cannot begin another render pass, or begin a compute pass or copy pass until you have ended the render pass.

Parameters

  command_buffer | a command buffer.
  color_target_infos | an array of texture subresources with corresponding clear values and load/store ops.
  num_color_targets | the number of color targets in the color_target_infos array.
  depth_stencil_target_info | a texture subresource with corresponding clear value and load/store ops, may be NULL.

Returns
  a render pass handle.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_EndGPURenderPass

## SDL_BindGPUComputePipeline()

void SDL_BindGPUComputePipeline | ( | SDL_GPUComputePass * | compute_pass,
|  | SDL_GPUComputePipeline * | compute_pipeline
| ) |  |

extern

Binds a compute pipeline on a command buffer for use in compute dispatch.

Parameters

  compute_pass | a compute pass handle.
  compute_pipeline | a compute pipeline to bind.

Since
  This function is available since SDL 3.2.0.

## SDL_BindGPUComputeSamplers()

void SDL_BindGPUComputeSamplers | ( | SDL_GPUComputePass * | compute_pass,
|  | Uint32 | first_slot,
|  | const SDL_GPUTextureSamplerBinding * | texture_sampler_bindings,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds texture-sampler pairs for use on the compute shader.

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  compute_pass | a compute pass handle.
  first_slot | the compute sampler slot to begin binding from.
  texture_sampler_bindings | an array of texture-sampler binding structs.
  num_bindings | the number of texture-sampler bindings to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUComputeStorageBuffers()

void SDL_BindGPUComputeStorageBuffers | ( | SDL_GPUComputePass * | compute_pass,
|  | Uint32 | first_slot,
|  | SDL_GPUBuffer *const * | storage_buffers,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds storage buffers as readonly for use on the compute pipeline.

These buffers must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  compute_pass | a compute pass handle.
  first_slot | the compute storage buffer slot to begin binding from.
  storage_buffers | an array of storage buffer binding structs.
  num_bindings | the number of storage buffers to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUComputeStorageTextures()

void SDL_BindGPUComputeStorageTextures | ( | SDL_GPUComputePass * | compute_pass,
|  | Uint32 | first_slot,
|  | SDL_GPUTexture *const * | storage_textures,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds storage textures as readonly for use on the compute pipeline.

These textures must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  compute_pass | a compute pass handle.
  first_slot | the compute storage texture slot to begin binding from.
  storage_textures | an array of storage textures.
  num_bindings | the number of storage textures to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUFragmentSamplers()

void SDL_BindGPUFragmentSamplers | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | first_slot,
|  | const SDL_GPUTextureSamplerBinding * | texture_sampler_bindings,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds texture-sampler pairs for use on the fragment shader.

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  render_pass | a render pass handle.
  first_slot | the fragment sampler slot to begin binding from.
  texture_sampler_bindings | an array of texture-sampler binding structs.
  num_bindings | the number of texture-sampler pairs to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUFragmentStorageBuffers()

void SDL_BindGPUFragmentStorageBuffers | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | first_slot,
|  | SDL_GPUBuffer *const * | storage_buffers,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds storage buffers for use on the fragment shader.

These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  render_pass | a render pass handle.
  first_slot | the fragment storage buffer slot to begin binding from.
  storage_buffers | an array of storage buffers.
  num_bindings | the number of storage buffers to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUFragmentStorageTextures()

void SDL_BindGPUFragmentStorageTextures | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | first_slot,
|  | SDL_GPUTexture *const * | storage_textures,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds storage textures for use on the fragment shader.

These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  render_pass | a render pass handle.
  first_slot | the fragment storage texture slot to begin binding from.
  storage_textures | an array of storage textures.
  num_bindings | the number of storage textures to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUGraphicsPipeline()

void SDL_BindGPUGraphicsPipeline | ( | SDL_GPURenderPass * | render_pass,
|  | SDL_GPUGraphicsPipeline * | graphics_pipeline
| ) |  |

extern

Binds a graphics pipeline on a render pass to be used in rendering.

A graphics pipeline must be bound before making any draw calls.

Parameters

  render_pass | a render pass handle.
  graphics_pipeline | the graphics pipeline to bind.

Since
  This function is available since SDL 3.2.0.

## SDL_BindGPUIndexBuffer()

void SDL_BindGPUIndexBuffer | ( | SDL_GPURenderPass * | render_pass,
|  | const SDL_GPUBufferBinding * | binding,
|  | SDL_GPUIndexElementSize | index_element_size
| ) |  |

extern

Binds an index buffer on a command buffer for use with subsequent draw calls.

Parameters

  render_pass | a render pass handle.
  binding | a pointer to a struct containing an index buffer and offset.
  index_element_size | whether the index values in the buffer are 16- or 32-bit.

Since
  This function is available since SDL 3.2.0.

## SDL_BindGPUVertexBuffers()

void SDL_BindGPUVertexBuffers | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | first_slot,
|  | const SDL_GPUBufferBinding * | bindings,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds vertex buffers on a command buffer for use with subsequent draw calls.

Parameters

  render_pass | a render pass handle.
  first_slot | the vertex buffer slot to begin binding from.
  bindings | an array of SDL_GPUBufferBinding structs containing vertex buffers and offset values.
  num_bindings | the number of bindings in the bindings array.

Since
  This function is available since SDL 3.2.0.

## SDL_BindGPUVertexSamplers()

void SDL_BindGPUVertexSamplers | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | first_slot,
|  | const SDL_GPUTextureSamplerBinding * | texture_sampler_bindings,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds texture-sampler pairs for use on the vertex shader.

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  render_pass | a render pass handle.
  first_slot | the vertex sampler slot to begin binding from.
  texture_sampler_bindings | an array of texture-sampler binding structs.
  num_bindings | the number of texture-sampler pairs to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUVertexStorageBuffers()

void SDL_BindGPUVertexStorageBuffers | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | first_slot,
|  | SDL_GPUBuffer *const * | storage_buffers,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds storage buffers for use on the vertex shader.

These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  render_pass | a render pass handle.
  first_slot | the vertex storage buffer slot to begin binding from.
  storage_buffers | an array of buffers.
  num_bindings | the number of buffers to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BindGPUVertexStorageTextures()

void SDL_BindGPUVertexStorageTextures | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | first_slot,
|  | SDL_GPUTexture *const * | storage_textures,
|  | Uint32 | num_bindings
| ) |  |

extern

Binds storage textures for use on the vertex shader.

These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

Parameters

  render_pass | a render pass handle.
  first_slot | the vertex storage texture slot to begin binding from.
  storage_textures | an array of storage textures.
  num_bindings | the number of storage texture to bind from the array.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader

## SDL_BlitGPUTexture()

void SDL_BlitGPUTexture | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | const SDL_GPUBlitInfo * | info
| ) |  |

extern

Blits from a source texture region to a destination texture region.

This function must not be called inside of any pass.

Parameters

  command_buffer | a command buffer.
  info | the blit info struct containing the blit parameters.

Since
  This function is available since SDL 3.2.0.

## SDL_CalculateGPUTextureFormatSize()

Uint32 SDL_CalculateGPUTextureFormatSize | ( | SDL_GPUTextureFormat | format,
|  | Uint32 | width,
|  | Uint32 | height,
|  | Uint32 | depth_or_layer_count
| ) |  |

extern

Calculate the size in bytes of a texture format with dimensions.

Parameters

  format | a texture format.
  width | width in pixels.
  height | height in pixels.
  depth_or_layer_count | depth for 3D textures or layer count otherwise.

Returns
  the size of a texture with this format and dimensions.

Since
  This function is available since SDL 3.2.0.

## SDL_CancelGPUCommandBuffer()

bool SDL_CancelGPUCommandBuffer | ( | SDL_GPUCommandBuffer * | command_buffer | ) |

extern

Cancels a command buffer.

None of the enqueued commands are executed.

It is an error to call this function after a swapchain texture has been acquired.

This must be called from the thread the command buffer was acquired on.

You must not reference the command buffer after calling this function.

Parameters

  command_buffer | a command buffer.

Returns
  true on success, false on error; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_WaitAndAcquireGPUSwapchainTexture
  SDL_AcquireGPUCommandBuffer
  SDL_AcquireGPUSwapchainTexture

## SDL_ClaimWindowForGPUDevice()

bool SDL_ClaimWindowForGPUDevice | ( | SDL_GPUDevice * | device,
|  | SDL_Window * | window
| ) |  |

extern

Claims a window, creating a swapchain structure for it.

This must be called before SDL_AcquireGPUSwapchainTexture is called using the window. You should only call this function from the thread that created the window.

The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain parameters, you must call SDL_SetGPUSwapchainParameters after claiming the window.

Parameters

  device | a GPU context.
  window | an SDL_Window.

Returns
  true on success, or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called from the thread that created the window.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_WaitAndAcquireGPUSwapchainTexture
  SDL_ReleaseWindowFromGPUDevice
  SDL_WindowSupportsGPUPresentMode
  SDL_WindowSupportsGPUSwapchainComposition

## SDL_CopyGPUBufferToBuffer()

void SDL_CopyGPUBufferToBuffer | ( | SDL_GPUCopyPass * | copy_pass,
|  | const SDL_GPUBufferLocation * | source,
|  | const SDL_GPUBufferLocation * | destination,
|  | Uint32 | size,
|  | bool | cycle
| ) |  |

extern

Performs a buffer-to-buffer copy.

This copy occurs on the GPU timeline. You may assume the copy has finished in subsequent commands.

Parameters

  copy_pass | a copy pass handle.
  source | the buffer and offset to copy from.
  destination | the buffer and offset to copy to.
  size | the length of the buffer to copy.
  cycle | if true, cycles the destination buffer if it is already bound, otherwise overwrites the data.

Since
  This function is available since SDL 3.2.0.

## SDL_CopyGPUTextureToTexture()

void SDL_CopyGPUTextureToTexture | ( | SDL_GPUCopyPass * | copy_pass,
|  | const SDL_GPUTextureLocation * | source,
|  | const SDL_GPUTextureLocation * | destination,
|  | Uint32 | w,
|  | Uint32 | h,
|  | Uint32 | d,
|  | bool | cycle
| ) |  |

extern

Performs a texture-to-texture copy.

This copy occurs on the GPU timeline. You may assume the copy has finished in subsequent commands.

Parameters

  copy_pass | a copy pass handle.
  source | a source texture region.
  destination | a destination texture region.
  w | the width of the region to copy.
  h | the height of the region to copy.
  d | the depth of the region to copy.
  cycle | if true, cycles the destination texture if the destination texture is bound, otherwise overwrites the data.

Since
  This function is available since SDL 3.2.0.

## SDL_CreateGPUBuffer()

SDL_GPUBuffer * SDL_CreateGPUBuffer | ( | SDL_GPUDevice * | device,
|  | const SDL_GPUBufferCreateInfo * | createinfo
| ) |  |

extern

Creates a buffer object to be used in graphics or compute workflows.

The contents of this buffer are undefined until data is written to the buffer.

Note that certain combinations of usage flags are invalid. For example, a buffer cannot have both the VERTEX and INDEX flags.

If you use a STORAGE flag, the data in the buffer must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.

For better understanding of underlying concepts and memory management with SDL GPU API, you may refer this blog post There are optional properties that can be provided through `props`. These are the supported properties:

- `SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.

Parameters

  device | a GPU Context.
  createinfo | a struct describing the state of the buffer to create.

Returns
  a buffer object on success, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_UploadToGPUBuffer
  SDL_DownloadFromGPUBuffer
  SDL_CopyGPUBufferToBuffer
  SDL_BindGPUVertexBuffers
  SDL_BindGPUIndexBuffer
  SDL_BindGPUVertexStorageBuffers
  SDL_BindGPUFragmentStorageBuffers
  SDL_DrawGPUPrimitivesIndirect
  SDL_DrawGPUIndexedPrimitivesIndirect
  SDL_BindGPUComputeStorageBuffers
  SDL_DispatchGPUComputeIndirect
  SDL_ReleaseGPUBuffer

## SDL_CreateGPUComputePipeline()

SDL_GPUComputePipeline * SDL_CreateGPUComputePipeline | ( | SDL_GPUDevice * | device,
|  | const SDL_GPUComputePipelineCreateInfo * | createinfo
| ) |  |

extern

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

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.

Parameters

  device | a GPU Context.
  createinfo | a struct describing the state of the compute pipeline to create.

Returns
  a compute pipeline object on success, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_BindGPUComputePipeline
  SDL_ReleaseGPUComputePipeline

## SDL_CreateGPUDevice()

SDL_GPUDevice * SDL_CreateGPUDevice | ( | SDL_GPUShaderFormat | format_flags,
|  | bool | debug_mode,
|  | const char * | name
| ) |  |

extern

Creates a GPU context.

Parameters

  format_flags | a bitflag indicating which shader formats the app is able to provide.
  debug_mode | enable debug mode properties and validations.
  name | the preferred GPU driver, or NULL to let SDL pick the optimal driver.

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

Since
  This function is available since SDL 3.2.0.

See also
  SDL_GetGPUShaderFormats
  SDL_GetGPUDeviceDriver
  SDL_DestroyGPUDevice
  SDL_GPUSupportsShaderFormats

## SDL_CreateGPUDeviceWithProperties()

SDL_GPUDevice * SDL_CreateGPUDeviceWithProperties | ( | SDL_PropertiesID | props | ) |

extern

Creates a GPU context.

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

Parameters

  props | the properties to use.

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

Since
  This function is available since SDL 3.2.0.

See also
  SDL_GetGPUShaderFormats
  SDL_GetGPUDeviceDriver
  SDL_DestroyGPUDevice
  SDL_GPUSupportsProperties

## SDL_CreateGPUGraphicsPipeline()

SDL_GPUGraphicsPipeline * SDL_CreateGPUGraphicsPipeline | ( | SDL_GPUDevice * | device,
|  | const SDL_GPUGraphicsPipelineCreateInfo * | createinfo
| ) |  |

extern

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

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

- `SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.

Parameters

  device | a GPU Context.
  createinfo | a struct describing the state of the graphics pipeline to create.

Returns
  a graphics pipeline object on success, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUShader
  SDL_BindGPUGraphicsPipeline
  SDL_ReleaseGPUGraphicsPipeline

## SDL_CreateGPUSampler()

SDL_GPUSampler * SDL_CreateGPUSampler | ( | SDL_GPUDevice * | device,
|  | const SDL_GPUSamplerCreateInfo * | createinfo
| ) |  |

extern

Creates a sampler object to be used when binding textures in a graphics workflow.

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

- `SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.

Parameters

  device | a GPU Context.
  createinfo | a struct describing the state of the sampler to create.

Returns
  a sampler object on success, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_BindGPUVertexSamplers
  SDL_BindGPUFragmentSamplers
  SDL_ReleaseGPUSampler

## SDL_CreateGPUShader()

SDL_GPUShader * SDL_CreateGPUShader | ( | SDL_GPUDevice * | device,
|  | const SDL_GPUShaderCreateInfo * | createinfo
| ) |  |

extern

Creates a shader to be used when creating a graphics pipeline.

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:

For vertex shaders:

- 0: Sampled textures, followed by storage textures, followed by storage buffers
- 1: Uniform buffers

For fragment shaders:

- 2: Sampled textures, followed by storage textures, followed by storage buffers
- 3: Uniform buffers

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

For vertex shaders:

- (t[n], space0): Sampled textures, followed by storage textures, followed by storage buffers
- (s[n], space0): Samplers with indices corresponding to the sampled textures
- (b[n], space1): Uniform buffers

For pixel shaders:

- (t[n], space2): Sampled textures, followed by storage textures, followed by storage buffers
- (s[n], space2): Samplers with indices corresponding to the sampled textures
- (b[n], space3): Uniform buffers

For MSL/metallib, use the following order:

- [[texture]]: Sampled textures, followed by storage textures
- [[sampler]]: Samplers with indices corresponding to the sampled textures
- [[buffer]]: Uniform buffers, followed by storage buffers. Vertex buffer 0 is bound at [[buffer(14)]], vertex buffer 1 at [[buffer(15)]], and so on. Rather than manually authoring vertex buffer indices, use the [[stage_in]] attribute which will automatically use the vertex input information from the SDL_GPUGraphicsPipeline.

Shader semantics other than system-value semantics do not matter in D3D12 and for ease of use the SDL implementation assumes that non system-value semantics will all be TEXCOORD. If you are using HLSL as the shader source language, your vertex semantics should start at TEXCOORD0 and increment like so: TEXCOORD1, TEXCOORD2, etc. If you wish to change the semantic prefix to something other than TEXCOORD you can use SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING with SDL_CreateGPUDeviceWithProperties().

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

- `SDL_PROP_GPU_SHADER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.

Parameters

  device | a GPU Context.
  createinfo | a struct describing the state of the shader to create.

Returns
  a shader object on success, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUGraphicsPipeline
  SDL_ReleaseGPUShader

## SDL_CreateGPUTexture()

SDL_GPUTexture * SDL_CreateGPUTexture | ( | SDL_GPUDevice * | device,
|  | const SDL_GPUTextureCreateInfo * | createinfo
| ) |  |

extern

Creates a texture object to be used in graphics or compute workflows.

The contents of this texture are undefined until data is written to the texture.

Note that certain combinations of usage flags are invalid. For example, a texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags.

If you request a sample count higher than the hardware supports, the implementation will automatically fall back to the highest available sample count.

There are optional properties that can be provided through SDL_GPUTextureCreateInfo's `props`. These are the supported properties:

- `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT`: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this red intensity. Defaults to zero.
- `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT`: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this green intensity. Defaults to zero.
- `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT`: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this blue intensity. Defaults to zero.
- `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT`: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this alpha intensity. Defaults to zero.
- `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT`: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a depth of this value. Defaults to zero.
- `SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER`: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a stencil of this Uint8 value. Defaults to zero.
- `SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.

Parameters

  device | a GPU Context.
  createinfo | a struct describing the state of the texture to create.

Returns
  a texture object on success, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_UploadToGPUTexture
  SDL_DownloadFromGPUTexture
  SDL_BindGPUVertexSamplers
  SDL_BindGPUVertexStorageTextures
  SDL_BindGPUFragmentSamplers
  SDL_BindGPUFragmentStorageTextures
  SDL_BindGPUComputeStorageTextures
  SDL_BlitGPUTexture
  SDL_ReleaseGPUTexture
  SDL_GPUTextureSupportsFormat

## SDL_CreateGPUTransferBuffer()

SDL_GPUTransferBuffer * SDL_CreateGPUTransferBuffer | ( | SDL_GPUDevice * | device,
|  | const SDL_GPUTransferBufferCreateInfo * | createinfo
| ) |  |

extern

Creates a transfer buffer to be used when uploading to or downloading from graphics resources.

Download buffers can be particularly expensive to create, so it is good practice to reuse them if data will be downloaded regularly.

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

- `SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING`: a name that can be displayed in debugging tools.

Parameters

  device | a GPU Context.
  createinfo | a struct describing the state of the transfer buffer to create.

Returns
  a transfer buffer on success, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_UploadToGPUBuffer
  SDL_DownloadFromGPUBuffer
  SDL_UploadToGPUTexture
  SDL_DownloadFromGPUTexture
  SDL_ReleaseGPUTransferBuffer

## SDL_DestroyGPUDevice()

void SDL_DestroyGPUDevice | ( | SDL_GPUDevice * | device | ) |

extern

Destroys a GPU context previously returned by SDL_CreateGPUDevice.

Parameters

  device | a GPU Context to destroy.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUDevice

## SDL_DispatchGPUCompute()

void SDL_DispatchGPUCompute | ( | SDL_GPUComputePass * | compute_pass,
|  | Uint32 | groupcount_x,
|  | Uint32 | groupcount_y,
|  | Uint32 | groupcount_z
| ) |  |

extern

Dispatches compute work.

You must not call this function before binding a compute pipeline.

A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.

Parameters

  compute_pass | a compute pass handle.
  groupcount_x | number of local workgroups to dispatch in the X dimension.
  groupcount_y | number of local workgroups to dispatch in the Y dimension.
  groupcount_z | number of local workgroups to dispatch in the Z dimension.

Since
  This function is available since SDL 3.2.0.

## SDL_DispatchGPUComputeIndirect()

void SDL_DispatchGPUComputeIndirect | ( | SDL_GPUComputePass * | compute_pass,
|  | SDL_GPUBuffer * | buffer,
|  | Uint32 | offset
| ) |  |

extern

Dispatches compute work with parameters set from a buffer.

The buffer layout should match the layout of SDL_GPUIndirectDispatchCommand. You must not call this function before binding a compute pipeline.

A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.

Parameters

  compute_pass | a compute pass handle.
  buffer | a buffer containing dispatch parameters.
  offset | the offset to start reading from the dispatch buffer.

Since
  This function is available since SDL 3.2.0.

## SDL_DownloadFromGPUBuffer()

void SDL_DownloadFromGPUBuffer | ( | SDL_GPUCopyPass * | copy_pass,
|  | const SDL_GPUBufferRegion * | source,
|  | const SDL_GPUTransferBufferLocation * | destination
| ) |  |

extern

Copies data from a buffer to a transfer buffer on the GPU timeline.

This data is not guaranteed to be copied until the command buffer fence is signaled.

Parameters

  copy_pass | a copy pass handle.
  source | the source buffer with offset and size.
  destination | the destination transfer buffer with offset.

Since
  This function is available since SDL 3.2.0.

## SDL_DownloadFromGPUTexture()

void SDL_DownloadFromGPUTexture | ( | SDL_GPUCopyPass * | copy_pass,
|  | const SDL_GPUTextureRegion * | source,
|  | const SDL_GPUTextureTransferInfo * | destination
| ) |  |

extern

Copies data from a texture to a transfer buffer on the GPU timeline.

This data is not guaranteed to be copied until the command buffer fence is signaled.

Parameters

  copy_pass | a copy pass handle.
  source | the source texture region.
  destination | the destination transfer buffer with image layout information.

Since
  This function is available since SDL 3.2.0.

## SDL_DrawGPUIndexedPrimitives()

void SDL_DrawGPUIndexedPrimitives | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | num_indices,
|  | Uint32 | num_instances,
|  | Uint32 | first_index,
|  | Sint32 | vertex_offset,
|  | Uint32 | first_instance
| ) |  |

extern

Draws data using bound graphics state with an index buffer and instancing enabled.

You must not call this function before binding a graphics pipeline.

Note that the `first_vertex` and `first_instance` parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID); GPU APIs and shader languages do not define these built-in variables consistently, so if your shader depends on them, the only way to keep behavior consistent and portable is to always pass 0 for the correlating parameter in the draw calls.

Parameters

  render_pass | a render pass handle.
  num_indices | the number of indices to draw per instance.
  num_instances | the number of instances to draw.
  first_index | the starting index within the index buffer.
  vertex_offset | value added to vertex index before indexing into the vertex buffer.
  first_instance | the ID of the first instance to draw.

Since
  This function is available since SDL 3.2.0.

## SDL_DrawGPUIndexedPrimitivesIndirect()

void SDL_DrawGPUIndexedPrimitivesIndirect | ( | SDL_GPURenderPass * | render_pass,
|  | SDL_GPUBuffer * | buffer,
|  | Uint32 | offset,
|  | Uint32 | draw_count
| ) |  |

extern

Draws data using bound graphics state with an index buffer enabled and with draw parameters set from a buffer.

The buffer must consist of tightly-packed draw parameter sets that each match the layout of SDL_GPUIndexedIndirectDrawCommand. You must not call this function before binding a graphics pipeline.

Parameters

  render_pass | a render pass handle.
  buffer | a buffer containing draw parameters.
  offset | the offset to start reading from the draw buffer.
  draw_count | the number of draw parameter sets that should be read from the draw buffer.

Since
  This function is available since SDL 3.2.0.

## SDL_DrawGPUPrimitives()

void SDL_DrawGPUPrimitives | ( | SDL_GPURenderPass * | render_pass,
|  | Uint32 | num_vertices,
|  | Uint32 | num_instances,
|  | Uint32 | first_vertex,
|  | Uint32 | first_instance
| ) |  |

extern

Draws data using bound graphics state.

You must not call this function before binding a graphics pipeline.

Note that the `first_vertex` and `first_instance` parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID); GPU APIs and shader languages do not define these built-in variables consistently, so if your shader depends on them, the only way to keep behavior consistent and portable is to always pass 0 for the correlating parameter in the draw calls.

Parameters

  render_pass | a render pass handle.
  num_vertices | the number of vertices to draw.
  num_instances | the number of instances that will be drawn.
  first_vertex | the index of the first vertex to draw.
  first_instance | the ID of the first instance to draw.

Since
  This function is available since SDL 3.2.0.

## SDL_DrawGPUPrimitivesIndirect()

void SDL_DrawGPUPrimitivesIndirect | ( | SDL_GPURenderPass * | render_pass,
|  | SDL_GPUBuffer * | buffer,
|  | Uint32 | offset,
|  | Uint32 | draw_count
| ) |  |

extern

Draws data using bound graphics state and with draw parameters set from a buffer.

The buffer must consist of tightly-packed draw parameter sets that each match the layout of SDL_GPUIndirectDrawCommand. You must not call this function before binding a graphics pipeline.

Parameters

  render_pass | a render pass handle.
  buffer | a buffer containing draw parameters.
  offset | the offset to start reading from the draw buffer.
  draw_count | the number of draw parameter sets that should be read from the draw buffer.

Since
  This function is available since SDL 3.2.0.

## SDL_EndGPUComputePass()

void SDL_EndGPUComputePass | ( | SDL_GPUComputePass * | compute_pass | ) |

extern

Ends the current compute pass.

All bound compute state on the command buffer is unset. The compute pass handle is now invalid.

Parameters

  compute_pass | a compute pass handle.

Since
  This function is available since SDL 3.2.0.

## SDL_EndGPUCopyPass()

void SDL_EndGPUCopyPass | ( | SDL_GPUCopyPass * | copy_pass | ) |

extern

Ends the current copy pass.

Parameters

  copy_pass | a copy pass handle.

Since
  This function is available since SDL 3.2.0.

## SDL_EndGPURenderPass()

void SDL_EndGPURenderPass | ( | SDL_GPURenderPass * | render_pass | ) |

extern

Ends the given render pass.

All bound graphics state on the render pass command buffer is unset. The render pass handle is now invalid.

Parameters

  render_pass | a render pass handle.

Since
  This function is available since SDL 3.2.0.

## SDL_GenerateMipmapsForGPUTexture()

void SDL_GenerateMipmapsForGPUTexture | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | SDL_GPUTexture * | texture
| ) |  |

extern

Generates mipmaps for the given texture.

This function must not be called inside of any pass.

Parameters

  command_buffer | a command_buffer.
  texture | a texture with more than 1 mip level.

Since
  This function is available since SDL 3.2.0.

## SDL_GetGPUDeviceDriver()

const char * SDL_GetGPUDeviceDriver | ( | SDL_GPUDevice * | device | ) |

extern

Returns the name of the backend used to create this GPU context.

Parameters

  device | a GPU context to query.

Returns
  the name of the device's driver, or NULL on error.

Since
  This function is available since SDL 3.2.0.

## SDL_GetGPUDriver()

const char * SDL_GetGPUDriver | ( | int | index | ) |

extern

Get the name of a built in GPU driver.

The GPU drivers are presented in the order in which they are normally checked during initialization.

The names of drivers are all simple, low-ASCII identifiers, like "vulkan", "metal" or "direct3d12". These never have Unicode characters, and are not meant to be proper names.

Parameters

  index | the index of a GPU driver.

Returns
  the name of the GPU driver with the given index.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_GetNumGPUDrivers

## SDL_GetGPUShaderFormats()

SDL_GPUShaderFormat SDL_GetGPUShaderFormats | ( | SDL_GPUDevice * | device | ) |

extern

Returns the supported shader formats for this GPU context.

Parameters

  device | a GPU context to query.

Returns
  a bitflag indicating which shader formats the driver is able to consume.

Since
  This function is available since SDL 3.2.0.

## SDL_GetGPUSwapchainTextureFormat()

SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat | ( | SDL_GPUDevice * | device,
|  | SDL_Window * | window
| ) |  |

extern

Obtains the texture format of the swapchain for the given window.

Note that this format can change if the swapchain parameters change.

Parameters

  device | a GPU context.
  window | an SDL_Window that has been claimed.

Returns
  the texture format of the swapchain.

Since
  This function is available since SDL 3.2.0.

## SDL_GetNumGPUDrivers()

int SDL_GetNumGPUDrivers | ( | void |  | ) |

extern

Get the number of GPU drivers compiled into SDL.

Returns
  the number of built in GPU drivers.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_GetGPUDriver

## SDL_GPUSupportsProperties()

bool SDL_GPUSupportsProperties | ( | SDL_PropertiesID | props | ) |

extern

Checks for GPU runtime support.

Parameters

  props | the properties to use.

Returns
  true if supported, false otherwise.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUDeviceWithProperties

## SDL_GPUSupportsShaderFormats()

bool SDL_GPUSupportsShaderFormats | ( | SDL_GPUShaderFormat | format_flags,
|  | const char * | name
| ) |  |

extern

Checks for GPU runtime support.

Parameters

  format_flags | a bitflag indicating which shader formats the app is able to provide.
  name | the preferred GPU driver, or NULL to let SDL pick the optimal driver.

Returns
  true if supported, false otherwise.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUDevice

## SDL_GPUTextureFormatTexelBlockSize()

Uint32 SDL_GPUTextureFormatTexelBlockSize | ( | SDL_GPUTextureFormat | format | ) |

extern

Obtains the texel block size for a texture format.

Parameters

  format | the texture format you want to know the texel size of.

Returns
  the texel block size of the texture format.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_UploadToGPUTexture

## SDL_GPUTextureSupportsFormat()

bool SDL_GPUTextureSupportsFormat | ( | SDL_GPUDevice * | device,
|  | SDL_GPUTextureFormat | format,
|  | SDL_GPUTextureType | type,
|  | SDL_GPUTextureUsageFlags | usage
| ) |  |

extern

Determines whether a texture format is supported for a given type and usage.

Parameters

  device | a GPU context.
  format | the texture format to check.
  type | the type of texture (2D, 3D, Cube).
  usage | a bitmask of all usage scenarios to check.

Returns
  whether the texture format is supported for this type and usage.

Since
  This function is available since SDL 3.2.0.

## SDL_GPUTextureSupportsSampleCount()

bool SDL_GPUTextureSupportsSampleCount | ( | SDL_GPUDevice * | device,
|  | SDL_GPUTextureFormat | format,
|  | SDL_GPUSampleCount | sample_count
| ) |  |

extern

Determines if a sample count for a texture format is supported.

Parameters

  device | a GPU context.
  format | the texture format to check.
  sample_count | the sample count to check.

Returns
  whether the sample count is supported for this texture format.

Since
  This function is available since SDL 3.2.0.

## SDL_InsertGPUDebugLabel()

void SDL_InsertGPUDebugLabel | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | const char * | text
| ) |  |

extern

Inserts an arbitrary string label into the command buffer callstream.

Useful for debugging.

Parameters

  command_buffer | a command buffer.
  text | a UTF-8 string constant to insert as the label.

Since
  This function is available since SDL 3.2.0.

## SDL_MapGPUTransferBuffer()

void * SDL_MapGPUTransferBuffer | ( | SDL_GPUDevice * | device,
|  | SDL_GPUTransferBuffer * | transfer_buffer,
|  | bool | cycle
| ) |  |

extern

Maps a transfer buffer into application address space.

You must unmap the transfer buffer before encoding upload commands. The memory is owned by the graphics driver - do NOT call SDL_free() on the returned pointer.

Parameters

  device | a GPU context.
  transfer_buffer | a transfer buffer.
  cycle | if true, cycles the transfer buffer if it is already bound.

Returns
  the address of the mapped transfer buffer memory, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

## SDL_PopGPUDebugGroup()

void SDL_PopGPUDebugGroup | ( | SDL_GPUCommandBuffer * | command_buffer | ) |

extern

Ends the most-recently pushed debug group.

Parameters

  command_buffer | a command buffer.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_PushGPUDebugGroup

## SDL_PushGPUComputeUniformData()

void SDL_PushGPUComputeUniformData | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | Uint32 | slot_index,
|  | const void * | data,
|  | Uint32 | length
| ) |  |

extern

Pushes data to a uniform slot on the command buffer.

Subsequent draw calls will use this uniform data.

The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.

Parameters

  command_buffer | a command buffer.
  slot_index | the uniform slot to push data to.
  data | client data to write.
  length | the length of the data to write.

Since
  This function is available since SDL 3.2.0.

## SDL_PushGPUDebugGroup()

void SDL_PushGPUDebugGroup | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | const char * | name
| ) |  |

extern

Begins a debug group with an arbitary name.

Used for denoting groups of calls when viewing the command buffer callstream in a graphics debugging tool.

Each call to SDL_PushGPUDebugGroup must have a corresponding call to SDL_PopGPUDebugGroup.

On some backends (e.g. Metal), pushing a debug group during a render/blit/compute pass will create a group that is scoped to the native pass rather than the command buffer. For best results, if you push a debug group during a pass, always pop it in the same pass.

Parameters

  command_buffer | a command buffer.
  name | a UTF-8 string constant that names the group.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_PopGPUDebugGroup

## SDL_PushGPUFragmentUniformData()

void SDL_PushGPUFragmentUniformData | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | Uint32 | slot_index,
|  | const void * | data,
|  | Uint32 | length
| ) |  |

extern

Pushes data to a fragment uniform slot on the command buffer.

Subsequent draw calls will use this uniform data.

The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.

Parameters

  command_buffer | a command buffer.
  slot_index | the fragment uniform slot to push data to.
  data | client data to write.
  length | the length of the data to write.

Since
  This function is available since SDL 3.2.0.

## SDL_PushGPUVertexUniformData()

void SDL_PushGPUVertexUniformData | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | Uint32 | slot_index,
|  | const void * | data,
|  | Uint32 | length
| ) |  |

extern

Pushes data to a vertex uniform slot on the command buffer.

Subsequent draw calls will use this uniform data.

The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.

Parameters

  command_buffer | a command buffer.
  slot_index | the vertex uniform slot to push data to.
  data | client data to write.
  length | the length of the data to write.

Since
  This function is available since SDL 3.2.0.

## SDL_QueryGPUFence()

bool SDL_QueryGPUFence | ( | SDL_GPUDevice * | device,
|  | SDL_GPUFence * | fence
| ) |  |

extern

Checks the status of a fence.

Parameters

  device | a GPU context.
  fence | a fence.

Returns
  true if the fence is signaled, false if it is not.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_SubmitGPUCommandBufferAndAcquireFence

## SDL_ReleaseGPUBuffer()

void SDL_ReleaseGPUBuffer | ( | SDL_GPUDevice * | device,
|  | SDL_GPUBuffer * | buffer
| ) |  |

extern

Frees the given buffer as soon as it is safe to do so.

You must not reference the buffer after calling this function.

Parameters

  device | a GPU context.
  buffer | a buffer to be destroyed.

Since
  This function is available since SDL 3.2.0.

## SDL_ReleaseGPUComputePipeline()

void SDL_ReleaseGPUComputePipeline | ( | SDL_GPUDevice * | device,
|  | SDL_GPUComputePipeline * | compute_pipeline
| ) |  |

extern

Frees the given compute pipeline as soon as it is safe to do so.

You must not reference the compute pipeline after calling this function.

Parameters

  device | a GPU context.
  compute_pipeline | a compute pipeline to be destroyed.

Since
  This function is available since SDL 3.2.0.

## SDL_ReleaseGPUFence()

void SDL_ReleaseGPUFence | ( | SDL_GPUDevice * | device,
|  | SDL_GPUFence * | fence
| ) |  |

extern

Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence.

You must not reference the fence after calling this function.

Parameters

  device | a GPU context.
  fence | a fence.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_SubmitGPUCommandBufferAndAcquireFence

## SDL_ReleaseGPUGraphicsPipeline()

void SDL_ReleaseGPUGraphicsPipeline | ( | SDL_GPUDevice * | device,
|  | SDL_GPUGraphicsPipeline * | graphics_pipeline
| ) |  |

extern

Frees the given graphics pipeline as soon as it is safe to do so.

You must not reference the graphics pipeline after calling this function.

Parameters

  device | a GPU context.
  graphics_pipeline | a graphics pipeline to be destroyed.

Since
  This function is available since SDL 3.2.0.

## SDL_ReleaseGPUSampler()

void SDL_ReleaseGPUSampler | ( | SDL_GPUDevice * | device,
|  | SDL_GPUSampler * | sampler
| ) |  |

extern

Frees the given sampler as soon as it is safe to do so.

You must not reference the sampler after calling this function.

Parameters

  device | a GPU context.
  sampler | a sampler to be destroyed.

Since
  This function is available since SDL 3.2.0.

## SDL_ReleaseGPUShader()

void SDL_ReleaseGPUShader | ( | SDL_GPUDevice * | device,
|  | SDL_GPUShader * | shader
| ) |  |

extern

Frees the given shader as soon as it is safe to do so.

You must not reference the shader after calling this function.

Parameters

  device | a GPU context.
  shader | a shader to be destroyed.

Since
  This function is available since SDL 3.2.0.

## SDL_ReleaseGPUTexture()

void SDL_ReleaseGPUTexture | ( | SDL_GPUDevice * | device,
|  | SDL_GPUTexture * | texture
| ) |  |

extern

Frees the given texture as soon as it is safe to do so.

You must not reference the texture after calling this function.

Parameters

  device | a GPU context.
  texture | a texture to be destroyed.

Since
  This function is available since SDL 3.2.0.

## SDL_ReleaseGPUTransferBuffer()

void SDL_ReleaseGPUTransferBuffer | ( | SDL_GPUDevice * | device,
|  | SDL_GPUTransferBuffer * | transfer_buffer
| ) |  |

extern

Frees the given transfer buffer as soon as it is safe to do so.

You must not reference the transfer buffer after calling this function.

Parameters

  device | a GPU context.
  transfer_buffer | a transfer buffer to be destroyed.

Since
  This function is available since SDL 3.2.0.

## SDL_ReleaseWindowFromGPUDevice()

void SDL_ReleaseWindowFromGPUDevice | ( | SDL_GPUDevice * | device,
|  | SDL_Window * | window
| ) |  |

extern

Unclaims a window, destroying its swapchain structure.

Parameters

  device | a GPU context.
  window | an SDL_Window that has been claimed.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_ClaimWindowForGPUDevice

## SDL_SetGPUAllowedFramesInFlight()

bool SDL_SetGPUAllowedFramesInFlight | ( | SDL_GPUDevice * | device,
|  | Uint32 | allowed_frames_in_flight
| ) |  |

extern

Configures the maximum allowed number of frames in flight.

The default value when the device is created is 2. This means that after you have submitted 2 frames for presentation, if the GPU has not finished working on the first frame, SDL_AcquireGPUSwapchainTexture() will fill the swapchain texture pointer with NULL, and SDL_WaitAndAcquireGPUSwapchainTexture() will block.

Higher values increase throughput at the expense of visual latency. Lower values decrease visual latency at the expense of throughput.

Note that calling this function will stall and flush the command queue to prevent synchronization issues.

The minimum value of allowed frames in flight is 1, and the maximum is 3.

Parameters

  device | a GPU context.
  allowed_frames_in_flight | the maximum number of frames that can be pending on the GPU.

Returns
  true if successful, false on error; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

## SDL_SetGPUBlendConstants()

void SDL_SetGPUBlendConstants | ( | SDL_GPURenderPass * | render_pass,
|  | SDL_FColor | blend_constants
| ) |  |

extern

Sets the current blend constants on a command buffer.

Parameters

  render_pass | a render pass handle.
  blend_constants | the blend constant color.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_GPU_BLENDFACTOR_CONSTANT_COLOR
  SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR

## SDL_SetGPUBufferName()

void SDL_SetGPUBufferName | ( | SDL_GPUDevice * | device,
|  | SDL_GPUBuffer * | buffer,
|  | const char * | text
| ) |  |

extern

Sets an arbitrary string constant to label a buffer.

You should use SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING with SDL_CreateGPUBuffer instead of this function to avoid thread safety issues.

Parameters

  device | a GPU Context.
  buffer | a buffer to attach the name to.
  text | a UTF-8 string constant to mark as the name of the buffer.

\threadsafety This function is not thread safe, you must make sure the buffer is not simultaneously used by any other thread.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUBuffer

## SDL_SetGPUScissor()

void SDL_SetGPUScissor | ( | SDL_GPURenderPass * | render_pass,
|  | const SDL_Rect * | scissor
| ) |  |

extern

Sets the current scissor state on a command buffer.

Parameters

  render_pass | a render pass handle.
  scissor | the scissor area to set.

Since
  This function is available since SDL 3.2.0.

## SDL_SetGPUStencilReference()

void SDL_SetGPUStencilReference | ( | SDL_GPURenderPass * | render_pass,
|  | Uint8 | reference
| ) |  |

extern

Sets the current stencil reference value on a command buffer.

Parameters

  render_pass | a render pass handle.
  reference | the stencil reference value to set.

Since
  This function is available since SDL 3.2.0.

## SDL_SetGPUSwapchainParameters()

bool SDL_SetGPUSwapchainParameters | ( | SDL_GPUDevice * | device,
|  | SDL_Window * | window,
|  | SDL_GPUSwapchainComposition | swapchain_composition,
|  | SDL_GPUPresentMode | present_mode
| ) |  |

extern

Changes the swapchain parameters for the given claimed window.

This function will fail if the requested present mode or swapchain composition are unsupported by the device. Check if the parameters are supported via SDL_WindowSupportsGPUPresentMode / SDL_WindowSupportsGPUSwapchainComposition prior to calling this function.

SDL_GPU_PRESENTMODE_VSYNC with SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always supported.

Parameters

  device | a GPU context.
  window | an SDL_Window that has been claimed.
  swapchain_composition | the desired composition of the swapchain.
  present_mode | the desired present mode for the swapchain.

Returns
  true if successful, false on error; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_WindowSupportsGPUPresentMode
  SDL_WindowSupportsGPUSwapchainComposition

## SDL_SetGPUTextureName()

void SDL_SetGPUTextureName | ( | SDL_GPUDevice * | device,
|  | SDL_GPUTexture * | texture,
|  | const char * | text
| ) |  |

extern

Sets an arbitrary string constant to label a texture.

You should use SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING with SDL_CreateGPUTexture instead of this function to avoid thread safety issues.

Parameters

  device | a GPU Context.
  texture | a texture to attach the name to.
  text | a UTF-8 string constant to mark as the name of the texture.

\threadsafety This function is not thread safe, you must make sure the texture is not simultaneously used by any other thread.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_CreateGPUTexture

## SDL_SetGPUViewport()

void SDL_SetGPUViewport | ( | SDL_GPURenderPass * | render_pass,
|  | const SDL_GPUViewport * | viewport
| ) |  |

extern

Sets the current viewport state on a command buffer.

Parameters

  render_pass | a render pass handle.
  viewport | the viewport to set.

Since
  This function is available since SDL 3.2.0.

## SDL_SubmitGPUCommandBuffer()

bool SDL_SubmitGPUCommandBuffer | ( | SDL_GPUCommandBuffer * | command_buffer | ) |

extern

Submits a command buffer so its commands can be processed on the GPU.

It is invalid to use the command buffer after this is called.

This must be called from the thread the command buffer was acquired on.

All commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing.

Parameters

  command_buffer | a command buffer.

Returns
  true on success, false on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_AcquireGPUCommandBuffer
  SDL_WaitAndAcquireGPUSwapchainTexture
  SDL_AcquireGPUSwapchainTexture
  SDL_SubmitGPUCommandBufferAndAcquireFence

## SDL_SubmitGPUCommandBufferAndAcquireFence()

SDL_GPUFence * SDL_SubmitGPUCommandBufferAndAcquireFence | ( | SDL_GPUCommandBuffer * | command_buffer | ) |

extern

Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated with the command buffer.

You must release this fence when it is no longer needed or it will cause a leak. It is invalid to use the command buffer after this is called.

This must be called from the thread the command buffer was acquired on.

All commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing.

Parameters

  command_buffer | a command buffer.

Returns
  a fence associated with the command buffer, or NULL on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_AcquireGPUCommandBuffer
  SDL_WaitAndAcquireGPUSwapchainTexture
  SDL_AcquireGPUSwapchainTexture
  SDL_SubmitGPUCommandBuffer
  SDL_ReleaseGPUFence

## SDL_UnmapGPUTransferBuffer()

void SDL_UnmapGPUTransferBuffer | ( | SDL_GPUDevice * | device,
|  | SDL_GPUTransferBuffer * | transfer_buffer
| ) |  |

extern

Unmaps a previously mapped transfer buffer.

Parameters

  device | a GPU context.
  transfer_buffer | a previously mapped transfer buffer.

Since
  This function is available since SDL 3.2.0.

## SDL_UploadToGPUBuffer()

void SDL_UploadToGPUBuffer | ( | SDL_GPUCopyPass * | copy_pass,
|  | const SDL_GPUTransferBufferLocation * | source,
|  | const SDL_GPUBufferRegion * | destination,
|  | bool | cycle
| ) |  |

extern

Uploads data from a transfer buffer to a buffer.

The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.

Parameters

  copy_pass | a copy pass handle.
  source | the source transfer buffer with offset.
  destination | the destination buffer with offset and size.
  cycle | if true, cycles the buffer if it is already bound, otherwise overwrites the data.

Since
  This function is available since SDL 3.2.0.

## SDL_UploadToGPUTexture()

void SDL_UploadToGPUTexture | ( | SDL_GPUCopyPass * | copy_pass,
|  | const SDL_GPUTextureTransferInfo * | source,
|  | const SDL_GPUTextureRegion * | destination,
|  | bool | cycle
| ) |  |

extern

Uploads data from a transfer buffer to a texture.

The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.

You must align the data in the transfer buffer to a multiple of the texel size of the texture format.

Parameters

  copy_pass | a copy pass handle.
  source | the source transfer buffer with image layout information.
  destination | the destination texture region.
  cycle | if true, cycles the texture if the texture is bound, otherwise overwrites the data.

Since
  This function is available since SDL 3.2.0.

## SDL_WaitAndAcquireGPUSwapchainTexture()

bool SDL_WaitAndAcquireGPUSwapchainTexture | ( | SDL_GPUCommandBuffer * | command_buffer,
|  | SDL_Window * | window,
|  | SDL_GPUTexture ** | swapchain_texture,
|  | Uint32 * | swapchain_texture_width,
|  | Uint32 * | swapchain_texture_height
| ) |  |

extern

Blocks the thread until a swapchain texture is available to be acquired, and then acquires it.

When a swapchain texture is acquired on a command buffer, it will automatically be submitted for presentation when the command buffer is submitted. The swapchain texture should only be referenced by the command buffer used to acquire it. It is an error to call SDL_CancelGPUCommandBuffer() after a swapchain texture is acquired.

This function can fill the swapchain texture handle with NULL in certain cases, for example if the window is minimized. This is not an error. You should always make sure to check whether the pointer is NULL before actually using it.

The swapchain texture is managed by the implementation and must not be freed by the user. You MUST NOT call this function from any thread other than the one that created the window.

The swapchain texture is write-only and cannot be used as a sampler or for another reading operation.

Parameters

  command_buffer | a command buffer.
  window | a window that has been claimed.
  swapchain_texture | a pointer filled in with a swapchain texture handle.
  swapchain_texture_width | a pointer filled in with the swapchain texture width, may be NULL.
  swapchain_texture_height | a pointer filled in with the swapchain texture height, may be NULL.

Returns
  true on success, false on error; call SDL_GetError() for more information.

\threadsafety This function should only be called from the thread that created the window.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_SubmitGPUCommandBuffer
  SDL_SubmitGPUCommandBufferAndAcquireFence
  SDL_AcquireGPUSwapchainTexture

## SDL_WaitForGPUFences()

bool SDL_WaitForGPUFences | ( | SDL_GPUDevice * | device,
|  | bool | wait_all,
|  | SDL_GPUFence *const * | fences,
|  | Uint32 | num_fences
| ) |  |

extern

Blocks the thread until the given fences are signaled.

Parameters

  device | a GPU context.
  wait_all | if 0, wait for any fence to be signaled, if 1, wait for all fences to be signaled.
  fences | an array of fences to wait on.
  num_fences | the number of fences in the fences array.

Returns
  true on success, false on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_SubmitGPUCommandBufferAndAcquireFence
  SDL_WaitForGPUIdle

## SDL_WaitForGPUIdle()

bool SDL_WaitForGPUIdle | ( | SDL_GPUDevice * | device | ) |

extern

Blocks the thread until the GPU is completely idle.

Parameters

  device | a GPU context.

Returns
  true on success, false on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_WaitForGPUFences

## SDL_WaitForGPUSwapchain()

bool SDL_WaitForGPUSwapchain | ( | SDL_GPUDevice * | device,
|  | SDL_Window * | window
| ) |  |

extern

Blocks the thread until a swapchain texture is available to be acquired.

Parameters

  device | a GPU context.
  window | a window that has been claimed.

Returns
  true on success, false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called from the thread that created the window.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_AcquireGPUSwapchainTexture
  SDL_WaitAndAcquireGPUSwapchainTexture
  SDL_SetGPUAllowedFramesInFlight

## SDL_WindowSupportsGPUPresentMode()

bool SDL_WindowSupportsGPUPresentMode | ( | SDL_GPUDevice * | device,
|  | SDL_Window * | window,
|  | SDL_GPUPresentMode | present_mode
| ) |  |

extern

Determines whether a presentation mode is supported by the window.

The window must be claimed before calling this function.

Parameters

  device | a GPU context.
  window | an SDL_Window.
  present_mode | the presentation mode to check.

Returns
  true if supported, false if unsupported.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_ClaimWindowForGPUDevice

## SDL_WindowSupportsGPUSwapchainComposition()

bool SDL_WindowSupportsGPUSwapchainComposition | ( | SDL_GPUDevice * | device,
|  | SDL_Window * | window,
|  | SDL_GPUSwapchainComposition | swapchain_composition
| ) |  |

extern

Determines whether a swapchain composition is supported by the window.

The window must be claimed before calling this function.

Parameters

  device | a GPU context.
  window | an SDL_Window.
  swapchain_composition | the swapchain composition to check.

Returns
  true if supported, false if unsupported.

Since
  This function is available since SDL 3.2.0.

See also
  SDL_ClaimWindowForGPUDevice