---
name: "SDL_SetGPUAllowedFramesInFlight"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_SetGPUAllowedFramesInFlight"
---

# SDL\_SetGPUAllowedFramesInFlight(3)

Configures the maximum allowed number of frames in flight.

## NAME

SDL\_SetGPUAllowedFramesInFlight - Configures the maximum allowed number of frames in flight.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_SetGPUAllowedFramesInFlight(**     **SDL\_GPUDevice \*device,**     **Uint32 allowed\_frames\_in\_flight);**

## 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.

## RETURN VALUE

Returns true if successful, false on error; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
