* A structure specifying a depth-stencil clear value.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUDepthStencilTargetInfo
* \sa SDL_BeginGPURenderPass
*/
typedefstructSDL_GPUDepthStencilValue
typedefstructSDL_GPUDepthStencilValue
{
{
floatdepth;
floatdepth;/**< The clear value for the depth aspect of the depth-stencil target. */
Uint8stencil;
Uint8stencil;/**< The clear value for the stencil aspect of the depth-stencil target. */
Uint8padding1;
Uint8padding1;
Uint8padding2;
Uint8padding2;
Uint8padding3;
Uint8padding3;
}SDL_GPUDepthStencilValue;
}SDL_GPUDepthStencilValue;
/**
* A structure specifying a viewport.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_SetGPUViewport
*/
typedefstructSDL_GPUViewport
typedefstructSDL_GPUViewport
{
{
floatx;
floatx;/**< The left offset of the viewport. */
floaty;
floaty;/**< The top offset of the viewport. */
floatw;
floatw;/**< The width of the viewport. */
floath;
floath;/**< The height of the viewport. */
floatmin_depth;
floatmin_depth;/**< The minimum depth of the viewport. */
floatmax_depth;
floatmax_depth;/**< The maximum depth of the viewport. */
}SDL_GPUViewport;
}SDL_GPUViewport;
/**
* A structure specifying parameters related to transferring data to or from a texture.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_UploadToGPUTexture
* \sa SDL_DownloadFromGPUTexture
*/
typedefstructSDL_GPUTextureTransferInfo
typedefstructSDL_GPUTextureTransferInfo
{
{
SDL_GPUTransferBuffer*transfer_buffer;
SDL_GPUTransferBuffer*transfer_buffer;/**< The transfer buffer used in the transfer operation. */
Uint32offset;/* starting location of the image data */
Uint32offset;/**< The starting byte of the image data in the transfer buffer. */
Uint32pixels_per_row;/* number of pixels from one row to the next */
Uint32pixels_per_row;/**< The number of pixels from one row to the next. */
Uint32rows_per_layer;/* number of rows from one layer/depth-slice to the next */
Uint32rows_per_layer;/**< The number of rows from one layer/depth-slice to the next. */
}SDL_GPUTextureTransferInfo;
}SDL_GPUTextureTransferInfo;
/**
* A structure specifying a location in a transfer buffer.
*
* Used when transferring buffer data to or from a transfer buffer.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_UploadToGPUBuffer
* \sa SDL_DownloadFromGPUBuffer
*/
typedefstructSDL_GPUTransferBufferLocation
typedefstructSDL_GPUTransferBufferLocation
{
{
SDL_GPUTransferBuffer*transfer_buffer;
SDL_GPUTransferBuffer*transfer_buffer;/**< The transfer buffer used in the transfer operation. */
Uint32offset;
Uint32offset;/**< The starting byte of the buffer data in the transfer buffer. */
}SDL_GPUTransferBufferLocation;
}SDL_GPUTransferBufferLocation;
/**
* A structure specifying a location in a texture.
*
* Used when copying data from one texture to another.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_CopyGPUTextureToTexture
*/
typedefstructSDL_GPUTextureLocation
typedefstructSDL_GPUTextureLocation
{
{
SDL_GPUTexture*texture;
SDL_GPUTexture*texture;/**< The texture used in the copy operation. */
Uint32mip_level;
Uint32mip_level;/**< The mip level index of the location. */
Uint32layer;
Uint32layer;/**< The layer index of the location. */
Uint32x;
Uint32x;/**< The left offset of the location. */
Uint32y;
Uint32y;/**< The top offset of the location. */
Uint32z;
Uint32z;/**< The front offset of the location. */
}SDL_GPUTextureLocation;
}SDL_GPUTextureLocation;
/**
* A structure specifying a region of a texture.
*
* Used when transferring data to or from a texture.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_UploadToGPUTexture
* \sa SDL_DownloadFromGPUTexture
*/
typedefstructSDL_GPUTextureRegion
typedefstructSDL_GPUTextureRegion
{
{
SDL_GPUTexture*texture;
SDL_GPUTexture*texture;/**< The texture used in the copy operation. */
Uint32mip_level;
Uint32mip_level;/**< The mip level index to transfer. */
Uint32layer;
Uint32layer;/**< The layer index to transfer. */
Uint32x;
Uint32x;/** The left offset of the region. */
Uint32y;
Uint32y;/** The top offset of the region. */
Uint32z;
Uint32z;/** The front offset of the region. */
Uint32w;
Uint32w;/** The width of the region. */
Uint32h;
Uint32h;/** The height of the region. */
Uint32d;
Uint32d;/** The depth of the region. */
}SDL_GPUTextureRegion;
}SDL_GPUTextureRegion;
/**
* A structure specifying a region of a texture used in the blit operation.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_BlitGPUTexture
*/
typedefstructSDL_GPUBlitRegion
typedefstructSDL_GPUBlitRegion
{
{
SDL_GPUTexture*texture;
SDL_GPUTexture*texture;/**< The texture. */
Uint32mip_level;
Uint32mip_level;/**< The mip level index of the region. */
Uint32layer_or_depth_plane;
Uint32layer_or_depth_plane;/**< The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. */
Uint32x;
Uint32x;/**< The left offset of the region. */
Uint32y;
Uint32y;/**< The top offset of the region. */
Uint32w;
Uint32w;/**< The width of the region. */
Uint32h;
Uint32h;/**< The height of the region. */
}SDL_GPUBlitRegion;
}SDL_GPUBlitRegion;
/**
* A structure specifying a location in a buffer.
*
* Used when copying data between buffers.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_CopyGPUBufferToBuffer
*/
typedefstructSDL_GPUBufferLocation
typedefstructSDL_GPUBufferLocation
{
{
SDL_GPUBuffer*buffer;
SDL_GPUBuffer*buffer;/**< The buffer. */
Uint32offset;
Uint32offset;/**< The starting byte within the buffer. */
}SDL_GPUBufferLocation;
}SDL_GPUBufferLocation;
/**
* A structure specifying a region of a buffer.
*
* Used when transferring data to or from buffers.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_UploadToGPUBuffer
* \sa SDL_DownloadFromGPUBuffer
*/
typedefstructSDL_GPUBufferRegion
typedefstructSDL_GPUBufferRegion
{
{
SDL_GPUBuffer*buffer;
SDL_GPUBuffer*buffer;/**< The buffer. */
Uint32offset;
Uint32offset;/**< The starting byte within the buffer. */
Uint32size;
Uint32size;/**< The size in bytes of the region. */
}SDL_GPUBufferRegion;
}SDL_GPUBufferRegion;
/* Note that the `first_vertex` and `first_instance` parameters are NOT compatible with
/**
* A structure specifying the parameters of an indirect draw command.
*
* Note that the `first_vertex` and `first_instance` parameters are NOT compatible with
* built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If
* 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
* your shader depends on these variables, the correlating draw call parameter MUST
* be 0.
* be 0.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_DrawGPUPrimitivesIndirect
*/
*/
typedefstructSDL_GPUIndirectDrawCommand
typedefstructSDL_GPUIndirectDrawCommand
{
{
Uint32num_vertices;/* number of vertices to draw */
Uint32num_vertices;/**< The number of vertices to draw. */
Uint32num_instances;/* number of instances to draw */
Uint32num_instances;/**< The number of instances to draw. */
Uint32first_vertex;/* index of the first vertex to draw */
Uint32first_vertex;/**< The index of the first vertex to draw. */
Uint32first_instance;/* ID of the first instance to draw */
Uint32first_instance;/**< The ID of the first instance to draw. */
}SDL_GPUIndirectDrawCommand;
}SDL_GPUIndirectDrawCommand;
/**
* A structure specifying the parameters of an indexed indirect draw command.
*
* Note that the `first_vertex` and `first_instance` 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.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_DrawGPUIndexedPrimitivesIndirect
*/
typedefstructSDL_GPUIndexedIndirectDrawCommand
typedefstructSDL_GPUIndexedIndirectDrawCommand
{
{
Uint32num_indices;/* number of vertices to draw per instance */
Uint32num_indices;/**< The number of indices to draw per instance. */
Uint32num_instances;/* number of instances to draw */
Uint32num_instances;/**< The number of instances to draw. */
Uint32first_index;/* base index within the index buffer */
Uint32first_index;/**< The base index within the index buffer. */
Sint32vertex_offset;/* value added to vertex index before indexing into the vertex buffer */
Sint32vertex_offset;/**< The value added to the vertex index before indexing into the vertex buffer. */
Uint32first_instance;/* ID of the first instance to draw */
Uint32first_instance;/**< The ID of the first instance to draw. */
}SDL_GPUIndexedIndirectDrawCommand;
}SDL_GPUIndexedIndirectDrawCommand;
/**
* A structure specifying the parameters of an indexed dispatch command.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_DispatchGPUComputeIndirect
*/
typedefstructSDL_GPUIndirectDispatchCommand
typedefstructSDL_GPUIndirectDispatchCommand
{
{
Uint32groupcount_x;
Uint32groupcount_x;/**< The number of local workgroups to dispatch in the X dimension. */
Uint32groupcount_y;
Uint32groupcount_y;/**< The number of local workgroups to dispatch in the Y dimension. */
Uint32groupcount_z;
Uint32groupcount_z;/**< The number of local workgroups to dispatch in the Z dimension. */
}SDL_GPUIndirectDispatchCommand;
}SDL_GPUIndirectDispatchCommand;
/* State structures */
/* State structures */
/**
* A structure specifying the parameters of a sampler.
*
* \since This function is available since SDL 3.0.0
*
* \sa SDL_CreateGPUSampler
*/
typedefstructSDL_GPUSamplerCreateInfo
typedefstructSDL_GPUSamplerCreateInfo
{
{
SDL_GPUFiltermin_filter;
SDL_GPUFiltermin_filter;/**< The minification filter to apply to lookups. */
SDL_GPUFiltermag_filter;
SDL_GPUFiltermag_filter;/**< The magnification filter to apply to lookups. */
SDL_GPUSamplerMipmapModemipmap_mode;
SDL_GPUSamplerMipmapModemipmap_mode;/**< The mipmap filter to apply to lookups. */
SDL_GPUSamplerAddressModeaddress_mode_u;
SDL_GPUSamplerAddressModeaddress_mode_u;/**< The addressing mode for U coordinates outside [0, 1). */
SDL_GPUSamplerAddressModeaddress_mode_v;
SDL_GPUSamplerAddressModeaddress_mode_v;/**< The addressing mode for V coordinates outside [0, 1). */
SDL_GPUSamplerAddressModeaddress_mode_w;
SDL_GPUSamplerAddressModeaddress_mode_w;/**< The addressing mode for W coordinates outside [0, 1). */
floatmip_lod_bias;
floatmip_lod_bias;/**< The bias to be added to mipmap LOD calculation. */
floatmax_anisotropy;
floatmax_anisotropy;/**< The anisotropy value clamp used by the sampler. If enable_anisotropy is SDL_FALSE, this is ignored. */
SDL_boolenable_anisotropy;
SDL_boolenable_anisotropy;/**< SDL_TRUE to enable anisotropic filtering. */
SDL_boolenable_compare;
SDL_boolenable_compare;/**< SDL_TRUE to enable comparison against a reference value during lookups. */
Uint8padding1;
Uint8padding1;
Uint8padding2;
Uint8padding2;
SDL_GPUCompareOpcompare_op;
SDL_GPUCompareOpcompare_op;/**< The comparison operator to apply to fetched data before filtering. */
floatmin_lod;
floatmin_lod;/**< Clamps the minimum of the computed LOD value. */
floatmax_lod;
floatmax_lod;/**< Clamps the maximum of the computed LOD value. */
SDL_PropertiesIDprops;
SDL_PropertiesIDprops;/**< A properties ID for extensions. Should be 0 if no extensions are needed. */
}SDL_GPUSamplerCreateInfo;
}SDL_GPUSamplerCreateInfo;
/**
* A structure specifying a vertex binding.
*
* When you call SDL_BindGPUVertexBuffers, you specify the binding indices of the vertex buffers.
* For example if you called SDL_BindGPUVertexBuffers with a first_binding of 2 and num_bindings of 3, the binding indices 2, 3, 4 would be used by the vertex buffers you pass in.
*
* Vertex attributes are linked to bindings via the index. The binding_index field of SDL_GPUVertexAttribute specifies the vertex buffer binding index that the attribute will be read from.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUVertexAttribute
* \sa SDL_GPUVertexInputState
*/
typedefstructSDL_GPUVertexBinding
typedefstructSDL_GPUVertexBinding
{
{
Uint32binding;
Uint32index;/**< The binding index. */
Uint32pitch;
Uint32pitch;/**< The byte pitch between consecutive elements of the vertex buffer. */
SDL_GPUVertexInputRateinput_rate;
SDL_GPUVertexInputRateinput_rate;/**< Whether attribute addressing is a function of the vertex index or instance index. */
Uint32instance_step_rate;/* ignored unless input_rate is INSTANCE */
Uint32instance_step_rate;/**< The number of instances to draw using the same per-instance data before advancing in the instance buffer by one element. Ignored unless input_rate is SDL_GPU_VERTEXINPUTRATE_INSTANCE */
}SDL_GPUVertexBinding;
}SDL_GPUVertexBinding;
/**
* A structure specifying a vertex attribute.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUVertexBinding
* \sa SDL_GPUVertexInputState
*/
typedefstructSDL_GPUVertexAttribute
typedefstructSDL_GPUVertexAttribute
{
{
Uint32location;
Uint32location;/**< The shader input location index. */
Uint32binding;
Uint32binding_index;/**< The binding index. */
SDL_GPUVertexElementFormatformat;
SDL_GPUVertexElementFormatformat;/**< The size and type of the attribute data. */
Uint32offset;
Uint32offset;/**< The byte offset of this attribute relative to the start of the vertex element. */
}SDL_GPUVertexAttribute;
}SDL_GPUVertexAttribute;
/**
* A structure specifying the parameters of a graphics pipeline vertex input state.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUGraphicsPipelineCreateInfo
*/
typedefstructSDL_GPUVertexInputState
typedefstructSDL_GPUVertexInputState
{
{
constSDL_GPUVertexBinding*vertex_bindings;
constSDL_GPUVertexBinding*vertex_bindings;/**< A pointer to an array of vertex binding descriptions. */
Uint32num_vertex_bindings;
Uint32num_vertex_bindings;/**< The number of vertex binding descriptions in the above array. */
constSDL_GPUVertexAttribute*vertex_attributes;
constSDL_GPUVertexAttribute*vertex_attributes;/**< A pointer to an array of vertex attribute descriptions. */
Uint32num_vertex_attributes;
Uint32num_vertex_attributes;/**< The number of vertex attribute descriptions in the above array. */
}SDL_GPUVertexInputState;
}SDL_GPUVertexInputState;
/**
* A structure specifying the stencil operation state of a graphics pipeline.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUDepthStencilState
*/
typedefstructSDL_GPUStencilOpState
typedefstructSDL_GPUStencilOpState
{
{
SDL_GPUStencilOpfail_op;
SDL_GPUStencilOpfail_op;/**< The action performed on samples that fail the stencil test. */
SDL_GPUStencilOppass_op;
SDL_GPUStencilOppass_op;/**< The action performed on samples that pass the depth and stencil tests. */
SDL_GPUStencilOpdepth_fail_op;
SDL_GPUStencilOpdepth_fail_op;/**< The action performed on samples that pass the stencil test and fail the depth test. */
SDL_GPUCompareOpcompare_op;
SDL_GPUCompareOpcompare_op;/**< The comparison operator used in the stencil test. */
}SDL_GPUStencilOpState;
}SDL_GPUStencilOpState;
/**
* A structure specifying the blend state of a color target.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUColorTargetDescription
*/
typedefstructSDL_GPUColorTargetBlendState
typedefstructSDL_GPUColorTargetBlendState
{
{
SDL_boolenable_blend;
SDL_boolenable_blend;/**< Whether blending is enabled for the color target. */
Uint8padding1;
Uint8padding1;
Uint8padding2;
Uint8padding2;
Uint8padding3;
Uint8padding3;
SDL_GPUBlendFactorsrc_color_blendfactor;
SDL_GPUBlendFactorsrc_color_blendfactor;/**< The value to be multiplied by the source RGB value. */
SDL_GPUBlendFactordst_color_blendfactor;
SDL_GPUBlendFactordst_color_blendfactor;/**< The value to be multiplied by the destination RGB value. */
SDL_GPUBlendOpcolor_blend_op;
SDL_GPUBlendOpcolor_blend_op;/**< The blend operation for the RGB components. */
SDL_GPUBlendFactorsrc_alpha_blendfactor;
SDL_GPUBlendFactorsrc_alpha_blendfactor;/**< The value to be multiplied by the source alpha. */
SDL_GPUBlendFactordst_alpha_blendfactor;
SDL_GPUBlendFactordst_alpha_blendfactor;/**< The value to be multiplied by the destination alpha. */
SDL_GPUBlendOpalpha_blend_op;
SDL_GPUBlendOpalpha_blend_op;/**< The blend operation for the alpha component. */
SDL_GPUColorComponentFlagscolor_write_mask;
SDL_GPUColorComponentFlagscolor_write_mask;/**< A bitmask specifying which of the RGBA components are enabled for writing. */
}SDL_GPUColorTargetBlendState;
}SDL_GPUColorTargetBlendState;
/**
* A structure specifying code and metadata for creating a shader object.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_CreateGPUShader
*/
typedefstructSDL_GPUShaderCreateInfo
typedefstructSDL_GPUShaderCreateInfo
{
{
size_tcode_size;
size_tcode_size;/**< The size in bytes of the code pointed to. */
constUint8*code;
constUint8*code;/**< A pointer to shader code. */
constchar*entrypoint;
constchar*entrypoint;/**< A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. */
SDL_GPUShaderFormatformat;
SDL_GPUShaderFormatformat;/**< The format of the shader code. */
SDL_GPUShaderStagestage;
SDL_GPUShaderStagestage;/**< The stage the shader program corresponds to. */
Uint32num_samplers;
Uint32num_samplers;/**< The number of samplers defined in the shader. */
Uint32num_storage_textures;
Uint32num_storage_textures;/**< The number of storage textures defined in the shader. */
Uint32num_storage_buffers;
Uint32num_storage_buffers;/**< The number of storage buffers defined in the shader. */
Uint32num_uniform_buffers;
Uint32num_uniform_buffers;/**< The number of uniform buffers defined in the shader. */
SDL_PropertiesIDprops;
SDL_PropertiesIDprops;/**< A properties ID for extensions. Should be 0 if no extensions are needed. */
}SDL_GPUShaderCreateInfo;
}SDL_GPUShaderCreateInfo;
/**
* A structure specifying the parameters of a texture.
*
* Usage flags can be bitwise OR'd together for combinations of usages. Note that certain usage combinations are invalid, for example SAMPLER and GRAPHICS_STORAGE.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_CreateGPUTexture
*/
typedefstructSDL_GPUTextureCreateInfo
typedefstructSDL_GPUTextureCreateInfo
{
{
SDL_GPUTextureTypetype;
SDL_GPUTextureTypetype;/**< The base dimensionality of the texture. */
SDL_GPUTextureFormatformat;
SDL_GPUTextureFormatformat;/**< The pixel format of the texture. */
SDL_GPUTextureUsageFlagsusage;
SDL_GPUTextureUsageFlagsusage;/**< How the texture is intended to be used by the client. */
Uint32width;
Uint32width;/**< The width of the texture. */
Uint32height;
Uint32height;/**< The height of the texture. */
Uint32layer_count_or_depth;
Uint32layer_count_or_depth;/**< The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures. */
Uint32num_levels;
Uint32num_levels;/**< The number of mip levels in the texture. */
SDL_GPUSampleCountsample_count;
SDL_GPUSampleCountsample_count;/**< The number of samples per texel. Only applies if the texture is used as a render target. */
SDL_PropertiesIDprops;
SDL_PropertiesIDprops;/**< A properties ID for extensions. Should be 0 if no extensions are needed. */
constSDL_GPUColorTargetDescription*color_target_descriptions;/**< A pointer to an array of color target descriptions. */
Uint32num_color_targets;
Uint32num_color_targets;/**< The number of color target descriptions in the above array. */
SDL_boolhas_depth_stencil_target;
SDL_boolhas_depth_stencil_target;/**< SDL_TRUE specifies that the pipeline uses a depth-stencil target. */
Uint8padding1;
Uint8padding1;
Uint8padding2;
Uint8padding2;
Uint8padding3;
Uint8padding3;
SDL_GPUTextureFormatdepth_stencil_format;
SDL_GPUTextureFormatdepth_stencil_format;/**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is SDL_FALSE. */
}SDL_GpuGraphicsPipelineTargetInfo;
}SDL_GpuGraphicsPipelineTargetInfo;
/**
* A structure specifying the parameters of a graphics pipeline state.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_CreateGPUGraphicsPipeline
*/
typedefstructSDL_GPUGraphicsPipelineCreateInfo
typedefstructSDL_GPUGraphicsPipelineCreateInfo
{
{
SDL_GPUShader*vertex_shader;
SDL_GPUShader*vertex_shader;/**< The vertex shader used by the graphics pipeline. */
SDL_GPUShader*fragment_shader;
SDL_GPUShader*fragment_shader;/**< The fragment shader used by the graphics pipeline. */
SDL_GPUVertexInputStatevertex_input_state;
SDL_GPUVertexInputStatevertex_input_state;/**< The vertex layout of the graphics pipeline. */
SDL_GPUPrimitiveTypeprimitive_type;
SDL_GPUPrimitiveTypeprimitive_type;/**< The primitive topology of the graphics pipeline. */
SDL_GPURasterizerStaterasterizer_state;
SDL_GPURasterizerStaterasterizer_state;/**< The rasterizer state of the graphics pipeline. */
SDL_GPUMultisampleStatemultisample_state;
SDL_GPUMultisampleStatemultisample_state;/**< The multisample state of the graphics pipeline. */
SDL_GPUDepthStencilStatedepth_stencil_state;
SDL_GPUDepthStencilStatedepth_stencil_state;/**< The depth-stencil state of the graphics pipeline. */
SDL_GpuGraphicsPipelineTargetInfotarget_info;
SDL_GpuGraphicsPipelineTargetInfotarget_info;/**< Formats and blend modes for the render targets of the graphics pipeline. */
SDL_PropertiesIDprops;
SDL_PropertiesIDprops;/**< A properties ID for extensions. Should be 0 if no extensions are needed. */
}SDL_GPUGraphicsPipelineCreateInfo;
}SDL_GPUGraphicsPipelineCreateInfo;
/**
* A structure specifying the parameters of a compute pipeline state.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_CreateGPUComputePipeline
*/
typedefstructSDL_GPUComputePipelineCreateInfo
typedefstructSDL_GPUComputePipelineCreateInfo
{
{
size_tcode_size;
size_tcode_size;/**< The size in bytes of the compute shader code pointed to. */
constUint8*code;
constUint8*code;/**< A pointer to compute shader code. */
constchar*entrypoint;
constchar*entrypoint;/**< A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader. */
SDL_GPUShaderFormatformat;
SDL_GPUShaderFormatformat;/**< The format of the compute shader code. */
Uint32num_readonly_storage_textures;
Uint32num_readonly_storage_textures;/**< The number of readonly storage textures defined in the shader. */
Uint32num_readonly_storage_buffers;
Uint32num_readonly_storage_buffers;/**< The number of readonly storage buffers defined in the shader. */
Uint32num_writeonly_storage_textures;
Uint32num_writeonly_storage_textures;/**< The number of writeonly storage textures defined in the shader. */
Uint32num_writeonly_storage_buffers;
Uint32num_writeonly_storage_buffers;/**< The number of writeonly storage buffers defined in the shader. */
Uint32num_uniform_buffers;
Uint32num_uniform_buffers;/** The number of uniform buffers defined in the shader. */
Uint32threadcount_x;
Uint32threadcount_x;/** The number of threads in the X dimension. This should match the value in the shader. */
Uint32threadcount_y;
Uint32threadcount_y;/** The number of threads in the Y dimension. This should match the value in the shader. */
Uint32threadcount_z;
Uint32threadcount_z;/** The number of threads in the Z dimension. This should match the value in the shader. */
SDL_PropertiesIDprops;
SDL_PropertiesIDprops;/**< A properties ID for extensions. Should be 0 if no extensions are needed. */
}SDL_GPUComputePipelineCreateInfo;
}SDL_GPUComputePipelineCreateInfo;
/**
* A structure specifying the parameters of a color target used by a render pass.
*
* The load_op field determines what is done with the texture at the beginning of the render pass.
*
* - LOAD: Loads the data currently in the texture.
* - CLEAR: Clears the texture to a single color.
* - DONT_CARE: 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.
*
* The store_op field determines what is done with the color results of the render pass.
*
* - STORE: Stores the results of the render pass in the texture.
* - DONT_CARE: The driver will do whatever it wants with the texture memory. This is often a good option for depth/stencil textures.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_BeginGPURenderPass
*/
typedefstructSDL_GPUColorTargetInfo
typedefstructSDL_GPUColorTargetInfo
{
{
/* The texture that will be used as a color target by a render pass. */
SDL_GPUTexture*texture;/**< The texture that will be used as a color target by a render pass. */
SDL_GPUTexture*texture;
Uint32mip_level;/**< The mip level to use as a color target. */
Uint32mip_level;
Uint32layer_or_depth_plane;/**< The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. */
Uint32layer_or_depth_plane;/* For 3D textures, you can bind an individual depth plane as a target. */
SDL_FColorclear_color;/**< The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
SDL_GPULoadOpload_op;/**< What is done with the contents of the color target at the beginning of the render pass. */
/* Can be ignored by RenderPass if CLEAR is not used */
SDL_GPUStoreOpstore_op;/**< What is done with the results of the render pass. */
SDL_FColorclear_color;
SDL_boolcycle;/**< SDL_TRUE cycles the texture if the texture is bound and load_op is not LOAD */
/* Determines what is done with the texture at the beginning of the render pass.
*
* LOAD:
* Loads the data currently in the texture.
*
* CLEAR:
* Clears the texture to a single color.
*
* DONT_CARE:
* 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_GPULoadOpload_op;
/* Determines what is done with the texture at the end of the render pass.
*
* STORE:
* Stores the results of the render pass in the texture.
*
* DONT_CARE:
* The driver will do whatever it wants with the texture memory.
* This is often a good option for depth/stencil textures.
*/
SDL_GPUStoreOpstore_op;
/* if SDL_TRUE, cycles the texture if the texture is bound and load_op is not LOAD */
SDL_boolcycle;
Uint8padding1;
Uint8padding1;
Uint8padding2;
Uint8padding2;
Uint8padding3;
Uint8padding3;
}SDL_GPUColorTargetInfo;
}SDL_GPUColorTargetInfo;
/**
* A structure specifying the parameters of a depth-stencil target used by a render pass.
*
* The load_op field determines what is done with the depth contents of the texture at the beginning of the render pass.
*
* - LOAD: Loads the depth values currently in the texture.
* - CLEAR: Clears the texture to a single depth.
* - DONT_CARE: 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.
*
* The store_op field determines what is done with the depth results of the render pass.
*
* - STORE: Stores the depth results in the texture.
* - DONT_CARE: The driver will do whatever it wants with the depth results. This is often a good option for depth/stencil textures that don't need to be reused again.
*
* The stencil_load_op field determines what is done with the stencil contents of the texture at the beginning of the render pass.
*
* - LOAD: Loads the stencil values currently in the texture.
* - CLEAR: Clears the stencil values to a single value.
* - DONT_CARE: 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.
*
* The stencil_store_op field determines what is done with the stencil results of the render pass.
*
* - STORE: Stores the stencil results in the texture.
* - DONT_CARE: The driver will do whatever it wants with the stencil results. This is often a good option for depth/stencil textures that don't need to be reused again.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_BeginGPURenderPass
*/
typedefstructSDL_GPUDepthStencilTargetInfo
typedefstructSDL_GPUDepthStencilTargetInfo
{
{
/* The texture that will be used as the depth stencil target by a render pass. */
SDL_GPUTexture*texture;/**< The texture that will be used as the depth stencil target by the render pass. */
SDL_GPUTexture*texture;
SDL_GPUDepthStencilValueclear_value;/**< The depth-stencil clear values. Can be ignored by the render pass if SDL_GPU_LOADOP_CLEAR is not used. */
SDL_GPULoadOpload_op;/**< What is done with the depth contents at the beginning of the render pass. */
/* Can be ignored by the render pass if CLEAR is not used */
SDL_GPUStoreOpstore_op;/**< What is done with the depth results of the render pass. */
SDL_GPUDepthStencilValueclear_value;
SDL_GPULoadOpstencil_load_op;/**< What is done with the stencil contents at the beginning of the render pass. */
SDL_GPUStoreOpstencil_store_op;/**< What is done with the stencil results of the render pass. */
/* Determines what is done with the depth values at the beginning of the render pass.
SDL_boolcycle;/**< SDL_TRUE cycles the texture if the texture is bound and any load ops are not LOAD */
*
* LOAD:
* Loads the depth values currently in the texture.
*
* CLEAR:
* Clears the texture to a single depth.
*
* DONT_CARE:
* 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_GPULoadOpload_op;
/* Determines what is done with the depth values at the end of the render pass.
*
* STORE:
* Stores the depth results in the texture.
*
* DONT_CARE:
* The driver will do whatever it wants with the texture memory.
* This is often a good option for depth/stencil textures.
*/
SDL_GPUStoreOpstore_op;
/* Determines what is done with the stencil values at the beginning of the render pass.
*
* LOAD:
* Loads the stencil values currently in the texture.
*
* CLEAR:
* Clears the texture to a single stencil value.
*
* DONT_CARE:
* 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_GPULoadOpstencil_load_op;
/* Determines what is done with the stencil values at the end of the render pass.
*
* STORE:
* Stores the stencil results in the texture.
*
* DONT_CARE:
* The driver will do whatever it wants with the texture memory.
* This is often a good option for depth/stencil textures.
*/
SDL_GPUStoreOpstencil_store_op;
/* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */
* A structure specifying parameters in a buffer binding call.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_BindGPUVertexBuffers
* \sa SDL_BindGPUIndexBuffers
*/
typedefstructSDL_GPUBufferBinding
typedefstructSDL_GPUBufferBinding
{
{
SDL_GPUBuffer*buffer;
SDL_GPUBuffer*buffer;/**< The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffers. */
Uint32offset;
Uint32offset;/**< The starting byte of the data to bind in the buffer. */
}SDL_GPUBufferBinding;
}SDL_GPUBufferBinding;
/**
* A structure specifying parameters in a sampler binding call.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_BindGPUVertexSamplers
* \sa SDL_BindGPUFragmentSamplers
*/
typedefstructSDL_GPUTextureSamplerBinding
typedefstructSDL_GPUTextureSamplerBinding
{
{
SDL_GPUTexture*texture;
SDL_GPUTexture*texture;/**< The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. */
SDL_GPUSampler*sampler;
SDL_GPUSampler*sampler;/**< The sampler to bind. */
}SDL_GPUTextureSamplerBinding;
}SDL_GPUTextureSamplerBinding;
/**
* A structure specifying parameters related to binding buffers in a compute pass.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_BeginGPUComputePass
*/
typedefstructSDL_GPUStorageBufferWriteOnlyBinding
typedefstructSDL_GPUStorageBufferWriteOnlyBinding
{
{
SDL_GPUBuffer*buffer;
SDL_GPUBuffer*buffer;/**< The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. */
SDL_boolcycle;/**< SDL_TRUE cycles the buffer if it is already bound. */
/* if SDL_TRUE, cycles the buffer if it is bound. */
SDL_boolcycle;
Uint8padding1;
Uint8padding1;
Uint8padding2;
Uint8padding2;
Uint8padding3;
Uint8padding3;
}SDL_GPUStorageBufferWriteOnlyBinding;
}SDL_GPUStorageBufferWriteOnlyBinding;
/**
* A structure specifying parameters related to binding textures in a compute pass.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.