SDL_BINDGPUVERTEXSTORAGETEXTURES(3)

πŸ’– SDL_BindGPUVertexStorageTextures πŸ’–

okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_BindGPUVertexStorageTextures ✨


🌸 NAME 🌸

SDL_BindGPUVertexStorageTextures β€” binds storage textures so your vertex shader can actually use them πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_gpu.h>

void SDL_BindGPUVertexStorageTextures(
    SDL_GPURenderPass *render_pass,
    Uint32 first_slot,
    SDL_GPUTexture *const *storage_textures,
    Uint32 num_bindings);

πŸ’… DESCRIPTION πŸ’…

okay so first things first, queen: these textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ. no exceptions, that's the vibe check they have to pass 🫢

and the textures you're binding have to have a matching type declared in the shader β€” like 2D, 3D, 2DMS, etc. mismatched types? not slay. the shader said what it said πŸ’€

also, be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader(). literally go read that one too, it's giving prerequisites πŸ“š


✨ FUNCTION PARAMETERS ✨

  • render_pass β€” a render pass handle 🎨
  • first_slot β€” the vertex storage texture slot to begin binding from 🎯
  • storage_textures β€” an array of storage textures 🧚
  • num_bindings β€” the number of storage texture to bind from the array πŸ”’

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0 πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€


ngl, if you skipped the SDL_CreateGPUShader() requirement you're gonna have a bad time. it's not me being dramatic, it's just fr fr the rules πŸ™ˆ

Simple Directmedia Layer β€” SDL 3.4.18 β€” mwah, that's a wrap bestie, go bind some textures and slay πŸ’…βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from