From a7cb45ee1bbd1c8549949867c567c179262c1c07 Mon Sep 17 00:00:00 2001 From: hwsmm Date: Mon, 2 Sep 2024 22:03:54 +0900 Subject: [PATCH] Update bindings to df501040fd646a1f4eab92aa5b698b35a36013ed --- SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs | 4 +- SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs | 2 +- SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs | 1242 ++++++++++++++++++++++ SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs | 17 +- SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs | 1 + SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs | 1 - SDL3-CS/SDL3/SDL_gpu.cs | 17 + SDL3-CS/generate_bindings.py | 1 + 8 files changed, 1274 insertions(+), 11 deletions(-) create mode 100644 SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs create mode 100644 SDL3-CS/SDL3/SDL_gpu.cs diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs index 6b324fe..8013f26 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs @@ -67,10 +67,10 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] - public static extern IntPtr SDL_AtomicSetPtr([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v); + public static extern IntPtr SDL_AtomicSetPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] - public static extern IntPtr SDL_AtomicGetPtr([NativeTypeName("void **")] IntPtr* a); + public static extern IntPtr SDL_AtomicGetPointer([NativeTypeName("void **")] IntPtr* a); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs index 4597e8b..43da9ba 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs @@ -1106,7 +1106,7 @@ namespace SDL public static extern SDL_bool SDL_AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_DelEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); + public static extern void SDL_RemoveEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs new file mode 100644 index 0000000..c4d1f6a --- /dev/null +++ b/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs @@ -0,0 +1,1242 @@ +/* + + C# bindings for Simple DirectMedia Layer. + Original copyright notice of input files: + + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace SDL +{ + public partial struct SDL_GPUDevice + { + } + + public partial struct SDL_GPUBuffer + { + } + + public partial struct SDL_GPUTransferBuffer + { + } + + public partial struct SDL_GPUTexture + { + } + + public partial struct SDL_GPUSampler + { + } + + public partial struct SDL_GPUShader + { + } + + public partial struct SDL_GPUComputePipeline + { + } + + public partial struct SDL_GPUGraphicsPipeline + { + } + + public partial struct SDL_GPUCommandBuffer + { + } + + public partial struct SDL_GPURenderPass + { + } + + public partial struct SDL_GPUComputePass + { + } + + public partial struct SDL_GPUCopyPass + { + } + + public partial struct SDL_GPUFence + { + } + + public enum SDL_GPUPrimitiveType + { + SDL_GPU_PRIMITIVETYPE_POINTLIST, + SDL_GPU_PRIMITIVETYPE_LINELIST, + SDL_GPU_PRIMITIVETYPE_LINESTRIP, + SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP, + } + + public enum SDL_GPULoadOp + { + SDL_GPU_LOADOP_LOAD, + SDL_GPU_LOADOP_CLEAR, + SDL_GPU_LOADOP_DONT_CARE, + } + + public enum SDL_GPUStoreOp + { + SDL_GPU_STOREOP_STORE, + SDL_GPU_STOREOP_DONT_CARE, + } + + public enum SDL_GPUIndexElementSize + { + SDL_GPU_INDEXELEMENTSIZE_16BIT, + SDL_GPU_INDEXELEMENTSIZE_32BIT, + } + + public enum SDL_GPUTextureFormat + { + SDL_GPU_TEXTUREFORMAT_INVALID = -1, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM, + SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM, + SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM, + SDL_GPU_TEXTUREFORMAT_R8_UNORM, + SDL_GPU_TEXTUREFORMAT_A8_UNORM, + SDL_GPU_TEXTUREFORMAT_BC1_UNORM, + SDL_GPU_TEXTUREFORMAT_BC2_UNORM, + SDL_GPU_TEXTUREFORMAT_BC3_UNORM, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM, + SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, + SDL_GPU_TEXTUREFORMAT_R16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT, + SDL_GPU_TEXTUREFORMAT_R16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC3_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_D16_UNORM, + SDL_GPU_TEXTUREFORMAT_D24_UNORM, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT, + } + + public enum SDL_GPUTextureUsageFlagBits + { + SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT = 0x00000001, + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET_BIT = 0x00000002, + SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET_BIT = 0x00000004, + SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040, + } + + public enum SDL_GPUTextureType + { + SDL_GPU_TEXTURETYPE_2D, + SDL_GPU_TEXTURETYPE_2D_ARRAY, + SDL_GPU_TEXTURETYPE_3D, + SDL_GPU_TEXTURETYPE_CUBE, + } + + public enum SDL_GPUSampleCount + { + SDL_GPU_SAMPLECOUNT_1, + SDL_GPU_SAMPLECOUNT_2, + SDL_GPU_SAMPLECOUNT_4, + SDL_GPU_SAMPLECOUNT_8, + } + + public enum SDL_GPUCubeMapFace + { + SDL_GPU_CUBEMAPFACE_POSITIVEX, + SDL_GPU_CUBEMAPFACE_NEGATIVEX, + SDL_GPU_CUBEMAPFACE_POSITIVEY, + SDL_GPU_CUBEMAPFACE_NEGATIVEY, + SDL_GPU_CUBEMAPFACE_POSITIVEZ, + SDL_GPU_CUBEMAPFACE_NEGATIVEZ, + } + + public enum SDL_GPUBufferUsageFlagBits + { + SDL_GPU_BUFFERUSAGE_VERTEX_BIT = 0x00000001, + SDL_GPU_BUFFERUSAGE_INDEX_BIT = 0x00000002, + SDL_GPU_BUFFERUSAGE_INDIRECT_BIT = 0x00000004, + SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040, + } + + public enum SDL_GPUTransferBufferUsage + { + SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD, + } + + public enum SDL_GPUShaderStage + { + SDL_GPU_SHADERSTAGE_VERTEX, + SDL_GPU_SHADERSTAGE_FRAGMENT, + } + + public enum SDL_GPUShaderFormatFlagBits + { + SDL_GPU_SHADERFORMAT_INVALID = 0x00000000, + SDL_GPU_SHADERFORMAT_SECRET = 0x00000001, + SDL_GPU_SHADERFORMAT_SPIRV = 0x00000002, + SDL_GPU_SHADERFORMAT_DXBC = 0x00000004, + SDL_GPU_SHADERFORMAT_DXIL = 0x00000008, + SDL_GPU_SHADERFORMAT_MSL = 0x00000010, + SDL_GPU_SHADERFORMAT_METALLIB = 0x00000020, + } + + public enum SDL_GPUVertexElementFormat + { + SDL_GPU_VERTEXELEMENTFORMAT_INT, + SDL_GPU_VERTEXELEMENTFORMAT_INT2, + SDL_GPU_VERTEXELEMENTFORMAT_INT3, + SDL_GPU_VERTEXELEMENTFORMAT_INT4, + SDL_GPU_VERTEXELEMENTFORMAT_UINT, + SDL_GPU_VERTEXELEMENTFORMAT_UINT2, + SDL_GPU_VERTEXELEMENTFORMAT_UINT3, + SDL_GPU_VERTEXELEMENTFORMAT_UINT4, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_HALF2, + SDL_GPU_VERTEXELEMENTFORMAT_HALF4, + } + + public enum SDL_GPUVertexInputRate + { + SDL_GPU_VERTEXINPUTRATE_VERTEX = 0, + SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1, + } + + public enum SDL_GPUFillMode + { + SDL_GPU_FILLMODE_FILL, + SDL_GPU_FILLMODE_LINE, + } + + public enum SDL_GPUCullMode + { + SDL_GPU_CULLMODE_NONE, + SDL_GPU_CULLMODE_FRONT, + SDL_GPU_CULLMODE_BACK, + } + + public enum SDL_GPUFrontFace + { + SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, + SDL_GPU_FRONTFACE_CLOCKWISE, + } + + public enum SDL_GPUCompareOp + { + SDL_GPU_COMPAREOP_NEVER, + SDL_GPU_COMPAREOP_LESS, + SDL_GPU_COMPAREOP_EQUAL, + SDL_GPU_COMPAREOP_LESS_OR_EQUAL, + SDL_GPU_COMPAREOP_GREATER, + SDL_GPU_COMPAREOP_NOT_EQUAL, + SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + SDL_GPU_COMPAREOP_ALWAYS, + } + + public enum SDL_GPUStencilOp + { + SDL_GPU_STENCILOP_KEEP, + SDL_GPU_STENCILOP_ZERO, + SDL_GPU_STENCILOP_REPLACE, + SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_INVERT, + SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, + SDL_GPU_STENCILOP_DECREMENT_AND_WRAP, + } + + public enum SDL_GPUBlendOp + { + SDL_GPU_BLENDOP_ADD, + SDL_GPU_BLENDOP_SUBTRACT, + SDL_GPU_BLENDOP_REVERSE_SUBTRACT, + SDL_GPU_BLENDOP_MIN, + SDL_GPU_BLENDOP_MAX, + } + + public enum SDL_GPUBlendFactor + { + SDL_GPU_BLENDFACTOR_ZERO, + SDL_GPU_BLENDFACTOR_ONE, + SDL_GPU_BLENDFACTOR_SRC_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SDL_GPU_BLENDFACTOR_DST_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_DST_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE, + } + + public 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, + } + + public enum SDL_GPUFilter + { + SDL_GPU_FILTER_NEAREST, + SDL_GPU_FILTER_LINEAR, + } + + public enum SDL_GPUSamplerMipmapMode + { + SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, + SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, + } + + public enum SDL_GPUSamplerAddressMode + { + SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE, + } + + public enum SDL_GPUPresentMode + { + SDL_GPU_PRESENTMODE_VSYNC, + SDL_GPU_PRESENTMODE_IMMEDIATE, + SDL_GPU_PRESENTMODE_MAILBOX, + } + + public enum SDL_GPUSwapchainComposition + { + SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048, + } + + public enum SDL_GPUDriver + { + SDL_GPU_DRIVER_INVALID = -1, + SDL_GPU_DRIVER_SECRET, + SDL_GPU_DRIVER_VULKAN, + SDL_GPU_DRIVER_D3D11, + SDL_GPU_DRIVER_D3D12, + SDL_GPU_DRIVER_METAL, + } + + public partial struct SDL_GPUDepthStencilValue + { + public float depth; + + [NativeTypeName("Uint8")] + public byte stencil; + } + + public partial struct SDL_GPUViewport + { + public float x; + + public float y; + + public float w; + + public float h; + + public float minDepth; + + public float maxDepth; + } + + public unsafe partial struct SDL_GPUTextureTransferInfo + { + public SDL_GPUTransferBuffer* transferBuffer; + + [NativeTypeName("Uint32")] + public uint offset; + + [NativeTypeName("Uint32")] + public uint imagePitch; + + [NativeTypeName("Uint32")] + public uint imageHeight; + } + + public unsafe partial struct SDL_GPUTransferBufferLocation + { + public SDL_GPUTransferBuffer* transferBuffer; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUTextureLocation + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mipLevel; + + [NativeTypeName("Uint32")] + public uint layer; + + [NativeTypeName("Uint32")] + public uint x; + + [NativeTypeName("Uint32")] + public uint y; + + [NativeTypeName("Uint32")] + public uint z; + } + + public unsafe partial struct SDL_GPUTextureRegion + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mipLevel; + + [NativeTypeName("Uint32")] + public uint layer; + + [NativeTypeName("Uint32")] + public uint x; + + [NativeTypeName("Uint32")] + public uint y; + + [NativeTypeName("Uint32")] + public uint z; + + [NativeTypeName("Uint32")] + public uint w; + + [NativeTypeName("Uint32")] + public uint h; + + [NativeTypeName("Uint32")] + public uint d; + } + + public unsafe partial struct SDL_GPUBlitRegion + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mipLevel; + + [NativeTypeName("Uint32")] + public uint layerOrDepthPlane; + + [NativeTypeName("Uint32")] + public uint x; + + [NativeTypeName("Uint32")] + public uint y; + + [NativeTypeName("Uint32")] + public uint w; + + [NativeTypeName("Uint32")] + public uint h; + } + + public unsafe partial struct SDL_GPUBufferLocation + { + public SDL_GPUBuffer* buffer; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUBufferRegion + { + public SDL_GPUBuffer* buffer; + + [NativeTypeName("Uint32")] + public uint offset; + + [NativeTypeName("Uint32")] + public uint size; + } + + public partial struct SDL_GPUIndirectDrawCommand + { + [NativeTypeName("Uint32")] + public uint vertexCount; + + [NativeTypeName("Uint32")] + public uint instanceCount; + + [NativeTypeName("Uint32")] + public uint firstVertex; + + [NativeTypeName("Uint32")] + public uint firstInstance; + } + + public partial struct SDL_GPUIndexedIndirectDrawCommand + { + [NativeTypeName("Uint32")] + public uint indexCount; + + [NativeTypeName("Uint32")] + public uint instanceCount; + + [NativeTypeName("Uint32")] + public uint firstIndex; + + [NativeTypeName("Sint32")] + public int vertexOffset; + + [NativeTypeName("Uint32")] + public uint firstInstance; + } + + public partial struct SDL_GPUIndirectDispatchCommand + { + [NativeTypeName("Uint32")] + public uint groupCountX; + + [NativeTypeName("Uint32")] + public uint groupCountY; + + [NativeTypeName("Uint32")] + public uint groupCountZ; + } + + public partial struct SDL_GPUSamplerCreateInfo + { + public SDL_GPUFilter minFilter; + + public SDL_GPUFilter magFilter; + + public SDL_GPUSamplerMipmapMode mipmapMode; + + public SDL_GPUSamplerAddressMode addressModeU; + + public SDL_GPUSamplerAddressMode addressModeV; + + public SDL_GPUSamplerAddressMode addressModeW; + + public float mipLodBias; + + public SDL_bool anisotropyEnable; + + public float maxAnisotropy; + + public SDL_bool compareEnable; + + public SDL_GPUCompareOp compareOp; + + public float minLod; + + public float maxLod; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUVertexBinding + { + [NativeTypeName("Uint32")] + public uint binding; + + [NativeTypeName("Uint32")] + public uint stride; + + public SDL_GPUVertexInputRate inputRate; + + [NativeTypeName("Uint32")] + public uint instanceStepRate; + } + + public partial struct SDL_GPUVertexAttribute + { + [NativeTypeName("Uint32")] + public uint location; + + [NativeTypeName("Uint32")] + public uint binding; + + public SDL_GPUVertexElementFormat format; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUVertexInputState + { + [NativeTypeName("const SDL_GPUVertexBinding *")] + public SDL_GPUVertexBinding* vertexBindings; + + [NativeTypeName("Uint32")] + public uint vertexBindingCount; + + [NativeTypeName("const SDL_GPUVertexAttribute *")] + public SDL_GPUVertexAttribute* vertexAttributes; + + [NativeTypeName("Uint32")] + public uint vertexAttributeCount; + } + + public partial struct SDL_GPUStencilOpState + { + public SDL_GPUStencilOp failOp; + + public SDL_GPUStencilOp passOp; + + public SDL_GPUStencilOp depthFailOp; + + public SDL_GPUCompareOp compareOp; + } + + public partial struct SDL_GPUColorAttachmentBlendState + { + public SDL_bool blendEnable; + + public SDL_GPUBlendFactor srcColorBlendFactor; + + public SDL_GPUBlendFactor dstColorBlendFactor; + + public SDL_GPUBlendOp colorBlendOp; + + public SDL_GPUBlendFactor srcAlphaBlendFactor; + + public SDL_GPUBlendFactor dstAlphaBlendFactor; + + public SDL_GPUBlendOp alphaBlendOp; + + public SDL_GPUColorComponentFlags colorWriteMask; + } + + public unsafe partial struct SDL_GPUShaderCreateInfo + { + [NativeTypeName("size_t")] + public nuint codeSize; + + [NativeTypeName("const Uint8 *")] + public byte* code; + + [NativeTypeName("const char *")] + public byte* entryPointName; + + public SDL_GPUShaderFormat format; + + public SDL_GPUShaderStage stage; + + [NativeTypeName("Uint32")] + public uint samplerCount; + + [NativeTypeName("Uint32")] + public uint storageTextureCount; + + [NativeTypeName("Uint32")] + public uint storageBufferCount; + + [NativeTypeName("Uint32")] + public uint uniformBufferCount; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUTextureCreateInfo + { + public SDL_GPUTextureType type; + + public SDL_GPUTextureFormat format; + + public SDL_GPUTextureUsageFlags usageFlags; + + [NativeTypeName("Uint32")] + public uint width; + + [NativeTypeName("Uint32")] + public uint height; + + [NativeTypeName("Uint32")] + public uint layerCountOrDepth; + + [NativeTypeName("Uint32")] + public uint levelCount; + + public SDL_GPUSampleCount sampleCount; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUBufferCreateInfo + { + public SDL_GPUBufferUsageFlags usageFlags; + + [NativeTypeName("Uint32")] + public uint sizeInBytes; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUTransferBufferCreateInfo + { + public SDL_GPUTransferBufferUsage usage; + + [NativeTypeName("Uint32")] + public uint sizeInBytes; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPURasterizerState + { + public SDL_GPUFillMode fillMode; + + public SDL_GPUCullMode cullMode; + + public SDL_GPUFrontFace frontFace; + + public SDL_bool depthBiasEnable; + + public float depthBiasConstantFactor; + + public float depthBiasClamp; + + public float depthBiasSlopeFactor; + } + + public partial struct SDL_GPUMultisampleState + { + public SDL_GPUSampleCount sampleCount; + + [NativeTypeName("Uint32")] + public uint sampleMask; + } + + public partial struct SDL_GPUDepthStencilState + { + public SDL_bool depthTestEnable; + + public SDL_bool depthWriteEnable; + + public SDL_GPUCompareOp compareOp; + + public SDL_bool stencilTestEnable; + + public SDL_GPUStencilOpState backStencilState; + + public SDL_GPUStencilOpState frontStencilState; + + [NativeTypeName("Uint8")] + public byte compareMask; + + [NativeTypeName("Uint8")] + public byte writeMask; + + [NativeTypeName("Uint8")] + public byte reference; + } + + public partial struct SDL_GPUColorAttachmentDescription + { + public SDL_GPUTextureFormat format; + + public SDL_GPUColorAttachmentBlendState blendState; + } + + public unsafe partial struct SDL_GPUGraphicsPipelineAttachmentInfo + { + public SDL_GPUColorAttachmentDescription* colorAttachmentDescriptions; + + [NativeTypeName("Uint32")] + public uint colorAttachmentCount; + + public SDL_bool hasDepthStencilAttachment; + + public SDL_GPUTextureFormat depthStencilFormat; + } + + public unsafe partial struct SDL_GPUGraphicsPipelineCreateInfo + { + public SDL_GPUShader* vertexShader; + + public SDL_GPUShader* fragmentShader; + + public SDL_GPUVertexInputState vertexInputState; + + public SDL_GPUPrimitiveType primitiveType; + + public SDL_GPURasterizerState rasterizerState; + + public SDL_GPUMultisampleState multisampleState; + + public SDL_GPUDepthStencilState depthStencilState; + + public SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo; + + [NativeTypeName("float[4]")] + public _blendConstants_e__FixedBuffer blendConstants; + + public SDL_PropertiesID props; + + [InlineArray(4)] + public partial struct _blendConstants_e__FixedBuffer + { + public float e0; + } + } + + public unsafe partial struct SDL_GPUComputePipelineCreateInfo + { + [NativeTypeName("size_t")] + public nuint codeSize; + + [NativeTypeName("const Uint8 *")] + public byte* code; + + [NativeTypeName("const char *")] + public byte* entryPointName; + + public SDL_GPUShaderFormat format; + + [NativeTypeName("Uint32")] + public uint readOnlyStorageTextureCount; + + [NativeTypeName("Uint32")] + public uint readOnlyStorageBufferCount; + + [NativeTypeName("Uint32")] + public uint writeOnlyStorageTextureCount; + + [NativeTypeName("Uint32")] + public uint writeOnlyStorageBufferCount; + + [NativeTypeName("Uint32")] + public uint uniformBufferCount; + + [NativeTypeName("Uint32")] + public uint threadCountX; + + [NativeTypeName("Uint32")] + public uint threadCountY; + + [NativeTypeName("Uint32")] + public uint threadCountZ; + + public SDL_PropertiesID props; + } + + public unsafe partial struct SDL_GPUColorAttachmentInfo + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mipLevel; + + [NativeTypeName("Uint32")] + public uint layerOrDepthPlane; + + public SDL_FColor clearColor; + + public SDL_GPULoadOp loadOp; + + public SDL_GPUStoreOp storeOp; + + public SDL_bool cycle; + } + + public unsafe partial struct SDL_GPUDepthStencilAttachmentInfo + { + public SDL_GPUTexture* texture; + + public SDL_GPUDepthStencilValue depthStencilClearValue; + + public SDL_GPULoadOp loadOp; + + public SDL_GPUStoreOp storeOp; + + public SDL_GPULoadOp stencilLoadOp; + + public SDL_GPUStoreOp stencilStoreOp; + + public SDL_bool cycle; + } + + public unsafe partial struct SDL_GPUBufferBinding + { + public SDL_GPUBuffer* buffer; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUTextureSamplerBinding + { + public SDL_GPUTexture* texture; + + public SDL_GPUSampler* sampler; + } + + public unsafe partial struct SDL_GPUStorageBufferWriteOnlyBinding + { + public SDL_GPUBuffer* buffer; + + public SDL_bool cycle; + } + + public unsafe partial struct SDL_GPUStorageTextureWriteOnlyBinding + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mipLevel; + + [NativeTypeName("Uint32")] + public uint layer; + + public SDL_bool cycle; + } + + public static unsafe partial class SDL3 + { + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUDevice* SDL_CreateGPUDevice(SDL_GPUShaderFormat formatFlags, SDL_bool debugMode, [NativeTypeName("const char *")] byte* name); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUDevice* SDL_CreateGPUDeviceWithProperties(SDL_PropertiesID props); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DestroyGPUDevice(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUDriver SDL_GetGPUDriver(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUComputePipeline* SDL_CreateGPUComputePipeline(SDL_GPUDevice* device, SDL_GPUComputePipelineCreateInfo* computePipelineCreateInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUGraphicsPipeline* SDL_CreateGPUGraphicsPipeline(SDL_GPUDevice* device, SDL_GPUGraphicsPipelineCreateInfo* pipelineCreateInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUSampler* SDL_CreateGPUSampler(SDL_GPUDevice* device, SDL_GPUSamplerCreateInfo* samplerCreateInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUShader* SDL_CreateGPUShader(SDL_GPUDevice* device, SDL_GPUShaderCreateInfo* shaderCreateInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTexture* SDL_CreateGPUTexture(SDL_GPUDevice* device, SDL_GPUTextureCreateInfo* textureCreateInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUBuffer* SDL_CreateGPUBuffer(SDL_GPUDevice* device, SDL_GPUBufferCreateInfo* bufferCreateInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTransferBuffer* SDL_CreateGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBufferCreateInfo* transferBufferCreateInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUBufferName(SDL_GPUDevice* device, SDL_GPUBuffer* buffer, [NativeTypeName("const char *")] byte* text); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUTextureName(SDL_GPUDevice* device, SDL_GPUTexture* texture, [NativeTypeName("const char *")] byte* text); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_InsertGPUDebugLabel(SDL_GPUCommandBuffer* commandBuffer, [NativeTypeName("const char *")] byte* text); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUDebugGroup(SDL_GPUCommandBuffer* commandBuffer, [NativeTypeName("const char *")] byte* name); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PopGPUDebugGroup(SDL_GPUCommandBuffer* commandBuffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUTexture(SDL_GPUDevice* device, SDL_GPUTexture* texture); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUSampler(SDL_GPUDevice* device, SDL_GPUSampler* sampler); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUBuffer(SDL_GPUDevice* device, SDL_GPUBuffer* buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transferBuffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUComputePipeline(SDL_GPUDevice* device, SDL_GPUComputePipeline* computePipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUShader(SDL_GPUDevice* device, SDL_GPUShader* shader); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUGraphicsPipeline(SDL_GPUDevice* device, SDL_GPUGraphicsPipeline* graphicsPipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUCommandBuffer* SDL_AcquireGPUCommandBuffer(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUVertexUniformData(SDL_GPUCommandBuffer* commandBuffer, [NativeTypeName("Uint32")] uint slotIndex, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint dataLengthInBytes); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUFragmentUniformData(SDL_GPUCommandBuffer* commandBuffer, [NativeTypeName("Uint32")] uint slotIndex, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint dataLengthInBytes); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUComputeUniformData(SDL_GPUCommandBuffer* commandBuffer, [NativeTypeName("Uint32")] uint slotIndex, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint dataLengthInBytes); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPURenderPass* SDL_BeginGPURenderPass(SDL_GPUCommandBuffer* commandBuffer, SDL_GPUColorAttachmentInfo* colorAttachmentInfos, [NativeTypeName("Uint32")] uint colorAttachmentCount, SDL_GPUDepthStencilAttachmentInfo* depthStencilAttachmentInfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUGraphicsPipeline(SDL_GPURenderPass* renderPass, SDL_GPUGraphicsPipeline* graphicsPipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUViewport(SDL_GPURenderPass* renderPass, SDL_GPUViewport* viewport); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUScissor(SDL_GPURenderPass* renderPass, SDL_Rect* scissor); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexBuffers(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint firstBinding, SDL_GPUBufferBinding* pBindings, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUIndexBuffer(SDL_GPURenderPass* renderPass, SDL_GPUBufferBinding* pBinding, SDL_GPUIndexElementSize indexElementSize); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexSamplers(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUTextureSamplerBinding* textureSamplerBindings, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexStorageTextures(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUTexture** storageTextures, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexStorageBuffers(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUBuffer** storageBuffers, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUFragmentSamplers(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUTextureSamplerBinding* textureSamplerBindings, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUFragmentStorageTextures(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUTexture** storageTextures, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUFragmentStorageBuffers(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUBuffer** storageBuffers, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUIndexedPrimitives(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint indexCount, [NativeTypeName("Uint32")] uint instanceCount, [NativeTypeName("Uint32")] uint firstIndex, [NativeTypeName("Sint32")] int vertexOffset, [NativeTypeName("Uint32")] uint firstInstance); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUPrimitives(SDL_GPURenderPass* renderPass, [NativeTypeName("Uint32")] uint vertexCount, [NativeTypeName("Uint32")] uint instanceCount, [NativeTypeName("Uint32")] uint firstVertex, [NativeTypeName("Uint32")] uint firstInstance); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUPrimitivesIndirect(SDL_GPURenderPass* renderPass, SDL_GPUBuffer* buffer, [NativeTypeName("Uint32")] uint offsetInBytes, [NativeTypeName("Uint32")] uint drawCount, [NativeTypeName("Uint32")] uint stride); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUIndexedPrimitivesIndirect(SDL_GPURenderPass* renderPass, SDL_GPUBuffer* buffer, [NativeTypeName("Uint32")] uint offsetInBytes, [NativeTypeName("Uint32")] uint drawCount, [NativeTypeName("Uint32")] uint stride); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_EndGPURenderPass(SDL_GPURenderPass* renderPass); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUComputePass* SDL_BeginGPUComputePass(SDL_GPUCommandBuffer* commandBuffer, SDL_GPUStorageTextureWriteOnlyBinding* storageTextureBindings, [NativeTypeName("Uint32")] uint storageTextureBindingCount, SDL_GPUStorageBufferWriteOnlyBinding* storageBufferBindings, [NativeTypeName("Uint32")] uint storageBufferBindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUComputePipeline(SDL_GPUComputePass* computePass, SDL_GPUComputePipeline* computePipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUComputeStorageTextures(SDL_GPUComputePass* computePass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUTexture** storageTextures, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUComputeStorageBuffers(SDL_GPUComputePass* computePass, [NativeTypeName("Uint32")] uint firstSlot, SDL_GPUBuffer** storageBuffers, [NativeTypeName("Uint32")] uint bindingCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DispatchGPUCompute(SDL_GPUComputePass* computePass, [NativeTypeName("Uint32")] uint groupCountX, [NativeTypeName("Uint32")] uint groupCountY, [NativeTypeName("Uint32")] uint groupCountZ); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DispatchGPUComputeIndirect(SDL_GPUComputePass* computePass, SDL_GPUBuffer* buffer, [NativeTypeName("Uint32")] uint offsetInBytes); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_EndGPUComputePass(SDL_GPUComputePass* computePass); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("void*")] + public static extern IntPtr SDL_MapGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transferBuffer, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_UnmapGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transferBuffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUCopyPass* SDL_BeginGPUCopyPass(SDL_GPUCommandBuffer* commandBuffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_UploadToGPUTexture(SDL_GPUCopyPass* copyPass, SDL_GPUTextureTransferInfo* source, SDL_GPUTextureRegion* destination, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_UploadToGPUBuffer(SDL_GPUCopyPass* copyPass, SDL_GPUTransferBufferLocation* source, SDL_GPUBufferRegion* destination, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_CopyGPUTextureToTexture(SDL_GPUCopyPass* copyPass, SDL_GPUTextureLocation* source, SDL_GPUTextureLocation* destination, [NativeTypeName("Uint32")] uint w, [NativeTypeName("Uint32")] uint h, [NativeTypeName("Uint32")] uint d, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_CopyGPUBufferToBuffer(SDL_GPUCopyPass* copyPass, SDL_GPUBufferLocation* source, SDL_GPUBufferLocation* destination, [NativeTypeName("Uint32")] uint size, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DownloadFromGPUTexture(SDL_GPUCopyPass* copyPass, SDL_GPUTextureRegion* source, SDL_GPUTextureTransferInfo* destination); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DownloadFromGPUBuffer(SDL_GPUCopyPass* copyPass, SDL_GPUBufferRegion* source, SDL_GPUTransferBufferLocation* destination); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_EndGPUCopyPass(SDL_GPUCopyPass* copyPass); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_GenerateMipmapsForGPUTexture(SDL_GPUCommandBuffer* commandBuffer, SDL_GPUTexture* texture); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BlitGPUTexture(SDL_GPUCommandBuffer* commandBuffer, SDL_GPUBlitRegion* source, SDL_GPUBlitRegion* destination, SDL_FlipMode flipMode, SDL_GPUFilter filterMode, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_WindowSupportsGPUSwapchainComposition(SDL_GPUDevice* device, SDL_Window* window, SDL_GPUSwapchainComposition swapchainComposition); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_WindowSupportsGPUPresentMode(SDL_GPUDevice* device, SDL_Window* window, SDL_GPUPresentMode presentMode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_ClaimWindowForGPUDevice(SDL_GPUDevice* device, SDL_Window* window); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseWindowFromGPUDevice(SDL_GPUDevice* device, SDL_Window* window); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_SetGPUSwapchainParameters(SDL_GPUDevice* device, SDL_Window* window, SDL_GPUSwapchainComposition swapchainComposition, SDL_GPUPresentMode presentMode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat(SDL_GPUDevice* device, SDL_Window* window); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTexture* SDL_AcquireGPUSwapchainTexture(SDL_GPUCommandBuffer* commandBuffer, SDL_Window* window, [NativeTypeName("Uint32 *")] uint* pWidth, [NativeTypeName("Uint32 *")] uint* pHeight); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SubmitGPUCommandBuffer(SDL_GPUCommandBuffer* commandBuffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUFence* SDL_SubmitGPUCommandBufferAndAcquireFence(SDL_GPUCommandBuffer* commandBuffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_WaitForGPUIdle(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_WaitForGPUFences(SDL_GPUDevice* device, SDL_bool waitAll, SDL_GPUFence** pFences, [NativeTypeName("Uint32")] uint fenceCount); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_QueryGPUFence(SDL_GPUDevice* device, SDL_GPUFence* fence); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUFence(SDL_GPUDevice* device, SDL_GPUFence* fence); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint SDL_GPUTextureFormatTexelBlockSize(SDL_GPUTextureFormat textureFormat); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_GPUTextureSupportsFormat(SDL_GPUDevice* device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_GPUTextureSupportsSampleCount(SDL_GPUDevice* device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sampleCount); + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT \"SDL.gpu.createtexture.d3d12.clear.r\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT => "SDL.gpu.createtexture.d3d12.clear.r"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT \"SDL.gpu.createtexture.d3d12.clear.g\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT => "SDL.gpu.createtexture.d3d12.clear.g"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT \"SDL.gpu.createtexture.d3d12.clear.b\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT => "SDL.gpu.createtexture.d3d12.clear.b"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT \"SDL.gpu.createtexture.d3d12.clear.a\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT => "SDL.gpu.createtexture.d3d12.clear.a"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT \"SDL.gpu.createtexture.d3d12.clear.depth\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT => "SDL.gpu.createtexture.d3d12.clear.depth"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 \"SDL.gpu.createtexture.d3d12.clear.stencil\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 => "SDL.gpu.createtexture.d3d12.clear.stencil"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL \"SDL.gpu.device.create.debugmode\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL => "SDL.gpu.device.create.debugmode"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL \"SDL.gpu.device.create.preferlowpower\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL => "SDL.gpu.device.create.preferlowpower"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING \"SDL.gpu.device.create.name\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING => "SDL.gpu.device.create.name"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL \"SDL.gpu.device.create.shaders.secret\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL => "SDL.gpu.device.create.shaders.secret"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL \"SDL.gpu.device.create.shaders.spirv\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL => "SDL.gpu.device.create.shaders.spirv"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL \"SDL.gpu.device.create.shaders.dxbc\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL => "SDL.gpu.device.create.shaders.dxbc"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL \"SDL.gpu.device.create.shaders.dxil\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL => "SDL.gpu.device.create.shaders.dxil"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL \"SDL.gpu.device.create.shaders.msl\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL => "SDL.gpu.device.create.shaders.msl"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL \"SDL.gpu.device.create.shaders.metallib\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL => "SDL.gpu.device.create.shaders.metallib"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING \"SDL.gpu.device.create.d3d12.semantic\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING => "SDL.gpu.device.create.d3d12.semantic"u8; + } +} diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs index d870fec..727d659 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs @@ -60,7 +60,7 @@ namespace SDL public static extern SDL_bool SDL_AddHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_DelHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern void SDL_RemoveHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")] public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"u8; @@ -221,6 +221,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_HIDAPI_UDEV \"SDL_HIDAPI_UDEV\"")] public static ReadOnlySpan SDL_HINT_HIDAPI_UDEV => "SDL_HIDAPI_UDEV"u8; + [NativeTypeName("#define SDL_HINT_GPU_DRIVER \"SDL_GPU_DRIVER\"")] + public static ReadOnlySpan SDL_HINT_GPU_DRIVER => "SDL_GPU_DRIVER"u8; + [NativeTypeName("#define SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS \"SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS\"")] public static ReadOnlySpan SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS => "SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS"u8; @@ -491,12 +494,6 @@ namespace SDL [NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_ORIENTATIONS\"")] public static ReadOnlySpan SDL_HINT_ORIENTATIONS => "SDL_ORIENTATIONS"u8; - [NativeTypeName("#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON \"SDL_PEN_DELAY_MOUSE_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_PEN_DELAY_MOUSE_BUTTON => "SDL_PEN_DELAY_MOUSE_BUTTON"u8; - - [NativeTypeName("#define SDL_HINT_PEN_NOT_MOUSE \"SDL_PEN_NOT_MOUSE\"")] - public static ReadOnlySpan SDL_HINT_PEN_NOT_MOUSE => "SDL_PEN_NOT_MOUSE"u8; - [NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")] public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => "SDL_POLL_SENTINEL"u8; @@ -515,6 +512,12 @@ namespace SDL [NativeTypeName("#define SDL_HINT_RENDER_VULKAN_DEBUG \"SDL_RENDER_VULKAN_DEBUG\"")] public static ReadOnlySpan SDL_HINT_RENDER_VULKAN_DEBUG => "SDL_RENDER_VULKAN_DEBUG"u8; + [NativeTypeName("#define SDL_HINT_RENDER_GPU_DEBUG \"SDL_RENDER_GPU_DEBUG\"")] + public static ReadOnlySpan SDL_HINT_RENDER_GPU_DEBUG => "SDL_RENDER_GPU_DEBUG"u8; + + [NativeTypeName("#define SDL_HINT_RENDER_GPU_LOW_POWER \"SDL_RENDER_GPU_LOW_POWER\"")] + public static ReadOnlySpan SDL_HINT_RENDER_GPU_LOW_POWER => "SDL_RENDER_GPU_LOW_POWER"u8; + [NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")] public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => "SDL_RENDER_DRIVER"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs index a35110d..42439f3 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs @@ -37,6 +37,7 @@ namespace SDL SDL_LOG_CATEGORY_AUDIO, SDL_LOG_CATEGORY_VIDEO, SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_GPU, SDL_LOG_CATEGORY_INPUT, SDL_LOG_CATEGORY_TEST, SDL_LOG_CATEGORY_RESERVED1, diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs index 84ce60e..0cc3683 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs @@ -32,7 +32,6 @@ namespace SDL { SDL_SCALEMODE_NEAREST, SDL_SCALEMODE_LINEAR, - SDL_SCALEMODE_BEST, } public enum SDL_FlipMode diff --git a/SDL3-CS/SDL3/SDL_gpu.cs b/SDL3-CS/SDL3/SDL_gpu.cs new file mode 100644 index 0000000..6d38fef --- /dev/null +++ b/SDL3-CS/SDL3/SDL_gpu.cs @@ -0,0 +1,17 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace SDL +{ + [Typedef] + public enum SDL_GPUColorComponentFlags : byte; + + [Typedef] + public enum SDL_GPUShaderFormat : uint; + + [Typedef] + public enum SDL_GPUTextureUsageFlags : uint; + + [Typedef] + public enum SDL_GPUBufferUsageFlags : uint; +} \ No newline at end of file diff --git a/SDL3-CS/generate_bindings.py b/SDL3-CS/generate_bindings.py index 049e2db..1181a25 100644 --- a/SDL3-CS/generate_bindings.py +++ b/SDL3-CS/generate_bindings.py @@ -90,6 +90,7 @@ headers = [ add("SDL3/SDL_events.h"), add("SDL3/SDL_filesystem.h"), add("SDL3/SDL_gamepad.h"), + add("SDL3/SDL_gpu.h"), add("SDL3/SDL_guid.h"), add("SDL3/SDL_haptic.h"), add("SDL3/SDL_hidapi.h"),