Renamed SDL_GPURenderStateDesc to SDL_GPURenderStateCreateInfo for consistency with GPU API conventions

Fixes https://github.com/libsdl-org/SDL/issues/12817
This commit is contained in:
Sam Lantinga
2025-08-27 05:38:31 -07:00
parent 0a6b80717c
commit 285df94623
5 changed files with 36 additions and 55 deletions

View File

@@ -2809,18 +2809,14 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetDefaultTextureScaleMode(SDL_Renderer *re
extern SDL_DECLSPEC bool SDLCALL SDL_GetDefaultTextureScaleMode(SDL_Renderer *renderer, SDL_ScaleMode *scale_mode);
/**
* GPU render state description.
*
* This structure should be initialized using SDL_INIT_INTERFACE().
* A structure specifying the parameters of a GPU render state.
*
* \since This struct is available since SDL 3.4.0.
*
* \sa SDL_CreateGPURenderState
*/
typedef struct SDL_GPURenderStateDesc
typedef struct SDL_GPURenderStateCreateInfo
{
Uint32 version; /**< the version of this interface */
SDL_GPUShader *fragment_shader; /**< The fragment shader to use when this render state is active */
Sint32 num_sampler_bindings; /**< The number of additional fragment samplers to bind when this render state is active */
@@ -2829,19 +2825,11 @@ typedef struct SDL_GPURenderStateDesc
Sint32 num_storage_textures; /**< The number of storage textures to bind when this render state is active */
SDL_GPUTexture *const *storage_textures; /**< Storage textures to bind when this render state is active */
Sint32 num_storage_buffers; /**< The number of storage buffers to bind when this render state is active */
Sint32 num_storage_buffers; /**< The number of storage buffers to bind when this render state is active */
SDL_GPUBuffer *const *storage_buffers; /**< Storage buffers to bind when this render state is active */
} SDL_GPURenderStateDesc;
/* Check the size of SDL_GPURenderStateDesc
*
* If this assert fails, either the compiler is padding to an unexpected size,
* or the interface has been updated and this should be updated to match and
* the code using this interface should be updated to handle the old version.
*/
SDL_COMPILE_TIME_ASSERT(SDL_GPURenderStateDesc_SIZE,
(sizeof(void *) == 4 && sizeof(SDL_GPURenderStateDesc) == 32) ||
(sizeof(void *) == 8 && sizeof(SDL_GPURenderStateDesc) == 64));
SDL_PropertiesID props; /**< A properties ID for extensions. Should be 0 if no extensions are needed. */
} SDL_GPURenderStateCreateInfo;
/**
* A custom GPU render state.
@@ -2859,8 +2847,7 @@ typedef struct SDL_GPURenderState SDL_GPURenderState;
* Create custom GPU render state.
*
* \param renderer the renderer to use.
* \param desc GPU render state description, initialized using
* SDL_INIT_INTERFACE().
* \param createinfo a struct describing the GPU render state to create.
* \returns a custom GPU render state or NULL on failure; call SDL_GetError()
* for more information.
*
@@ -2873,7 +2860,7 @@ typedef struct SDL_GPURenderState SDL_GPURenderState;
* \sa SDL_SetRenderGPUState
* \sa SDL_DestroyGPURenderState
*/
extern SDL_DECLSPEC SDL_GPURenderState * SDLCALL SDL_CreateGPURenderState(SDL_Renderer *renderer, SDL_GPURenderStateDesc *desc);
extern SDL_DECLSPEC SDL_GPURenderState * SDLCALL SDL_CreateGPURenderState(SDL_Renderer *renderer, SDL_GPURenderStateCreateInfo *createinfo);
/**
* Set fragment shader uniform variables in a custom GPU render state.