SDL_DISPATCHGPUCOMPUTEINDIRECT(3)

πŸ’– NAME πŸ’–

SDL_DispatchGPUComputeIndirect β€” the way you dispatch compute work when the parameters are chillin' inside a buffer instead of passed as arguments, periodt ✨


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

void SDL_DispatchGPUComputeIndirect(
    SDL_GPUComputePass *compute_pass,
    SDL_GPUBuffer *buffer,
    Uint32 offset);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, lowkey this one is the ✨indirect✨ version of dispatching compute β€” instead of you handing over the numbers yourself, the numbers are sitting in a buffer and the GPU goes and reads them. so iconic of it πŸ’…

The buffer layout should match the layout of SDL_GPUIndirectDispatchCommand, no cap. And listen β€” you must not call this function before binding a compute pipeline. Like, bind first. Don't be that girl πŸŽ€

🚨 A VERY IMPORTANT NOTE 🚨 If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. ngl that's chaos energy and we do not stan πŸ™ˆ If the write order matters, you MUST end the compute pass and begin another one. literally non-negotiable, bestie πŸ‘‘

🌈 FUNCTION PARAMETERS 🌈

  • compute_pass β€” a compute pass handle πŸ’œ
  • buffer β€” a buffer containing dispatch parameters πŸ“
  • offset β€” the offset to start reading from the dispatch buffer 🧚

⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0 β€” so if you're on anything older, sorry babe, it's giving outdated 😭


and that's the whole page, bestie! this lil' cutie lives in the Simple Directmedia Layer docs, straight from the SDL 3.4.18 era β€” she ate and left no crumbs πŸ‘‘πŸ’… mwah 🫢

πŸ“¦ where this page comes from