SDL_SubmitGP...dAcquireFence(3)

✨ SDL_SubmitGPUCommandBufferAndAcquireFence ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, this one's a banger πŸ’–


🌸 NAME 🌸

SDL_SubmitGPUCommandBufferAndAcquireFence β€” she submits a command buffer so its commands can actually get processed on the GPU, and acquires a fence that's associated with that command buffer. two jobs, one function, main character energy fr fr πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_gpu.h>

SDL_GPUFence * SDL_SubmitGPUCommandBufferAndAcquireFence(
    SDL_GPUCommandBuffer *command_buffer);

like look at her. one arg. returns a fence pointer. iconic πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first things first, and this is important: you must release this fence when you don't need it anymore, or it will cause a leak. not a vibe. a leak. do not do that 😭

also, it is invalid to use the command buffer after this is called. like, she's gone, she's submitted, let her go πŸ•ŠοΈ

this must be called from the thread the command buffer was acquired on. same thread, no exceptions, that's the rule 🧡

and here's the lil guarantee that makes it all make sense: all commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing. so like, ordering? handled. sequencing? slay ✨


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • command_buffer β€” a command buffer. that's it, that's the whole parameter, she's simple like that 🫢

🌈 RETURN VALUE 🌈

returns a fence associated with the command buffer πŸ’– or NULL on failure, in which case you should call SDL_GetError() for more info. always check, bestie, always check πŸ™ˆ


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on anything older, no fence for you πŸ˜”


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, go say hi:


πŸŽ€ reminder bestie: SDL_ReleaseGPUFence(3) is literally right there in the see-also. release the fence. no leaks in this household. periodt. πŸ’…

and that's the page!! brought to you by Simple Directmedia Layer, version SDL 3.4.18, filed under SDL_SubmitGP...dAcquireFence(3) β€” mwah, go submit something gorgeous πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from