SDL_CancelGPUCommandBuffer(3)
π SDL_CancelGPUCommandBuffer β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is literally just a little function named SDL_CancelGPUCommandBuffer π β and yes, her whole job is cancelling a command buffer. no cap.
πΈ NAME πΈ
SDL_CancelGPUCommandBuffer β cancels a command buffer. that's it. that's the vibe. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_gpu.h>
bool SDL_CancelGPUCommandBuffer(
SDL_GPUCommandBuffer *command_buffer);
like, you pull in <SDL3/SDL_gpu.h> and then you get to yeet a command buffer into the void. iconic. π¦
π DESCRIPTION π
okay so here's the tea, and it's actually important, so pay attention pookie π
None of the enqueued commands are executed. literally zero. all those commands you queued up? not happening. cancelled. ghosted. they're not even gonna show up. π
it is an error to call this function after a swapchain texture has been acquired. so like, once you've got your hands on that swapchain texture, this door is closed, bestie. no going back. π
this must be called from the thread the command buffer was acquired on. same thread, no switching up on us. the command buffer knows where it came from and it will absolutely clock you if you try to play it any other way. π«Ά
and the big one β you must not reference the command buffer after calling this function. not once. not a lil peek. not a "just to check." it's done. let her rest. β
π FUNCTION PARAMETERS π
command_bufferβ a command buffer. yeah that's the whole description, she's lowkey mysterious like that π§
π RETURN VALUE π
returns true on success, false on error. and if you get that false, don't just sit there spiralling β call SDL_GetError() for more information, she'll tell you what went wrong. π
π₯ AVAILABILITY π₯
this function is available since SDL 3.2.0. so if you're on anything older, sorry babes, she's not there yet π
π SEE ALSO π
SDL_WaitAndAcquireGPUSwapchainTexture(3)SDL_AcquireGPUCommandBuffer(3)SDL_AcquireGPUSwapchainTexture(3)
go read those next, iykyk π
and that's the whole page, bestie β brought to you by the fine folks at Simple Directmedia Layer, running SDL 3.4.18, and dated right there in the corner as always. mwah π 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