SDL_BindGPUC...orageTextures(3)

πŸ’– SDL_BindGPUComputeStorageTextures πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we make your GPU do the most ✨


πŸŽ€ NAME πŸŽ€

SDL_BindGPUComputeStorageTextures β€” binds storage textures as readonly for use on the compute pipeline. yes, the whole function name. it's long. it's giving "my parents named me after the entire alphabet". we love her anyway πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_gpu.h>

void SDL_BindGPUComputeStorageTextures(
    SDL_GPUComputePass *compute_pass,
    Uint32 first_slot,
    SDL_GPUTexture *const *storage_textures,
    Uint32 num_bindings);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie πŸ“ these textures you're binding? they must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ. like, non-negotiable. that's their whole job, that's their main character arc, that's the vibe check they passed at creation time.

the textures being bound also have to have a matching type declared in the shader β€” 2D, 3D, 2DMS, etc. no mismatches allowed, that's not the energy we're on today 😭

and fr fr, be sure your shader is set up according to the requirements documented in SDL_CreateGPUComputePipeline(). go read that one. i'll wait. 🫢


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • compute_pass β€” a compute pass handle. the lil guy you're doing all this binding inside of ✨
  • first_slot β€” the compute storage texture slot to begin binding from. like, where do we start? right here, bestie πŸ‘‘
  • storage_textures β€” an array of storage textures. the whole squad 🌈
  • num_bindings β€” the number of storage textures to bind from the array. how many of the squad are actually coming to the party πŸ’€

🌸 AVAILABILITY 🌸

this function is available since SDL 3.2.0. iconic behavior, honestly. periodt. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page, you ate that πŸ’… no cap. go forth and bind responsibly, bestie 🧚

reminder: SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ β€” if your texture wasn't made with this, it's not invited. sorry not sorry πŸ’–

Simple Directmedia Layer Β· SDL 3.4.18 β€” mwah, love u, see u in the next man page πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from