SDL_BindGPUVertexSamplers(3)

✨ SDL_BindGPUVertexSamplers ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, page SDL_BindGPUVertexSamplers(3) πŸ’… this one's all about telling your vertex shader where its texture-sampler pairs live. let's get into it 🫢


🌸 NAME 🌸

SDL_BindGPUVertexSamplers β€” binds texture-sampler pairs for use on the vertex shader.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_gpu.h>

void SDL_BindGPUVertexSamplers(
    SDL_GPURenderPass *render_pass,
    Uint32 first_slot,
    const SDL_GPUTextureSamplerBinding *texture_sampler_bindings,
    Uint32 num_bindings);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe check: those textures you're binding? they must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. no exceptions, no cap 🚫

also, the textures being bound must have a matching type declared in the shader β€” like 2D, 3D, etc. it's giving "they have to actually match, bestie". and multisample textures are not allowed πŸ’€ periodt.

and be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader() β€” go read that one too, it's iconic and you need it. iykyk ✨


πŸ’– FUNCTION PARAMETERS πŸ’–

  • render_pass β€” a render pass handle. your main character, the thing everything happens inside of 🎬
  • first_slot β€” the vertex sampler slot to begin binding from. where the story starts, basically 🌈
  • texture_sampler_bindings β€” an array of texture-sampler binding structs. the whole squad, lined up πŸ«‚
  • num_bindings β€” the number of texture-sampler pairs to bind from the array. how many of the squad are actually showing up πŸ”₯

⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. she's been here a minute and she ate πŸ‘‘


🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸ’œ she was written by the lovely folks at Simple Directmedia Layer, version SDL 3.4.18, and she's out here living her best life in the manual. go forth and bind responsibly, mwah πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from