SDL_GPURENDERSTATECREATEINFO(3type)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

🌸 SDL_GPURenderStateCreateInfo 🌸

okay so you're in the SDL3 DATATYPES section of the manual and you just found the struct that holds every single deet about a GPU render state. no cap, this is the whole vibe ✨


✨ NAME ✨

SDL_GPURenderStateCreateInfo β€” the lil struct that lists out all the parameters of a GPU render state πŸ’–


✨ SYNOPSIS ✨

#include <SDL3/SDL_render.h>

typedef struct SDL_GPURenderStateCreateInfo
{
    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 */
    const SDL_GPUTextureSamplerBinding *sampler_bindings;   /**< Additional fragment samplers to bind when this render state is active */

    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 */
    SDL_GPUBuffer *const *storage_buffers;      /**< Storage buffers to bind when this render state is active */

    SDL_PropertiesID props;         /**< A properties ID for extensions. Should be 0 if no extensions are needed. */
} SDL_GPURenderStateCreateInfo;

✨ DESCRIPTION ✨

so basically bestie, every field in here is a thing that gets bound the moment this render state goes active. let me walk you through it 🫢

  • fragment_shader β€” a SDL_GPUShader *, and it's the fragment shader that's doing the work while this render state is the one on stage πŸ‘‘
  • num_sampler_bindings β€” a Sint32, the count of extra fragment samplers you're binding while this render state is active. it's giving "how many more besties am I bringing" πŸ’…
  • sampler_bindings β€” a const SDL_GPUTextureSamplerBinding *, i.e. the actual extra fragment samplers getting bound when this render state is active ✨
  • num_storage_textures β€” a Sint32, the number of storage textures to bind while this render state is active 🌸
  • storage_textures β€” an SDL_GPUTexture *const *, the storage textures themselves that get bound when this render state is active πŸ¦‹
  • num_storage_buffers β€” a Sint32, how many storage buffers get bound while this render state is active πŸ’œ
  • storage_buffers β€” an SDL_GPUBuffer *const *, the actual storage buffers that get bound when this render state is active 🌈
  • props β€” a SDL_PropertiesID for extensions. and listen: this one should be 0 if you don't need any extensions. periodt πŸ”₯
not me double-checking that props is 0 when you're not using extensions πŸ™ˆ it literally says "Should be 0 if no extensions are needed", so don't be out here passing vibes instead of a zero πŸ’€

✨ AVAILABILITY ✨

this struct has been around since SDL 3.4.0, iconic behavior honestly πŸ‘‘


✨ SEE ALSO ✨


and that's the whole page bestie, you ate πŸ’– written under Simple Directmedia Layer, SDL 3.4.18 β€” go make something gorgeous with it, mwah πŸŽ€πŸ’…

πŸ“¦ where this page comes from