SDL_CreateGPUComputePipeline(3)
β¨ NAME β¨
SDL_CreateGPUComputePipeline β bestie, this is the one that creates a pipeline object so you can do a whole compute workflow π
β¨
It lives in the SDL3 FUNCTIONS family, and the manual page you're reading is SDL_CreateGPUComputePipeline(3). Hiii, welcome, let's get into it π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gpu.h>
SDL_GPUComputePipeline * SDL_CreateGPUComputePipeline(
SDL_GPUDevice *device,
const SDL_GPUComputePipelineCreateInfo *createinfo);
Two args, one pointer back. Iconic honestly.
π¦ DESCRIPTION π¦
Okay so here's the tea β β your shader resource bindings have to be authored in a particular order, and that order depends on which shader format you're rolling with. This is not a suggestion, it's the vibe check your shaders must pass. π₯
π For SPIR-V shaders
Use these resource sets, in this exact order:
0: Sampled textures, followed by read-only storage textures, followed by read-only storage buffers1: Read-write storage textures, followed by read-write storage buffers2: Uniform buffers
π For DXBC and DXIL shaders
Use this register order:
(t[n], space0): Sampled textures, followed by read-only storage textures, followed by read-only storage buffers(u[n], space1): Read-write storage textures, followed by read-write storage buffers(b[n], space2): Uniform buffers
π For MSL/metallib
Use this order:
[[buffer]]: Uniform buffers, followed by read-only storage buffers, followed by read-write storage buffers[[texture]]: Sampled textures, followed by read-only storage textures, followed by read-write storage textures
There are optional properties you can hand over through props π β and these are the ones that are supported:
SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING: a name that can be displayed in debugging tools.
That's it, that's the list. A cute lil name for your pipeline so the debugger doesn't just call it "thing #4" π
π FUNCTION PARAMETERS π
deviceβ a GPU Context. Your whole GPU situation lives here, bestie.createinfoβ a struct describing the state of the compute pipeline to create. This is where you say what you want it to be, no cap.
π RETURN VALUE π
Returns a compute pipeline object on success π
, or NULL on failure β and if you get that NULL, call SDL_GetError() for more information, because she WILL tell you what went wrong. Go read it, fr fr. π«Ά
β AVAILABILITY β
This function is available since SDL 3.2.0. If you're on anything older, it's giving... not available, sorry babe. π
π₯ SEE ALSO π₯
The whole trilogy β create it, bind it, release it. Main character energy all around. β¨
Simple Directmedia Layer wrote this whole thing, and the version on this page is SDL 3.4.18 π That's the source and the version, folded into one cute lil sign-off. Now go make that compute pipeline, bestie, you got this πΈπ¦π
π¦ 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