SDL_BindGPUFragmentSamplers(3)

πŸ’– SDL_BindGPUFragmentSamplers(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we're talking about SDL_BindGPUFragmentSamplers β€” yes the whole name, say it with your chest πŸ’…


✨ NAME ✨

SDL_BindGPUFragmentSamplers β€” binds texture-sampler pairs for use on the fragment shader.

like. it's the girl that introduces your textures to your fragment shader. matchmaker energy fr fr πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

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

there she is. iconic signature, no notes πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's important:

  • The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. not optional. not a vibe suggestion. it's the law ✨
  • The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). so if your shader said 2D and you roll up with a 3D texture? it's giving mismatch, and not in a cute way 😭
  • Multisample textures are not allowed. nope. not invited to this party πŸ™ˆ
  • Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader(). go read that one too, bestie, it's a prerequisite, iykyk 🫢

πŸ‘‘ FUNCTION PARAMETERS πŸ‘‘

  • render_pass β€” a render pass handle. the whole situation happens inside this pass, slay.
  • first_slot β€” the fragment sampler slot to begin binding from. your starting point, your main character entrance ⭐
  • texture_sampler_bindings β€” an array of texture-sampler binding structs. the whole friend group, arriving together 🌈
  • num_bindings β€” the number of texture-sampler pairs to bind from the array. how many besties you're bringing in πŸ’œ

🌟 AVAILABILITY 🌟

This function is available since SDL 3.2.0. so if you're on 3.2.0 or later, you're eating good πŸ”₯


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, bestie. go bind those samplers, you're gonna do amazing, no cap. 🧚✨

with love from the Simple Directmedia Layer, SDL 3.4.18 β€” this page was SDL_BindGPUFragmentSamplers(3), and yes she ate πŸ’–πŸ‘‘

πŸ“¦ where this page comes from