Dangerous --vsync=false flag.

This commit is contained in:
Ben Vanik
2015-01-03 01:32:59 -08:00
parent c6f0ce7a1e
commit 858f70549f
5 changed files with 34 additions and 20 deletions

View File

@@ -77,10 +77,15 @@ X_STATUS GL4GraphicsSystem::Setup() {
reinterpret_cast<cpu::MMIOWriteCallback>(MMIOWriteRegisterThunk));
// 60hz vsync timer.
DWORD timer_period = 16;
if (!FLAGS_vsync) {
// DANGER a value too low here will lead to starvation!
timer_period = 4;
}
timer_queue_ = CreateTimerQueue();
CreateTimerQueueTimer(&vsync_timer_, timer_queue_,
(WAITORTIMERCALLBACK)VsyncCallbackThunk, this, 16, 16,
WT_EXECUTEINTIMERTHREAD);
(WAITORTIMERCALLBACK)VsyncCallbackThunk, this, 16,
timer_period, WT_EXECUTEINPERSISTENTTHREAD);
return X_STATUS_SUCCESS;
}
@@ -138,9 +143,6 @@ void GL4GraphicsSystem::SwapHandler(const SwapParameters& swap_params) {
control_->width(), control_->height(),
GL_COLOR_BUFFER_BIT, GL_LINEAR);
});
// Roll over vblank.
MarkVblank();
}
uint64_t GL4GraphicsSystem::ReadRegister(uint64_t addr) {