mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-25 22:19:10 +00:00
GPU: Add SetGPUAllowedFramesInFlight (#11599)
This commit is contained in:
parent
47429227ab
commit
fa5f84fb6e
9 changed files with 109 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue