mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-09 18:45:35 +00:00
gpu: Fix swapchain texture cycling.
This is actually a 1:1 copy of a patch we wrote for GPU PS5 some time ago!
This commit is contained in:
@@ -8061,7 +8061,10 @@ static bool D3D12_Submit(
|
||||
|
||||
windowData->inFlightFences[windowData->frameCounter] = (SDL_GPUFence *)d3d12CommandBuffer->inFlightFence;
|
||||
(void)SDL_AtomicIncRef(&d3d12CommandBuffer->inFlightFence->referenceCount);
|
||||
windowData->frameCounter = (windowData->frameCounter + 1) % renderer->allowedFramesInFlight;
|
||||
|
||||
// Normally this is '% allowedFramesInFlight', but the value gets clamped
|
||||
// at swapchain creation time, so use swapchainTextureCount instead
|
||||
windowData->frameCounter = (windowData->frameCounter + 1) % windowData->swapchainTextureCount;
|
||||
}
|
||||
|
||||
// Check for cleanups
|
||||
|
||||
Reference in New Issue
Block a user