SDL_PUSHGPUCOMPUTEUNIFORMDATA(3)
π SDL_PushGPUComputeUniformData(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_PushGPUComputeUniformData π«Ά
β¨ NAME β¨
SDL_PushGPUComputeUniformData β pushes data to a uniform slot on the command buffer. that's it, that's the job, and she does it flawlessly π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gpu.h>
void SDL_PushGPUComputeUniformData(
SDL_GPUCommandBuffer *command_buffer,
Uint32 slot_index,
const void *data,
Uint32 length);
π¦ DESCRIPTION π¦
so here's the tea: subsequent draw calls in this command buffer will use this uniform data. like, once you push it, it's locked in for everything that comes after in that command buffer. no cap. β¨
now the important part, and I need you to actually read this one bestie, not just skim it like the group chat: the data being pushed must respect std140 layout conventions. in practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned. yes, for real. if you don't, the vibes will be off and the GPU will simply not understand you. it's giving misaligned struct, and not in a cute way π
π FUNCTION PARAMETERS π
command_bufferβ a command buffer. your little vessel of compute destiny πslot_indexβ the uniform slot to push data to. pick your slot, queen πdataβ client data to write. the actual payload, the substance, the content πlengthβ the length of the data to write. how much of the data you're sending. be precise, fr fr π
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, she's not there yet π
heads up bestie: thestd140+ 16-byte alignment thing forvec3andvec4is not a suggestion, it's the rules. respect the layout or respect the consequences π
and that's the whole page, you ate it, you understood it, you're iconic π
Simple Directmedia Layer made this, this doc is for SDL 3.4.18, and the page is literally just SDL_PushGPUComputeUniformData(3) β so go push some uniform data and slay π
β¨π¦ππ
π¦ 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