|
| 1 | +/* |
| 2 | + <auto-generated/> |
| 3 | + C# bindings for Simple DirectMedia Layer. |
| 4 | + Original copyright notice of input files: |
| 5 | +
|
| 6 | + Simple DirectMedia Layer |
| 7 | + Copyright (C) 1997-2024 Sam Lantinga <[email protected]> |
| 8 | +
|
| 9 | + This software is provided 'as-is', without any express or implied |
| 10 | + warranty. In no event will the authors be held liable for any damages |
| 11 | + arising from the use of this software. |
| 12 | +
|
| 13 | + Permission is granted to anyone to use this software for any purpose, |
| 14 | + including commercial applications, and to alter it and redistribute it |
| 15 | + freely, subject to the following restrictions: |
| 16 | +
|
| 17 | + 1. The origin of this software must not be misrepresented; you must not |
| 18 | + claim that you wrote the original software. If you use this software |
| 19 | + in a product, an acknowledgment in the product documentation would be |
| 20 | + appreciated but is not required. |
| 21 | + 2. Altered source versions must be plainly marked as such, and must not be |
| 22 | + misrepresented as being the original software. |
| 23 | + 3. This notice may not be removed or altered from any source distribution. |
| 24 | +*/ |
| 25 | + |
| 26 | +using System; |
| 27 | +using System.Runtime.InteropServices; |
| 28 | + |
| 29 | +namespace SDL |
| 30 | +{ |
| 31 | + public enum SDL_ShaderCross_IOVarType |
| 32 | + { |
| 33 | + SDL_SHADERCROSS_IOVAR_TYPE_UNKNOWN, |
| 34 | + SDL_SHADERCROSS_IOVAR_TYPE_INT8, |
| 35 | + SDL_SHADERCROSS_IOVAR_TYPE_UINT8, |
| 36 | + SDL_SHADERCROSS_IOVAR_TYPE_INT16, |
| 37 | + SDL_SHADERCROSS_IOVAR_TYPE_UINT16, |
| 38 | + SDL_SHADERCROSS_IOVAR_TYPE_INT32, |
| 39 | + SDL_SHADERCROSS_IOVAR_TYPE_UINT32, |
| 40 | + SDL_SHADERCROSS_IOVAR_TYPE_INT64, |
| 41 | + SDL_SHADERCROSS_IOVAR_TYPE_UINT64, |
| 42 | + SDL_SHADERCROSS_IOVAR_TYPE_FLOAT16, |
| 43 | + SDL_SHADERCROSS_IOVAR_TYPE_FLOAT32, |
| 44 | + SDL_SHADERCROSS_IOVAR_TYPE_FLOAT64, |
| 45 | + } |
| 46 | + |
| 47 | + public enum SDL_ShaderCross_ShaderStage |
| 48 | + { |
| 49 | + SDL_SHADERCROSS_SHADERSTAGE_VERTEX, |
| 50 | + SDL_SHADERCROSS_SHADERSTAGE_FRAGMENT, |
| 51 | + SDL_SHADERCROSS_SHADERSTAGE_COMPUTE, |
| 52 | + } |
| 53 | + |
| 54 | + public unsafe partial struct SDL_ShaderCross_IOVarMetadata |
| 55 | + { |
| 56 | + [NativeTypeName("char *")] |
| 57 | + public byte* name; |
| 58 | + |
| 59 | + [NativeTypeName("Uint32")] |
| 60 | + public uint location; |
| 61 | + |
| 62 | + public SDL_ShaderCross_IOVarType vector_type; |
| 63 | + |
| 64 | + [NativeTypeName("Uint32")] |
| 65 | + public uint vector_size; |
| 66 | + } |
| 67 | + |
| 68 | + public unsafe partial struct SDL_ShaderCross_GraphicsShaderMetadata |
| 69 | + { |
| 70 | + [NativeTypeName("Uint32")] |
| 71 | + public uint num_samplers; |
| 72 | + |
| 73 | + [NativeTypeName("Uint32")] |
| 74 | + public uint num_storage_textures; |
| 75 | + |
| 76 | + [NativeTypeName("Uint32")] |
| 77 | + public uint num_storage_buffers; |
| 78 | + |
| 79 | + [NativeTypeName("Uint32")] |
| 80 | + public uint num_uniform_buffers; |
| 81 | + |
| 82 | + [NativeTypeName("Uint32")] |
| 83 | + public uint num_inputs; |
| 84 | + |
| 85 | + public SDL_ShaderCross_IOVarMetadata* inputs; |
| 86 | + |
| 87 | + [NativeTypeName("Uint32")] |
| 88 | + public uint num_outputs; |
| 89 | + |
| 90 | + public SDL_ShaderCross_IOVarMetadata* outputs; |
| 91 | + } |
| 92 | + |
| 93 | + public partial struct SDL_ShaderCross_ComputePipelineMetadata |
| 94 | + { |
| 95 | + [NativeTypeName("Uint32")] |
| 96 | + public uint num_samplers; |
| 97 | + |
| 98 | + [NativeTypeName("Uint32")] |
| 99 | + public uint num_readonly_storage_textures; |
| 100 | + |
| 101 | + [NativeTypeName("Uint32")] |
| 102 | + public uint num_readonly_storage_buffers; |
| 103 | + |
| 104 | + [NativeTypeName("Uint32")] |
| 105 | + public uint num_readwrite_storage_textures; |
| 106 | + |
| 107 | + [NativeTypeName("Uint32")] |
| 108 | + public uint num_readwrite_storage_buffers; |
| 109 | + |
| 110 | + [NativeTypeName("Uint32")] |
| 111 | + public uint num_uniform_buffers; |
| 112 | + |
| 113 | + [NativeTypeName("Uint32")] |
| 114 | + public uint threadcount_x; |
| 115 | + |
| 116 | + [NativeTypeName("Uint32")] |
| 117 | + public uint threadcount_y; |
| 118 | + |
| 119 | + [NativeTypeName("Uint32")] |
| 120 | + public uint threadcount_z; |
| 121 | + } |
| 122 | + |
| 123 | + public unsafe partial struct SDL_ShaderCross_SPIRV_Info |
| 124 | + { |
| 125 | + [NativeTypeName("const Uint8 *")] |
| 126 | + public byte* bytecode; |
| 127 | + |
| 128 | + [NativeTypeName("size_t")] |
| 129 | + public nuint bytecode_size; |
| 130 | + |
| 131 | + [NativeTypeName("const char *")] |
| 132 | + public byte* entrypoint; |
| 133 | + |
| 134 | + public SDL_ShaderCross_ShaderStage shader_stage; |
| 135 | + |
| 136 | + [NativeTypeName("bool")] |
| 137 | + public SDLBool enable_debug; |
| 138 | + |
| 139 | + [NativeTypeName("const char *")] |
| 140 | + public byte* name; |
| 141 | + |
| 142 | + public SDL_PropertiesID props; |
| 143 | + } |
| 144 | + |
| 145 | + public unsafe partial struct SDL_ShaderCross_HLSL_Define |
| 146 | + { |
| 147 | + [NativeTypeName("char *")] |
| 148 | + public byte* name; |
| 149 | + |
| 150 | + [NativeTypeName("char *")] |
| 151 | + public byte* value; |
| 152 | + } |
| 153 | + |
| 154 | + public unsafe partial struct SDL_ShaderCross_HLSL_Info |
| 155 | + { |
| 156 | + [NativeTypeName("const char *")] |
| 157 | + public byte* source; |
| 158 | + |
| 159 | + [NativeTypeName("const char *")] |
| 160 | + public byte* entrypoint; |
| 161 | + |
| 162 | + [NativeTypeName("const char *")] |
| 163 | + public byte* include_dir; |
| 164 | + |
| 165 | + public SDL_ShaderCross_HLSL_Define* defines; |
| 166 | + |
| 167 | + public SDL_ShaderCross_ShaderStage shader_stage; |
| 168 | + |
| 169 | + [NativeTypeName("bool")] |
| 170 | + public SDLBool enable_debug; |
| 171 | + |
| 172 | + [NativeTypeName("const char *")] |
| 173 | + public byte* name; |
| 174 | + |
| 175 | + public SDL_PropertiesID props; |
| 176 | + } |
| 177 | + |
| 178 | + public static unsafe partial class SDL3_shadercross |
| 179 | + { |
| 180 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 181 | + [return: NativeTypeName("bool")] |
| 182 | + public static extern SDLBool SDL_ShaderCross_Init(); |
| 183 | + |
| 184 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 185 | + public static extern void SDL_ShaderCross_Quit(); |
| 186 | + |
| 187 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 188 | + public static extern SDL_GPUShaderFormat SDL_ShaderCross_GetSPIRVShaderFormats(); |
| 189 | + |
| 190 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 191 | + [return: NativeTypeName("void*")] |
| 192 | + public static extern IntPtr SDL_ShaderCross_TranspileMSLFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info); |
| 193 | + |
| 194 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 195 | + [return: NativeTypeName("void*")] |
| 196 | + public static extern IntPtr SDL_ShaderCross_TranspileHLSLFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info); |
| 197 | + |
| 198 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 199 | + [return: NativeTypeName("void*")] |
| 200 | + public static extern IntPtr SDL_ShaderCross_CompileDXBCFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("size_t *")] nuint* size); |
| 201 | + |
| 202 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 203 | + [return: NativeTypeName("void*")] |
| 204 | + public static extern IntPtr SDL_ShaderCross_CompileDXILFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("size_t *")] nuint* size); |
| 205 | + |
| 206 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 207 | + public static extern SDL_GPUShader* SDL_ShaderCross_CompileGraphicsShaderFromSPIRV(SDL_GPUDevice* device, [NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("const SDL_ShaderCross_GraphicsShaderMetadata *")] SDL_ShaderCross_GraphicsShaderMetadata* metadata, SDL_PropertiesID props); |
| 208 | + |
| 209 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 210 | + public static extern SDL_GPUComputePipeline* SDL_ShaderCross_CompileComputePipelineFromSPIRV(SDL_GPUDevice* device, [NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("const SDL_ShaderCross_ComputePipelineMetadata *")] SDL_ShaderCross_ComputePipelineMetadata* metadata, SDL_PropertiesID props); |
| 211 | + |
| 212 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 213 | + public static extern SDL_ShaderCross_GraphicsShaderMetadata* SDL_ShaderCross_ReflectGraphicsSPIRV([NativeTypeName("const Uint8 *")] byte* bytecode, [NativeTypeName("size_t")] nuint bytecode_size, SDL_PropertiesID props); |
| 214 | + |
| 215 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 216 | + public static extern SDL_ShaderCross_ComputePipelineMetadata* SDL_ShaderCross_ReflectComputeSPIRV([NativeTypeName("const Uint8 *")] byte* bytecode, [NativeTypeName("size_t")] nuint bytecode_size, SDL_PropertiesID props); |
| 217 | + |
| 218 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 219 | + public static extern SDL_GPUShaderFormat SDL_ShaderCross_GetHLSLShaderFormats(); |
| 220 | + |
| 221 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 222 | + [return: NativeTypeName("void*")] |
| 223 | + public static extern IntPtr SDL_ShaderCross_CompileDXBCFromHLSL([NativeTypeName("const SDL_ShaderCross_HLSL_Info *")] SDL_ShaderCross_HLSL_Info* info, [NativeTypeName("size_t *")] nuint* size); |
| 224 | + |
| 225 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 226 | + [return: NativeTypeName("void*")] |
| 227 | + public static extern IntPtr SDL_ShaderCross_CompileDXILFromHLSL([NativeTypeName("const SDL_ShaderCross_HLSL_Info *")] SDL_ShaderCross_HLSL_Info* info, [NativeTypeName("size_t *")] nuint* size); |
| 228 | + |
| 229 | + [DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] |
| 230 | + [return: NativeTypeName("void*")] |
| 231 | + public static extern IntPtr SDL_ShaderCross_CompileSPIRVFromHLSL([NativeTypeName("const SDL_ShaderCross_HLSL_Info *")] SDL_ShaderCross_HLSL_Info* info, [NativeTypeName("size_t *")] nuint* size); |
| 232 | + |
| 233 | + [NativeTypeName("#define SDL_SHADERCROSS_MAJOR_VERSION 3")] |
| 234 | + public const int SDL_SHADERCROSS_MAJOR_VERSION = 3; |
| 235 | + |
| 236 | + [NativeTypeName("#define SDL_SHADERCROSS_MINOR_VERSION 0")] |
| 237 | + public const int SDL_SHADERCROSS_MINOR_VERSION = 0; |
| 238 | + |
| 239 | + [NativeTypeName("#define SDL_SHADERCROSS_MICRO_VERSION 0")] |
| 240 | + public const int SDL_SHADERCROSS_MICRO_VERSION = 0; |
| 241 | + |
| 242 | + [NativeTypeName("#define SDL_SHADERCROSS_PROP_SPIRV_PSSL_COMPATIBILITY \"SDL.shadercross.spirv.pssl.compatibility\"")] |
| 243 | + public static ReadOnlySpan<byte> SDL_SHADERCROSS_PROP_SPIRV_PSSL_COMPATIBILITY => "SDL.shadercross.spirv.pssl.compatibility"u8; |
| 244 | + |
| 245 | + [NativeTypeName("#define SDL_SHADERCROSS_PROP_SPIRV_MSL_VERSION \"SDL.shadercross.spirv.msl.version\"")] |
| 246 | + public static ReadOnlySpan<byte> SDL_SHADERCROSS_PROP_SPIRV_MSL_VERSION => "SDL.shadercross.spirv.msl.version"u8; |
| 247 | + } |
| 248 | +} |
0 commit comments