logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_SetGPUAllowedFramesInFlight - Configures the maximum allowed number of frames in flight.

Availability

       This function is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                 SDL_SetGPUAllowedFramesInFlight(3)

Description

       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.

Function Parameters

device a GPU context.

       allowed_frames_in_flight
              the maximum number of frames that can be pending on the GPU.

Header File

       Defined in SDL3/SDL_gpu.h

Name

       SDL_SetGPUAllowedFramesInFlight - Configures the maximum allowed number of frames in flight.

Return Value

       Returns true if successful, false on error; call

       SDL_GetError () for more information.

Synopsis

#include"SDL3/SDL.h"boolSDL_SetGPUAllowedFramesInFlight(SDL_GPUDevice*device,Uint32allowed_frames_in_flight);

See Also