SDL 3.0
SDL_gpu.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/* WIKI CATEGORY: GPU */
23
24/**
25 * # CategoryGPU
26 *
27 * Include file for SDL GPU API functions
28 */
29
30#ifndef SDL_gpu_h_
31#define SDL_gpu_h_
32
33#include <SDL3/SDL_stdinc.h>
34#include <SDL3/SDL_pixels.h>
35#include <SDL3/SDL_properties.h>
36#include <SDL3/SDL_rect.h>
37#include <SDL3/SDL_surface.h>
38#include <SDL3/SDL_video.h>
39
40#include <SDL3/SDL_begin_code.h>
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
45/* Type Declarations */
46
60
69
76
82
88
89/* Texture format support varies depending on driver, hardware, and usage flags.
90 * In general, you should use SDL_GPUTextureSupportsFormat to query if a format
91 * is supported before using it. However, there are a few guaranteed formats.
92 *
93 * For SAMPLER usage, the following formats are universally supported:
94 * - R8G8B8A8_UNORM
95 * - B8G8R8A8_UNORM
96 * - R8_UNORM
97 * - R8_SNORM
98 * - R8G8_UNORM
99 * - R8G8_SNORM
100 * - R8G8B8A8_SNORM
101 * - R16_FLOAT
102 * - R16G16_FLOAT
103 * - R16G16B16A16_FLOAT
104 * - R32_FLOAT
105 * - R32G32_FLOAT
106 * - R32G32B32A32_FLOAT
107 * - R11G11B10_UFLOAT
108 * - R8G8B8A8_UNORM_SRGB
109 * - B8G8R8A8_UNORM_SRGB
110 * - D16_UNORM
111 *
112 * For COLOR_TARGET usage, the following formats are universally supported:
113 * - R8G8B8A8_UNORM
114 * - B8G8R8A8_UNORM
115 * - R8_UNORM
116 * - R16_FLOAT
117 * - R16G16_FLOAT
118 * - R16G16B16A16_FLOAT
119 * - R32_FLOAT
120 * - R32G32_FLOAT
121 * - R32G32B32A32_FLOAT
122 * - R8_UINT
123 * - R8G8_UINT
124 * - R8G8B8A8_UINT
125 * - R16_UINT
126 * - R16G16_UINT
127 * - R16G16B16A16_UINT
128 * - R8_INT
129 * - R8G8_INT
130 * - R8G8B8A8_INT
131 * - R16_INT
132 * - R16G16_INT
133 * - R16G16B16A16_INT
134 * - R8G8B8A8_UNORM_SRGB
135 * - B8G8R8A8_UNORM_SRGB
136 *
137 * For STORAGE usages, the following formats are universally supported:
138 * - R8G8B8A8_UNORM
139 * - R8G8B8A8_SNORM
140 * - R16G16B16A16_FLOAT
141 * - R32_FLOAT
142 * - R32G32_FLOAT
143 * - R32G32B32A32_FLOAT
144 * - R8G8B8A8_UINT
145 * - R16G16B16A16_UINT
146 * - R8G8B8A8_INT
147 * - R16G16B16A16_INT
148 *
149 * For DEPTH_STENCIL_TARGET usage, the following formats are universally supported:
150 * - D16_UNORM
151 * - Either (but not necessarily both!) D24_UNORM or D32_SFLOAT
152 * - Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT
153 *
154 * Unless D16_UNORM is sufficient for your purposes, always check which
155 * of D24/D32 is supported before creating a depth-stencil texture!
156 */
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 */
230
232
233#define SDL_GPU_TEXTUREUSAGE_SAMPLER (1u << 0) /**< texture supports sampling */
234#define SDL_GPU_TEXTUREUSAGE_COLOR_TARGET (1u << 1) /**< texture is a color render target */
235#define SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET (1u << 2) /**< texture is a depth stencil target */
236#define SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ (1u << 3) /**< texture supports storage reads in graphics stages */
237#define SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ (1u << 4) /**< texture supports storage reads in the compute stage */
238#define SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE (1u << 5) /**< texture supports storage writes in the compute stage */
239
247
255
265
267
268#define SDL_GPU_BUFFERUSAGE_VERTEX (1u << 0) /**< buffer is a vertex buffer */
269#define SDL_GPU_BUFFERUSAGE_INDEX (1u << 1) /**< buffer is an index buffer */
270#define SDL_GPU_BUFFERUSAGE_INDIRECT (1u << 2) /**< buffer is an indirect buffer */
271#define SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ (1u << 3) /**< buffer supports storage reads in graphics stages */
272#define SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ (1u << 4) /**< buffer supports storage reads in the compute stage */
273#define SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE (1u << 5) /**< buffer supports storage writes in the compute stage */
274
280
286
288
289#define SDL_GPU_SHADERFORMAT_PRIVATE (1u << 0) /**< shaders for NDA'd platforms */
290#define SDL_GPU_SHADERFORMAT_SPIRV (1u << 1) /**< SPIR-V shaders for Vulkan */
291#define SDL_GPU_SHADERFORMAT_DXBC (1u << 2) /**< DXBC SM5_0 shaders for D3D11 */
292#define SDL_GPU_SHADERFORMAT_DXIL (1u << 3) /**< DXIL shaders for D3D12 */
293#define SDL_GPU_SHADERFORMAT_MSL (1u << 4) /**< MSL shaders for Metal */
294#define SDL_GPU_SHADERFORMAT_METALLIB (1u << 5) /**< precompiled metallib shaders for Metal */
295
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 */
352
358
364
371
377
389
401
410
427
429
430#define SDL_GPU_COLORCOMPONENT_R (1u << 0) /**< the red component */
431#define SDL_GPU_COLORCOMPONENT_G (1u << 1) /**< the green component */
432#define SDL_GPU_COLORCOMPONENT_B (1u << 2) /**< the blue component */
433#define SDL_GPU_COLORCOMPONENT_A (1u << 3) /**< the alpha component */
434
440
446
453
454/*
455 * VSYNC:
456 * Waits for vblank before presenting.
457 * If there is a pending image to present, the new image is enqueued for presentation.
458 * Disallows tearing at the cost of visual latency.
459 * When using this present mode, AcquireSwapchainTexture will block if too many frames are in flight.
460 * IMMEDIATE:
461 * Immediately presents.
462 * Lowest latency option, but tearing may occur.
463 * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight.
464 * MAILBOX:
465 * Waits for vblank before presenting. No tearing is possible.
466 * If there is a pending image to present, the pending image is replaced by the new image.
467 * Similar to VSYNC, but with reduced visual latency.
468 * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight.
469 */
476
477/*
478 * SDR:
479 * B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in nonlinear sRGB encoding. Blends raw pixel values.
480 * SDR_LINEAR:
481 * B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are in nonlinear sRGB encoding. Blends in linear space.
482 * HDR_EXTENDED_LINEAR:
483 * R16G16B16A16_SFLOAT swapchain. Pixel values are in extended linear encoding. Blends in linear space.
484 * HDR10_ST2048:
485 * A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in PQ ST2048 encoding. Blends raw pixel values. (TODO: verify this)
486 */
494
504
505/* Structures */
506
512
513typedef struct SDL_GPUViewport
514{
515 float x;
516 float y;
517 float w;
518 float h;
519 float minDepth;
520 float maxDepth;
522
524{
526 Uint32 offset; /* starting location of the image data */
527 Uint32 imagePitch; /* number of pixels from one row to the next */
528 Uint32 imageHeight; /* number of rows from one layer/depth-slice to the next */
530
536
546
559
570
576
583
584/* Note that the `firstVertex` and `firstInstance` parameters are NOT compatible with
585 * built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If
586 * your shader depends on these variables, the correlating draw call parameter MUST
587 * be 0.
588 */
590{
591 Uint32 vertexCount; /* number of vertices to draw */
592 Uint32 instanceCount; /* number of instances to draw */
593 Uint32 firstVertex; /* index of the first vertex to draw */
594 Uint32 firstInstance; /* ID of the first instance to draw */
596
598{
599 Uint32 indexCount; /* number of vertices to draw per instance */
600 Uint32 instanceCount; /* number of instances to draw */
601 Uint32 firstIndex; /* base index within the index buffer */
602 Sint32 vertexOffset; /* value added to vertex index before indexing into the vertex buffer */
603 Uint32 firstInstance; /* ID of the first instance to draw */
605
612
613/* State structures */
614
633
641
649
657
665
677
692
706
707#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT "SDL.gpu.createtexture.d3d12.clear.r"
708#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT "SDL.gpu.createtexture.d3d12.clear.g"
709#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT "SDL.gpu.createtexture.d3d12.clear.b"
710#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a"
711#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth"
712#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil"
713
721
729
730/* Pipeline state structures */
731
742
748
761
767
775
790
808
810{
811 /* The texture that will be used as a color attachment by a render pass. */
814 Uint32 layerOrDepthPlane; /* For 3D textures, you can bind an individual depth plane as an attachment. */
815
816 /* Can be ignored by RenderPass if CLEAR is not used */
818
819 /* Determines what is done with the texture at the beginning of the render pass.
820 *
821 * LOAD:
822 * Loads the data currently in the texture.
823 *
824 * CLEAR:
825 * Clears the texture to a single color.
826 *
827 * DONT_CARE:
828 * The driver will do whatever it wants with the texture memory.
829 * This is a good option if you know that every single pixel will be touched in the render pass.
830 */
832
833 /* Determines what is done with the texture at the end of the render pass.
834 *
835 * STORE:
836 * Stores the results of the render pass in the texture.
837 *
838 * DONT_CARE:
839 * The driver will do whatever it wants with the texture memory.
840 * This is often a good option for depth/stencil textures.
841 */
843
844 /* if SDL_TRUE, cycles the texture if the texture is bound and loadOp is not LOAD */
847
849{
850 /* The texture that will be used as the depth stencil attachment by a render pass. */
852
853 /* Can be ignored by the render pass if CLEAR is not used */
855
856 /* Determines what is done with the depth values at the beginning of the render pass.
857 *
858 * LOAD:
859 * Loads the depth values currently in the texture.
860 *
861 * CLEAR:
862 * Clears the texture to a single depth.
863 *
864 * DONT_CARE:
865 * The driver will do whatever it wants with the memory.
866 * This is a good option if you know that every single pixel will be touched in the render pass.
867 */
869
870 /* Determines what is done with the depth values at the end of the render pass.
871 *
872 * STORE:
873 * Stores the depth results in the texture.
874 *
875 * DONT_CARE:
876 * The driver will do whatever it wants with the texture memory.
877 * This is often a good option for depth/stencil textures.
878 */
880
881 /* Determines what is done with the stencil values at the beginning of the render pass.
882 *
883 * LOAD:
884 * Loads the stencil values currently in the texture.
885 *
886 * CLEAR:
887 * Clears the texture to a single stencil value.
888 *
889 * DONT_CARE:
890 * The driver will do whatever it wants with the memory.
891 * This is a good option if you know that every single pixel will be touched in the render pass.
892 */
894
895 /* Determines what is done with the stencil values at the end of the render pass.
896 *
897 * STORE:
898 * Stores the stencil results in the texture.
899 *
900 * DONT_CARE:
901 * The driver will do whatever it wants with the texture memory.
902 * This is often a good option for depth/stencil textures.
903 */
905
906 /* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */
909
910/* Binding structs */
911
917
923
925{
927
928 /* if SDL_TRUE, cycles the buffer if it is bound. */
931
933{
937
938 /* if SDL_TRUE, cycles the texture if the texture is bound. */
941
942/* Functions */
943
944/* Device */
945
946/**
947 * Creates a GPU context.
948 *
949 * \param formatFlags a bitflag indicating which shader formats the app is
950 * able to provide.
951 * \param debugMode enable debug mode properties and validations.
952 * \param name the preferred GPU driver, or NULL to let SDL pick the optimal
953 * driver.
954 * \returns a GPU context on success or NULL on failure.
955 *
956 * \since This function is available since SDL 3.0.0.
957 *
958 * \sa SDL_GetGPUDriver
959 * \sa SDL_DestroyGPUDevice
960 */
961extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
962 SDL_GPUShaderFormat formatFlags,
963 SDL_bool debugMode,
964 const char *name);
965
966/**
967 * Creates a GPU context.
968 *
969 * These are the supported properties:
970 *
971 * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties
972 * and validations, defaults to SDL_TRUE.
973 * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy
974 * efficiency over maximum GPU performance, defaults to SDL_FALSE.
975 * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to
976 * use, if a specific one is desired.
977 *
978 * These are the current shader format properties:
979 *
980 * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL`: The app is able to
981 * provide shaders for an NDA platform.
982 * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL`: The app is able to
983 * provide SPIR-V shaders if applicable.
984 * - SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL`: The app is able to provide
985 * DXBC shaders if applicable
986 * `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL`: The app is able to
987 * provide DXIL shaders if applicable.
988 * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL`: The app is able to provide
989 * MSL shaders if applicable.
990 * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: The app is able to
991 * provide Metal shader libraries if applicable.
992 *
993 * With the D3D12 renderer:
994 *
995 * - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING`: the prefix to
996 * use for all vertex semantics, default is "TEXCOORD".
997 *
998 * \param props the properties to use.
999 * \returns a GPU context on success or NULL on failure.
1000 *
1001 * \since This function is available since SDL 3.0.0.
1002 *
1003 * \sa SDL_GetGPUDriver
1004 * \sa SDL_DestroyGPUDevice
1005 */
1007 SDL_PropertiesID props);
1008
1009#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL "SDL.gpu.device.create.debugmode"
1010#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL "SDL.gpu.device.create.preferlowpower"
1011#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name"
1012#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL "SDL.gpu.device.create.shaders.private"
1013#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL "SDL.gpu.device.create.shaders.spirv"
1014#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL "SDL.gpu.device.create.shaders.dxbc"
1015#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL "SDL.gpu.device.create.shaders.dxil"
1016#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL "SDL.gpu.device.create.shaders.msl"
1017#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL "SDL.gpu.device.create.shaders.metallib"
1018#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic"
1019
1020/**
1021 * Destroys a GPU context previously returned by SDL_CreateGPUDevice.
1022 *
1023 * \param device a GPU Context to destroy.
1024 *
1025 * \since This function is available since SDL 3.0.0.
1026 *
1027 * \sa SDL_CreateGPUDevice
1028 */
1029extern SDL_DECLSPEC void SDLCALL SDL_DestroyGPUDevice(SDL_GPUDevice *device);
1030
1031/**
1032 * Returns the backend used to create this GPU context.
1033 *
1034 * \param device a GPU context to query.
1035 * \returns an SDL_GPUDriver value, or SDL_GPU_DRIVER_INVALID on error.
1036 *
1037 * \since This function is available since SDL 3.0.0.
1038 */
1039extern SDL_DECLSPEC SDL_GPUDriver SDLCALL SDL_GetGPUDriver(SDL_GPUDevice *device);
1040
1041/* State Creation */
1042
1043/**
1044 * Creates a pipeline object to be used in a compute workflow.
1045 *
1046 * Shader resource bindings must be authored to follow a particular order. For
1047 * SPIR-V shaders, use the following resource sets: 0: Read-only storage
1048 * textures, followed by read-only storage buffers 1: Write-only storage
1049 * textures, followed by write-only storage buffers 2: Uniform buffers
1050 *
1051 * For DXBC Shader Model 5_0 shaders, use the following register order: For t
1052 * registers: Read-only storage textures, followed by read-only storage
1053 * buffers For u registers: Write-only storage textures, followed by
1054 * write-only storage buffers For b registers: Uniform buffers
1055 *
1056 * For DXIL shaders, use the following register order: (t[n], space0):
1057 * Read-only storage textures, followed by read-only storage buffers (u[n],
1058 * space1): Write-only storage textures, followed by write-only storage
1059 * buffers (b[n], space2): Uniform buffers
1060 *
1061 * For MSL/metallib, use the following order: For [[buffer]]: Uniform buffers,
1062 * followed by write-only storage buffers, followed by write-only storage
1063 * buffers For [[texture]]: Read-only storage textures, followed by write-only
1064 * storage textures
1065 *
1066 * \param device a GPU Context.
1067 * \param computePipelineCreateInfo a struct describing the state of the
1068 * requested compute pipeline.
1069 * \returns a compute pipeline object on success, or NULL on failure.
1070 *
1071 * \since This function is available since SDL 3.0.0.
1072 *
1073 * \sa SDL_BindGPUComputePipeline
1074 * \sa SDL_ReleaseGPUComputePipeline
1075 */
1077 SDL_GPUDevice *device,
1078 SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo);
1079
1080/**
1081 * Creates a pipeline object to be used in a graphics workflow.
1082 *
1083 * \param device a GPU Context.
1084 * \param pipelineCreateInfo a struct describing the state of the desired
1085 * graphics pipeline.
1086 * \returns a graphics pipeline object on success, or NULL on failure.
1087 *
1088 * \since This function is available since SDL 3.0.0.
1089 *
1090 * \sa SDL_CreateGPUShader
1091 * \sa SDL_BindGPUGraphicsPipeline
1092 * \sa SDL_ReleaseGPUGraphicsPipeline
1093 */
1095 SDL_GPUDevice *device,
1096 SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo);
1097
1098/**
1099 * Creates a sampler object to be used when binding textures in a graphics
1100 * workflow.
1101 *
1102 * \param device a GPU Context.
1103 * \param samplerCreateInfo a struct describing the state of the desired
1104 * sampler.
1105 * \returns a sampler object on success, or NULL on failure.
1106 *
1107 * \since This function is available since SDL 3.0.0.
1108 *
1109 * \sa SDL_BindGPUVertexSamplers
1110 * \sa SDL_BindGPUFragmentSamplers
1111 * \sa SDL_ReleaseSampler
1112 */
1113extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler(
1114 SDL_GPUDevice *device,
1115 SDL_GPUSamplerCreateInfo *samplerCreateInfo);
1116
1117/**
1118 * Creates a shader to be used when creating a graphics pipeline.
1119 *
1120 * Shader resource bindings must be authored to follow a particular order
1121 * depending on the shader format.
1122 *
1123 * For SPIR-V shaders, use the following resource sets: For vertex shaders: 0:
1124 * Sampled textures, followed by storage textures, followed by storage buffers
1125 * 1: Uniform buffers For fragment shaders: 2: Sampled textures, followed by
1126 * storage textures, followed by storage buffers 3: Uniform buffers
1127 *
1128 * For DXBC Shader Model 5_0 shaders, use the following register order: For t
1129 * registers: Sampled textures, followed by storage textures, followed by
1130 * storage buffers For s registers: Samplers with indices corresponding to the
1131 * sampled textures For b registers: Uniform buffers
1132 *
1133 * For DXIL shaders, use the following register order: For vertex shaders:
1134 * (t[n], space0): Sampled textures, followed by storage textures, followed by
1135 * storage buffers (s[n], space0): Samplers with indices corresponding to the
1136 * sampled textures (b[n], space1): Uniform buffers For pixel shaders: (t[n],
1137 * space2): Sampled textures, followed by storage textures, followed by
1138 * storage buffers (s[n], space2): Samplers with indices corresponding to the
1139 * sampled textures (b[n], space3): Uniform buffers
1140 *
1141 * For MSL/metallib, use the following order: For [[texture]]: Sampled
1142 * textures, followed by storage textures For [[sampler]]: Samplers with
1143 * indices corresponding to the sampled textures For [[buffer]]: Uniform
1144 * buffers, followed by storage buffers. Vertex buffer 0 is bound at
1145 * [[buffer(30)]], vertex buffer 1 at [[buffer(29)]], and so on. Rather than
1146 * manually authoring vertex buffer indices, use the [[stage_in]] attribute
1147 * which will automatically use the vertex input information from the
1148 * SDL_GPUPipeline.
1149 *
1150 * \param device a GPU Context.
1151 * \param shaderCreateInfo a struct describing the state of the desired
1152 * shader.
1153 * \returns a shader object on success, or NULL on failure.
1154 *
1155 * \since This function is available since SDL 3.0.0.
1156 *
1157 * \sa SDL_CreateGPUGraphicsPipeline
1158 * \sa SDL_ReleaseGPUShader
1159 */
1160extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader(
1161 SDL_GPUDevice *device,
1162 SDL_GPUShaderCreateInfo *shaderCreateInfo);
1163
1164/**
1165 * Creates a texture object to be used in graphics or compute workflows.
1166 *
1167 * The contents of this texture are undefined until data is written to the
1168 * texture.
1169 *
1170 * Note that certain combinations of usage flags are invalid. For example, a
1171 * texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags.
1172 *
1173 * If you request a sample count higher than the hardware supports, the
1174 * implementation will automatically fall back to the highest available sample
1175 * count.
1176 *
1177 * \param device a GPU Context.
1178 * \param textureCreateInfo a struct describing the state of the texture to
1179 * create.
1180 * \returns a texture object on success, or NULL on failure.
1181 *
1182 * \since This function is available since SDL 3.0.0.
1183 *
1184 * \sa SDL_UploadToGPUTexture
1185 * \sa SDL_DownloadFromGPUTexture
1186 * \sa SDL_BindGPUVertexSamplers
1187 * \sa SDL_BindGPUVertexStorageTextures
1188 * \sa SDL_BindGPUFragmentSamplers
1189 * \sa SDL_BindGPUFragmentStorageTextures
1190 * \sa SDL_BindGPUComputeStorageTextures
1191 * \sa SDL_BlitGPUTexture
1192 * \sa SDL_ReleaseGPUTexture
1193 * \sa SDL_GPUTextureSupportsFormat
1194 */
1195extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
1196 SDL_GPUDevice *device,
1197 SDL_GPUTextureCreateInfo *textureCreateInfo);
1198
1199/**
1200 * Creates a buffer object to be used in graphics or compute workflows.
1201 *
1202 * The contents of this buffer are undefined until data is written to the
1203 * buffer.
1204 *
1205 * Note that certain combinations of usage flags are invalid. For example, a
1206 * buffer cannot have both the VERTEX and INDEX flags.
1207 *
1208 * \param device a GPU Context.
1209 * \param bufferCreateInfo a struct describing the state of the buffer to
1210 * create.
1211 * \returns a buffer object on success, or NULL on failure.
1212 *
1213 * \since This function is available since SDL 3.0.0.
1214 *
1215 * \sa SDL_UploadToGPUBuffer
1216 * \sa SDL_BindGPUVertexBuffers
1217 * \sa SDL_BindGPUIndexBuffer
1218 * \sa SDL_BindGPUVertexStorageBuffers
1219 * \sa SDL_BindGPUFragmentStorageBuffers
1220 * \sa SDL_BindGPUComputeStorageBuffers
1221 * \sa SDL_ReleaseGPUBuffer
1222 */
1223extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer(
1224 SDL_GPUDevice *device,
1225 SDL_GPUBufferCreateInfo *bufferCreateInfo);
1226
1227/**
1228 * Creates a transfer buffer to be used when uploading to or downloading from
1229 * graphics resources.
1230 *
1231 * \param device a GPU Context.
1232 * \param transferBufferCreateInfo a struct describing the state of the
1233 * transfer buffer to create.
1234 * \returns a transfer buffer on success, or NULL on failure.
1235 *
1236 * \since This function is available since SDL 3.0.0.
1237 *
1238 * \sa SDL_UploadToGPUBuffer
1239 * \sa SDL_DownloadFromGPUBuffer
1240 * \sa SDL_UploadToGPUTexture
1241 * \sa SDL_DownloadFromGPUTexture
1242 * \sa SDL_ReleaseGPUTransferBuffer
1243 */
1245 SDL_GPUDevice *device,
1246 SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo);
1247
1248/* Debug Naming */
1249
1250/**
1251 * Sets an arbitrary string constant to label a buffer.
1252 *
1253 * Useful for debugging.
1254 *
1255 * \param device a GPU Context.
1256 * \param buffer a buffer to attach the name to.
1257 * \param text a UTF-8 string constant to mark as the name of the buffer.
1258 *
1259 * \since This function is available since SDL 3.0.0.
1260 */
1261extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName(
1262 SDL_GPUDevice *device,
1263 SDL_GPUBuffer *buffer,
1264 const char *text);
1265
1266/**
1267 * Sets an arbitrary string constant to label a texture.
1268 *
1269 * Useful for debugging.
1270 *
1271 * \param device a GPU Context.
1272 * \param texture a texture to attach the name to.
1273 * \param text a UTF-8 string constant to mark as the name of the texture.
1274 *
1275 * \since This function is available since SDL 3.0.0.
1276 */
1277extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName(
1278 SDL_GPUDevice *device,
1279 SDL_GPUTexture *texture,
1280 const char *text);
1281
1282/**
1283 * Inserts an arbitrary string label into the command buffer callstream.
1284 *
1285 * Useful for debugging.
1286 *
1287 * \param commandBuffer a command buffer.
1288 * \param text a UTF-8 string constant to insert as the label.
1289 *
1290 * \since This function is available since SDL 3.0.0.
1291 */
1292extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel(
1293 SDL_GPUCommandBuffer *commandBuffer,
1294 const char *text);
1295
1296/**
1297 * Begins a debug group with an arbitary name.
1298 *
1299 * Used for denoting groups of calls when viewing the command buffer
1300 * callstream in a graphics debugging tool.
1301 *
1302 * Each call to SDL_PushGPUDebugGroup must have a corresponding call to
1303 * SDL_PopGPUDebugGroup.
1304 *
1305 * On some backends (e.g. Metal), pushing a debug group during a
1306 * render/blit/compute pass will create a group that is scoped to the native
1307 * pass rather than the command buffer. For best results, if you push a debug
1308 * group during a pass, always pop it in the same pass.
1309 *
1310 * \param commandBuffer a command buffer.
1311 * \param name a UTF-8 string constant that names the group.
1312 *
1313 * \since This function is available since SDL 3.0.0.
1314 *
1315 * \sa SDL_PopGPUDebugGroup
1316 */
1317extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup(
1318 SDL_GPUCommandBuffer *commandBuffer,
1319 const char *name);
1320
1321/**
1322 * Ends the most-recently pushed debug group.
1323 *
1324 * \param commandBuffer a command buffer.
1325 *
1326 * \since This function is available since SDL 3.0.0.
1327 *
1328 * \sa SDL_PushGPUDebugGroup
1329 */
1330extern SDL_DECLSPEC void SDLCALL SDL_PopGPUDebugGroup(
1331 SDL_GPUCommandBuffer *commandBuffer);
1332
1333/* Disposal */
1334
1335/**
1336 * Frees the given texture as soon as it is safe to do so.
1337 *
1338 * You must not reference the texture after calling this function.
1339 *
1340 * \param device a GPU context.
1341 * \param texture a texture to be destroyed.
1342 *
1343 * \since This function is available since SDL 3.0.0.
1344 */
1345extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTexture(
1346 SDL_GPUDevice *device,
1347 SDL_GPUTexture *texture);
1348
1349/**
1350 * Frees the given sampler as soon as it is safe to do so.
1351 *
1352 * You must not reference the texture after calling this function.
1353 *
1354 * \param device a GPU context.
1355 * \param sampler a sampler to be destroyed.
1356 *
1357 * \since This function is available since SDL 3.0.0.
1358 */
1359extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUSampler(
1360 SDL_GPUDevice *device,
1361 SDL_GPUSampler *sampler);
1362
1363/**
1364 * Frees the given buffer as soon as it is safe to do so.
1365 *
1366 * You must not reference the buffer after calling this function.
1367 *
1368 * \param device a GPU context.
1369 * \param buffer a buffer to be destroyed.
1370 *
1371 * \since This function is available since SDL 3.0.0.
1372 */
1373extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUBuffer(
1374 SDL_GPUDevice *device,
1375 SDL_GPUBuffer *buffer);
1376
1377/**
1378 * Frees the given transfer buffer as soon as it is safe to do so.
1379 *
1380 * You must not reference the transfer buffer after calling this function.
1381 *
1382 * \param device a GPU context.
1383 * \param transferBuffer a transfer buffer to be destroyed.
1384 *
1385 * \since This function is available since SDL 3.0.0.
1386 */
1387extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTransferBuffer(
1388 SDL_GPUDevice *device,
1389 SDL_GPUTransferBuffer *transferBuffer);
1390
1391/**
1392 * Frees the given compute pipeline as soon as it is safe to do so.
1393 *
1394 * You must not reference the compute pipeline after calling this function.
1395 *
1396 * \param device a GPU context.
1397 * \param computePipeline a compute pipeline to be destroyed.
1398 *
1399 * \since This function is available since SDL 3.0.0.
1400 */
1401extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUComputePipeline(
1402 SDL_GPUDevice *device,
1403 SDL_GPUComputePipeline *computePipeline);
1404
1405/**
1406 * Frees the given shader as soon as it is safe to do so.
1407 *
1408 * You must not reference the shader after calling this function.
1409 *
1410 * \param device a GPU context.
1411 * \param shader a shader to be destroyed.
1412 *
1413 * \since This function is available since SDL 3.0.0.
1414 */
1415extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUShader(
1416 SDL_GPUDevice *device,
1417 SDL_GPUShader *shader);
1418
1419/**
1420 * Frees the given graphics pipeline as soon as it is safe to do so.
1421 *
1422 * You must not reference the graphics pipeline after calling this function.
1423 *
1424 * \param device a GPU context.
1425 * \param graphicsPipeline a graphics pipeline to be destroyed.
1426 *
1427 * \since This function is available since SDL 3.0.0.
1428 */
1429extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline(
1430 SDL_GPUDevice *device,
1431 SDL_GPUGraphicsPipeline *graphicsPipeline);
1432
1433/*
1434 * COMMAND BUFFERS
1435 *
1436 * Render state is managed via command buffers.
1437 * When setting render state, that state is always local to the command buffer.
1438 *
1439 * Commands only begin execution on the GPU once Submit is called.
1440 * Once the command buffer is submitted, it is no longer valid to use it.
1441 *
1442 * Command buffers are executed in submission order. If you submit command buffer A and then command buffer B
1443 * all commands in A will begin executing before any command in B begins executing.
1444 *
1445 * In multi-threading scenarios, you should acquire and submit a command buffer on the same thread.
1446 * As long as you satisfy this requirement, all functionality related to command buffers is thread-safe.
1447 */
1448
1449/**
1450 * Acquire a command buffer.
1451 *
1452 * This command buffer is managed by the implementation and should not be
1453 * freed by the user. The command buffer may only be used on the thread it was
1454 * acquired on. The command buffer should be submitted on the thread it was
1455 * acquired on.
1456 *
1457 * \param device a GPU context.
1458 * \returns a command buffer.
1459 *
1460 * \since This function is available since SDL 3.0.0.
1461 *
1462 * \sa SDL_SubmitGPUCommandBuffer
1463 * \sa SDL_SubmitGPUCommandBufferAndAcquireFence
1464 */
1466 SDL_GPUDevice *device);
1467
1468/*
1469 * UNIFORM DATA
1470 *
1471 * Uniforms are for passing data to shaders.
1472 * The uniform data will be constant across all executions of the shader.
1473 *
1474 * There are 4 available uniform slots per shader stage (vertex, fragment, compute).
1475 * Uniform data pushed to a slot on a stage keeps its value throughout the command buffer
1476 * until you call the relevant Push function on that slot again.
1477 *
1478 * For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0,
1479 * push the camera matrix at the start of the command buffer, and that data will be used for every
1480 * subsequent draw call.
1481 *
1482 * It is valid to push uniform data during a render or compute pass.
1483 *
1484 * Uniforms are best for pushing small amounts of data.
1485 * If you are pushing more than a matrix or two per call you should consider using a storage buffer instead.
1486 */
1487
1488/**
1489 * Pushes data to a vertex uniform slot on the command buffer.
1490 *
1491 * Subsequent draw calls will use this uniform data.
1492 *
1493 * \param commandBuffer a command buffer.
1494 * \param slotIndex the vertex uniform slot to push data to.
1495 * \param data client data to write.
1496 * \param dataLengthInBytes the length of the data to write.
1497 *
1498 * \since This function is available since SDL 3.0.0.
1499 */
1500extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData(
1501 SDL_GPUCommandBuffer *commandBuffer,
1502 Uint32 slotIndex,
1503 const void *data,
1504 Uint32 dataLengthInBytes);
1505
1506/**
1507 * Pushes data to a fragment uniform slot on the command buffer.
1508 *
1509 * Subsequent draw calls will use this uniform data.
1510 *
1511 * \param commandBuffer a command buffer.
1512 * \param slotIndex the fragment uniform slot to push data to.
1513 * \param data client data to write.
1514 * \param dataLengthInBytes the length of the data to write.
1515 *
1516 * \since This function is available since SDL 3.0.0.
1517 */
1518extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData(
1519 SDL_GPUCommandBuffer *commandBuffer,
1520 Uint32 slotIndex,
1521 const void *data,
1522 Uint32 dataLengthInBytes);
1523
1524/**
1525 * Pushes data to a uniform slot on the command buffer.
1526 *
1527 * Subsequent draw calls will use this uniform data.
1528 *
1529 * \param commandBuffer a command buffer.
1530 * \param slotIndex the uniform slot to push data to.
1531 * \param data client data to write.
1532 * \param dataLengthInBytes the length of the data to write.
1533 *
1534 * \since This function is available since SDL 3.0.0.
1535 */
1536extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData(
1537 SDL_GPUCommandBuffer *commandBuffer,
1538 Uint32 slotIndex,
1539 const void *data,
1540 Uint32 dataLengthInBytes);
1541
1542/*
1543 * A NOTE ON CYCLING
1544 *
1545 * When using a command buffer, operations do not occur immediately -
1546 * they occur some time after the command buffer is submitted.
1547 *
1548 * When a resource is used in a pending or active command buffer, it is considered to be "bound".
1549 * When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound".
1550 *
1551 * If data resources are bound, it is unspecified when that data will be unbound
1552 * unless you acquire a fence when submitting the command buffer and wait on it.
1553 * However, this doesn't mean you need to track resource usage manually.
1554 *
1555 * All of the functions and structs that involve writing to a resource have a "cycle" bool.
1556 * GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources.
1557 * When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource,
1558 * or if none are available, a new one is created.
1559 * This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed.
1560 *
1561 * For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture.
1562 * The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have
1563 * to worry about overwriting any data that is not yet uploaded.
1564 *
1565 * Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames.
1566 * If you set cycle to SDL_TRUE in the ColorAttachmentInfo struct, you can prevent this data dependency.
1567 *
1568 * Cycling will never undefine already bound data.
1569 * When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again.
1570 * You must take care not to read undefined data.
1571 *
1572 * Note that when cycling a texture, the entire texture will be cycled,
1573 * even if only part of the texture is used in the call,
1574 * so you must consider the entire texture to contain undefined data after cycling.
1575 *
1576 * You must also take care not to overwrite a section of data that has been referenced in a command without cycling first.
1577 * It is OK to overwrite unreferenced data in a bound resource without cycling,
1578 * but overwriting a section of data that has already been referenced will produce unexpected results.
1579 */
1580
1581/* Graphics State */
1582
1583/**
1584 * Begins a render pass on a command buffer.
1585 *
1586 * A render pass consists of a set of texture subresources (or depth slices in
1587 * the 3D texture case) which will be rendered to during the render pass,
1588 * along with corresponding clear values and load/store operations. All
1589 * operations related to graphics pipelines must take place inside of a render
1590 * pass. A default viewport and scissor state are automatically set when this
1591 * is called. You cannot begin another render pass, or begin a compute pass or
1592 * copy pass until you have ended the render pass.
1593 *
1594 * \param commandBuffer a command buffer.
1595 * \param colorAttachmentInfos an array of texture subresources with
1596 * corresponding clear values and load/store ops.
1597 * \param colorAttachmentCount the number of color attachments in the
1598 * colorAttachmentInfos array.
1599 * \param depthStencilAttachmentInfo a texture subresource with corresponding
1600 * clear value and load/store ops, may be
1601 * NULL.
1602 * \returns a render pass handle.
1603 *
1604 * \since This function is available since SDL 3.0.0.
1605 *
1606 * \sa SDL_EndGPURenderPass
1607 */
1608extern SDL_DECLSPEC SDL_GPURenderPass *SDLCALL SDL_BeginGPURenderPass(
1609 SDL_GPUCommandBuffer *commandBuffer,
1610 SDL_GPUColorAttachmentInfo *colorAttachmentInfos,
1611 Uint32 colorAttachmentCount,
1612 SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo);
1613
1614/**
1615 * Binds a graphics pipeline on a render pass to be used in rendering.
1616 *
1617 * A graphics pipeline must be bound before making any draw calls.
1618 *
1619 * \param renderPass a render pass handle.
1620 * \param graphicsPipeline the graphics pipeline to bind.
1621 *
1622 * \since This function is available since SDL 3.0.0.
1623 */
1624extern SDL_DECLSPEC void SDLCALL SDL_BindGPUGraphicsPipeline(
1625 SDL_GPURenderPass *renderPass,
1626 SDL_GPUGraphicsPipeline *graphicsPipeline);
1627
1628/**
1629 * Sets the current viewport state on a command buffer.
1630 *
1631 * \param renderPass a render pass handle.
1632 * \param viewport the viewport to set.
1633 *
1634 * \since This function is available since SDL 3.0.0.
1635 */
1636extern SDL_DECLSPEC void SDLCALL SDL_SetGPUViewport(
1637 SDL_GPURenderPass *renderPass,
1638 SDL_GPUViewport *viewport);
1639
1640/**
1641 * Sets the current scissor state on a command buffer.
1642 *
1643 * \param renderPass a render pass handle.
1644 * \param scissor the scissor area to set.
1645 *
1646 * \since This function is available since SDL 3.0.0.
1647 */
1648extern SDL_DECLSPEC void SDLCALL SDL_SetGPUScissor(
1649 SDL_GPURenderPass *renderPass,
1650 SDL_Rect *scissor);
1651
1652/**
1653 * Binds vertex buffers on a command buffer for use with subsequent draw
1654 * calls.
1655 *
1656 * \param renderPass a render pass handle.
1657 * \param firstBinding the starting bind point for the vertex buffers.
1658 * \param pBindings an array of SDL_GPUBufferBinding structs containing vertex
1659 * buffers and offset values.
1660 * \param bindingCount the number of bindings in the pBindings array.
1661 *
1662 * \since This function is available since SDL 3.0.0.
1663 */
1664extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexBuffers(
1665 SDL_GPURenderPass *renderPass,
1666 Uint32 firstBinding,
1667 SDL_GPUBufferBinding *pBindings,
1668 Uint32 bindingCount);
1669
1670/**
1671 * Binds an index buffer on a command buffer for use with subsequent draw
1672 * calls.
1673 *
1674 * \param renderPass a render pass handle.
1675 * \param pBinding a pointer to a struct containing an index buffer and
1676 * offset.
1677 * \param indexElementSize whether the index values in the buffer are 16- or
1678 * 32-bit.
1679 *
1680 * \since This function is available since SDL 3.0.0.
1681 */
1682extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer(
1683 SDL_GPURenderPass *renderPass,
1684 SDL_GPUBufferBinding *pBinding,
1685 SDL_GPUIndexElementSize indexElementSize);
1686
1687/**
1688 * Binds texture-sampler pairs for use on the vertex shader.
1689 *
1690 * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
1691 *
1692 * \param renderPass a render pass handle.
1693 * \param firstSlot the vertex sampler slot to begin binding from.
1694 * \param textureSamplerBindings an array of texture-sampler binding structs.
1695 * \param bindingCount the number of texture-sampler pairs to bind from the
1696 * array.
1697 *
1698 * \since This function is available since SDL 3.0.0.
1699 */
1700extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers(
1701 SDL_GPURenderPass *renderPass,
1702 Uint32 firstSlot,
1703 SDL_GPUTextureSamplerBinding *textureSamplerBindings,
1704 Uint32 bindingCount);
1705
1706/**
1707 * Binds storage textures for use on the vertex shader.
1708 *
1709 * These textures must have been created with
1710 * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
1711 *
1712 * \param renderPass a render pass handle.
1713 * \param firstSlot the vertex storage texture slot to begin binding from.
1714 * \param storageTextures an array of storage textures.
1715 * \param bindingCount the number of storage texture to bind from the array.
1716 *
1717 * \since This function is available since SDL 3.0.0.
1718 */
1719extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures(
1720 SDL_GPURenderPass *renderPass,
1721 Uint32 firstSlot,
1722 SDL_GPUTexture **storageTextures,
1723 Uint32 bindingCount);
1724
1725/**
1726 * Binds storage buffers for use on the vertex shader.
1727 *
1728 * These buffers must have been created with
1729 * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
1730 *
1731 * \param renderPass a render pass handle.
1732 * \param firstSlot the vertex storage buffer slot to begin binding from.
1733 * \param storageBuffers an array of buffers.
1734 * \param bindingCount the number of buffers to bind from the array.
1735 *
1736 * \since This function is available since SDL 3.0.0.
1737 */
1738extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers(
1739 SDL_GPURenderPass *renderPass,
1740 Uint32 firstSlot,
1741 SDL_GPUBuffer **storageBuffers,
1742 Uint32 bindingCount);
1743
1744/**
1745 * Binds texture-sampler pairs for use on the fragment shader.
1746 *
1747 * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
1748 *
1749 * \param renderPass a render pass handle.
1750 * \param firstSlot the fragment sampler slot to begin binding from.
1751 * \param textureSamplerBindings an array of texture-sampler binding structs.
1752 * \param bindingCount the number of texture-sampler pairs to bind from the
1753 * array.
1754 *
1755 * \since This function is available since SDL 3.0.0.
1756 */
1757extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers(
1758 SDL_GPURenderPass *renderPass,
1759 Uint32 firstSlot,
1760 SDL_GPUTextureSamplerBinding *textureSamplerBindings,
1761 Uint32 bindingCount);
1762
1763/**
1764 * Binds storage textures for use on the fragment shader.
1765 *
1766 * These textures must have been created with
1767 * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
1768 *
1769 * \param renderPass a render pass handle.
1770 * \param firstSlot the fragment storage texture slot to begin binding from.
1771 * \param storageTextures an array of storage textures.
1772 * \param bindingCount the number of storage textures to bind from the array.
1773 *
1774 * \since This function is available since SDL 3.0.0.
1775 */
1776extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures(
1777 SDL_GPURenderPass *renderPass,
1778 Uint32 firstSlot,
1779 SDL_GPUTexture **storageTextures,
1780 Uint32 bindingCount);
1781
1782/**
1783 * Binds storage buffers for use on the fragment shader.
1784 *
1785 * These buffers must have been created with
1786 * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
1787 *
1788 * \param renderPass a render pass handle.
1789 * \param firstSlot the fragment storage buffer slot to begin binding from.
1790 * \param storageBuffers an array of storage buffers.
1791 * \param bindingCount the number of storage buffers to bind from the array.
1792 *
1793 * \since This function is available since SDL 3.0.0.
1794 */
1795extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageBuffers(
1796 SDL_GPURenderPass *renderPass,
1797 Uint32 firstSlot,
1798 SDL_GPUBuffer **storageBuffers,
1799 Uint32 bindingCount);
1800
1801/* Drawing */
1802
1803/**
1804 * Draws data using bound graphics state with an index buffer and instancing
1805 * enabled.
1806 *
1807 * You must not call this function before binding a graphics pipeline.
1808 *
1809 * Note that the `firstVertex` and `firstInstance` parameters are NOT
1810 * compatible with built-in vertex/instance ID variables in shaders (for
1811 * example, SV_VertexID). If your shader depends on these variables, the
1812 * correlating draw call parameter MUST be 0.
1813 *
1814 * \param renderPass a render pass handle.
1815 * \param indexCount the number of vertices to draw per instance.
1816 * \param instanceCount the number of instances to draw.
1817 * \param firstIndex the starting index within the index buffer.
1818 * \param vertexOffset value added to vertex index before indexing into the
1819 * vertex buffer.
1820 * \param firstInstance the ID of the first instance to draw.
1821 *
1822 * \since This function is available since SDL 3.0.0.
1823 */
1824extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitives(
1825 SDL_GPURenderPass *renderPass,
1826 Uint32 indexCount,
1827 Uint32 instanceCount,
1828 Uint32 firstIndex,
1829 Sint32 vertexOffset,
1830 Uint32 firstInstance);
1831
1832/**
1833 * Draws data using bound graphics state.
1834 *
1835 * You must not call this function before binding a graphics pipeline.
1836 *
1837 * Note that the `firstVertex` and `firstInstance` parameters are NOT
1838 * compatible with built-in vertex/instance ID variables in shaders (for
1839 * example, SV_VertexID). If your shader depends on these variables, the
1840 * correlating draw call parameter MUST be 0.
1841 *
1842 * \param renderPass a render pass handle.
1843 * \param vertexCount the number of vertices to draw.
1844 * \param instanceCount the number of instances that will be drawn.
1845 * \param firstVertex the index of the first vertex to draw.
1846 * \param firstInstance the ID of the first instance to draw.
1847 *
1848 * \since This function is available since SDL 3.0.0.
1849 */
1850extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitives(
1851 SDL_GPURenderPass *renderPass,
1852 Uint32 vertexCount,
1853 Uint32 instanceCount,
1854 Uint32 firstVertex,
1855 Uint32 firstInstance);
1856
1857/**
1858 * Draws data using bound graphics state and with draw parameters set from a
1859 * buffer.
1860 *
1861 * The buffer layout should match the layout of SDL_GPUIndirectDrawCommand.
1862 * You must not call this function before binding a graphics pipeline.
1863 *
1864 * \param renderPass a render pass handle.
1865 * \param buffer a buffer containing draw parameters.
1866 * \param offsetInBytes the offset to start reading from the draw buffer.
1867 * \param drawCount the number of draw parameter sets that should be read from
1868 * the draw buffer.
1869 * \param stride the byte stride between sets of draw parameters.
1870 *
1871 * \since This function is available since SDL 3.0.0.
1872 */
1873extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitivesIndirect(
1874 SDL_GPURenderPass *renderPass,
1875 SDL_GPUBuffer *buffer,
1876 Uint32 offsetInBytes,
1877 Uint32 drawCount,
1878 Uint32 stride);
1879
1880/**
1881 * Draws data using bound graphics state with an index buffer enabled and with
1882 * draw parameters set from a buffer.
1883 *
1884 * The buffer layout should match the layout of
1885 * SDL_GPUIndexedIndirectDrawCommand. You must not call this function before
1886 * binding a graphics pipeline.
1887 *
1888 * \param renderPass a render pass handle.
1889 * \param buffer a buffer containing draw parameters.
1890 * \param offsetInBytes the offset to start reading from the draw buffer.
1891 * \param drawCount the number of draw parameter sets that should be read from
1892 * the draw buffer.
1893 * \param stride the byte stride between sets of draw parameters.
1894 *
1895 * \since This function is available since SDL 3.0.0.
1896 */
1897extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitivesIndirect(
1898 SDL_GPURenderPass *renderPass,
1899 SDL_GPUBuffer *buffer,
1900 Uint32 offsetInBytes,
1901 Uint32 drawCount,
1902 Uint32 stride);
1903
1904/**
1905 * Ends the given render pass.
1906 *
1907 * All bound graphics state on the render pass command buffer is unset. The
1908 * render pass handle is now invalid.
1909 *
1910 * \param renderPass a render pass handle.
1911 *
1912 * \since This function is available since SDL 3.0.0.
1913 */
1914extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass(
1915 SDL_GPURenderPass *renderPass);
1916
1917/* Compute Pass */
1918
1919/**
1920 * Begins a compute pass on a command buffer.
1921 *
1922 * A compute pass is defined by a set of texture subresources and buffers that
1923 * will be written to by compute pipelines. These textures and buffers must
1924 * have been created with the COMPUTE_STORAGE_WRITE bit. All operations
1925 * related to compute pipelines must take place inside of a compute pass. You
1926 * must not begin another compute pass, or a render pass or copy pass before
1927 * ending the compute pass.
1928 *
1929 * A VERY IMPORTANT NOTE Textures and buffers bound as write-only MUST NOT be
1930 * read from during the compute pass. Doing so will result in undefined
1931 * behavior. If your compute work requires reading the output from a previous
1932 * dispatch, you MUST end the current compute pass and begin a new one before
1933 * you can safely access the data.
1934 *
1935 * \param commandBuffer a command buffer.
1936 * \param storageTextureBindings an array of writeable storage texture binding
1937 * structs.
1938 * \param storageTextureBindingCount the number of storage textures to bind
1939 * from the array.
1940 * \param storageBufferBindings an array of writeable storage buffer binding
1941 * structs.
1942 * \param storageBufferBindingCount the number of storage buffers to bind from
1943 * the array.
1944 * \returns a compute pass handle.
1945 *
1946 * \since This function is available since SDL 3.0.0.
1947 *
1948 * \sa SDL_EndGPUComputePass
1949 */
1950extern SDL_DECLSPEC SDL_GPUComputePass *SDLCALL SDL_BeginGPUComputePass(
1951 SDL_GPUCommandBuffer *commandBuffer,
1952 SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings,
1953 Uint32 storageTextureBindingCount,
1954 SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings,
1955 Uint32 storageBufferBindingCount);
1956
1957/**
1958 * Binds a compute pipeline on a command buffer for use in compute dispatch.
1959 *
1960 * \param computePass a compute pass handle.
1961 * \param computePipeline a compute pipeline to bind.
1962 *
1963 * \since This function is available since SDL 3.0.0.
1964 */
1965extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline(
1966 SDL_GPUComputePass *computePass,
1967 SDL_GPUComputePipeline *computePipeline);
1968
1969/**
1970 * Binds storage textures as readonly for use on the compute pipeline.
1971 *
1972 * These textures must have been created with
1973 * SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ.
1974 *
1975 * \param computePass a compute pass handle.
1976 * \param firstSlot the compute storage texture slot to begin binding from.
1977 * \param storageTextures an array of storage textures.
1978 * \param bindingCount the number of storage textures to bind from the array.
1979 *
1980 * \since This function is available since SDL 3.0.0.
1981 */
1982extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures(
1983 SDL_GPUComputePass *computePass,
1984 Uint32 firstSlot,
1985 SDL_GPUTexture **storageTextures,
1986 Uint32 bindingCount);
1987
1988/**
1989 * Binds storage buffers as readonly for use on the compute pipeline.
1990 *
1991 * These buffers must have been created with
1992 * SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ.
1993 *
1994 * \param computePass a compute pass handle.
1995 * \param firstSlot the compute storage buffer slot to begin binding from.
1996 * \param storageBuffers an array of storage buffer binding structs.
1997 * \param bindingCount the number of storage buffers to bind from the array.
1998 *
1999 * \since This function is available since SDL 3.0.0.
2000 */
2001extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers(
2002 SDL_GPUComputePass *computePass,
2003 Uint32 firstSlot,
2004 SDL_GPUBuffer **storageBuffers,
2005 Uint32 bindingCount);
2006
2007/**
2008 * Dispatches compute work.
2009 *
2010 * You must not call this function before binding a compute pipeline.
2011 *
2012 * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and
2013 * the dispatches write to the same resource region as each other, there is no
2014 * guarantee of which order the writes will occur. If the write order matters,
2015 * you MUST end the compute pass and begin another one.
2016 *
2017 * \param computePass a compute pass handle.
2018 * \param groupCountX number of local workgroups to dispatch in the X
2019 * dimension.
2020 * \param groupCountY number of local workgroups to dispatch in the Y
2021 * dimension.
2022 * \param groupCountZ number of local workgroups to dispatch in the Z
2023 * dimension.
2024 *
2025 * \since This function is available since SDL 3.0.0.
2026 */
2027extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUCompute(
2028 SDL_GPUComputePass *computePass,
2029 Uint32 groupCountX,
2030 Uint32 groupCountY,
2031 Uint32 groupCountZ);
2032
2033/**
2034 * Dispatches compute work with parameters set from a buffer.
2035 *
2036 * The buffer layout should match the layout of
2037 * SDL_GPUIndirectDispatchCommand. You must not call this function before
2038 * binding a compute pipeline.
2039 *
2040 * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and
2041 * the dispatches write to the same resource region as each other, there is no
2042 * guarantee of which order the writes will occur. If the write order matters,
2043 * you MUST end the compute pass and begin another one.
2044 *
2045 * \param computePass a compute pass handle.
2046 * \param buffer a buffer containing dispatch parameters.
2047 * \param offsetInBytes the offset to start reading from the dispatch buffer.
2048 *
2049 * \since This function is available since SDL 3.0.0.
2050 */
2051extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUComputeIndirect(
2052 SDL_GPUComputePass *computePass,
2053 SDL_GPUBuffer *buffer,
2054 Uint32 offsetInBytes);
2055
2056/**
2057 * Ends the current compute pass.
2058 *
2059 * All bound compute state on the command buffer is unset. The compute pass
2060 * handle is now invalid.
2061 *
2062 * \param computePass a compute pass handle.
2063 *
2064 * \since This function is available since SDL 3.0.0.
2065 */
2066extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
2067 SDL_GPUComputePass *computePass);
2068
2069/* TransferBuffer Data */
2070
2071/**
2072 * Maps a transfer buffer into application address space.
2073 *
2074 * You must unmap the transfer buffer before encoding upload commands.
2075 *
2076 * \param device a GPU context.
2077 * \param transferBuffer a transfer buffer.
2078 * \param cycle if SDL_TRUE, cycles the transfer buffer if it is bound.
2079 * \returns the address of the mapped transfer buffer memory.
2080 *
2081 * \since This function is available since SDL 3.0.0.
2082 */
2083extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer(
2084 SDL_GPUDevice *device,
2085 SDL_GPUTransferBuffer *transferBuffer,
2086 SDL_bool cycle);
2087
2088/**
2089 * Unmaps a previously mapped transfer buffer.
2090 *
2091 * \param device a GPU context.
2092 * \param transferBuffer a previously mapped transfer buffer.
2093 *
2094 * \since This function is available since SDL 3.0.0.
2095 */
2096extern SDL_DECLSPEC void SDLCALL SDL_UnmapGPUTransferBuffer(
2097 SDL_GPUDevice *device,
2098 SDL_GPUTransferBuffer *transferBuffer);
2099
2100/* Copy Pass */
2101
2102/**
2103 * Begins a copy pass on a command buffer.
2104 *
2105 * All operations related to copying to or from buffers or textures take place
2106 * inside a copy pass. You must not begin another copy pass, or a render pass
2107 * or compute pass before ending the copy pass.
2108 *
2109 * \param commandBuffer a command buffer.
2110 * \returns a copy pass handle.
2111 *
2112 * \since This function is available since SDL 3.0.0.
2113 */
2114extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass(
2115 SDL_GPUCommandBuffer *commandBuffer);
2116
2117/**
2118 * Uploads data from a transfer buffer to a texture.
2119 *
2120 * The upload occurs on the GPU timeline. You may assume that the upload has
2121 * finished in subsequent commands.
2122 *
2123 * You must align the data in the transfer buffer to a multiple of the texel
2124 * size of the texture format.
2125 *
2126 * \param copyPass a copy pass handle.
2127 * \param source the source transfer buffer with image layout information.
2128 * \param destination the destination texture region.
2129 * \param cycle if SDL_TRUE, cycles the texture if the texture is bound,
2130 * otherwise overwrites the data.
2131 *
2132 * \since This function is available since SDL 3.0.0.
2133 */
2134extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture(
2135 SDL_GPUCopyPass *copyPass,
2137 SDL_GPUTextureRegion *destination,
2138 SDL_bool cycle);
2139
2140/* Uploads data from a TransferBuffer to a Buffer. */
2141
2142/**
2143 * Uploads data from a transfer buffer to a buffer.
2144 *
2145 * The upload occurs on the GPU timeline. You may assume that the upload has
2146 * finished in subsequent commands.
2147 *
2148 * \param copyPass a copy pass handle.
2149 * \param source the source transfer buffer with offset.
2150 * \param destination the destination buffer with offset and size.
2151 * \param cycle if SDL_TRUE, cycles the buffer if it is bound, otherwise
2152 * overwrites the data.
2153 *
2154 * \since This function is available since SDL 3.0.0.
2155 */
2156extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer(
2157 SDL_GPUCopyPass *copyPass,
2159 SDL_GPUBufferRegion *destination,
2160 SDL_bool cycle);
2161
2162/**
2163 * Performs a texture-to-texture copy.
2164 *
2165 * This copy occurs on the GPU timeline. You may assume the copy has finished
2166 * in subsequent commands.
2167 *
2168 * \param copyPass a copy pass handle.
2169 * \param source a source texture region.
2170 * \param destination a destination texture region.
2171 * \param w the width of the region to copy.
2172 * \param h the height of the region to copy.
2173 * \param d the depth of the region to copy.
2174 * \param cycle if SDL_TRUE, cycles the destination texture if the destination
2175 * texture is bound, otherwise overwrites the data.
2176 *
2177 * \since This function is available since SDL 3.0.0.
2178 */
2179extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture(
2180 SDL_GPUCopyPass *copyPass,
2181 SDL_GPUTextureLocation *source,
2182 SDL_GPUTextureLocation *destination,
2183 Uint32 w,
2184 Uint32 h,
2185 Uint32 d,
2186 SDL_bool cycle);
2187
2188/* Copies data from a buffer to a buffer. */
2189
2190/**
2191 * Performs a buffer-to-buffer copy.
2192 *
2193 * This copy occurs on the GPU timeline. You may assume the copy has finished
2194 * in subsequent commands.
2195 *
2196 * \param copyPass a copy pass handle.
2197 * \param source the buffer and offset to copy from.
2198 * \param destination the buffer and offset to copy to.
2199 * \param size the length of the buffer to copy.
2200 * \param cycle if SDL_TRUE, cycles the destination buffer if it is bound,
2201 * otherwise overwrites the data.
2202 *
2203 * \since This function is available since SDL 3.0.0.
2204 */
2205extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer(
2206 SDL_GPUCopyPass *copyPass,
2207 SDL_GPUBufferLocation *source,
2208 SDL_GPUBufferLocation *destination,
2209 Uint32 size,
2210 SDL_bool cycle);
2211
2212/**
2213 * Copies data from a texture to a transfer buffer on the GPU timeline.
2214 *
2215 * This data is not guaranteed to be copied until the command buffer fence is
2216 * signaled.
2217 *
2218 * \param copyPass a copy pass handle.
2219 * \param source the source texture region.
2220 * \param destination the destination transfer buffer with image layout
2221 * information.
2222 *
2223 * \since This function is available since SDL 3.0.0.
2224 */
2225extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUTexture(
2226 SDL_GPUCopyPass *copyPass,
2227 SDL_GPUTextureRegion *source,
2228 SDL_GPUTextureTransferInfo *destination);
2229
2230/**
2231 * Copies data from a buffer to a transfer buffer on the GPU timeline.
2232 *
2233 * This data is not guaranteed to be copied until the command buffer fence is
2234 * signaled.
2235 *
2236 * \param copyPass a copy pass handle.
2237 * \param source the source buffer with offset and size.
2238 * \param destination the destination transfer buffer with offset.
2239 *
2240 * \since This function is available since SDL 3.0.0.
2241 */
2242extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUBuffer(
2243 SDL_GPUCopyPass *copyPass,
2244 SDL_GPUBufferRegion *source,
2245 SDL_GPUTransferBufferLocation *destination);
2246
2247/**
2248 * Ends the current copy pass.
2249 *
2250 * \param copyPass a copy pass handle.
2251 *
2252 * \since This function is available since SDL 3.0.0.
2253 */
2254extern SDL_DECLSPEC void SDLCALL SDL_EndGPUCopyPass(
2255 SDL_GPUCopyPass *copyPass);
2256
2257/**
2258 * Generates mipmaps for the given texture.
2259 *
2260 * This function must not be called inside of any pass.
2261 *
2262 * \param commandBuffer a commandBuffer.
2263 * \param texture a texture with more than 1 mip level.
2264 *
2265 * \since This function is available since SDL 3.0.0.
2266 */
2267extern SDL_DECLSPEC void SDLCALL SDL_GenerateMipmapsForGPUTexture(
2268 SDL_GPUCommandBuffer *commandBuffer,
2269 SDL_GPUTexture *texture);
2270
2271/**
2272 * Blits from a source texture region to a destination texture region.
2273 *
2274 * This function must not be called inside of any pass.
2275 *
2276 * \param commandBuffer a command buffer.
2277 * \param source the texture region to copy from.
2278 * \param destination the texture region to copy to.
2279 * \param flipMode the flip mode for the source texture region.
2280 * \param filterMode the filter mode that will be used when blitting.
2281 * \param cycle if SDL_TRUE, cycles the destination texture if the destination
2282 * texture is bound, otherwise overwrites the data.
2283 *
2284 * \since This function is available since SDL 3.0.0.
2285 */
2286extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture(
2287 SDL_GPUCommandBuffer *commandBuffer,
2288 SDL_GPUBlitRegion *source,
2289 SDL_GPUBlitRegion *destination,
2290 SDL_FlipMode flipMode,
2291 SDL_GPUFilter filterMode,
2292 SDL_bool cycle);
2293
2294/* Submission/Presentation */
2295
2296/**
2297 * Determines whether a swapchain composition is supported by the window.
2298 *
2299 * The window must be claimed before calling this function.
2300 *
2301 * \param device a GPU context.
2302 * \param window an SDL_Window.
2303 * \param swapchainComposition the swapchain composition to check.
2304 * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
2305 *
2306 * \since This function is available since SDL 3.0.0.
2307 *
2308 * \sa SDL_ClaimWindowForGPUDevice
2309 */
2311 SDL_GPUDevice *device,
2312 SDL_Window *window,
2313 SDL_GPUSwapchainComposition swapchainComposition);
2314
2315/**
2316 * Determines whether a presentation mode is supported by the window.
2317 *
2318 * The window must be claimed before calling this function.
2319 *
2320 * \param device a GPU context.
2321 * \param window an SDL_Window.
2322 * \param presentMode the presentation mode to check.
2323 * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
2324 *
2325 * \since This function is available since SDL 3.0.0.
2326 *
2327 * \sa SDL_ClaimWindowForGPUDevice
2328 */
2329extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode(
2330 SDL_GPUDevice *device,
2331 SDL_Window *window,
2332 SDL_GPUPresentMode presentMode);
2333
2334/**
2335 * Claims a window, creating a swapchain structure for it.
2336 *
2337 * This must be called before SDL_AcquireGPUSwapchainTexture is called using
2338 * the window.
2339 *
2340 * The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and
2341 * SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain
2342 * parameters, you must call SetSwapchainParameters after claiming the window.
2343 *
2344 * \param device a GPU context.
2345 * \param window an SDL_Window.
2346 * \returns SDL_TRUE on success, otherwise SDL_FALSE.
2347 *
2348 * \since This function is available since SDL 3.0.0.
2349 *
2350 * \sa SDL_AcquireGPUSwapchainTexture
2351 * \sa SDL_ReleaseWindowFromGPUDevice
2352 * \sa SDL_WindowSupportsGPUPresentMode
2353 * \sa SDL_WindowSupportsGPUSwapchainComposition
2354 */
2355extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice(
2356 SDL_GPUDevice *device,
2357 SDL_Window *window);
2358
2359/**
2360 * Unclaims a window, destroying its swapchain structure.
2361 *
2362 * \param device a GPU context.
2363 * \param window an SDL_Window that has been claimed.
2364 *
2365 * \since This function is available since SDL 3.0.0.
2366 *
2367 * \sa SDL_ClaimWindowForGPUDevice
2368 */
2369extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice(
2370 SDL_GPUDevice *device,
2371 SDL_Window *window);
2372
2373/**
2374 * Changes the swapchain parameters for the given claimed window.
2375 *
2376 * This function will fail if the requested present mode or swapchain
2377 * composition are unsupported by the device. Check if the parameters are
2378 * supported via SDL_WindowSupportsGPUPresentMode /
2379 * SDL_WindowSupportsGPUSwapchainComposition prior to calling this function.
2380 *
2381 * SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always
2382 * supported.
2383 *
2384 * \param device a GPU context.
2385 * \param window an SDL_Window that has been claimed.
2386 * \param swapchainComposition the desired composition of the swapchain.
2387 * \param presentMode the desired present mode for the swapchain.
2388 * \returns SDL_TRUE if successful, SDL_FALSE on error.
2389 *
2390 * \since This function is available since SDL 3.0.0.
2391 *
2392 * \sa SDL_WindowSupportsGPUPresentMode
2393 * \sa SDL_WindowSupportsGPUSwapchainComposition
2394 */
2395extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters(
2396 SDL_GPUDevice *device,
2397 SDL_Window *window,
2398 SDL_GPUSwapchainComposition swapchainComposition,
2399 SDL_GPUPresentMode presentMode);
2400
2401/**
2402 * Obtains the texture format of the swapchain for the given window.
2403 *
2404 * \param device a GPU context.
2405 * \param window an SDL_Window that has been claimed.
2406 * \returns the texture format of the swapchain.
2407 *
2408 * \since This function is available since SDL 3.0.0.
2409 */
2411 SDL_GPUDevice *device,
2412 SDL_Window *window);
2413
2414/**
2415 * Acquire a texture to use in presentation.
2416 *
2417 * When a swapchain texture is acquired on a command buffer, it will
2418 * automatically be submitted for presentation when the command buffer is
2419 * submitted. The swapchain texture should only be referenced by the command
2420 * buffer used to acquire it. May return NULL under certain conditions. This
2421 * is not necessarily an error. This texture is managed by the implementation
2422 * and must not be freed by the user. You MUST NOT call this function from any
2423 * thread other than the one that created the window.
2424 *
2425 * \param commandBuffer a command buffer.
2426 * \param window a window that has been claimed.
2427 * \param pWidth a pointer filled in with the swapchain width.
2428 * \param pHeight a pointer filled in with the swapchain height.
2429 * \returns a swapchain texture.
2430 *
2431 * \since This function is available since SDL 3.0.0.
2432 *
2433 * \sa SDL_ClaimWindowForGPUDevice
2434 * \sa SDL_SubmitGPUCommandBuffer
2435 * \sa SDL_SubmitGPUCommandBufferAndAcquireFence
2436 */
2438 SDL_GPUCommandBuffer *commandBuffer,
2439 SDL_Window *window,
2440 Uint32 *pWidth,
2441 Uint32 *pHeight);
2442
2443/**
2444 * Submits a command buffer so its commands can be processed on the GPU.
2445 *
2446 * It is invalid to use the command buffer after this is called.
2447 *
2448 * This must be called from the thread the command buffer was acquired on.
2449 *
2450 * All commands in the submission are guaranteed to begin executing before any
2451 * command in a subsequent submission begins executing.
2452 *
2453 * \param commandBuffer a command buffer.
2454 *
2455 * \since This function is available since SDL 3.0.0.
2456 *
2457 * \sa SDL_AcquireGPUCommandBuffer
2458 * \sa SDL_AcquireGPUSwapchainTexture
2459 * \sa SDL_SubmitGPUCommandBufferAndAcquireFence
2460 */
2461extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPUCommandBuffer(
2462 SDL_GPUCommandBuffer *commandBuffer);
2463
2464/**
2465 * Submits a command buffer so its commands can be processed on the GPU, and
2466 * acquires a fence associated with the command buffer.
2467 *
2468 * You must release this fence when it is no longer needed or it will cause a
2469 * leak. It is invalid to use the command buffer after this is called.
2470 *
2471 * This must be called from the thread the command buffer was acquired on.
2472 *
2473 * All commands in the submission are guaranteed to begin executing before any
2474 * command in a subsequent submission begins executing.
2475 *
2476 * \param commandBuffer a command buffer.
2477 * \returns a fence associated with the command buffer.
2478 *
2479 * \since This function is available since SDL 3.0.0.
2480 *
2481 * \sa SDL_AcquireGPUCommandBuffer
2482 * \sa SDL_AcquireGPUSwapchainTexture
2483 * \sa SDL_SubmitGPUCommandBuffer
2484 * \sa SDL_ReleaseGPUFence
2485 */
2487 SDL_GPUCommandBuffer *commandBuffer);
2488
2489/**
2490 * Blocks the thread until the GPU is completely idle.
2491 *
2492 * \param device a GPU context.
2493 *
2494 * \since This function is available since SDL 3.0.0.
2495 *
2496 * \sa SDL_WaitForGPUFences
2497 */
2498extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle(
2499 SDL_GPUDevice *device);
2500
2501/**
2502 * Blocks the thread until the given fences are signaled.
2503 *
2504 * \param device a GPU context.
2505 * \param waitAll if 0, wait for any fence to be signaled, if 1, wait for all
2506 * fences to be signaled.
2507 * \param pFences an array of fences to wait on.
2508 * \param fenceCount the number of fences in the pFences array.
2509 *
2510 * \since This function is available since SDL 3.0.0.
2511 *
2512 * \sa SDL_SubmitGPUCommandBufferAndAcquireFence
2513 * \sa SDL_WaitForGPUIdle
2514 */
2515extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences(
2516 SDL_GPUDevice *device,
2517 SDL_bool waitAll,
2518 SDL_GPUFence **pFences,
2519 Uint32 fenceCount);
2520
2521/**
2522 * Checks the status of a fence.
2523 *
2524 * \param device a GPU context.
2525 * \param fence a fence.
2526 * \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not.
2527 *
2528 * \since This function is available since SDL 3.0.0.
2529 *
2530 * \sa SDL_SubmitGPUCommandBufferAndAcquireFence
2531 */
2532extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence(
2533 SDL_GPUDevice *device,
2534 SDL_GPUFence *fence);
2535
2536/**
2537 * Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence.
2538 *
2539 * \param device a GPU context.
2540 * \param fence a fence.
2541 *
2542 * \since This function is available since SDL 3.0.0.
2543 *
2544 * \sa SDL_SubmitGPUCommandBufferAndAcquireFence
2545 */
2546extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUFence(
2547 SDL_GPUDevice *device,
2548 SDL_GPUFence *fence);
2549
2550/* Format Info */
2551
2552/**
2553 * Obtains the texel block size for a texture format.
2554 *
2555 * \param textureFormat the texture format you want to know the texel size of.
2556 * \returns the texel block size of the texture format.
2557 *
2558 * \since This function is available since SDL 3.0.0.
2559 *
2560 * \sa SDL_UploadToGPUTexture
2561 */
2562extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize(
2563 SDL_GPUTextureFormat textureFormat);
2564
2565/**
2566 * Determines whether a texture format is supported for a given type and
2567 * usage.
2568 *
2569 * \param device a GPU context.
2570 * \param format the texture format to check.
2571 * \param type the type of texture (2D, 3D, Cube).
2572 * \param usage a bitmask of all usage scenarios to check.
2573 * \returns whether the texture format is supported for this type and usage.
2574 *
2575 * \since This function is available since SDL 3.0.0.
2576 */
2577extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat(
2578 SDL_GPUDevice *device,
2579 SDL_GPUTextureFormat format,
2580 SDL_GPUTextureType type,
2582
2583/**
2584 * Determines if a sample count for a texture format is supported.
2585 *
2586 * \param device a GPU context.
2587 * \param format the texture format to check.
2588 * \param sampleCount the sample count to check.
2589 * \returns a hardware-specific version of min(preferred, possible).
2590 *
2591 * \since This function is available since SDL 3.0.0.
2592 */
2594 SDL_GPUDevice *device,
2595 SDL_GPUTextureFormat format,
2596 SDL_GPUSampleCount sampleCount);
2597
2598#ifdef SDL_PLATFORM_GDK
2599
2600/**
2601 * Call this to suspend GPU operation on Xbox when you receive the
2602 * SDL_EVENT_DID_ENTER_BACKGROUND event.
2603 *
2604 * Do NOT call any SDL_GPU functions after calling this function! This must
2605 * also be called before calling SDL_GDKSuspendComplete.
2606 *
2607 * \param device a GPU context.
2608 *
2609 * \since This function is available since SDL 3.0.0.
2610 *
2611 * \sa SDL_AddEventWatch
2612 */
2613extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(SDL_GPUDevice *device);
2614
2615/**
2616 * Call this to resume GPU operation on Xbox when you receive the
2617 * SDL_EVENT_WILL_ENTER_FOREGROUND event.
2618 *
2619 * When resuming, this function MUST be called before calling any other
2620 * SDL_GPU functions.
2621 *
2622 * \param device a GPU context.
2623 *
2624 * \since This function is available since SDL 3.0.0.
2625 *
2626 * \sa SDL_AddEventWatch
2627 */
2628extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(SDL_GPUDevice *device);
2629
2630#endif /* SDL_PLATFORM_GDK */
2631
2632#ifdef __cplusplus
2633}
2634#endif /* __cplusplus */
2635#include <SDL3/SDL_close_code.h>
2636
2637#endif /* SDL_gpu_h_ */
void SDL_BindGPUVertexBuffers(SDL_GPURenderPass *renderPass, Uint32 firstBinding, SDL_GPUBufferBinding *pBindings, Uint32 bindingCount)
void SDL_DestroyGPUDevice(SDL_GPUDevice *device)
void SDL_EndGPUCopyPass(SDL_GPUCopyPass *copyPass)
void SDL_ReleaseGPUGraphicsPipeline(SDL_GPUDevice *device, SDL_GPUGraphicsPipeline *graphicsPipeline)
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
void SDL_ReleaseGPUComputePipeline(SDL_GPUDevice *device, SDL_GPUComputePipeline *computePipeline)
SDL_GPUDriver SDL_GetGPUDriver(SDL_GPUDevice *device)
void SDL_DrawGPUPrimitives(SDL_GPURenderPass *renderPass, Uint32 vertexCount, Uint32 instanceCount, Uint32 firstVertex, Uint32 firstInstance)
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_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_GPUCopyPass * SDL_BeginGPUCopyPass(SDL_GPUCommandBuffer *commandBuffer)
SDL_GPUDevice * SDL_CreateGPUDevice(SDL_GPUShaderFormat formatFlags, SDL_bool debugMode, const char *name)
struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer
Definition SDL_gpu.h:49
Uint32 SDL_GPUTextureFormatTexelBlockSize(SDL_GPUTextureFormat textureFormat)
void SDL_DownloadFromGPUTexture(SDL_GPUCopyPass *copyPass, SDL_GPUTextureRegion *source, SDL_GPUTextureTransferInfo *destination)
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_GPUDevice * SDL_CreateGPUDeviceWithProperties(SDL_PropertiesID props)
void SDL_BindGPUComputeStorageTextures(SDL_GPUComputePass *computePass, Uint32 firstSlot, SDL_GPUTexture **storageTextures, Uint32 bindingCount)
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
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
void SDL_ReleaseGPUTransferBuffer(SDL_GPUDevice *device, SDL_GPUTransferBuffer *transferBuffer)
void SDL_SetGPUScissor(SDL_GPURenderPass *renderPass, SDL_Rect *scissor)
SDL_GPUCommandBuffer * SDL_AcquireGPUCommandBuffer(SDL_GPUDevice *device)
void SDL_EndGPURenderPass(SDL_GPURenderPass *renderPass)
SDL_bool SDL_ClaimWindowForGPUDevice(SDL_GPUDevice *device, SDL_Window *window)
Uint32 SDL_GPUShaderFormat
Definition SDL_gpu.h:287
void SDL_DrawGPUIndexedPrimitives(SDL_GPURenderPass *renderPass, Uint32 indexCount, Uint32 instanceCount, Uint32 firstIndex, Sint32 vertexOffset, Uint32 firstInstance)
void SDL_BindGPUComputePipeline(SDL_GPUComputePass *computePass, SDL_GPUComputePipeline *computePipeline)
SDL_bool SDL_WindowSupportsGPUSwapchainComposition(SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchainComposition)
void SDL_SetGPUTextureName(SDL_GPUDevice *device, SDL_GPUTexture *texture, const char *text)
void SDL_SetGPUViewport(SDL_GPURenderPass *renderPass, SDL_GPUViewport *viewport)
struct SDL_GPURenderPass SDL_GPURenderPass
Definition SDL_gpu.h:56
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_GPUIndexElementSize
Definition SDL_gpu.h:84
@ SDL_GPU_INDEXELEMENTSIZE_16BIT
Definition SDL_gpu.h:85
@ SDL_GPU_INDEXELEMENTSIZE_32BIT
Definition SDL_gpu.h:86
void SDL_EndGPUComputePass(SDL_GPUComputePass *computePass)
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_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
void SDL_DrawGPUPrimitivesIndirect(SDL_GPURenderPass *renderPass, SDL_GPUBuffer *buffer, Uint32 offsetInBytes, Uint32 drawCount, Uint32 stride)
SDL_GPUSampler * SDL_CreateGPUSampler(SDL_GPUDevice *device, SDL_GPUSamplerCreateInfo *samplerCreateInfo)
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
void SDL_DownloadFromGPUBuffer(SDL_GPUCopyPass *copyPass, SDL_GPUBufferRegion *source, SDL_GPUTransferBufferLocation *destination)
void SDL_UploadToGPUBuffer(SDL_GPUCopyPass *copyPass, SDL_GPUTransferBufferLocation *source, SDL_GPUBufferRegion *destination, SDL_bool cycle)
SDL_GPUShader * SDL_CreateGPUShader(SDL_GPUDevice *device, SDL_GPUShaderCreateInfo *shaderCreateInfo)
SDL_GPUBuffer * SDL_CreateGPUBuffer(SDL_GPUDevice *device, SDL_GPUBufferCreateInfo *bufferCreateInfo)
void SDL_DispatchGPUComputeIndirect(SDL_GPUComputePass *computePass, SDL_GPUBuffer *buffer, Uint32 offsetInBytes)
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
void SDL_WaitForGPUFences(SDL_GPUDevice *device, SDL_bool waitAll, SDL_GPUFence **pFences, Uint32 fenceCount)
struct SDL_GPUSampler SDL_GPUSampler
Definition SDL_gpu.h:51
void SDL_UnmapGPUTransferBuffer(SDL_GPUDevice *device, SDL_GPUTransferBuffer *transferBuffer)
struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer
Definition SDL_gpu.h:55
void SDL_PushGPUVertexUniformData(SDL_GPUCommandBuffer *commandBuffer, Uint32 slotIndex, const void *data, Uint32 dataLengthInBytes)
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_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
struct SDL_GPUFence SDL_GPUFence
Definition SDL_gpu.h:59
void SDL_DrawGPUIndexedPrimitivesIndirect(SDL_GPURenderPass *renderPass, SDL_GPUBuffer *buffer, Uint32 offsetInBytes, Uint32 drawCount, Uint32 stride)
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
void SDL_PushGPUDebugGroup(SDL_GPUCommandBuffer *commandBuffer, const char *name)
void SDL_BlitGPUTexture(SDL_GPUCommandBuffer *commandBuffer, SDL_GPUBlitRegion *source, SDL_GPUBlitRegion *destination, SDL_FlipMode flipMode, SDL_GPUFilter filterMode, SDL_bool cycle)
void SDL_ReleaseGPUSampler(SDL_GPUDevice *device, SDL_GPUSampler *sampler)
Uint8 SDL_GPUColorComponentFlags
Definition SDL_gpu.h:428
SDL_GPUComputePipeline * SDL_CreateGPUComputePipeline(SDL_GPUDevice *device, SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo)
struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline
Definition SDL_gpu.h:54
void SDL_ReleaseGPUTexture(SDL_GPUDevice *device, SDL_GPUTexture *texture)
void SDL_GenerateMipmapsForGPUTexture(SDL_GPUCommandBuffer *commandBuffer, SDL_GPUTexture *texture)
SDL_GPUTexture * SDL_CreateGPUTexture(SDL_GPUDevice *device, SDL_GPUTextureCreateInfo *textureCreateInfo)
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
void SDL_ReleaseGPUShader(SDL_GPUDevice *device, SDL_GPUShader *shader)
struct SDL_GPUComputePipeline SDL_GPUComputePipeline
Definition SDL_gpu.h:53
struct SDL_GPUTexture SDL_GPUTexture
Definition SDL_gpu.h:50
void SDL_ReleaseGPUBuffer(SDL_GPUDevice *device, SDL_GPUBuffer *buffer)
Uint32 SDL_GPUTextureUsageFlags
Definition SDL_gpu.h:231
void SDL_ReleaseGPUFence(SDL_GPUDevice *device, SDL_GPUFence *fence)
void SDL_BindGPUComputeStorageBuffers(SDL_GPUComputePass *computePass, Uint32 firstSlot, SDL_GPUBuffer **storageBuffers, Uint32 bindingCount)
SDL_GPUTexture * SDL_AcquireGPUSwapchainTexture(SDL_GPUCommandBuffer *commandBuffer, SDL_Window *window, Uint32 *pWidth, Uint32 *pHeight)
Uint32 SDL_GPUBufferUsageFlags
Definition SDL_gpu.h:266
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
void SDL_CopyGPUBufferToBuffer(SDL_GPUCopyPass *copyPass, SDL_GPUBufferLocation *source, SDL_GPUBufferLocation *destination, Uint32 size, SDL_bool cycle)
SDL_bool SDL_WindowSupportsGPUPresentMode(SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode presentMode)
SDL_bool SDL_GPUTextureSupportsSampleCount(SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sampleCount)
void SDL_SubmitGPUCommandBuffer(SDL_GPUCommandBuffer *commandBuffer)
SDL_GPUFence * SDL_SubmitGPUCommandBufferAndAcquireFence(SDL_GPUCommandBuffer *commandBuffer)
SDL_GPUComputePass * SDL_BeginGPUComputePass(SDL_GPUCommandBuffer *commandBuffer, SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings, Uint32 storageTextureBindingCount, SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings, Uint32 storageBufferBindingCount)
void SDL_PushGPUComputeUniformData(SDL_GPUCommandBuffer *commandBuffer, Uint32 slotIndex, const void *data, Uint32 dataLengthInBytes)
SDL_bool SDL_GPUTextureSupportsFormat(SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage)
struct SDL_GPUBuffer SDL_GPUBuffer
Definition SDL_gpu.h:48
SDL_GPUGraphicsPipeline * SDL_CreateGPUGraphicsPipeline(SDL_GPUDevice *device, SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo)
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
struct SDL_GPUCopyPass SDL_GPUCopyPass
Definition SDL_gpu.h:58
void SDL_DispatchGPUCompute(SDL_GPUComputePass *computePass, Uint32 groupCountX, Uint32 groupCountY, Uint32 groupCountZ)
void SDL_BindGPUVertexStorageBuffers(SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUBuffer **storageBuffers, Uint32 bindingCount)
void SDL_CopyGPUTextureToTexture(SDL_GPUCopyPass *copyPass, SDL_GPUTextureLocation *source, SDL_GPUTextureLocation *destination, Uint32 w, Uint32 h, Uint32 d, SDL_bool cycle)
SDL_GPURenderPass * SDL_BeginGPURenderPass(SDL_GPUCommandBuffer *commandBuffer, SDL_GPUColorAttachmentInfo *colorAttachmentInfos, Uint32 colorAttachmentCount, SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo)
void SDL_BindGPUIndexBuffer(SDL_GPURenderPass *renderPass, SDL_GPUBufferBinding *pBinding, SDL_GPUIndexElementSize indexElementSize)
SDL_bool SDL_QueryGPUFence(SDL_GPUDevice *device, SDL_GPUFence *fence)
void SDL_BindGPUGraphicsPipeline(SDL_GPURenderPass *renderPass, SDL_GPUGraphicsPipeline *graphicsPipeline)
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_GPUTransferBufferUsage
Definition SDL_gpu.h:276
@ SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
Definition SDL_gpu.h:278
@ SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD
Definition SDL_gpu.h:277
void SDL_BindGPUFragmentSamplers(SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTextureSamplerBinding *textureSamplerBindings, Uint32 bindingCount)
void SDL_InsertGPUDebugLabel(SDL_GPUCommandBuffer *commandBuffer, const char *text)
struct SDL_GPUShader SDL_GPUShader
Definition SDL_gpu.h:52
void SDL_BindGPUVertexSamplers(SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTextureSamplerBinding *textureSamplerBindings, Uint32 bindingCount)
void SDL_PushGPUFragmentUniformData(SDL_GPUCommandBuffer *commandBuffer, Uint32 slotIndex, const void *data, Uint32 dataLengthInBytes)
SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat(SDL_GPUDevice *device, SDL_Window *window)
SDL_GPUSwapchainComposition
Definition SDL_gpu.h:488
@ SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048
Definition SDL_gpu.h:492
@ SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR
Definition SDL_gpu.h:490
@ SDL_GPU_SWAPCHAINCOMPOSITION_SDR
Definition SDL_gpu.h:489
@ SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR
Definition SDL_gpu.h:491
SDL_bool SDL_SetGPUSwapchainParameters(SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchainComposition, SDL_GPUPresentMode presentMode)
void SDL_PopGPUDebugGroup(SDL_GPUCommandBuffer *commandBuffer)
SDL_GPUTransferBuffer * SDL_CreateGPUTransferBuffer(SDL_GPUDevice *device, SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo)
void SDL_BindGPUFragmentStorageTextures(SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTexture **storageTextures, Uint32 bindingCount)
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
void SDL_ReleaseWindowFromGPUDevice(SDL_GPUDevice *device, SDL_Window *window)
void SDL_SetGPUBufferName(SDL_GPUDevice *device, SDL_GPUBuffer *buffer, const char *text)
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
void * SDL_MapGPUTransferBuffer(SDL_GPUDevice *device, SDL_GPUTransferBuffer *transferBuffer, SDL_bool cycle)
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
void SDL_BindGPUVertexStorageTextures(SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUTexture **storageTextures, Uint32 bindingCount)
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
struct SDL_GPUComputePass SDL_GPUComputePass
Definition SDL_gpu.h:57
struct SDL_GPUDevice SDL_GPUDevice
Definition SDL_gpu.h:47
void SDL_UploadToGPUTexture(SDL_GPUCopyPass *copyPass, SDL_GPUTextureTransferInfo *source, SDL_GPUTextureRegion *destination, SDL_bool cycle)
void SDL_WaitForGPUIdle(SDL_GPUDevice *device)
void SDL_BindGPUFragmentStorageBuffers(SDL_GPURenderPass *renderPass, Uint32 firstSlot, SDL_GPUBuffer **storageBuffers, Uint32 bindingCount)
Uint32 SDL_PropertiesID
uint8_t Uint8
Definition SDL_stdinc.h:232
int32_t Sint32
Definition SDL_stdinc.h:259
SDL_MALLOC size_t size
Definition SDL_stdinc.h:535
uint32_t Uint32
Definition SDL_stdinc.h:268
bool SDL_bool
Definition SDL_stdinc.h:216
SDL_FlipMode
Definition SDL_surface.h:83
struct SDL_Window SDL_Window
Definition SDL_video.h:144
SDL_GPUTexture * texture
Definition SDL_gpu.h:562
Uint32 layerOrDepthPlane
Definition SDL_gpu.h:564
SDL_GPUBuffer * buffer
Definition SDL_gpu.h:914
SDL_GPUBufferUsageFlags usageFlags
Definition SDL_gpu.h:716
SDL_PropertiesID props
Definition SDL_gpu.h:719
SDL_GPUBuffer * buffer
Definition SDL_gpu.h:573
SDL_GPUBuffer * buffer
Definition SDL_gpu.h:579
SDL_GPUBlendFactor dstAlphaBlendFactor
Definition SDL_gpu.h:673
SDL_GPUBlendFactor dstColorBlendFactor
Definition SDL_gpu.h:670
SDL_GPUBlendFactor srcAlphaBlendFactor
Definition SDL_gpu.h:672
SDL_GPUColorComponentFlags colorWriteMask
Definition SDL_gpu.h:675
SDL_GPUBlendFactor srcColorBlendFactor
Definition SDL_gpu.h:669
SDL_GPUColorAttachmentBlendState blendState
Definition SDL_gpu.h:765
SDL_GPUTextureFormat format
Definition SDL_gpu.h:764
SDL_GPUStoreOp storeOp
Definition SDL_gpu.h:842
SDL_GPUTexture * texture
Definition SDL_gpu.h:812
SDL_GPUShaderFormat format
Definition SDL_gpu.h:796
SDL_GPUDepthStencilValue depthStencilClearValue
Definition SDL_gpu.h:854
SDL_GPUCompareOp compareOp
Definition SDL_gpu.h:753
SDL_GPUStencilOpState frontStencilState
Definition SDL_gpu.h:756
SDL_GPUStencilOpState backStencilState
Definition SDL_gpu.h:755
SDL_GPUColorAttachmentDescription * colorAttachmentDescriptions
Definition SDL_gpu.h:770
SDL_GPUTextureFormat depthStencilFormat
Definition SDL_gpu.h:773
SDL_GPURasterizerState rasterizerState
Definition SDL_gpu.h:782
SDL_GPUVertexInputState vertexInputState
Definition SDL_gpu.h:780
SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo
Definition SDL_gpu.h:785
SDL_GPUPrimitiveType primitiveType
Definition SDL_gpu.h:781
SDL_GPUMultisampleState multisampleState
Definition SDL_gpu.h:783
SDL_GPUDepthStencilState depthStencilState
Definition SDL_gpu.h:784
SDL_GPUSampleCount sampleCount
Definition SDL_gpu.h:745
SDL_bool depthBiasEnable
Definition SDL_gpu.h:737
SDL_GPUCullMode cullMode
Definition SDL_gpu.h:735
SDL_GPUFillMode fillMode
Definition SDL_gpu.h:734
SDL_GPUFrontFace frontFace
Definition SDL_gpu.h:736
float depthBiasConstantFactor
Definition SDL_gpu.h:738
SDL_GPUSamplerMipmapMode mipmapMode
Definition SDL_gpu.h:619
SDL_GPUSamplerAddressMode addressModeU
Definition SDL_gpu.h:620
SDL_GPUSamplerAddressMode addressModeV
Definition SDL_gpu.h:621
SDL_GPUCompareOp compareOp
Definition SDL_gpu.h:627
SDL_GPUFilter magFilter
Definition SDL_gpu.h:618
SDL_GPUSamplerAddressMode addressModeW
Definition SDL_gpu.h:622
SDL_PropertiesID props
Definition SDL_gpu.h:631
SDL_GPUFilter minFilter
Definition SDL_gpu.h:617
SDL_PropertiesID props
Definition SDL_gpu.h:690
SDL_GPUShaderFormat format
Definition SDL_gpu.h:683
const Uint8 * code
Definition SDL_gpu.h:681
SDL_GPUShaderStage stage
Definition SDL_gpu.h:684
const char * entryPointName
Definition SDL_gpu.h:682
SDL_GPUStencilOp failOp
Definition SDL_gpu.h:660
SDL_GPUStencilOp passOp
Definition SDL_gpu.h:661
SDL_GPUStencilOp depthFailOp
Definition SDL_gpu.h:662
SDL_GPUCompareOp compareOp
Definition SDL_gpu.h:663
SDL_PropertiesID props
Definition SDL_gpu.h:704
SDL_GPUTextureFormat format
Definition SDL_gpu.h:696
SDL_GPUTextureType type
Definition SDL_gpu.h:695
SDL_GPUTextureUsageFlags usageFlags
Definition SDL_gpu.h:697
SDL_GPUSampleCount sampleCount
Definition SDL_gpu.h:702
SDL_GPUTexture * texture
Definition SDL_gpu.h:539
SDL_GPUTexture * texture
Definition SDL_gpu.h:549
SDL_GPUSampler * sampler
Definition SDL_gpu.h:921
SDL_GPUTexture * texture
Definition SDL_gpu.h:920
SDL_GPUTransferBuffer * transferBuffer
Definition SDL_gpu.h:525
SDL_GPUTransferBufferUsage usage
Definition SDL_gpu.h:724
SDL_GPUTransferBuffer * transferBuffer
Definition SDL_gpu.h:533
SDL_GPUVertexElementFormat format
Definition SDL_gpu.h:646
Uint32 instanceStepRate
Definition SDL_gpu.h:639
SDL_GPUVertexInputRate inputRate
Definition SDL_gpu.h:638
const SDL_GPUVertexAttribute * vertexAttributes
Definition SDL_gpu.h:654
const SDL_GPUVertexBinding * vertexBindings
Definition SDL_gpu.h:652