SDL 3.0
SDL_gpu.h File Reference
+ 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_GPUDepthStencilValue
 
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_GPUVertexBinding
 
struct  SDL_GPUVertexAttribute
 
struct  SDL_GPUVertexInputState
 
struct  SDL_GPUStencilOpState
 
struct  SDL_GPUColorAttachmentBlendState
 
struct  SDL_GPUShaderCreateInfo
 
struct  SDL_GPUTextureCreateInfo
 
struct  SDL_GPUBufferCreateInfo
 
struct  SDL_GPUTransferBufferCreateInfo
 
struct  SDL_GPURasterizerState
 
struct  SDL_GPUMultisampleState
 
struct  SDL_GPUDepthStencilState
 
struct  SDL_GPUColorAttachmentDescription
 
struct  SDL_GPUGraphicsPipelineAttachmentInfo
 
struct  SDL_GPUGraphicsPipelineCreateInfo
 
struct  SDL_GPUComputePipelineCreateInfo
 
struct  SDL_GPUColorAttachmentInfo
 
struct  SDL_GPUDepthStencilAttachmentInfo
 
struct  SDL_GPUBufferBinding
 
struct  SDL_GPUTextureSamplerBinding
 
struct  SDL_GPUStorageBufferWriteOnlyBinding
 
struct  SDL_GPUStorageTextureWriteOnlyBinding
 

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_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_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_CREATETEXTURE_D3D12_CLEAR_R_FLOAT   "SDL.gpu.createtexture.d3d12.clear.r"
 
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT   "SDL.gpu.createtexture.d3d12.clear.g"
 
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT   "SDL.gpu.createtexture.d3d12.clear.b"
 
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT   "SDL.gpu.createtexture.d3d12.clear.a"
 
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT   "SDL.gpu.createtexture.d3d12.clear.depth"
 
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8   "SDL.gpu.createtexture.d3d12.clear.stencil"
 
#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL   "SDL.gpu.device.create.debugmode"
 
#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL   "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_BOOL   "SDL.gpu.device.create.shaders.private"
 
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL   "SDL.gpu.device.create.shaders.spirv"
 
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL   "SDL.gpu.device.create.shaders.dxbc"
 
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL   "SDL.gpu.device.create.shaders.dxil"
 
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL   "SDL.gpu.device.create.shaders.msl"
 
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL   "SDL.gpu.device.create.shaders.metallib"
 
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING   "SDL.gpu.device.create.d3d12.semantic"
 

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_POINTLIST ,
  SDL_GPU_PRIMITIVETYPE_LINELIST ,
  SDL_GPU_PRIMITIVETYPE_LINESTRIP ,
  SDL_GPU_PRIMITIVETYPE_TRIANGLELIST ,
  SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP
}
 
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
}
 
enum  SDL_GPUIndexElementSize {
  SDL_GPU_INDEXELEMENTSIZE_16BIT ,
  SDL_GPU_INDEXELEMENTSIZE_32BIT
}
 
enum  SDL_GPUTextureFormat {
  SDL_GPU_TEXTUREFORMAT_INVALID = -1 ,
  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_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_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
}
 
enum  SDL_GPUTextureType {
  SDL_GPU_TEXTURETYPE_2D ,
  SDL_GPU_TEXTURETYPE_2D_ARRAY ,
  SDL_GPU_TEXTURETYPE_3D ,
  SDL_GPU_TEXTURETYPE_CUBE
}
 
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_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 = 0 ,
  SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1
}
 
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_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_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_ADD ,
  SDL_GPU_BLENDOP_SUBTRACT ,
  SDL_GPU_BLENDOP_REVERSE_SUBTRACT ,
  SDL_GPU_BLENDOP_MIN ,
  SDL_GPU_BLENDOP_MAX
}
 
enum  SDL_GPUBlendFactor {
  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_ST2048
}
 
enum  SDL_GPUDriver {
  SDL_GPU_DRIVER_INVALID = -1 ,
  SDL_GPU_DRIVER_PRIVATE ,
  SDL_GPU_DRIVER_VULKAN ,
  SDL_GPU_DRIVER_D3D11 ,
  SDL_GPU_DRIVER_D3D12 ,
  SDL_GPU_DRIVER_METAL
}
 

Functions

SDL_GPUDeviceSDL_CreateGPUDevice (SDL_GPUShaderFormat formatFlags, SDL_bool debugMode, const char *name)
 
SDL_GPUDeviceSDL_CreateGPUDeviceWithProperties (SDL_PropertiesID props)
 
void SDL_DestroyGPUDevice (SDL_GPUDevice *device)
 
SDL_GPUDriver SDL_GetGPUDriver (SDL_GPUDevice *device)
 
SDL_GPUComputePipelineSDL_CreateGPUComputePipeline (SDL_GPUDevice *device, SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo)
 
SDL_GPUGraphicsPipelineSDL_CreateGPUGraphicsPipeline (SDL_GPUDevice *device, SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo)
 
SDL_GPUSamplerSDL_CreateGPUSampler (SDL_GPUDevice *device, SDL_GPUSamplerCreateInfo *samplerCreateInfo)
 
SDL_GPUShaderSDL_CreateGPUShader (SDL_GPUDevice *device, SDL_GPUShaderCreateInfo *shaderCreateInfo)
 
SDL_GPUTextureSDL_CreateGPUTexture (SDL_GPUDevice *device, SDL_GPUTextureCreateInfo *textureCreateInfo)
 
SDL_GPUBufferSDL_CreateGPUBuffer (SDL_GPUDevice *device, SDL_GPUBufferCreateInfo *bufferCreateInfo)
 
SDL_GPUTransferBufferSDL_CreateGPUTransferBuffer (SDL_GPUDevice *device, SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo)
 
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 *commandBuffer, const char *text)
 
void SDL_PushGPUDebugGroup (SDL_GPUCommandBuffer *commandBuffer, const char *name)
 
void SDL_PopGPUDebugGroup (SDL_GPUCommandBuffer *commandBuffer)
 
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 *transferBuffer)
 
void SDL_ReleaseGPUComputePipeline (SDL_GPUDevice *device, SDL_GPUComputePipeline *computePipeline)
 
void SDL_ReleaseGPUShader (SDL_GPUDevice *device, SDL_GPUShader *shader)
 
void SDL_ReleaseGPUGraphicsPipeline (SDL_GPUDevice *device, SDL_GPUGraphicsPipeline *graphicsPipeline)
 
SDL_GPUCommandBufferSDL_AcquireGPUCommandBuffer (SDL_GPUDevice *device)
 
void SDL_PushGPUVertexUniformData (SDL_GPUCommandBuffer *commandBuffer, Uint32 slotIndex, const void *data, Uint32 dataLengthInBytes)
 
void SDL_PushGPUFragmentUniformData (SDL_GPUCommandBuffer *commandBuffer, Uint32 slotIndex, const void *data, Uint32 dataLengthInBytes)
 
void SDL_PushGPUComputeUniformData (SDL_GPUCommandBuffer *commandBuffer, Uint32 slotIndex, const void *data, Uint32 dataLengthInBytes)
 
SDL_GPURenderPassSDL_BeginGPURenderPass (SDL_GPUCommandBuffer *commandBuffer, SDL_GPUColorAttachmentInfo *colorAttachmentInfos, Uint32 colorAttachmentCount, SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo)
 
void SDL_BindGPUGraphicsPipeline (SDL_GPURenderPass *renderPass, SDL_GPUGraphicsPipeline *graphicsPipeline)
 
void SDL_SetGPUViewport (SDL_GPURenderPass *renderPass, SDL_GPUViewport *viewport)
 
void SDL_SetGPUScissor (SDL_GPURenderPass *renderPass, SDL_Rect *scissor)
 
void SDL_BindGPUVertexBuffers (SDL_GPURenderPass *renderPass, Uint32 firstBinding, SDL_GPUBufferBinding *pBindings, Uint32 bindingCount)
 
void SDL_BindGPUIndexBuffer (SDL_GPURenderPass *renderPass, SDL_GPUBufferBinding *pBinding, SDL_GPUIndexElementSize indexElementSize)
 
void SDL_BindGPUVertexSamplers (SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTextureSamplerBinding *textureSamplerBindings, Uint32 bindingCount)
 
void SDL_BindGPUVertexStorageTextures (SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTexture **storageTextures, Uint32 bindingCount)
 
void SDL_BindGPUVertexStorageBuffers (SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUBuffer **storageBuffers, Uint32 bindingCount)
 
void SDL_BindGPUFragmentSamplers (SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTextureSamplerBinding *textureSamplerBindings, Uint32 bindingCount)
 
void SDL_BindGPUFragmentStorageTextures (SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTexture **storageTextures, Uint32 bindingCount)
 
void SDL_BindGPUFragmentStorageBuffers (SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUBuffer **storageBuffers, Uint32 bindingCount)
 
void SDL_DrawGPUIndexedPrimitives (SDL_GPURenderPass *renderPass, Uint32 indexCount, Uint32 instanceCount, Uint32 firstIndex, Sint32 vertexOffset, Uint32 firstInstance)
 
void SDL_DrawGPUPrimitives (SDL_GPURenderPass *renderPass, Uint32 vertexCount, Uint32 instanceCount, Uint32 firstVertex, Uint32 firstInstance)
 
void SDL_DrawGPUPrimitivesIndirect (SDL_GPURenderPass *renderPass, SDL_GPUBuffer *buffer, Uint32 offsetInBytes, Uint32 drawCount, Uint32 stride)
 
void SDL_DrawGPUIndexedPrimitivesIndirect (SDL_GPURenderPass *renderPass, SDL_GPUBuffer *buffer, Uint32 offsetInBytes, Uint32 drawCount, Uint32 stride)
 
void SDL_EndGPURenderPass (SDL_GPURenderPass *renderPass)
 
SDL_GPUComputePassSDL_BeginGPUComputePass (SDL_GPUCommandBuffer *commandBuffer, SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings, Uint32 storageTextureBindingCount, SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings, Uint32 storageBufferBindingCount)
 
void SDL_BindGPUComputePipeline (SDL_GPUComputePass *computePass, SDL_GPUComputePipeline *computePipeline)
 
void SDL_BindGPUComputeStorageTextures (SDL_GPUComputePass *computePass, Uint32 firstSlot, SDL_GPUTexture **storageTextures, Uint32 bindingCount)
 
void SDL_BindGPUComputeStorageBuffers (SDL_GPUComputePass *computePass, Uint32 firstSlot, SDL_GPUBuffer **storageBuffers, Uint32 bindingCount)
 
void SDL_DispatchGPUCompute (SDL_GPUComputePass *computePass, Uint32 groupCountX, Uint32 groupCountY, Uint32 groupCountZ)
 
void SDL_DispatchGPUComputeIndirect (SDL_GPUComputePass *computePass, SDL_GPUBuffer *buffer, Uint32 offsetInBytes)
 
void SDL_EndGPUComputePass (SDL_GPUComputePass *computePass)
 
void * SDL_MapGPUTransferBuffer (SDL_GPUDevice *device, SDL_GPUTransferBuffer *transferBuffer, SDL_bool cycle)
 
void SDL_UnmapGPUTransferBuffer (SDL_GPUDevice *device, SDL_GPUTransferBuffer *transferBuffer)
 
SDL_GPUCopyPassSDL_BeginGPUCopyPass (SDL_GPUCommandBuffer *commandBuffer)
 
void SDL_UploadToGPUTexture (SDL_GPUCopyPass *copyPass, SDL_GPUTextureTransferInfo *source, SDL_GPUTextureRegion *destination, SDL_bool cycle)
 
void SDL_UploadToGPUBuffer (SDL_GPUCopyPass *copyPass, SDL_GPUTransferBufferLocation *source, SDL_GPUBufferRegion *destination, SDL_bool cycle)
 
void SDL_CopyGPUTextureToTexture (SDL_GPUCopyPass *copyPass, SDL_GPUTextureLocation *source, SDL_GPUTextureLocation *destination, Uint32 w, Uint32 h, Uint32 d, SDL_bool cycle)
 
void SDL_CopyGPUBufferToBuffer (SDL_GPUCopyPass *copyPass, SDL_GPUBufferLocation *source, SDL_GPUBufferLocation *destination, Uint32 size, SDL_bool cycle)
 
void SDL_DownloadFromGPUTexture (SDL_GPUCopyPass *copyPass, SDL_GPUTextureRegion *source, SDL_GPUTextureTransferInfo *destination)
 
void SDL_DownloadFromGPUBuffer (SDL_GPUCopyPass *copyPass, SDL_GPUBufferRegion *source, SDL_GPUTransferBufferLocation *destination)
 
void SDL_EndGPUCopyPass (SDL_GPUCopyPass *copyPass)
 
void SDL_GenerateMipmapsForGPUTexture (SDL_GPUCommandBuffer *commandBuffer, SDL_GPUTexture *texture)
 
void SDL_BlitGPUTexture (SDL_GPUCommandBuffer *commandBuffer, SDL_GPUBlitRegion *source, SDL_GPUBlitRegion *destination, SDL_FlipMode flipMode, SDL_GPUFilter filterMode, SDL_bool cycle)
 
SDL_bool SDL_WindowSupportsGPUSwapchainComposition (SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchainComposition)
 
SDL_bool SDL_WindowSupportsGPUPresentMode (SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode presentMode)
 
SDL_bool SDL_ClaimWindowForGPUDevice (SDL_GPUDevice *device, SDL_Window *window)
 
void SDL_ReleaseWindowFromGPUDevice (SDL_GPUDevice *device, SDL_Window *window)
 
SDL_bool SDL_SetGPUSwapchainParameters (SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchainComposition, SDL_GPUPresentMode presentMode)
 
SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat (SDL_GPUDevice *device, SDL_Window *window)
 
SDL_GPUTextureSDL_AcquireGPUSwapchainTexture (SDL_GPUCommandBuffer *commandBuffer, SDL_Window *window, Uint32 *pWidth, Uint32 *pHeight)
 
void SDL_SubmitGPUCommandBuffer (SDL_GPUCommandBuffer *commandBuffer)
 
SDL_GPUFenceSDL_SubmitGPUCommandBufferAndAcquireFence (SDL_GPUCommandBuffer *commandBuffer)
 
void SDL_WaitForGPUIdle (SDL_GPUDevice *device)
 
void SDL_WaitForGPUFences (SDL_GPUDevice *device, SDL_bool waitAll, SDL_GPUFence **pFences, Uint32 fenceCount)
 
SDL_bool SDL_QueryGPUFence (SDL_GPUDevice *device, SDL_GPUFence *fence)
 
void SDL_ReleaseGPUFence (SDL_GPUDevice *device, SDL_GPUFence *fence)
 
Uint32 SDL_GPUTextureFormatTexelBlockSize (SDL_GPUTextureFormat textureFormat)
 
SDL_bool SDL_GPUTextureSupportsFormat (SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage)
 
SDL_bool SDL_GPUTextureSupportsSampleCount (SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sampleCount)
 

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 272 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 273 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 271 of file SDL_gpu.h.

◆ SDL_GPU_BUFFERUSAGE_INDEX

#define SDL_GPU_BUFFERUSAGE_INDEX   (1u << 1)

buffer is an index buffer

Definition at line 269 of file SDL_gpu.h.

◆ SDL_GPU_BUFFERUSAGE_INDIRECT

#define SDL_GPU_BUFFERUSAGE_INDIRECT   (1u << 2)

buffer is an indirect buffer

Definition at line 270 of file SDL_gpu.h.

◆ SDL_GPU_BUFFERUSAGE_VERTEX

#define SDL_GPU_BUFFERUSAGE_VERTEX   (1u << 0)

buffer is a vertex buffer

Definition at line 268 of file SDL_gpu.h.

◆ SDL_GPU_COLORCOMPONENT_A

#define SDL_GPU_COLORCOMPONENT_A   (1u << 3)

the alpha component

Definition at line 433 of file SDL_gpu.h.

◆ SDL_GPU_COLORCOMPONENT_B

#define SDL_GPU_COLORCOMPONENT_B   (1u << 2)

the blue component

Definition at line 432 of file SDL_gpu.h.

◆ SDL_GPU_COLORCOMPONENT_G

#define SDL_GPU_COLORCOMPONENT_G   (1u << 1)

the green component

Definition at line 431 of file SDL_gpu.h.

◆ SDL_GPU_COLORCOMPONENT_R

#define SDL_GPU_COLORCOMPONENT_R   (1u << 0)

the red component

Definition at line 430 of file SDL_gpu.h.

◆ SDL_GPU_SHADERFORMAT_DXBC

#define SDL_GPU_SHADERFORMAT_DXBC   (1u << 2)

DXBC SM5_0 shaders for D3D11

Definition at line 291 of file SDL_gpu.h.

◆ SDL_GPU_SHADERFORMAT_DXIL

#define SDL_GPU_SHADERFORMAT_DXIL   (1u << 3)

DXIL shaders for D3D12

Definition at line 292 of file SDL_gpu.h.

◆ SDL_GPU_SHADERFORMAT_METALLIB

#define SDL_GPU_SHADERFORMAT_METALLIB   (1u << 5)

precompiled metallib shaders for Metal

Definition at line 294 of file SDL_gpu.h.

◆ SDL_GPU_SHADERFORMAT_MSL

#define SDL_GPU_SHADERFORMAT_MSL   (1u << 4)

MSL shaders for Metal

Definition at line 293 of file SDL_gpu.h.

◆ SDL_GPU_SHADERFORMAT_PRIVATE

#define SDL_GPU_SHADERFORMAT_PRIVATE   (1u << 0)

shaders for NDA'd platforms

Definition at line 289 of file SDL_gpu.h.

◆ SDL_GPU_SHADERFORMAT_SPIRV

#define SDL_GPU_SHADERFORMAT_SPIRV   (1u << 1)

SPIR-V shaders for Vulkan

Definition at line 290 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 234 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 237 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 238 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 235 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 236 of file SDL_gpu.h.

◆ SDL_GPU_TEXTUREUSAGE_SAMPLER

#define SDL_GPU_TEXTUREUSAGE_SAMPLER   (1u << 0)

texture supports sampling

Definition at line 233 of file SDL_gpu.h.

◆ SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT

#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT   "SDL.gpu.createtexture.d3d12.clear.a"

Definition at line 710 of file SDL_gpu.h.

◆ SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT

#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT   "SDL.gpu.createtexture.d3d12.clear.b"

Definition at line 709 of file SDL_gpu.h.

◆ SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT

#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT   "SDL.gpu.createtexture.d3d12.clear.depth"

Definition at line 711 of file SDL_gpu.h.

◆ SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT

#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT   "SDL.gpu.createtexture.d3d12.clear.g"

Definition at line 708 of file SDL_gpu.h.

◆ SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT

#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT   "SDL.gpu.createtexture.d3d12.clear.r"

Definition at line 707 of file SDL_gpu.h.

◆ SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8

#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8   "SDL.gpu.createtexture.d3d12.clear.stencil"

Definition at line 712 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 1018 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL

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

Definition at line 1009 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 1011 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL

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

Definition at line 1010 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL

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

Definition at line 1014 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL

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

Definition at line 1015 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL

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

Definition at line 1017 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL

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

Definition at line 1016 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL

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

Definition at line 1012 of file SDL_gpu.h.

◆ SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL

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

Definition at line 1013 of file SDL_gpu.h.

Typedef Documentation

◆ SDL_GPUBuffer

typedef struct SDL_GPUBuffer SDL_GPUBuffer

Definition at line 48 of file SDL_gpu.h.

◆ SDL_GPUBufferUsageFlags

Definition at line 266 of file SDL_gpu.h.

◆ SDL_GPUColorComponentFlags

Definition at line 428 of file SDL_gpu.h.

◆ SDL_GPUCommandBuffer

Definition at line 55 of file SDL_gpu.h.

◆ SDL_GPUComputePass

Definition at line 57 of file SDL_gpu.h.

◆ SDL_GPUComputePipeline

Definition at line 53 of file SDL_gpu.h.

◆ SDL_GPUCopyPass

Definition at line 58 of file SDL_gpu.h.

◆ SDL_GPUDevice

typedef struct SDL_GPUDevice SDL_GPUDevice

CategoryGPU

Include file for SDL GPU API functions

Definition at line 47 of file SDL_gpu.h.

◆ SDL_GPUFence

typedef struct SDL_GPUFence SDL_GPUFence

Definition at line 59 of file SDL_gpu.h.

◆ SDL_GPUGraphicsPipeline

Definition at line 54 of file SDL_gpu.h.

◆ SDL_GPURenderPass

Definition at line 56 of file SDL_gpu.h.

◆ SDL_GPUSampler

Definition at line 51 of file SDL_gpu.h.

◆ SDL_GPUShader

typedef struct SDL_GPUShader SDL_GPUShader

Definition at line 52 of file SDL_gpu.h.

◆ SDL_GPUShaderFormat

Definition at line 287 of file SDL_gpu.h.

◆ SDL_GPUTexture

Definition at line 50 of file SDL_gpu.h.

◆ SDL_GPUTextureUsageFlags

Definition at line 231 of file SDL_gpu.h.

◆ SDL_GPUTransferBuffer

Definition at line 49 of file SDL_gpu.h.

Enumeration Type Documentation

◆ SDL_GPUBlendFactor

Enumerator
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 

Definition at line 411 of file SDL_gpu.h.

412{
SDL_GPUBlendFactor
Definition SDL_gpu.h:412
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA
Definition SDL_gpu.h:420
@ SDL_GPU_BLENDFACTOR_CONSTANT_COLOR
Definition SDL_gpu.h:423
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR
Definition SDL_gpu.h:418
@ SDL_GPU_BLENDFACTOR_DST_ALPHA
Definition SDL_gpu.h:421
@ SDL_GPU_BLENDFACTOR_ZERO
Definition SDL_gpu.h:413
@ SDL_GPU_BLENDFACTOR_DST_COLOR
Definition SDL_gpu.h:417
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA
Definition SDL_gpu.h:422
@ SDL_GPU_BLENDFACTOR_SRC_ALPHA
Definition SDL_gpu.h:419
@ SDL_GPU_BLENDFACTOR_SRC_COLOR
Definition SDL_gpu.h:415
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR
Definition SDL_gpu.h:416
@ SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
Definition SDL_gpu.h:425
@ SDL_GPU_BLENDFACTOR_ONE
Definition SDL_gpu.h:414
@ SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR
Definition SDL_gpu.h:424

◆ SDL_GPUBlendOp

Enumerator
SDL_GPU_BLENDOP_ADD 
SDL_GPU_BLENDOP_SUBTRACT 
SDL_GPU_BLENDOP_REVERSE_SUBTRACT 
SDL_GPU_BLENDOP_MIN 
SDL_GPU_BLENDOP_MAX 

Definition at line 402 of file SDL_gpu.h.

403{
SDL_GPUBlendOp
Definition SDL_gpu.h:403
@ SDL_GPU_BLENDOP_MIN
Definition SDL_gpu.h:407
@ SDL_GPU_BLENDOP_MAX
Definition SDL_gpu.h:408
@ SDL_GPU_BLENDOP_REVERSE_SUBTRACT
Definition SDL_gpu.h:406
@ SDL_GPU_BLENDOP_SUBTRACT
Definition SDL_gpu.h:405
@ SDL_GPU_BLENDOP_ADD
Definition SDL_gpu.h:404

◆ SDL_GPUCompareOp

Enumerator
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 

Definition at line 378 of file SDL_gpu.h.

379{
SDL_GPUCompareOp
Definition SDL_gpu.h:379
@ SDL_GPU_COMPAREOP_NEVER
Definition SDL_gpu.h:380
@ SDL_GPU_COMPAREOP_GREATER
Definition SDL_gpu.h:384
@ SDL_GPU_COMPAREOP_LESS
Definition SDL_gpu.h:381
@ SDL_GPU_COMPAREOP_GREATER_OR_EQUAL
Definition SDL_gpu.h:386
@ SDL_GPU_COMPAREOP_ALWAYS
Definition SDL_gpu.h:387
@ SDL_GPU_COMPAREOP_LESS_OR_EQUAL
Definition SDL_gpu.h:383
@ SDL_GPU_COMPAREOP_NOT_EQUAL
Definition SDL_gpu.h:385
@ SDL_GPU_COMPAREOP_EQUAL
Definition SDL_gpu.h:382

◆ SDL_GPUCubeMapFace

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 256 of file SDL_gpu.h.

257{
SDL_GPUCubeMapFace
Definition SDL_gpu.h:257
@ SDL_GPU_CUBEMAPFACE_NEGATIVEY
Definition SDL_gpu.h:261
@ SDL_GPU_CUBEMAPFACE_POSITIVEY
Definition SDL_gpu.h:260
@ SDL_GPU_CUBEMAPFACE_NEGATIVEX
Definition SDL_gpu.h:259
@ SDL_GPU_CUBEMAPFACE_NEGATIVEZ
Definition SDL_gpu.h:263
@ SDL_GPU_CUBEMAPFACE_POSITIVEX
Definition SDL_gpu.h:258
@ SDL_GPU_CUBEMAPFACE_POSITIVEZ
Definition SDL_gpu.h:262

◆ SDL_GPUCullMode

Enumerator
SDL_GPU_CULLMODE_NONE 
SDL_GPU_CULLMODE_FRONT 
SDL_GPU_CULLMODE_BACK 

Definition at line 365 of file SDL_gpu.h.

366{
SDL_GPUCullMode
Definition SDL_gpu.h:366
@ SDL_GPU_CULLMODE_FRONT
Definition SDL_gpu.h:368
@ SDL_GPU_CULLMODE_NONE
Definition SDL_gpu.h:367
@ SDL_GPU_CULLMODE_BACK
Definition SDL_gpu.h:369

◆ SDL_GPUDriver

Enumerator
SDL_GPU_DRIVER_INVALID 
SDL_GPU_DRIVER_PRIVATE 
SDL_GPU_DRIVER_VULKAN 
SDL_GPU_DRIVER_D3D11 
SDL_GPU_DRIVER_D3D12 
SDL_GPU_DRIVER_METAL 

Definition at line 495 of file SDL_gpu.h.

496{
498 SDL_GPU_DRIVER_PRIVATE, /* NDA'd platforms */
SDL_GPUDriver
Definition SDL_gpu.h:496
@ SDL_GPU_DRIVER_PRIVATE
Definition SDL_gpu.h:498
@ SDL_GPU_DRIVER_D3D12
Definition SDL_gpu.h:501
@ SDL_GPU_DRIVER_D3D11
Definition SDL_gpu.h:500
@ SDL_GPU_DRIVER_INVALID
Definition SDL_gpu.h:497
@ SDL_GPU_DRIVER_VULKAN
Definition SDL_gpu.h:499
@ SDL_GPU_DRIVER_METAL
Definition SDL_gpu.h:502

◆ SDL_GPUFillMode

Enumerator
SDL_GPU_FILLMODE_FILL 
SDL_GPU_FILLMODE_LINE 

Definition at line 359 of file SDL_gpu.h.

360{
SDL_GPUFillMode
Definition SDL_gpu.h:360
@ SDL_GPU_FILLMODE_FILL
Definition SDL_gpu.h:361
@ SDL_GPU_FILLMODE_LINE
Definition SDL_gpu.h:362

◆ SDL_GPUFilter

Enumerator
SDL_GPU_FILTER_NEAREST 
SDL_GPU_FILTER_LINEAR 

Definition at line 435 of file SDL_gpu.h.

436{
SDL_GPUFilter
Definition SDL_gpu.h:436
@ SDL_GPU_FILTER_NEAREST
Definition SDL_gpu.h:437
@ SDL_GPU_FILTER_LINEAR
Definition SDL_gpu.h:438

◆ SDL_GPUFrontFace

Enumerator
SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE 
SDL_GPU_FRONTFACE_CLOCKWISE 

Definition at line 372 of file SDL_gpu.h.

373{
SDL_GPUFrontFace
Definition SDL_gpu.h:373
@ SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE
Definition SDL_gpu.h:374
@ SDL_GPU_FRONTFACE_CLOCKWISE
Definition SDL_gpu.h:375

◆ SDL_GPUIndexElementSize

Enumerator
SDL_GPU_INDEXELEMENTSIZE_16BIT 
SDL_GPU_INDEXELEMENTSIZE_32BIT 

Definition at line 83 of file SDL_gpu.h.

84{
SDL_GPUIndexElementSize
Definition SDL_gpu.h:84
@ SDL_GPU_INDEXELEMENTSIZE_16BIT
Definition SDL_gpu.h:85
@ SDL_GPU_INDEXELEMENTSIZE_32BIT
Definition SDL_gpu.h:86

◆ SDL_GPULoadOp

Enumerator
SDL_GPU_LOADOP_LOAD 
SDL_GPU_LOADOP_CLEAR 
SDL_GPU_LOADOP_DONT_CARE 

Definition at line 70 of file SDL_gpu.h.

71{
SDL_GPULoadOp
Definition SDL_gpu.h:71
@ SDL_GPU_LOADOP_DONT_CARE
Definition SDL_gpu.h:74
@ SDL_GPU_LOADOP_CLEAR
Definition SDL_gpu.h:73
@ SDL_GPU_LOADOP_LOAD
Definition SDL_gpu.h:72

◆ SDL_GPUPresentMode

Enumerator
SDL_GPU_PRESENTMODE_VSYNC 
SDL_GPU_PRESENTMODE_IMMEDIATE 
SDL_GPU_PRESENTMODE_MAILBOX 

Definition at line 470 of file SDL_gpu.h.

471{
SDL_GPUPresentMode
Definition SDL_gpu.h:471
@ SDL_GPU_PRESENTMODE_VSYNC
Definition SDL_gpu.h:472
@ SDL_GPU_PRESENTMODE_IMMEDIATE
Definition SDL_gpu.h:473
@ SDL_GPU_PRESENTMODE_MAILBOX
Definition SDL_gpu.h:474

◆ SDL_GPUPrimitiveType

Enumerator
SDL_GPU_PRIMITIVETYPE_POINTLIST 
SDL_GPU_PRIMITIVETYPE_LINELIST 
SDL_GPU_PRIMITIVETYPE_LINESTRIP 
SDL_GPU_PRIMITIVETYPE_TRIANGLELIST 
SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP 

Definition at line 61 of file SDL_gpu.h.

62{
SDL_GPUPrimitiveType
Definition SDL_gpu.h:62
@ SDL_GPU_PRIMITIVETYPE_TRIANGLELIST
Definition SDL_gpu.h:66
@ SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP
Definition SDL_gpu.h:67
@ SDL_GPU_PRIMITIVETYPE_POINTLIST
Definition SDL_gpu.h:63
@ SDL_GPU_PRIMITIVETYPE_LINESTRIP
Definition SDL_gpu.h:65
@ SDL_GPU_PRIMITIVETYPE_LINELIST
Definition SDL_gpu.h:64

◆ SDL_GPUSampleCount

Enumerator
SDL_GPU_SAMPLECOUNT_1 
SDL_GPU_SAMPLECOUNT_2 
SDL_GPU_SAMPLECOUNT_4 
SDL_GPU_SAMPLECOUNT_8 

Definition at line 248 of file SDL_gpu.h.

249{
SDL_GPUSampleCount
Definition SDL_gpu.h:249
@ SDL_GPU_SAMPLECOUNT_2
Definition SDL_gpu.h:251
@ SDL_GPU_SAMPLECOUNT_8
Definition SDL_gpu.h:253
@ SDL_GPU_SAMPLECOUNT_1
Definition SDL_gpu.h:250
@ SDL_GPU_SAMPLECOUNT_4
Definition SDL_gpu.h:252

◆ SDL_GPUSamplerAddressMode

Enumerator
SDL_GPU_SAMPLERADDRESSMODE_REPEAT 
SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT 
SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE 

Definition at line 447 of file SDL_gpu.h.

448{
SDL_GPUSamplerAddressMode
Definition SDL_gpu.h:448
@ SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT
Definition SDL_gpu.h:450
@ SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE
Definition SDL_gpu.h:451
@ SDL_GPU_SAMPLERADDRESSMODE_REPEAT
Definition SDL_gpu.h:449

◆ SDL_GPUSamplerMipmapMode

Enumerator
SDL_GPU_SAMPLERMIPMAPMODE_NEAREST 
SDL_GPU_SAMPLERMIPMAPMODE_LINEAR 

Definition at line 441 of file SDL_gpu.h.

442{
SDL_GPUSamplerMipmapMode
Definition SDL_gpu.h:442
@ SDL_GPU_SAMPLERMIPMAPMODE_NEAREST
Definition SDL_gpu.h:443
@ SDL_GPU_SAMPLERMIPMAPMODE_LINEAR
Definition SDL_gpu.h:444

◆ SDL_GPUShaderStage

Enumerator
SDL_GPU_SHADERSTAGE_VERTEX 
SDL_GPU_SHADERSTAGE_FRAGMENT 

Definition at line 281 of file SDL_gpu.h.

282{
SDL_GPUShaderStage
Definition SDL_gpu.h:282
@ SDL_GPU_SHADERSTAGE_FRAGMENT
Definition SDL_gpu.h:284
@ SDL_GPU_SHADERSTAGE_VERTEX
Definition SDL_gpu.h:283

◆ SDL_GPUStencilOp

Enumerator
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 

Definition at line 390 of file SDL_gpu.h.

391{
SDL_GPUStencilOp
Definition SDL_gpu.h:391
@ SDL_GPU_STENCILOP_DECREMENT_AND_WRAP
Definition SDL_gpu.h:399
@ SDL_GPU_STENCILOP_ZERO
Definition SDL_gpu.h:393
@ SDL_GPU_STENCILOP_KEEP
Definition SDL_gpu.h:392
@ SDL_GPU_STENCILOP_INVERT
Definition SDL_gpu.h:397
@ SDL_GPU_STENCILOP_REPLACE
Definition SDL_gpu.h:394
@ SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP
Definition SDL_gpu.h:396
@ SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP
Definition SDL_gpu.h:395
@ SDL_GPU_STENCILOP_INCREMENT_AND_WRAP
Definition SDL_gpu.h:398

◆ SDL_GPUStoreOp

Enumerator
SDL_GPU_STOREOP_STORE 
SDL_GPU_STOREOP_DONT_CARE 

Definition at line 77 of file SDL_gpu.h.

78{
SDL_GPUStoreOp
Definition SDL_gpu.h:78
@ SDL_GPU_STOREOP_STORE
Definition SDL_gpu.h:79
@ SDL_GPU_STOREOP_DONT_CARE
Definition SDL_gpu.h:80

◆ SDL_GPUSwapchainComposition

Enumerator
SDL_GPU_SWAPCHAINCOMPOSITION_SDR 
SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR 
SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR 
SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048 

Definition at line 487 of file SDL_gpu.h.

◆ SDL_GPUTextureFormat

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

Definition at line 157 of file SDL_gpu.h.

158{
160
161 /* Unsigned Normalized Float Color Formats */
174 /* Compressed Unsigned Normalized Float Color Formats */
181 /* Compressed Signed Float Color Formats */
183 /* Compressed Unsigned Float Color Formats */
185 /* Signed Normalized Float Color Formats */
192 /* Signed Float Color Formats */
199 /* Unsigned Float Color Formats */
201 /* Unsigned Integer Color Formats */
208 /* Signed Integer Color Formats */
215 /* SRGB Unsigned Normalized Color Formats */
218 /* Compressed SRGB Unsigned Normalized Color Formats */
223 /* Depth Formats */
SDL_GPUTextureFormat
Definition SDL_gpu.h:158
@ SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM
Definition SDL_gpu.h:173
@ SDL_GPU_TEXTUREFORMAT_D16_UNORM
Definition SDL_gpu.h:224
@ SDL_GPU_TEXTUREFORMAT_R16G16_INT
Definition SDL_gpu.h:213
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT
Definition SDL_gpu.h:207
@ SDL_GPU_TEXTUREFORMAT_R8_UINT
Definition SDL_gpu.h:202
@ SDL_GPU_TEXTUREFORMAT_R8G8_SNORM
Definition SDL_gpu.h:187
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM
Definition SDL_gpu.h:168
@ SDL_GPU_TEXTUREFORMAT_A8_UNORM
Definition SDL_gpu.h:162
@ SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT
Definition SDL_gpu.h:182
@ SDL_GPU_TEXTUREFORMAT_R16_UINT
Definition SDL_gpu.h:205
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM
Definition SDL_gpu.h:191
@ SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM
Definition SDL_gpu.h:179
@ SDL_GPU_TEXTUREFORMAT_R16_INT
Definition SDL_gpu.h:212
@ SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM
Definition SDL_gpu.h:178
@ SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT
Definition SDL_gpu.h:197
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB
Definition SDL_gpu.h:216
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM
Definition SDL_gpu.h:188
@ SDL_GPU_TEXTUREFORMAT_R16_UNORM
Definition SDL_gpu.h:166
@ SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT
Definition SDL_gpu.h:228
@ SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT
Definition SDL_gpu.h:184
@ SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM
Definition SDL_gpu.h:180
@ SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM
Definition SDL_gpu.h:176
@ SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT
Definition SDL_gpu.h:198
@ SDL_GPU_TEXTUREFORMAT_R8_SNORM
Definition SDL_gpu.h:186
@ SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB
Definition SDL_gpu.h:219
@ SDL_GPU_TEXTUREFORMAT_R8_UNORM
Definition SDL_gpu.h:163
@ SDL_GPU_TEXTUREFORMAT_D24_UNORM
Definition SDL_gpu.h:225
@ SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB
Definition SDL_gpu.h:220
@ SDL_GPU_TEXTUREFORMAT_INVALID
Definition SDL_gpu.h:159
@ SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM
Definition SDL_gpu.h:177
@ SDL_GPU_TEXTUREFORMAT_R16G16_SNORM
Definition SDL_gpu.h:190
@ SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM
Definition SDL_gpu.h:172
@ SDL_GPU_TEXTUREFORMAT_R8G8_INT
Definition SDL_gpu.h:210
@ SDL_GPU_TEXTUREFORMAT_D32_FLOAT
Definition SDL_gpu.h:226
@ SDL_GPU_TEXTUREFORMAT_R8_INT
Definition SDL_gpu.h:209
@ SDL_GPU_TEXTUREFORMAT_R8G8_UINT
Definition SDL_gpu.h:203
@ SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT
Definition SDL_gpu.h:194
@ SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM
Definition SDL_gpu.h:171
@ SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB
Definition SDL_gpu.h:221
@ SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM
Definition SDL_gpu.h:175
@ SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB
Definition SDL_gpu.h:222
@ SDL_GPU_TEXTUREFORMAT_R32_FLOAT
Definition SDL_gpu.h:196
@ SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT
Definition SDL_gpu.h:227
@ SDL_GPU_TEXTUREFORMAT_R8G8_UNORM
Definition SDL_gpu.h:164
@ SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB
Definition SDL_gpu.h:217
@ SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM
Definition SDL_gpu.h:170
@ SDL_GPU_TEXTUREFORMAT_R16G16_UNORM
Definition SDL_gpu.h:167
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
Definition SDL_gpu.h:165
@ SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT
Definition SDL_gpu.h:200
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT
Definition SDL_gpu.h:214
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT
Definition SDL_gpu.h:204
@ SDL_GPU_TEXTUREFORMAT_R16G16_UINT
Definition SDL_gpu.h:206
@ SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT
Definition SDL_gpu.h:195
@ SDL_GPU_TEXTUREFORMAT_R16_SNORM
Definition SDL_gpu.h:189
@ SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT
Definition SDL_gpu.h:211
@ SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM
Definition SDL_gpu.h:169
@ SDL_GPU_TEXTUREFORMAT_R16_FLOAT
Definition SDL_gpu.h:193

◆ SDL_GPUTextureType

Enumerator
SDL_GPU_TEXTURETYPE_2D 
SDL_GPU_TEXTURETYPE_2D_ARRAY 
SDL_GPU_TEXTURETYPE_3D 
SDL_GPU_TEXTURETYPE_CUBE 

Definition at line 240 of file SDL_gpu.h.

241{
SDL_GPUTextureType
Definition SDL_gpu.h:241
@ SDL_GPU_TEXTURETYPE_3D
Definition SDL_gpu.h:244
@ SDL_GPU_TEXTURETYPE_CUBE
Definition SDL_gpu.h:245
@ SDL_GPU_TEXTURETYPE_2D
Definition SDL_gpu.h:242
@ SDL_GPU_TEXTURETYPE_2D_ARRAY
Definition SDL_gpu.h:243

◆ SDL_GPUTransferBufferUsage

Enumerator
SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD 
SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD 

Definition at line 275 of file SDL_gpu.h.

276{
SDL_GPUTransferBufferUsage
Definition SDL_gpu.h:276
@ SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
Definition SDL_gpu.h:278
@ SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD
Definition SDL_gpu.h:277

◆ SDL_GPUVertexElementFormat

Enumerator
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 296 of file SDL_gpu.h.

297{
298 /* 32-bit Signed Integers */
303
304 /* 32-bit Unsigned Integers */
309
310 /* 32-bit Floats */
315
316 /* 8-bit Signed Integers */
319
320 /* 8-bit Unsigned Integers */
323
324 /* 8-bit Signed Normalized */
327
328 /* 8-bit Unsigned Normalized */
331
332 /* 16-bit Signed Integers */
335
336 /* 16-bit Unsigned Integers */
339
340 /* 16-bit Signed Normalized */
343
344 /* 16-bit Unsigned Normalized */
347
348 /* 16-bit Floats */
SDL_GPUVertexElementFormat
Definition SDL_gpu.h:297
@ SDL_GPU_VERTEXELEMENTFORMAT_INT4
Definition SDL_gpu.h:302
@ SDL_GPU_VERTEXELEMENTFORMAT_INT
Definition SDL_gpu.h:299
@ SDL_GPU_VERTEXELEMENTFORMAT_HALF2
Definition SDL_gpu.h:349
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE2
Definition SDL_gpu.h:317
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4
Definition SDL_gpu.h:322
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT4
Definition SDL_gpu.h:338
@ SDL_GPU_VERTEXELEMENTFORMAT_INT2
Definition SDL_gpu.h:300
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM
Definition SDL_gpu.h:325
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT2
Definition SDL_gpu.h:306
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE4
Definition SDL_gpu.h:318
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM
Definition SDL_gpu.h:341
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4
Definition SDL_gpu.h:314
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM
Definition SDL_gpu.h:329
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT3
Definition SDL_gpu.h:307
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT
Definition SDL_gpu.h:305
@ SDL_GPU_VERTEXELEMENTFORMAT_UINT4
Definition SDL_gpu.h:308
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM
Definition SDL_gpu.h:345
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3
Definition SDL_gpu.h:313
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2
Definition SDL_gpu.h:321
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2
Definition SDL_gpu.h:312
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT4
Definition SDL_gpu.h:334
@ SDL_GPU_VERTEXELEMENTFORMAT_FLOAT
Definition SDL_gpu.h:311
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT2
Definition SDL_gpu.h:333
@ SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM
Definition SDL_gpu.h:326
@ SDL_GPU_VERTEXELEMENTFORMAT_HALF4
Definition SDL_gpu.h:350
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT2
Definition SDL_gpu.h:337
@ SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM
Definition SDL_gpu.h:330
@ SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM
Definition SDL_gpu.h:342
@ SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM
Definition SDL_gpu.h:346
@ SDL_GPU_VERTEXELEMENTFORMAT_INT3
Definition SDL_gpu.h:301

◆ SDL_GPUVertexInputRate

Enumerator
SDL_GPU_VERTEXINPUTRATE_VERTEX 
SDL_GPU_VERTEXINPUTRATE_INSTANCE 

Definition at line 353 of file SDL_gpu.h.

354{
SDL_GPUVertexInputRate
Definition SDL_gpu.h:354
@ SDL_GPU_VERTEXINPUTRATE_INSTANCE
Definition SDL_gpu.h:356
@ SDL_GPU_VERTEXINPUTRATE_VERTEX
Definition SDL_gpu.h:355

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.

Parameters
devicea GPU context.
Returns
a command buffer.
Since
This function is available since SDL 3.0.0.
See also
SDL_SubmitGPUCommandBuffer
SDL_SubmitGPUCommandBufferAndAcquireFence

◆ SDL_AcquireGPUSwapchainTexture()

SDL_GPUTexture * SDL_AcquireGPUSwapchainTexture ( SDL_GPUCommandBuffer commandBuffer,
SDL_Window window,
Uint32 pWidth,
Uint32 pHeight 
)
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. May return NULL under certain conditions. This is not necessarily an error. This 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
commandBuffera command buffer.
windowa window that has been claimed.
pWidtha pointer filled in with the swapchain width.
pHeighta pointer filled in with the swapchain height.
Returns
a swapchain texture.
Since
This function is available since SDL 3.0.0.
See also
SDL_ClaimWindowForGPUDevice
SDL_SubmitGPUCommandBuffer
SDL_SubmitGPUCommandBufferAndAcquireFence

◆ SDL_BeginGPUComputePass()

SDL_GPUComputePass * SDL_BeginGPUComputePass ( SDL_GPUCommandBuffer commandBuffer,
SDL_GPUStorageTextureWriteOnlyBinding storageTextureBindings,
Uint32  storageTextureBindingCount,
SDL_GPUStorageBufferWriteOnlyBinding storageBufferBindings,
Uint32  storageBufferBindingCount 
)
extern

Begins a compute pass on a command buffer.

A compute pass is defined by a set of texture subresources and buffers that will be written to by compute pipelines. These textures and buffers must have been created with the COMPUTE_STORAGE_WRITE bit. 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 Textures and buffers bound as write-only MUST NOT be read from during the compute pass. Doing so will result in undefined behavior. If your compute work requires reading the output from a previous dispatch, you MUST end the current compute pass and begin a new one before you can safely access the data.

Parameters
commandBuffera command buffer.
storageTextureBindingsan array of writeable storage texture binding structs.
storageTextureBindingCountthe number of storage textures to bind from the array.
storageBufferBindingsan array of writeable storage buffer binding structs.
storageBufferBindingCountthe number of storage buffers to bind from the array.
Returns
a compute pass handle.
Since
This function is available since SDL 3.0.0.
See also
SDL_EndGPUComputePass

◆ SDL_BeginGPUCopyPass()

SDL_GPUCopyPass * SDL_BeginGPUCopyPass ( SDL_GPUCommandBuffer commandBuffer)
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
commandBuffera command buffer.
Returns
a copy pass handle.
Since
This function is available since SDL 3.0.0.

◆ SDL_BeginGPURenderPass()

SDL_GPURenderPass * SDL_BeginGPURenderPass ( SDL_GPUCommandBuffer commandBuffer,
SDL_GPUColorAttachmentInfo colorAttachmentInfos,
Uint32  colorAttachmentCount,
SDL_GPUDepthStencilAttachmentInfo depthStencilAttachmentInfo 
)
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
commandBuffera command buffer.
colorAttachmentInfosan array of texture subresources with corresponding clear values and load/store ops.
colorAttachmentCountthe number of color attachments in the colorAttachmentInfos array.
depthStencilAttachmentInfoa 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.0.0.
See also
SDL_EndGPURenderPass

◆ SDL_BindGPUComputePipeline()

void SDL_BindGPUComputePipeline ( SDL_GPUComputePass computePass,
SDL_GPUComputePipeline computePipeline 
)
extern

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

Parameters
computePassa compute pass handle.
computePipelinea compute pipeline to bind.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUComputeStorageBuffers()

void SDL_BindGPUComputeStorageBuffers ( SDL_GPUComputePass computePass,
Uint32  firstSlot,
SDL_GPUBuffer **  storageBuffers,
Uint32  bindingCount 
)
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.

Parameters
computePassa compute pass handle.
firstSlotthe compute storage buffer slot to begin binding from.
storageBuffersan array of storage buffer binding structs.
bindingCountthe number of storage buffers to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUComputeStorageTextures()

void SDL_BindGPUComputeStorageTextures ( SDL_GPUComputePass computePass,
Uint32  firstSlot,
SDL_GPUTexture **  storageTextures,
Uint32  bindingCount 
)
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.

Parameters
computePassa compute pass handle.
firstSlotthe compute storage texture slot to begin binding from.
storageTexturesan array of storage textures.
bindingCountthe number of storage textures to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUFragmentSamplers()

void SDL_BindGPUFragmentSamplers ( SDL_GPURenderPass renderPass,
Uint32  firstSlot,
SDL_GPUTextureSamplerBinding textureSamplerBindings,
Uint32  bindingCount 
)
extern

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

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.

Parameters
renderPassa render pass handle.
firstSlotthe fragment sampler slot to begin binding from.
textureSamplerBindingsan array of texture-sampler binding structs.
bindingCountthe number of texture-sampler pairs to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUFragmentStorageBuffers()

void SDL_BindGPUFragmentStorageBuffers ( SDL_GPURenderPass renderPass,
Uint32  firstSlot,
SDL_GPUBuffer **  storageBuffers,
Uint32  bindingCount 
)
extern

Binds storage buffers for use on the fragment shader.

These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.

Parameters
renderPassa render pass handle.
firstSlotthe fragment storage buffer slot to begin binding from.
storageBuffersan array of storage buffers.
bindingCountthe number of storage buffers to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUFragmentStorageTextures()

void SDL_BindGPUFragmentStorageTextures ( SDL_GPURenderPass renderPass,
Uint32  firstSlot,
SDL_GPUTexture **  storageTextures,
Uint32  bindingCount 
)
extern

Binds storage textures for use on the fragment shader.

These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.

Parameters
renderPassa render pass handle.
firstSlotthe fragment storage texture slot to begin binding from.
storageTexturesan array of storage textures.
bindingCountthe number of storage textures to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUGraphicsPipeline()

void SDL_BindGPUGraphicsPipeline ( SDL_GPURenderPass renderPass,
SDL_GPUGraphicsPipeline graphicsPipeline 
)
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
renderPassa render pass handle.
graphicsPipelinethe graphics pipeline to bind.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUIndexBuffer()

void SDL_BindGPUIndexBuffer ( SDL_GPURenderPass renderPass,
SDL_GPUBufferBinding pBinding,
SDL_GPUIndexElementSize  indexElementSize 
)
extern

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

Parameters
renderPassa render pass handle.
pBindinga pointer to a struct containing an index buffer and offset.
indexElementSizewhether the index values in the buffer are 16- or 32-bit.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUVertexBuffers()

void SDL_BindGPUVertexBuffers ( SDL_GPURenderPass renderPass,
Uint32  firstBinding,
SDL_GPUBufferBinding pBindings,
Uint32  bindingCount 
)
extern

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

Parameters
renderPassa render pass handle.
firstBindingthe starting bind point for the vertex buffers.
pBindingsan array of SDL_GPUBufferBinding structs containing vertex buffers and offset values.
bindingCountthe number of bindings in the pBindings array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUVertexSamplers()

void SDL_BindGPUVertexSamplers ( SDL_GPURenderPass renderPass,
Uint32  firstSlot,
SDL_GPUTextureSamplerBinding textureSamplerBindings,
Uint32  bindingCount 
)
extern

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

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.

Parameters
renderPassa render pass handle.
firstSlotthe vertex sampler slot to begin binding from.
textureSamplerBindingsan array of texture-sampler binding structs.
bindingCountthe number of texture-sampler pairs to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUVertexStorageBuffers()

void SDL_BindGPUVertexStorageBuffers ( SDL_GPURenderPass renderPass,
Uint32  firstSlot,
SDL_GPUBuffer **  storageBuffers,
Uint32  bindingCount 
)
extern

Binds storage buffers for use on the vertex shader.

These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.

Parameters
renderPassa render pass handle.
firstSlotthe vertex storage buffer slot to begin binding from.
storageBuffersan array of buffers.
bindingCountthe number of buffers to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BindGPUVertexStorageTextures()

void SDL_BindGPUVertexStorageTextures ( SDL_GPURenderPass renderPass,
Uint32  firstSlot,
SDL_GPUTexture **  storageTextures,
Uint32  bindingCount 
)
extern

Binds storage textures for use on the vertex shader.

These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.

Parameters
renderPassa render pass handle.
firstSlotthe vertex storage texture slot to begin binding from.
storageTexturesan array of storage textures.
bindingCountthe number of storage texture to bind from the array.
Since
This function is available since SDL 3.0.0.

◆ SDL_BlitGPUTexture()

void SDL_BlitGPUTexture ( SDL_GPUCommandBuffer commandBuffer,
SDL_GPUBlitRegion source,
SDL_GPUBlitRegion destination,
SDL_FlipMode  flipMode,
SDL_GPUFilter  filterMode,
SDL_bool  cycle 
)
extern

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

This function must not be called inside of any pass.

Parameters
commandBuffera command buffer.
sourcethe texture region to copy from.
destinationthe texture region to copy to.
flipModethe flip mode for the source texture region.
filterModethe filter mode that will be used when blitting.
cycleif SDL_TRUE, cycles the destination texture if the destination texture is bound, otherwise overwrites the data.
Since
This function is available since SDL 3.0.0.

◆ SDL_ClaimWindowForGPUDevice()

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

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 SetSwapchainParameters after claiming the window.

Parameters
devicea GPU context.
windowan SDL_Window.
Returns
SDL_TRUE on success, otherwise SDL_FALSE.
Since
This function is available since SDL 3.0.0.
See also
SDL_AcquireGPUSwapchainTexture
SDL_ReleaseWindowFromGPUDevice
SDL_WindowSupportsGPUPresentMode
SDL_WindowSupportsGPUSwapchainComposition

◆ SDL_CopyGPUBufferToBuffer()

void SDL_CopyGPUBufferToBuffer ( SDL_GPUCopyPass copyPass,
SDL_GPUBufferLocation source,
SDL_GPUBufferLocation destination,
Uint32  size,
SDL_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
copyPassa copy pass handle.
sourcethe buffer and offset to copy from.
destinationthe buffer and offset to copy to.
sizethe length of the buffer to copy.
cycleif SDL_TRUE, cycles the destination buffer if it is bound, otherwise overwrites the data.
Since
This function is available since SDL 3.0.0.

◆ SDL_CopyGPUTextureToTexture()

void SDL_CopyGPUTextureToTexture ( SDL_GPUCopyPass copyPass,
SDL_GPUTextureLocation source,
SDL_GPUTextureLocation destination,
Uint32  w,
Uint32  h,
Uint32  d,
SDL_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
copyPassa copy pass handle.
sourcea source texture region.
destinationa destination texture region.
wthe width of the region to copy.
hthe height of the region to copy.
dthe depth of the region to copy.
cycleif SDL_TRUE, cycles the destination texture if the destination texture is bound, otherwise overwrites the data.
Since
This function is available since SDL 3.0.0.

◆ SDL_CreateGPUBuffer()

SDL_GPUBuffer * SDL_CreateGPUBuffer ( SDL_GPUDevice device,
SDL_GPUBufferCreateInfo bufferCreateInfo 
)
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.

Parameters
devicea GPU Context.
bufferCreateInfoa struct describing the state of the buffer to create.
Returns
a buffer object on success, or NULL on failure.
Since
This function is available since SDL 3.0.0.
See also
SDL_UploadToGPUBuffer
SDL_BindGPUVertexBuffers
SDL_BindGPUIndexBuffer
SDL_BindGPUVertexStorageBuffers
SDL_BindGPUFragmentStorageBuffers
SDL_BindGPUComputeStorageBuffers
SDL_ReleaseGPUBuffer

◆ SDL_CreateGPUComputePipeline()

SDL_GPUComputePipeline * SDL_CreateGPUComputePipeline ( SDL_GPUDevice device,
SDL_GPUComputePipelineCreateInfo computePipelineCreateInfo 
)
extern

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

Shader resource bindings must be authored to follow a particular order. For SPIR-V shaders, use the following resource sets: 0: Read-only storage textures, followed by read-only storage buffers 1: Write-only storage textures, followed by write-only storage buffers 2: Uniform buffers

For DXBC Shader Model 5_0 shaders, use the following register order: For t registers: Read-only storage textures, followed by read-only storage buffers For u registers: Write-only storage textures, followed by write-only storage buffers For b registers: Uniform buffers

For DXIL shaders, use the following register order: (t[n], space0): Read-only storage textures, followed by read-only storage buffers (u[n], space1): Write-only storage textures, followed by write-only storage buffers (b[n], space2): Uniform buffers

For MSL/metallib, use the following order: For [[buffer]]: Uniform buffers, followed by write-only storage buffers, followed by write-only storage buffers For [[texture]]: Read-only storage textures, followed by write-only storage textures

Parameters
devicea GPU Context.
computePipelineCreateInfoa struct describing the state of the requested compute pipeline.
Returns
a compute pipeline object on success, or NULL on failure.
Since
This function is available since SDL 3.0.0.
See also
SDL_BindGPUComputePipeline
SDL_ReleaseGPUComputePipeline

◆ SDL_CreateGPUDevice()

SDL_GPUDevice * SDL_CreateGPUDevice ( SDL_GPUShaderFormat  formatFlags,
SDL_bool  debugMode,
const char *  name 
)
extern

Creates a GPU context.

Parameters
formatFlagsa bitflag indicating which shader formats the app is able to provide.
debugModeenable debug mode properties and validations.
namethe preferred GPU driver, or NULL to let SDL pick the optimal driver.
Returns
a GPU context on success or NULL on failure.
Since
This function is available since SDL 3.0.0.
See also
SDL_GetGPUDriver
SDL_DestroyGPUDevice

◆ 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_BOOL: enable debug mode properties and validations, defaults to SDL_TRUE.
  • SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL: enable to prefer energy efficiency over maximum GPU performance, defaults to SDL_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_BOOL: The app is able to provide shaders for an NDA platform.
  • SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL: The app is able to provide SPIR-V shaders if applicable.
  • SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL: The app is able to provide DXBC shaders if applicable SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL: The app is able to provide DXIL shaders if applicable. -SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL: The app is able to provide MSL shaders if applicable. -SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: 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
propsthe properties to use.
Returns
a GPU context on success or NULL on failure.
Since
This function is available since SDL 3.0.0.
See also
SDL_GetGPUDriver
SDL_DestroyGPUDevice

◆ SDL_CreateGPUGraphicsPipeline()

SDL_GPUGraphicsPipeline * SDL_CreateGPUGraphicsPipeline ( SDL_GPUDevice device,
SDL_GPUGraphicsPipelineCreateInfo pipelineCreateInfo 
)
extern

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

Parameters
devicea GPU Context.
pipelineCreateInfoa struct describing the state of the desired graphics pipeline.
Returns
a graphics pipeline object on success, or NULL on failure.
Since
This function is available since SDL 3.0.0.
See also
SDL_CreateGPUShader
SDL_BindGPUGraphicsPipeline
SDL_ReleaseGPUGraphicsPipeline

◆ SDL_CreateGPUSampler()

SDL_GPUSampler * SDL_CreateGPUSampler ( SDL_GPUDevice device,
SDL_GPUSamplerCreateInfo samplerCreateInfo 
)
extern

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

Parameters
devicea GPU Context.
samplerCreateInfoa struct describing the state of the desired sampler.
Returns
a sampler object on success, or NULL on failure.
Since
This function is available since SDL 3.0.0.
See also
SDL_BindGPUVertexSamplers
SDL_BindGPUFragmentSamplers
SDL_ReleaseSampler

◆ SDL_CreateGPUShader()

SDL_GPUShader * SDL_CreateGPUShader ( SDL_GPUDevice device,
SDL_GPUShaderCreateInfo shaderCreateInfo 
)
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 Shader Model 5_0 shaders, use the following register order: For t registers: Sampled textures, followed by storage textures, followed by storage buffers For s registers: Samplers with indices corresponding to the sampled textures For b registers: Uniform buffers

For 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: For [[texture]]: Sampled textures, followed by storage textures For [[sampler]]: Samplers with indices corresponding to the sampled textures For [[buffer]]: Uniform buffers, followed by storage buffers. Vertex buffer 0 is bound at [[buffer(30)]], vertex buffer 1 at [[buffer(29)]], 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_GPUPipeline.

Parameters
devicea GPU Context.
shaderCreateInfoa struct describing the state of the desired shader.
Returns
a shader object on success, or NULL on failure.
Since
This function is available since SDL 3.0.0.
See also
SDL_CreateGPUGraphicsPipeline
SDL_ReleaseGPUShader

◆ SDL_CreateGPUTexture()

SDL_GPUTexture * SDL_CreateGPUTexture ( SDL_GPUDevice device,
SDL_GPUTextureCreateInfo textureCreateInfo 
)
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.

Parameters
devicea GPU Context.
textureCreateInfoa struct describing the state of the texture to create.
Returns
a texture object on success, or NULL on failure.
Since
This function is available since SDL 3.0.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,
SDL_GPUTransferBufferCreateInfo transferBufferCreateInfo 
)
extern

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

Parameters
devicea GPU Context.
transferBufferCreateInfoa struct describing the state of the transfer buffer to create.
Returns
a transfer buffer on success, or NULL on failure.
Since
This function is available since SDL 3.0.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
devicea GPU Context to destroy.
Since
This function is available since SDL 3.0.0.
See also
SDL_CreateGPUDevice

◆ SDL_DispatchGPUCompute()

void SDL_DispatchGPUCompute ( SDL_GPUComputePass computePass,
Uint32  groupCountX,
Uint32  groupCountY,
Uint32  groupCountZ 
)
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
computePassa compute pass handle.
groupCountXnumber of local workgroups to dispatch in the X dimension.
groupCountYnumber of local workgroups to dispatch in the Y dimension.
groupCountZnumber of local workgroups to dispatch in the Z dimension.
Since
This function is available since SDL 3.0.0.

◆ SDL_DispatchGPUComputeIndirect()

void SDL_DispatchGPUComputeIndirect ( SDL_GPUComputePass computePass,
SDL_GPUBuffer buffer,
Uint32  offsetInBytes 
)
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
computePassa compute pass handle.
buffera buffer containing dispatch parameters.
offsetInBytesthe offset to start reading from the dispatch buffer.
Since
This function is available since SDL 3.0.0.

◆ SDL_DownloadFromGPUBuffer()

void SDL_DownloadFromGPUBuffer ( SDL_GPUCopyPass copyPass,
SDL_GPUBufferRegion source,
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
copyPassa copy pass handle.
sourcethe source buffer with offset and size.
destinationthe destination transfer buffer with offset.
Since
This function is available since SDL 3.0.0.

◆ SDL_DownloadFromGPUTexture()

void SDL_DownloadFromGPUTexture ( SDL_GPUCopyPass copyPass,
SDL_GPUTextureRegion source,
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
copyPassa copy pass handle.
sourcethe source texture region.
destinationthe destination transfer buffer with image layout information.
Since
This function is available since SDL 3.0.0.

◆ SDL_DrawGPUIndexedPrimitives()

void SDL_DrawGPUIndexedPrimitives ( SDL_GPURenderPass renderPass,
Uint32  indexCount,
Uint32  instanceCount,
Uint32  firstIndex,
Sint32  vertexOffset,
Uint32  firstInstance 
)
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 firstVertex and firstInstance parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If your shader depends on these variables, the correlating draw call parameter MUST be 0.

Parameters
renderPassa render pass handle.
indexCountthe number of vertices to draw per instance.
instanceCountthe number of instances to draw.
firstIndexthe starting index within the index buffer.
vertexOffsetvalue added to vertex index before indexing into the vertex buffer.
firstInstancethe ID of the first instance to draw.
Since
This function is available since SDL 3.0.0.

◆ SDL_DrawGPUIndexedPrimitivesIndirect()

void SDL_DrawGPUIndexedPrimitivesIndirect ( SDL_GPURenderPass renderPass,
SDL_GPUBuffer buffer,
Uint32  offsetInBytes,
Uint32  drawCount,
Uint32  stride 
)
extern

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

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

Parameters
renderPassa render pass handle.
buffera buffer containing draw parameters.
offsetInBytesthe offset to start reading from the draw buffer.
drawCountthe number of draw parameter sets that should be read from the draw buffer.
stridethe byte stride between sets of draw parameters.
Since
This function is available since SDL 3.0.0.

◆ SDL_DrawGPUPrimitives()

void SDL_DrawGPUPrimitives ( SDL_GPURenderPass renderPass,
Uint32  vertexCount,
Uint32  instanceCount,
Uint32  firstVertex,
Uint32  firstInstance 
)
extern

Draws data using bound graphics state.

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

Note that the firstVertex and firstInstance parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If your shader depends on these variables, the correlating draw call parameter MUST be 0.

Parameters
renderPassa render pass handle.
vertexCountthe number of vertices to draw.
instanceCountthe number of instances that will be drawn.
firstVertexthe index of the first vertex to draw.
firstInstancethe ID of the first instance to draw.
Since
This function is available since SDL 3.0.0.

◆ SDL_DrawGPUPrimitivesIndirect()

void SDL_DrawGPUPrimitivesIndirect ( SDL_GPURenderPass renderPass,
SDL_GPUBuffer buffer,
Uint32  offsetInBytes,
Uint32  drawCount,
Uint32  stride 
)
extern

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

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

Parameters
renderPassa render pass handle.
buffera buffer containing draw parameters.
offsetInBytesthe offset to start reading from the draw buffer.
drawCountthe number of draw parameter sets that should be read from the draw buffer.
stridethe byte stride between sets of draw parameters.
Since
This function is available since SDL 3.0.0.

◆ SDL_EndGPUComputePass()

void SDL_EndGPUComputePass ( SDL_GPUComputePass computePass)
extern

Ends the current compute pass.

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

Parameters
computePassa compute pass handle.
Since
This function is available since SDL 3.0.0.

◆ SDL_EndGPUCopyPass()

void SDL_EndGPUCopyPass ( SDL_GPUCopyPass copyPass)
extern

Ends the current copy pass.

Parameters
copyPassa copy pass handle.
Since
This function is available since SDL 3.0.0.

◆ SDL_EndGPURenderPass()

void SDL_EndGPURenderPass ( SDL_GPURenderPass renderPass)
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
renderPassa render pass handle.
Since
This function is available since SDL 3.0.0.

◆ SDL_GenerateMipmapsForGPUTexture()

void SDL_GenerateMipmapsForGPUTexture ( SDL_GPUCommandBuffer commandBuffer,
SDL_GPUTexture texture 
)
extern

Generates mipmaps for the given texture.

This function must not be called inside of any pass.

Parameters
commandBuffera commandBuffer.
texturea texture with more than 1 mip level.
Since
This function is available since SDL 3.0.0.

◆ SDL_GetGPUDriver()

SDL_GPUDriver SDL_GetGPUDriver ( SDL_GPUDevice device)
extern

Returns the backend used to create this GPU context.

Parameters
devicea GPU context to query.
Returns
an SDL_GPUDriver value, or SDL_GPU_DRIVER_INVALID on error.
Since
This function is available since SDL 3.0.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.

Parameters
devicea GPU context.
windowan SDL_Window that has been claimed.
Returns
the texture format of the swapchain.
Since
This function is available since SDL 3.0.0.

◆ SDL_GPUTextureFormatTexelBlockSize()

Uint32 SDL_GPUTextureFormatTexelBlockSize ( SDL_GPUTextureFormat  textureFormat)
extern

Obtains the texel block size for a texture format.

Parameters
textureFormatthe 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.0.0.
See also
SDL_UploadToGPUTexture

◆ SDL_GPUTextureSupportsFormat()

SDL_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
devicea GPU context.
formatthe texture format to check.
typethe type of texture (2D, 3D, Cube).
usagea 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.0.0.

◆ SDL_GPUTextureSupportsSampleCount()

SDL_bool SDL_GPUTextureSupportsSampleCount ( SDL_GPUDevice device,
SDL_GPUTextureFormat  format,
SDL_GPUSampleCount  sampleCount 
)
extern

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

Parameters
devicea GPU context.
formatthe texture format to check.
sampleCountthe sample count to check.
Returns
a hardware-specific version of min(preferred, possible).
Since
This function is available since SDL 3.0.0.

◆ SDL_InsertGPUDebugLabel()

void SDL_InsertGPUDebugLabel ( SDL_GPUCommandBuffer commandBuffer,
const char *  text 
)
extern

Inserts an arbitrary string label into the command buffer callstream.

Useful for debugging.

Parameters
commandBuffera command buffer.
texta UTF-8 string constant to insert as the label.
Since
This function is available since SDL 3.0.0.

◆ SDL_MapGPUTransferBuffer()

void * SDL_MapGPUTransferBuffer ( SDL_GPUDevice device,
SDL_GPUTransferBuffer transferBuffer,
SDL_bool  cycle 
)
extern

Maps a transfer buffer into application address space.

You must unmap the transfer buffer before encoding upload commands.

Parameters
devicea GPU context.
transferBuffera transfer buffer.
cycleif SDL_TRUE, cycles the transfer buffer if it is bound.
Returns
the address of the mapped transfer buffer memory.
Since
This function is available since SDL 3.0.0.

◆ SDL_PopGPUDebugGroup()

void SDL_PopGPUDebugGroup ( SDL_GPUCommandBuffer commandBuffer)
extern

Ends the most-recently pushed debug group.

Parameters
commandBuffera command buffer.
Since
This function is available since SDL 3.0.0.
See also
SDL_PushGPUDebugGroup

◆ SDL_PushGPUComputeUniformData()

void SDL_PushGPUComputeUniformData ( SDL_GPUCommandBuffer commandBuffer,
Uint32  slotIndex,
const void *  data,
Uint32  dataLengthInBytes 
)
extern

Pushes data to a uniform slot on the command buffer.

Subsequent draw calls will use this uniform data.

Parameters
commandBuffera command buffer.
slotIndexthe uniform slot to push data to.
dataclient data to write.
dataLengthInBytesthe length of the data to write.
Since
This function is available since SDL 3.0.0.

◆ SDL_PushGPUDebugGroup()

void SDL_PushGPUDebugGroup ( SDL_GPUCommandBuffer commandBuffer,
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
commandBuffera command buffer.
namea UTF-8 string constant that names the group.
Since
This function is available since SDL 3.0.0.
See also
SDL_PopGPUDebugGroup

◆ SDL_PushGPUFragmentUniformData()

void SDL_PushGPUFragmentUniformData ( SDL_GPUCommandBuffer commandBuffer,
Uint32  slotIndex,
const void *  data,
Uint32  dataLengthInBytes 
)
extern

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

Subsequent draw calls will use this uniform data.

Parameters
commandBuffera command buffer.
slotIndexthe fragment uniform slot to push data to.
dataclient data to write.
dataLengthInBytesthe length of the data to write.
Since
This function is available since SDL 3.0.0.

◆ SDL_PushGPUVertexUniformData()

void SDL_PushGPUVertexUniformData ( SDL_GPUCommandBuffer commandBuffer,
Uint32  slotIndex,
const void *  data,
Uint32  dataLengthInBytes 
)
extern

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

Subsequent draw calls will use this uniform data.

Parameters
commandBuffera command buffer.
slotIndexthe vertex uniform slot to push data to.
dataclient data to write.
dataLengthInBytesthe length of the data to write.
Since
This function is available since SDL 3.0.0.

◆ SDL_QueryGPUFence()

SDL_bool SDL_QueryGPUFence ( SDL_GPUDevice device,
SDL_GPUFence fence 
)
extern

Checks the status of a fence.

Parameters
devicea GPU context.
fencea fence.
Returns
SDL_TRUE if the fence is signaled, SDL_FALSE if it is not.
Since
This function is available since SDL 3.0.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
devicea GPU context.
buffera buffer to be destroyed.
Since
This function is available since SDL 3.0.0.

◆ SDL_ReleaseGPUComputePipeline()

void SDL_ReleaseGPUComputePipeline ( SDL_GPUDevice device,
SDL_GPUComputePipeline computePipeline 
)
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
devicea GPU context.
computePipelinea compute pipeline to be destroyed.
Since
This function is available since SDL 3.0.0.

◆ SDL_ReleaseGPUFence()

void SDL_ReleaseGPUFence ( SDL_GPUDevice device,
SDL_GPUFence fence 
)
extern

Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence.

Parameters
devicea GPU context.
fencea fence.
Since
This function is available since SDL 3.0.0.
See also
SDL_SubmitGPUCommandBufferAndAcquireFence

◆ SDL_ReleaseGPUGraphicsPipeline()

void SDL_ReleaseGPUGraphicsPipeline ( SDL_GPUDevice device,
SDL_GPUGraphicsPipeline graphicsPipeline 
)
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
devicea GPU context.
graphicsPipelinea graphics pipeline to be destroyed.
Since
This function is available since SDL 3.0.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 texture after calling this function.

Parameters
devicea GPU context.
samplera sampler to be destroyed.
Since
This function is available since SDL 3.0.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
devicea GPU context.
shadera shader to be destroyed.
Since
This function is available since SDL 3.0.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
devicea GPU context.
texturea texture to be destroyed.
Since
This function is available since SDL 3.0.0.

◆ SDL_ReleaseGPUTransferBuffer()

void SDL_ReleaseGPUTransferBuffer ( SDL_GPUDevice device,
SDL_GPUTransferBuffer transferBuffer 
)
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
devicea GPU context.
transferBuffera transfer buffer to be destroyed.
Since
This function is available since SDL 3.0.0.

◆ SDL_ReleaseWindowFromGPUDevice()

void SDL_ReleaseWindowFromGPUDevice ( SDL_GPUDevice device,
SDL_Window window 
)
extern

Unclaims a window, destroying its swapchain structure.

Parameters
devicea GPU context.
windowan SDL_Window that has been claimed.
Since
This function is available since SDL 3.0.0.
See also
SDL_ClaimWindowForGPUDevice

◆ SDL_SetGPUBufferName()

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

Sets an arbitrary string constant to label a buffer.

Useful for debugging.

Parameters
devicea GPU Context.
buffera buffer to attach the name to.
texta UTF-8 string constant to mark as the name of the buffer.
Since
This function is available since SDL 3.0.0.

◆ SDL_SetGPUScissor()

void SDL_SetGPUScissor ( SDL_GPURenderPass renderPass,
SDL_Rect scissor 
)
extern

Sets the current scissor state on a command buffer.

Parameters
renderPassa render pass handle.
scissorthe scissor area to set.
Since
This function is available since SDL 3.0.0.

◆ SDL_SetGPUSwapchainParameters()

SDL_bool SDL_SetGPUSwapchainParameters ( SDL_GPUDevice device,
SDL_Window window,
SDL_GPUSwapchainComposition  swapchainComposition,
SDL_GPUPresentMode  presentMode 
)
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 and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always supported.

Parameters
devicea GPU context.
windowan SDL_Window that has been claimed.
swapchainCompositionthe desired composition of the swapchain.
presentModethe desired present mode for the swapchain.
Returns
SDL_TRUE if successful, SDL_FALSE on error.
Since
This function is available since SDL 3.0.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.

Useful for debugging.

Parameters
devicea GPU Context.
texturea texture to attach the name to.
texta UTF-8 string constant to mark as the name of the texture.
Since
This function is available since SDL 3.0.0.

◆ SDL_SetGPUViewport()

void SDL_SetGPUViewport ( SDL_GPURenderPass renderPass,
SDL_GPUViewport viewport 
)
extern

Sets the current viewport state on a command buffer.

Parameters
renderPassa render pass handle.
viewportthe viewport to set.
Since
This function is available since SDL 3.0.0.

◆ SDL_SubmitGPUCommandBuffer()

void SDL_SubmitGPUCommandBuffer ( SDL_GPUCommandBuffer commandBuffer)
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
commandBuffera command buffer.
Since
This function is available since SDL 3.0.0.
See also
SDL_AcquireGPUCommandBuffer
SDL_AcquireGPUSwapchainTexture
SDL_SubmitGPUCommandBufferAndAcquireFence

◆ SDL_SubmitGPUCommandBufferAndAcquireFence()

SDL_GPUFence * SDL_SubmitGPUCommandBufferAndAcquireFence ( SDL_GPUCommandBuffer commandBuffer)
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
commandBuffera command buffer.
Returns
a fence associated with the command buffer.
Since
This function is available since SDL 3.0.0.
See also
SDL_AcquireGPUCommandBuffer
SDL_AcquireGPUSwapchainTexture
SDL_SubmitGPUCommandBuffer
SDL_ReleaseGPUFence

◆ SDL_UnmapGPUTransferBuffer()

void SDL_UnmapGPUTransferBuffer ( SDL_GPUDevice device,
SDL_GPUTransferBuffer transferBuffer 
)
extern

Unmaps a previously mapped transfer buffer.

Parameters
devicea GPU context.
transferBuffera previously mapped transfer buffer.
Since
This function is available since SDL 3.0.0.

◆ SDL_UploadToGPUBuffer()

void SDL_UploadToGPUBuffer ( SDL_GPUCopyPass copyPass,
SDL_GPUTransferBufferLocation source,
SDL_GPUBufferRegion destination,
SDL_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
copyPassa copy pass handle.
sourcethe source transfer buffer with offset.
destinationthe destination buffer with offset and size.
cycleif SDL_TRUE, cycles the buffer if it is bound, otherwise overwrites the data.
Since
This function is available since SDL 3.0.0.

◆ SDL_UploadToGPUTexture()

void SDL_UploadToGPUTexture ( SDL_GPUCopyPass copyPass,
SDL_GPUTextureTransferInfo source,
SDL_GPUTextureRegion destination,
SDL_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
copyPassa copy pass handle.
sourcethe source transfer buffer with image layout information.
destinationthe destination texture region.
cycleif SDL_TRUE, cycles the texture if the texture is bound, otherwise overwrites the data.
Since
This function is available since SDL 3.0.0.

◆ SDL_WaitForGPUFences()

void SDL_WaitForGPUFences ( SDL_GPUDevice device,
SDL_bool  waitAll,
SDL_GPUFence **  pFences,
Uint32  fenceCount 
)
extern

Blocks the thread until the given fences are signaled.

Parameters
devicea GPU context.
waitAllif 0, wait for any fence to be signaled, if 1, wait for all fences to be signaled.
pFencesan array of fences to wait on.
fenceCountthe number of fences in the pFences array.
Since
This function is available since SDL 3.0.0.
See also
SDL_SubmitGPUCommandBufferAndAcquireFence
SDL_WaitForGPUIdle

◆ SDL_WaitForGPUIdle()

void SDL_WaitForGPUIdle ( SDL_GPUDevice device)
extern

Blocks the thread until the GPU is completely idle.

Parameters
devicea GPU context.
Since
This function is available since SDL 3.0.0.
See also
SDL_WaitForGPUFences

◆ SDL_WindowSupportsGPUPresentMode()

SDL_bool SDL_WindowSupportsGPUPresentMode ( SDL_GPUDevice device,
SDL_Window window,
SDL_GPUPresentMode  presentMode 
)
extern

Determines whether a presentation mode is supported by the window.

The window must be claimed before calling this function.

Parameters
devicea GPU context.
windowan SDL_Window.
presentModethe presentation mode to check.
Returns
SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
Since
This function is available since SDL 3.0.0.
See also
SDL_ClaimWindowForGPUDevice

◆ SDL_WindowSupportsGPUSwapchainComposition()

SDL_bool SDL_WindowSupportsGPUSwapchainComposition ( SDL_GPUDevice device,
SDL_Window window,
SDL_GPUSwapchainComposition  swapchainComposition 
)
extern

Determines whether a swapchain composition is supported by the window.

The window must be claimed before calling this function.

Parameters
devicea GPU context.
windowan SDL_Window.
swapchainCompositionthe swapchain composition to check.
Returns
SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
Since
This function is available since SDL 3.0.0.
See also
SDL_ClaimWindowForGPUDevice