Skip to content

Commit

Permalink
Fix FPS deviation in DirectX (#530) (#538)
Browse files Browse the repository at this point in the history
Co-authored-by: Spodi <spodi2290@aol.com>
  • Loading branch information
Kenix3 and Spodi authored May 1, 2024
1 parent 96c8a89 commit ce9dd90
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/graphic/Fast3D/gfx_dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,13 +771,12 @@ static void gfx_dxgi_swap_buffers_begin(void) {
li.QuadPart = -left;
SetWaitableTimer(dxgi.timer, &li, 0, nullptr, nullptr, false);
WaitForSingleObject(dxgi.timer, INFINITE);

do {
YieldProcessor();
QueryPerformanceCounter(&t);
t.QuadPart = qpc_to_100ns(t.QuadPart);
} while (t.QuadPart < next);
}
do {
YieldProcessor();
QueryPerformanceCounter(&t);
t.QuadPart = qpc_to_100ns(t.QuadPart);
} while (t.QuadPart < next);
}
QueryPerformanceCounter(&t);
dxgi.previous_present_time = t;
Expand Down

0 comments on commit ce9dd90

Please sign in to comment.