From d70578b9aac957c4f1c26086d5cd9442d341ce2a Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 29 Aug 2024 16:08:10 -0700
Subject: [PATCH] Renamed Gpu to GPU
---
CMakeLists.txt | 6 +-
include/SDL3/SDL_gpu.h | 1054 ++++++++++----------
include/SDL3/SDL_hints.h | 2 +-
include/SDL3/SDL_opengl_glext.h | 40 +-
src/core/SDL_core_unsupported.c | 8 +-
src/dynapi/SDL_dynapi.sym | 162 +--
src/dynapi/SDL_dynapi_overrides.h | 162 +--
src/dynapi/SDL_dynapi_procs.h | 162 +--
src/gpu/SDL_gpu.c | 554 +++++-----
src/gpu/SDL_sysgpu.h | 412 ++++----
src/gpu/d3d11/SDL_gpu_d3d11.c | 464 ++++-----
src/gpu/d3d12/SDL_gpu_d3d12.c | 518 +++++-----
src/gpu/metal/SDL_gpu_metal.m | 438 ++++----
src/gpu/vulkan/SDL_gpu_vulkan.c | 454 ++++-----
src/render/direct3d12/SDL_render_d3d12.c | 2 +-
src/render/sdlgpu/SDL_gpu_util.h | 8 +-
src/render/sdlgpu/SDL_pipeline_gpu.c | 24 +-
src/render/sdlgpu/SDL_pipeline_gpu.h | 8 +-
src/render/sdlgpu/SDL_render_gpu.c | 250 ++---
src/render/sdlgpu/SDL_shaders_gpu.c | 28 +-
src/render/sdlgpu/SDL_shaders_gpu.h | 14 +-
src/video/directx/SDL_d3d12_xbox_cmacros.h | 4 +-
src/video/directx/d3d12.h | 10 +-
test/testgpu_spinning_cube.c | 160 +--
24 files changed, 2472 insertions(+), 2472 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d69831ae64644..45643c02fb909 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -233,7 +233,7 @@ endmacro()
define_sdl_subsystem(Audio)
define_sdl_subsystem(Video)
-define_sdl_subsystem(Gpu DEPS SDL_VIDEO)
+define_sdl_subsystem(GPU DEPS SDL_VIDEO)
define_sdl_subsystem(Render DEPS SDL_VIDEO)
define_sdl_subsystem(Camera DEPS SDL_VIDEO)
define_sdl_subsystem(Joystick)
@@ -332,7 +332,7 @@ dep_option(SDL_RENDER_D3D "Enable the Direct3D 9 render driver" ON "SDL
dep_option(SDL_RENDER_D3D11 "Enable the Direct3D 11 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_D3D12 "Enable the Direct3D 12 render driver" ON "SDL_RENDER;SDL_DIRECTX" OFF)
dep_option(SDL_RENDER_METAL "Enable the Metal render driver" ON "SDL_RENDER;${APPLE}" OFF)
-set_option(SDL_RENDER_GPU "Enable the SDL_Gpu render driver" ON)
+set_option(SDL_RENDER_GPU "Enable the SDL_GPU render driver" ON)
dep_option(SDL_VIVANTE "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF)
dep_option(SDL_VULKAN "Enable Vulkan support" ON "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR FREEBSD OR WINDOWS" OFF)
dep_option(SDL_RENDER_VULKAN "Enable the Vulkan render driver" ON "SDL_RENDER;SDL_VULKAN" OFF)
@@ -352,7 +352,7 @@ set_option(SDL_LIBUDEV "Enable libudev support" ON)
set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF)
set_option(SDL_CCACHE "Use Ccache to speed up build" OFF)
set_option(SDL_CLANG_TIDY "Run clang-tidy static analysis" OFF)
-set_option(SDL_GPU_DXVK "Build SDL_Gpu with DXVK support" OFF)
+set_option(SDL_GPU_DXVK "Build SDL_GPU with DXVK support" OFF)
set(SDL_VENDOR_INFO "" CACHE STRING "Vendor name and/or version to add to SDL_REVISION")
diff --git a/include/SDL3/SDL_gpu.h b/include/SDL3/SDL_gpu.h
index 507162ae8adf4..b106dc4efb9ea 100644
--- a/include/SDL3/SDL_gpu.h
+++ b/include/SDL3/SDL_gpu.h
@@ -38,50 +38,50 @@ extern "C" {
/* Type Declarations */
-typedef struct SDL_GpuDevice SDL_GpuDevice;
-typedef struct SDL_GpuBuffer SDL_GpuBuffer;
-typedef struct SDL_GpuTransferBuffer SDL_GpuTransferBuffer;
-typedef struct SDL_GpuTexture SDL_GpuTexture;
-typedef struct SDL_GpuSampler SDL_GpuSampler;
-typedef struct SDL_GpuShader SDL_GpuShader;
-typedef struct SDL_GpuComputePipeline SDL_GpuComputePipeline;
-typedef struct SDL_GpuGraphicsPipeline SDL_GpuGraphicsPipeline;
-typedef struct SDL_GpuCommandBuffer SDL_GpuCommandBuffer;
-typedef struct SDL_GpuRenderPass SDL_GpuRenderPass;
-typedef struct SDL_GpuComputePass SDL_GpuComputePass;
-typedef struct SDL_GpuCopyPass SDL_GpuCopyPass;
-typedef struct SDL_GpuFence SDL_GpuFence;
-
-typedef enum SDL_GpuPrimitiveType
+typedef struct SDL_GPUDevice SDL_GPUDevice;
+typedef struct SDL_GPUBuffer SDL_GPUBuffer;
+typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer;
+typedef struct SDL_GPUTexture SDL_GPUTexture;
+typedef struct SDL_GPUSampler SDL_GPUSampler;
+typedef struct SDL_GPUShader SDL_GPUShader;
+typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline;
+typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline;
+typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer;
+typedef struct SDL_GPURenderPass SDL_GPURenderPass;
+typedef struct SDL_GPUComputePass SDL_GPUComputePass;
+typedef struct SDL_GPUCopyPass SDL_GPUCopyPass;
+typedef struct SDL_GPUFence SDL_GPUFence;
+
+typedef enum SDL_GPUPrimitiveType
{
SDL_GPU_PRIMITIVETYPE_POINTLIST,
SDL_GPU_PRIMITIVETYPE_LINELIST,
SDL_GPU_PRIMITIVETYPE_LINESTRIP,
SDL_GPU_PRIMITIVETYPE_TRIANGLELIST,
SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP
-} SDL_GpuPrimitiveType;
+} SDL_GPUPrimitiveType;
-typedef enum SDL_GpuLoadOp
+typedef enum SDL_GPULoadOp
{
SDL_GPU_LOADOP_LOAD,
SDL_GPU_LOADOP_CLEAR,
SDL_GPU_LOADOP_DONT_CARE
-} SDL_GpuLoadOp;
+} SDL_GPULoadOp;
-typedef enum SDL_GpuStoreOp
+typedef enum SDL_GPUStoreOp
{
SDL_GPU_STOREOP_STORE,
SDL_GPU_STOREOP_DONT_CARE
-} SDL_GpuStoreOp;
+} SDL_GPUStoreOp;
-typedef enum SDL_GpuIndexElementSize
+typedef enum SDL_GPUIndexElementSize
{
SDL_GPU_INDEXELEMENTSIZE_16BIT,
SDL_GPU_INDEXELEMENTSIZE_32BIT
-} SDL_GpuIndexElementSize;
+} SDL_GPUIndexElementSize;
/* Texture format support varies depending on driver, hardware, and usage flags.
- * In general, you should use SDL_SupportsGpuTextureFormat to query if a format
+ * In general, you should use SDL_SupportsGPUTextureFormat to query if a format
* is supported before using it. However, there are a few guaranteed formats.
*
* For SAMPLER usage, the following formats are universally supported:
@@ -141,7 +141,7 @@ typedef enum SDL_GpuIndexElementSize
* Unless D16_UNORM is sufficient for your purposes, always check which
* of D24/D32 is supported before creating a depth-stencil texture!
*/
-typedef enum SDL_GpuTextureFormat
+typedef enum SDL_GPUTextureFormat
{
SDL_GPU_TEXTUREFORMAT_INVALID = -1,
@@ -190,9 +190,9 @@ typedef enum SDL_GpuTextureFormat
SDL_GPU_TEXTUREFORMAT_D32_FLOAT,
SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT,
SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT
-} SDL_GpuTextureFormat;
+} SDL_GPUTextureFormat;
-typedef enum SDL_GpuTextureUsageFlagBits
+typedef enum SDL_GPUTextureUsageFlagBits
{
SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT = 0x00000001,
SDL_GPU_TEXTUREUSAGE_COLOR_TARGET_BIT = 0x00000002,
@@ -200,27 +200,27 @@ typedef enum SDL_GpuTextureUsageFlagBits
SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008,
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020,
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040
-} SDL_GpuTextureUsageFlagBits;
+} SDL_GPUTextureUsageFlagBits;
-typedef Uint32 SDL_GpuTextureUsageFlags;
+typedef Uint32 SDL_GPUTextureUsageFlags;
-typedef enum SDL_GpuTextureType
+typedef enum SDL_GPUTextureType
{
SDL_GPU_TEXTURETYPE_2D,
SDL_GPU_TEXTURETYPE_2D_ARRAY,
SDL_GPU_TEXTURETYPE_3D,
SDL_GPU_TEXTURETYPE_CUBE
-} SDL_GpuTextureType;
+} SDL_GPUTextureType;
-typedef enum SDL_GpuSampleCount
+typedef enum SDL_GPUSampleCount
{
SDL_GPU_SAMPLECOUNT_1,
SDL_GPU_SAMPLECOUNT_2,
SDL_GPU_SAMPLECOUNT_4,
SDL_GPU_SAMPLECOUNT_8
-} SDL_GpuSampleCount;
+} SDL_GPUSampleCount;
-typedef enum SDL_GpuCubeMapFace
+typedef enum SDL_GPUCubeMapFace
{
SDL_GPU_CUBEMAPFACE_POSITIVEX,
SDL_GPU_CUBEMAPFACE_NEGATIVEX,
@@ -228,9 +228,9 @@ typedef enum SDL_GpuCubeMapFace
SDL_GPU_CUBEMAPFACE_NEGATIVEY,
SDL_GPU_CUBEMAPFACE_POSITIVEZ,
SDL_GPU_CUBEMAPFACE_NEGATIVEZ
-} SDL_GpuCubeMapFace;
+} SDL_GPUCubeMapFace;
-typedef enum SDL_GpuBufferUsageFlagBits
+typedef enum SDL_GPUBufferUsageFlagBits
{
SDL_GPU_BUFFERUSAGE_VERTEX_BIT = 0x00000001,
SDL_GPU_BUFFERUSAGE_INDEX_BIT = 0x00000002,
@@ -238,23 +238,23 @@ typedef enum SDL_GpuBufferUsageFlagBits
SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008,
SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020,
SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040
-} SDL_GpuBufferUsageFlagBits;
+} SDL_GPUBufferUsageFlagBits;
-typedef Uint32 SDL_GpuBufferUsageFlags;
+typedef Uint32 SDL_GPUBufferUsageFlags;
-typedef enum SDL_GpuTransferBufferUsage
+typedef enum SDL_GPUTransferBufferUsage
{
SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD,
SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD
-} SDL_GpuTransferBufferUsage;
+} SDL_GPUTransferBufferUsage;
-typedef enum SDL_GpuShaderStage
+typedef enum SDL_GPUShaderStage
{
SDL_GPU_SHADERSTAGE_VERTEX,
SDL_GPU_SHADERSTAGE_FRAGMENT
-} SDL_GpuShaderStage;
+} SDL_GPUShaderStage;
-typedef enum SDL_GpuShaderFormatFlagBits
+typedef enum SDL_GPUShaderFormatFlagBits
{
SDL_GPU_SHADERFORMAT_INVALID = 0x00000000,
SDL_GPU_SHADERFORMAT_SECRET = 0x00000001, /* NDA'd platforms */
@@ -263,11 +263,11 @@ typedef enum SDL_GpuShaderFormatFlagBits
SDL_GPU_SHADERFORMAT_DXIL = 0x00000008, /* D3D12 */
SDL_GPU_SHADERFORMAT_MSL = 0x00000010, /* Metal */
SDL_GPU_SHADERFORMAT_METALLIB = 0x00000020, /* Metal */
-} SDL_GpuShaderFormatFlagBits;
+} SDL_GPUShaderFormatFlagBits;
-typedef Uint32 SDL_GpuShaderFormat;
+typedef Uint32 SDL_GPUShaderFormat;
-typedef enum SDL_GpuVertexElementFormat
+typedef enum SDL_GPUVertexElementFormat
{
/* 32-bit Signed Integers */
SDL_GPU_VERTEXELEMENTFORMAT_INT,
@@ -322,34 +322,34 @@ typedef enum SDL_GpuVertexElementFormat
/* 16-bit Floats */
SDL_GPU_VERTEXELEMENTFORMAT_HALF2,
SDL_GPU_VERTEXELEMENTFORMAT_HALF4
-} SDL_GpuVertexElementFormat;
+} SDL_GPUVertexElementFormat;
-typedef enum SDL_GpuVertexInputRate
+typedef enum SDL_GPUVertexInputRate
{
SDL_GPU_VERTEXINPUTRATE_VERTEX = 0,
SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1
-} SDL_GpuVertexInputRate;
+} SDL_GPUVertexInputRate;
-typedef enum SDL_GpuFillMode
+typedef enum SDL_GPUFillMode
{
SDL_GPU_FILLMODE_FILL,
SDL_GPU_FILLMODE_LINE
-} SDL_GpuFillMode;
+} SDL_GPUFillMode;
-typedef enum SDL_GpuCullMode
+typedef enum SDL_GPUCullMode
{
SDL_GPU_CULLMODE_NONE,
SDL_GPU_CULLMODE_FRONT,
SDL_GPU_CULLMODE_BACK
-} SDL_GpuCullMode;
+} SDL_GPUCullMode;
-typedef enum SDL_GpuFrontFace
+typedef enum SDL_GPUFrontFace
{
SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE,
SDL_GPU_FRONTFACE_CLOCKWISE
-} SDL_GpuFrontFace;
+} SDL_GPUFrontFace;
-typedef enum SDL_GpuCompareOp
+typedef enum SDL_GPUCompareOp
{
SDL_GPU_COMPAREOP_NEVER,
SDL_GPU_COMPAREOP_LESS,
@@ -359,9 +359,9 @@ typedef enum SDL_GpuCompareOp
SDL_GPU_COMPAREOP_NOT_EQUAL,
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL,
SDL_GPU_COMPAREOP_ALWAYS
-} SDL_GpuCompareOp;
+} SDL_GPUCompareOp;
-typedef enum SDL_GpuStencilOp
+typedef enum SDL_GPUStencilOp
{
SDL_GPU_STENCILOP_KEEP,
SDL_GPU_STENCILOP_ZERO,
@@ -371,18 +371,18 @@ typedef enum SDL_GpuStencilOp
SDL_GPU_STENCILOP_INVERT,
SDL_GPU_STENCILOP_INCREMENT_AND_WRAP,
SDL_GPU_STENCILOP_DECREMENT_AND_WRAP
-} SDL_GpuStencilOp;
+} SDL_GPUStencilOp;
-typedef enum SDL_GpuBlendOp
+typedef enum SDL_GPUBlendOp
{
SDL_GPU_BLENDOP_ADD,
SDL_GPU_BLENDOP_SUBTRACT,
SDL_GPU_BLENDOP_REVERSE_SUBTRACT,
SDL_GPU_BLENDOP_MIN,
SDL_GPU_BLENDOP_MAX
-} SDL_GpuBlendOp;
+} SDL_GPUBlendOp;
-typedef enum SDL_GpuBlendFactor
+typedef enum SDL_GPUBlendFactor
{
SDL_GPU_BLENDFACTOR_ZERO,
SDL_GPU_BLENDFACTOR_ONE,
@@ -397,36 +397,36 @@ typedef enum SDL_GpuBlendFactor
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR,
SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR,
SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE
-} SDL_GpuBlendFactor;
+} SDL_GPUBlendFactor;
-typedef enum SDL_GpuColorComponentFlagBits
+typedef enum SDL_GPUColorComponentFlagBits
{
SDL_GPU_COLORCOMPONENT_R_BIT = 0x00000001,
SDL_GPU_COLORCOMPONENT_G_BIT = 0x00000002,
SDL_GPU_COLORCOMPONENT_B_BIT = 0x00000004,
SDL_GPU_COLORCOMPONENT_A_BIT = 0x00000008
-} SDL_GpuColorComponentFlagBits;
+} SDL_GPUColorComponentFlagBits;
-typedef Uint8 SDL_GpuColorComponentFlags;
+typedef Uint8 SDL_GPUColorComponentFlags;
-typedef enum SDL_GpuFilter
+typedef enum SDL_GPUFilter
{
SDL_GPU_FILTER_NEAREST,
SDL_GPU_FILTER_LINEAR
-} SDL_GpuFilter;
+} SDL_GPUFilter;
-typedef enum SDL_GpuSamplerMipmapMode
+typedef enum SDL_GPUSamplerMipmapMode
{
SDL_GPU_SAMPLERMIPMAPMODE_NEAREST,
SDL_GPU_SAMPLERMIPMAPMODE_LINEAR
-} SDL_GpuSamplerMipmapMode;
+} SDL_GPUSamplerMipmapMode;
-typedef enum SDL_GpuSamplerAddressMode
+typedef enum SDL_GPUSamplerAddressMode
{
SDL_GPU_SAMPLERADDRESSMODE_REPEAT,
SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT,
SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE
-} SDL_GpuSamplerAddressMode;
+} SDL_GPUSamplerAddressMode;
/*
* VSYNC:
@@ -444,12 +444,12 @@ typedef enum SDL_GpuSamplerAddressMode
* Similar to VSYNC, but with reduced visual latency.
* When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight.
*/
-typedef enum SDL_GpuPresentMode
+typedef enum SDL_GPUPresentMode
{
SDL_GPU_PRESENTMODE_VSYNC,
SDL_GPU_PRESENTMODE_IMMEDIATE,
SDL_GPU_PRESENTMODE_MAILBOX
-} SDL_GpuPresentMode;
+} SDL_GPUPresentMode;
/*
* SDR:
@@ -461,15 +461,15 @@ typedef enum SDL_GpuPresentMode
* HDR10_ST2048:
* A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in PQ ST2048 encoding. Blends raw pixel values. (TODO: verify this)
*/
-typedef enum SDL_GpuSwapchainComposition
+typedef enum SDL_GPUSwapchainComposition
{
SDL_GPU_SWAPCHAINCOMPOSITION_SDR,
SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR,
SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR,
SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048
-} SDL_GpuSwapchainComposition;
+} SDL_GPUSwapchainComposition;
-typedef enum SDL_GpuDriver
+typedef enum SDL_GPUDriver
{
SDL_GPU_DRIVER_INVALID = -1,
SDL_GPU_DRIVER_SECRET, /* NDA'd platforms */
@@ -477,17 +477,17 @@ typedef enum SDL_GpuDriver
SDL_GPU_DRIVER_D3D11,
SDL_GPU_DRIVER_D3D12,
SDL_GPU_DRIVER_METAL
-} SDL_GpuDriver;
+} SDL_GPUDriver;
/* Structures */
-typedef struct SDL_GpuDepthStencilValue
+typedef struct SDL_GPUDepthStencilValue
{
float depth;
Uint8 stencil;
-} SDL_GpuDepthStencilValue;
+} SDL_GPUDepthStencilValue;
-typedef struct SDL_GpuViewport
+typedef struct SDL_GPUViewport
{
float x;
float y;
@@ -495,35 +495,35 @@ typedef struct SDL_GpuViewport
float h;
float minDepth;
float maxDepth;
-} SDL_GpuViewport;
+} SDL_GPUViewport;
-typedef struct SDL_GpuTextureTransferInfo
+typedef struct SDL_GPUTextureTransferInfo
{
- SDL_GpuTransferBuffer *transferBuffer;
+ SDL_GPUTransferBuffer *transferBuffer;
Uint32 offset; /* starting location of the image data */
Uint32 imagePitch; /* number of pixels from one row to the next */
Uint32 imageHeight; /* number of rows from one layer/depth-slice to the next */
-} SDL_GpuTextureTransferInfo;
+} SDL_GPUTextureTransferInfo;
-typedef struct SDL_GpuTransferBufferLocation
+typedef struct SDL_GPUTransferBufferLocation
{
- SDL_GpuTransferBuffer *transferBuffer;
+ SDL_GPUTransferBuffer *transferBuffer;
Uint32 offset;
-} SDL_GpuTransferBufferLocation;
+} SDL_GPUTransferBufferLocation;
-typedef struct SDL_GpuTextureLocation
+typedef struct SDL_GPUTextureLocation
{
- SDL_GpuTexture *texture;
+ SDL_GPUTexture *texture;
Uint32 mipLevel;
Uint32 layer;
Uint32 x;
Uint32 y;
Uint32 z;
-} SDL_GpuTextureLocation;
+} SDL_GPUTextureLocation;
-typedef struct SDL_GpuTextureRegion
+typedef struct SDL_GPUTextureRegion
{
- SDL_GpuTexture *texture;
+ SDL_GPUTexture *texture;
Uint32 mipLevel;
Uint32 layer;
Uint32 x;
@@ -532,154 +532,154 @@ typedef struct SDL_GpuTextureRegion
Uint32 w;
Uint32 h;
Uint32 d;
-} SDL_GpuTextureRegion;
+} SDL_GPUTextureRegion;
-typedef struct SDL_GpuBlitRegion
+typedef struct SDL_GPUBlitRegion
{
- SDL_GpuTexture *texture;
+ SDL_GPUTexture *texture;
Uint32 mipLevel;
Uint32 layerOrDepthPlane;
Uint32 x;
Uint32 y;
Uint32 w;
Uint32 h;
-} SDL_GpuBlitRegion;
+} SDL_GPUBlitRegion;
-typedef struct SDL_GpuBufferLocation
+typedef struct SDL_GPUBufferLocation
{
- SDL_GpuBuffer *buffer;
+ SDL_GPUBuffer *buffer;
Uint32 offset;
-} SDL_GpuBufferLocation;
+} SDL_GPUBufferLocation;
-typedef struct SDL_GpuBufferRegion
+typedef struct SDL_GPUBufferRegion
{
- SDL_GpuBuffer *buffer;
+ SDL_GPUBuffer *buffer;
Uint32 offset;
Uint32 size;
-} SDL_GpuBufferRegion;
+} SDL_GPUBufferRegion;
/* Note that the `firstVertex` and `firstInstance` parameters are NOT compatible with
* built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If
* your shader depends on these variables, the correlating draw call parameter MUST
* be 0.
*/
-typedef struct SDL_GpuIndirectDrawCommand
+typedef struct SDL_GPUIndirectDrawCommand
{
Uint32 vertexCount; /* number of vertices to draw */
Uint32 instanceCount; /* number of instances to draw */
Uint32 firstVertex; /* index of the first vertex to draw */
Uint32 firstInstance; /* ID of the first instance to draw */
-} SDL_GpuIndirectDrawCommand;
+} SDL_GPUIndirectDrawCommand;
-typedef struct SDL_GpuIndexedIndirectDrawCommand
+typedef struct SDL_GPUIndexedIndirectDrawCommand
{
Uint32 indexCount; /* number of vertices to draw per instance */
Uint32 instanceCount; /* number of instances to draw */
Uint32 firstIndex; /* base index within the index buffer */
Sint32 vertexOffset; /* value added to vertex index before indexing into the vertex buffer */
Uint32 firstInstance; /* ID of the first instance to draw */
-} SDL_GpuIndexedIndirectDrawCommand;
+} SDL_GPUIndexedIndirectDrawCommand;
-typedef struct SDL_GpuIndirectDispatchCommand
+typedef struct SDL_GPUIndirectDispatchCommand
{
Uint32 groupCountX;
Uint32 groupCountY;
Uint32 groupCountZ;
-} SDL_GpuIndirectDispatchCommand;
+} SDL_GPUIndirectDispatchCommand;
/* State structures */
-typedef struct SDL_GpuSamplerCreateInfo
+typedef struct SDL_GPUSamplerCreateInfo
{
- SDL_GpuFilter minFilter;
- SDL_GpuFilter magFilter;
- SDL_GpuSamplerMipmapMode mipmapMode;
- SDL_GpuSamplerAddressMode addressModeU;
- SDL_GpuSamplerAddressMode addressModeV;
- SDL_GpuSamplerAddressMode addressModeW;
+ SDL_GPUFilter minFilter;
+ SDL_GPUFilter magFilter;
+ SDL_GPUSamplerMipmapMode mipmapMode;
+ SDL_GPUSamplerAddressMode addressModeU;
+ SDL_GPUSamplerAddressMode addressModeV;
+ SDL_GPUSamplerAddressMode addressModeW;
float mipLodBias;
SDL_bool anisotropyEnable;
float maxAnisotropy;
SDL_bool compareEnable;
- SDL_GpuCompareOp compareOp;
+ SDL_GPUCompareOp compareOp;
float minLod;
float maxLod;
SDL_PropertiesID props;
-} SDL_GpuSamplerCreateInfo;
+} SDL_GPUSamplerCreateInfo;
-typedef struct SDL_GpuVertexBinding
+typedef struct SDL_GPUVertexBinding
{
Uint32 binding;
Uint32 stride;
- SDL_GpuVertexInputRate inputRate;
+ SDL_GPUVertexInputRate inputRate;
Uint32 instanceStepRate; /* ignored unless inputRate is INSTANCE */
-} SDL_GpuVertexBinding;
+} SDL_GPUVertexBinding;
-typedef struct SDL_GpuVertexAttribute
+typedef struct SDL_GPUVertexAttribute
{
Uint32 location;
Uint32 binding;
- SDL_GpuVertexElementFormat format;
+ SDL_GPUVertexElementFormat format;
Uint32 offset;
-} SDL_GpuVertexAttribute;
+} SDL_GPUVertexAttribute;
-typedef struct SDL_GpuVertexInputState
+typedef struct SDL_GPUVertexInputState
{
- const SDL_GpuVertexBinding *vertexBindings;
+ const SDL_GPUVertexBinding *vertexBindings;
Uint32 vertexBindingCount;
- const SDL_GpuVertexAttribute *vertexAttributes;
+ const SDL_GPUVertexAttribute *vertexAttributes;
Uint32 vertexAttributeCount;
-} SDL_GpuVertexInputState;
+} SDL_GPUVertexInputState;
-typedef struct SDL_GpuStencilOpState
+typedef struct SDL_GPUStencilOpState
{
- SDL_GpuStencilOp failOp;
- SDL_GpuStencilOp passOp;
- SDL_GpuStencilOp depthFailOp;
- SDL_GpuCompareOp compareOp;
-} SDL_GpuStencilOpState;
+ SDL_GPUStencilOp failOp;
+ SDL_GPUStencilOp passOp;
+ SDL_GPUStencilOp depthFailOp;
+ SDL_GPUCompareOp compareOp;
+} SDL_GPUStencilOpState;
-typedef struct SDL_GpuColorAttachmentBlendState
+typedef struct SDL_GPUColorAttachmentBlendState
{
SDL_bool blendEnable;
- SDL_GpuBlendFactor srcColorBlendFactor;
- SDL_GpuBlendFactor dstColorBlendFactor;
- SDL_GpuBlendOp colorBlendOp;
- SDL_GpuBlendFactor srcAlphaBlendFactor;
- SDL_GpuBlendFactor dstAlphaBlendFactor;
- SDL_GpuBlendOp alphaBlendOp;
- SDL_GpuColorComponentFlags colorWriteMask;
-} SDL_GpuColorAttachmentBlendState;
+ SDL_GPUBlendFactor srcColorBlendFactor;
+ SDL_GPUBlendFactor dstColorBlendFactor;
+ SDL_GPUBlendOp colorBlendOp;
+ SDL_GPUBlendFactor srcAlphaBlendFactor;
+ SDL_GPUBlendFactor dstAlphaBlendFactor;
+ SDL_GPUBlendOp alphaBlendOp;
+ SDL_GPUColorComponentFlags colorWriteMask;
+} SDL_GPUColorAttachmentBlendState;
-typedef struct SDL_GpuShaderCreateInfo
+typedef struct SDL_GPUShaderCreateInfo
{
size_t codeSize;
const Uint8 *code;
const char *entryPointName;
- SDL_GpuShaderFormat format;
- SDL_GpuShaderStage stage;
+ SDL_GPUShaderFormat format;
+ SDL_GPUShaderStage stage;
Uint32 samplerCount;
Uint32 storageTextureCount;
Uint32 storageBufferCount;
Uint32 uniformBufferCount;
SDL_PropertiesID props;
-} SDL_GpuShaderCreateInfo;
+} SDL_GPUShaderCreateInfo;
-typedef struct SDL_GpuTextureCreateInfo
+typedef struct SDL_GPUTextureCreateInfo
{
- SDL_GpuTextureType type;
- SDL_GpuTextureFormat format;
- SDL_GpuTextureUsageFlags usageFlags;
+ SDL_GPUTextureType type;
+ SDL_GPUTextureFormat format;
+ SDL_GPUTextureUsageFlags usageFlags;
Uint32 width;
Uint32 height;
Uint32 layerCountOrDepth;
Uint32 levelCount;
- SDL_GpuSampleCount sampleCount;
+ SDL_GPUSampleCount sampleCount;
SDL_PropertiesID props;
-} SDL_GpuTextureCreateInfo;
+} SDL_GPUTextureCreateInfo;
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT "SDL.gpu.createtexture.d3d12.clear.r"
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT "SDL.gpu.createtexture.d3d12.clear.g"
@@ -688,89 +688,89 @@ typedef struct SDL_GpuTextureCreateInfo
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth"
#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil"
-typedef struct SDL_GpuBufferCreateInfo
+typedef struct SDL_GPUBufferCreateInfo
{
- SDL_GpuBufferUsageFlags usageFlags;
+ SDL_GPUBufferUsageFlags usageFlags;
Uint32 sizeInBytes;
SDL_PropertiesID props;
-} SDL_GpuBufferCreateInfo;
+} SDL_GPUBufferCreateInfo;
-typedef struct SDL_GpuTransferBufferCreateInfo
+typedef struct SDL_GPUTransferBufferCreateInfo
{
- SDL_GpuTransferBufferUsage usage;
+ SDL_GPUTransferBufferUsage usage;
Uint32 sizeInBytes;
SDL_PropertiesID props;
-} SDL_GpuTransferBufferCreateInfo;
+} SDL_GPUTransferBufferCreateInfo;
/* Pipeline state structures */
-typedef struct SDL_GpuRasterizerState
+typedef struct SDL_GPURasterizerState
{
- SDL_GpuFillMode fillMode;
- SDL_GpuCullMode cullMode;
- SDL_GpuFrontFace frontFace;
+ SDL_GPUFillMode fillMode;
+ SDL_GPUCullMode cullMode;
+ SDL_GPUFrontFace frontFace;
SDL_bool depthBiasEnable;
float depthBiasConstantFactor;
float depthBiasClamp;
float depthBiasSlopeFactor;
-} SDL_GpuRasterizerState;
+} SDL_GPURasterizerState;
-typedef struct SDL_GpuMultisampleState
+typedef struct SDL_GPUMultisampleState
{
- SDL_GpuSampleCount sampleCount;
+ SDL_GPUSampleCount sampleCount;
Uint32 sampleMask;
-} SDL_GpuMultisampleState;
+} SDL_GPUMultisampleState;
-typedef struct SDL_GpuDepthStencilState
+typedef struct SDL_GPUDepthStencilState
{
SDL_bool depthTestEnable;
SDL_bool depthWriteEnable;
- SDL_GpuCompareOp compareOp;
+ SDL_GPUCompareOp compareOp;
SDL_bool stencilTestEnable;
- SDL_GpuStencilOpState backStencilState;
- SDL_GpuStencilOpState frontStencilState;
+ SDL_GPUStencilOpState backStencilState;
+ SDL_GPUStencilOpState frontStencilState;
Uint8 compareMask;
Uint8 writeMask;
Uint8 reference;
-} SDL_GpuDepthStencilState;
+} SDL_GPUDepthStencilState;
-typedef struct SDL_GpuColorAttachmentDescription
+typedef struct SDL_GPUColorAttachmentDescription
{
- SDL_GpuTextureFormat format;
- SDL_GpuColorAttachmentBlendState blendState;
-} SDL_GpuColorAttachmentDescription;
+ SDL_GPUTextureFormat format;
+ SDL_GPUColorAttachmentBlendState blendState;
+} SDL_GPUColorAttachmentDescription;
-typedef struct SDL_GpuGraphicsPipelineAttachmentInfo
+typedef struct SDL_GPUGraphicsPipelineAttachmentInfo
{
- SDL_GpuColorAttachmentDescription *colorAttachmentDescriptions;
+ SDL_GPUColorAttachmentDescription *colorAttachmentDescriptions;
Uint32 colorAttachmentCount;
SDL_bool hasDepthStencilAttachment;
- SDL_GpuTextureFormat depthStencilFormat;
-} SDL_GpuGraphicsPipelineAttachmentInfo;
-
-typedef struct SDL_GpuGraphicsPipelineCreateInfo
-{
- SDL_GpuShader *vertexShader;
- SDL_GpuShader *fragmentShader;
- SDL_GpuVertexInputState vertexInputState;
- SDL_GpuPrimitiveType primitiveType;
- SDL_GpuRasterizerState rasterizerState;
- SDL_GpuMultisampleState multisampleState;
- SDL_GpuDepthStencilState depthStencilState;
- SDL_GpuGraphicsPipelineAttachmentInfo attachmentInfo;
+ SDL_GPUTextureFormat depthStencilFormat;
+} SDL_GPUGraphicsPipelineAttachmentInfo;
+
+typedef struct SDL_GPUGraphicsPipelineCreateInfo
+{
+ SDL_GPUShader *vertexShader;
+ SDL_GPUShader *fragmentShader;
+ SDL_GPUVertexInputState vertexInputState;
+ SDL_GPUPrimitiveType primitiveType;
+ SDL_GPURasterizerState rasterizerState;
+ SDL_GPUMultisampleState multisampleState;
+ SDL_GPUDepthStencilState depthStencilState;
+ SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo;
float blendConstants[4];
SDL_PropertiesID props;
-} SDL_GpuGraphicsPipelineCreateInfo;
+} SDL_GPUGraphicsPipelineCreateInfo;
-typedef struct SDL_GpuComputePipelineCreateInfo
+typedef struct SDL_GPUComputePipelineCreateInfo
{
size_t codeSize;
const Uint8 *code;
const char *entryPointName;
- SDL_GpuShaderFormat format;
+ SDL_GPUShaderFormat format;
Uint32 readOnlyStorageTextureCount;
Uint32 readOnlyStorageBufferCount;
Uint32 writeOnlyStorageTextureCount;
@@ -781,12 +781,12 @@ typedef struct SDL_GpuComputePipelineCreateInfo
Uint32 threadCountZ;
SDL_PropertiesID props;
-} SDL_GpuComputePipelineCreateInfo;
+} SDL_GPUComputePipelineCreateInfo;
-typedef struct SDL_GpuColorAttachmentInfo
+typedef struct SDL_GPUColorAttachmentInfo
{
/* The texture that will be used as a color attachment by a render pass. */
- SDL_GpuTexture *texture;
+ SDL_GPUTexture *texture;
Uint32 mipLevel;
Uint32 layerOrDepthPlane; /* For 3D textures, you can bind an individual depth plane as an attachment. */
@@ -805,7 +805,7 @@ typedef struct SDL_GpuColorAttachmentInfo
* The driver will do whatever it wants with the texture memory.
* This is a good option if you know that every single pixel will be touched in the render pass.
*/
- SDL_GpuLoadOp loadOp;
+ SDL_GPULoadOp loadOp;
/* Determines what is done with the texture at the end of the render pass.
*
@@ -816,19 +816,19 @@ typedef struct SDL_GpuColorAttachmentInfo
* The driver will do whatever it wants with the texture memory.
* This is often a good option for depth/stencil textures.
*/
- SDL_GpuStoreOp storeOp;
+ SDL_GPUStoreOp storeOp;
/* if SDL_TRUE, cycles the texture if the texture is bound and loadOp is not LOAD */
SDL_bool cycle;
-} SDL_GpuColorAttachmentInfo;
+} SDL_GPUColorAttachmentInfo;
-typedef struct SDL_GpuDepthStencilAttachmentInfo
+typedef struct SDL_GPUDepthStencilAttachmentInfo
{
/* The texture that will be used as the depth stencil attachment by a render pass. */
- SDL_GpuTexture *texture;
+ SDL_GPUTexture *texture;
/* Can be ignored by the render pass if CLEAR is not used */
- SDL_GpuDepthStencilValue depthStencilClearValue;
+ SDL_GPUDepthStencilValue depthStencilClearValue;
/* Determines what is done with the depth values at the beginning of the render pass.
*
@@ -842,7 +842,7 @@ typedef struct SDL_GpuDepthStencilAttachmentInfo
* The driver will do whatever it wants with the memory.
* This is a good option if you know that every single pixel will be touched in the render pass.
*/
- SDL_GpuLoadOp loadOp;
+ SDL_GPULoadOp loadOp;
/* Determines what is done with the depth values at the end of the render pass.
*
@@ -853,7 +853,7 @@ typedef struct SDL_GpuDepthStencilAttachmentInfo
* The driver will do whatever it wants with the texture memory.
* This is often a good option for depth/stencil textures.
*/
- SDL_GpuStoreOp storeOp;
+ SDL_GPUStoreOp storeOp;
/* Determines what is done with the stencil values at the beginning of the render pass.
*
@@ -867,7 +867,7 @@ typedef struct SDL_GpuDepthStencilAttachmentInfo
* The driver will do whatever it wants with the memory.
* This is a good option if you know that every single pixel will be touched in the render pass.
*/
- SDL_GpuLoadOp stencilLoadOp;
+ SDL_GPULoadOp stencilLoadOp;
/* Determines what is done with the stencil values at the end of the render pass.
*
@@ -878,43 +878,43 @@ typedef struct SDL_GpuDepthStencilAttachmentInfo
* The driver will do whatever it wants with the texture memory.
* This is often a good option for depth/stencil textures.
*/
- SDL_GpuStoreOp stencilStoreOp;
+ SDL_GPUStoreOp stencilStoreOp;
/* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */
SDL_bool cycle;
-} SDL_GpuDepthStencilAttachmentInfo;
+} SDL_GPUDepthStencilAttachmentInfo;
/* Binding structs */
-typedef struct SDL_GpuBufferBinding
+typedef struct SDL_GPUBufferBinding
{
- SDL_GpuBuffer *buffer;
+ SDL_GPUBuffer *buffer;
Uint32 offset;
-} SDL_GpuBufferBinding;
+} SDL_GPUBufferBinding;
-typedef struct SDL_GpuTextureSamplerBinding
+typedef struct SDL_GPUTextureSamplerBinding
{
- SDL_GpuTexture *texture;
- SDL_GpuSampler *sampler;
-} SDL_GpuTextureSamplerBinding;
+ SDL_GPUTexture *texture;
+ SDL_GPUSampler *sampler;
+} SDL_GPUTextureSamplerBinding;
-typedef struct SDL_GpuStorageBufferWriteOnlyBinding
+typedef struct SDL_GPUStorageBufferWriteOnlyBinding
{
- SDL_GpuBuffer *buffer;
+ SDL_GPUBuffer *buffer;
(Patch may be truncated, please check the link at the top of this post.)