GPU: device & frameSDL 3.2

SDL_SubmitGPUCommandBuffer

Sends everything recorded in the command buffer to the GPU (and presents the swapchain image, if one was acquired).

Signature

bool SDL_SubmitGPUCommandBuffer(SDL_GPUCommandBuffer *command_buffer);

How it works

The work runs on the GPU after this returns; the CPU does not wait. The command buffer is finished: do not touch it again, acquire a new one next frame. To wait for the GPU (e.g. to read results back), SDL_SubmitGPUCommandBufferAndAcquireFence gives you a fence to wait on.

Parameters

command_bufferSDL_GPUCommandBuffer *

The recorded command buffer.

Return value

true on success, false on failure.

Example

example.cpp
1SDL_EndGPURenderPass(pass);
2SDL_SubmitGPUCommandBuffer(cmd);   // GPU runs it, window shows it
Official SDL wiki