SDL_BindGPUComputeSamplers(3)

πŸ’– SDL_BindGPUComputeSamplers(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_BindGPUComputeSamplers πŸŽ€


✨ NAME ✨

SDL_BindGPUComputeSamplers β€” binds texture-sampler pairs for use on the compute shader 🫢


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

void SDL_BindGPUComputeSamplers(
    SDL_GPUComputePass *compute_pass,
    Uint32 first_slot,
    const SDL_GPUTextureSamplerBinding *texture_sampler_bindings,
    Uint32 num_bindings);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: you're feeding texture-sampler pairs to your compute shader, and this function is the one holding the aux cord 🎧

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. like, non-negotiable, that's the whole prerequisite.

The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). Multisample textures are not allowed β€” nope, not happening, not today πŸ™ˆ

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUComputePipeline(). no cap, go read that one too, it's the blueprint bestie πŸ“‹

πŸ’… FUNCTION PARAMETERS πŸ’…

  • compute_pass β€” a compute pass handle. it's giving "the pass we're doing all this in" ✨
  • first_slot β€” the compute sampler slot to begin binding from. where the story starts, lowkey πŸ“
  • texture_sampler_bindings β€” an array of texture-sampler binding structs. the whole squad, lined up 🧚
  • num_bindings β€” the number of texture-sampler bindings to bind from the array. how many of the squad are actually walking in πŸšΆβ™€οΈ

⭐ AVAILABILITY ⭐

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


🌈 SEE ALSO 🌈


and that's the whole page, bestie, you ate πŸ’… this little writeup came from Simple Directmedia Layer, version SDL 3.4.18, and yes it's literally the same SDL_BindGPUComputeSamplers(3) energy you came in with β€” periodt πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from