SDL_DispatchGPUCompute(3)
SDL_DispatchGPUCompute(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we make your GPU do homework for you β¨ this one's from <SDL3/SDL_gpu.h> and it's giving compute dispatch energy, no cap.
β¨ NAME β¨
SDL_DispatchGPUCompute β dispatches compute work. that's it, that's the whole vibe π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gpu.h>
void SDL_DispatchGPUCompute(
SDL_GPUComputePass *compute_pass,
Uint32 groupcount_x,
Uint32 groupcount_y,
Uint32 groupcount_z);
look at her. four params, returns void, zero drama. iconic π
π¦ DESCRIPTION π¦
so like, this function sends your compute work off to do its little thing. but there's a RULE, bestie, and it's non-negotiable:
You must not call this function before binding a compute pipeline.
fr fr. bind the pipeline first. the pipeline is the main character here and you cannot skip her intro π
π A VERY IMPORTANT NOTE π
not me putting this in its own section because it's genuinely that serious:
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. If the write order matters, you MUST end the compute pass and begin another one.
translating for the group chat: multiple dispatches in one pass + overlapping writes = chaos. nobody knows who wrote what first, not even the driver, not even god. if the order actually matters to you? end the compute pass, start a fresh one, and suddenly everything is deterministic again. do not fight this. she is not asking π
π FUNCTION PARAMETERS π
compute_passβ a compute pass handle. this is your little ticket into the pass, your backstage lanyard ποΈgroupcount_xβ number of local workgroups to dispatch in the X dimension. the horizontal girly β¨groupcount_yβ number of local workgroups to dispatch in the Y dimension. the vertical girly β¨groupcount_zβ number of local workgroups to dispatch in the Z dimension. the depth girly, the one who goes into the screen π
all three are Uint32, so keep it positive and keep it whole, bestie π
β AVAILABILITY β
she's been around since SDL 3.2.0 β so if you're on anything older than that, this function simply does not exist for you, sorry bestie π
and that's the whole page!! stay hydrated, bind your pipeline, and don't dispatch twice into the same region unless you're ready for the consequences π
cute little sign-off: this page comes from Simple Directmedia Layer, documented as of version SDL 3.4.18, and it's the SDL_DispatchGPUCompute(3) page β love her, obsessed with her, periodt ππβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms