GPU: Add SetGPUAllowedFramesInFlight (#11599)

This commit is contained in:
Evan Hemsley 2024-12-06 11:56:20 -08:00 committed by GitHub
parent 47429227ab
commit fa5f84fb6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 109 additions and 9 deletions

View file

@ -2650,6 +2650,25 @@ bool SDL_SetGPUSwapchainParameters(
present_mode);
}
bool SDL_SetGPUAllowedFramesInFlight(
SDL_GPUDevice *device,
Uint32 allowed_frames_in_flight)
{
CHECK_DEVICE_MAGIC(device, false);
if (device->debug_mode) {
if (allowed_frames_in_flight < 1 || allowed_frames_in_flight > 3)
{
SDL_assert_release(!"allowed_frames_in_flight value must be between 1 and 3!");
}
}
allowed_frames_in_flight = SDL_clamp(allowed_frames_in_flight, 1, 3);
return device->SetAllowedFramesInFlight(
device->driverData,
allowed_frames_in_flight);
}
SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat(
SDL_GPUDevice *device,
SDL_Window *window)