SDL Wiki
(This is the documentation for SDL3, which is the current stable version. SDL2 was the previous version!)

SDL_SetGPUAllowedFramesInFlight

Configures the maximum allowed number of frames in flight.

Header File

Defined in <SDL3/SDL_gpu.h>

Syntax

bool SDL_SetGPUAllowedFramesInFlight(
    SDL_GPUDevice *device,
    Uint32 allowed_frames_in_flight);

Function Parameters

SDL_GPUDevice * device a GPU context.
Uint32 allowed_frames_in_flight the maximum number of frames that can be pending on the GPU.

Return Value

(bool) Returns true if successful, false on error; call SDL_GetError() for more information.

Remarks

The default value when the device is created is 2. This means that after you have submitted 2 frames for presentation, if the GPU has not finished working on the first frame, SDL_AcquireGPUSwapchainTexture() will fill the swapchain texture pointer with NULL, and SDL_WaitAndAcquireGPUSwapchainTexture() will block.

Higher values increase throughput at the expense of visual latency. Lower values decrease visual latency at the expense of throughput.

Note that calling this function will stall and flush the command queue to prevent synchronization issues.

The minimum value of allowed frames in flight is 1, and the maximum is 3.

Version

This function is available since SDL 3.2.0.


CategoryAPI, CategoryAPIFunction, CategoryGPU


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.