melonDS-emu / melonDS

DS emulator, sorta
https://melonds.kuribo64.net
GNU General Public License v3.0
3.27k stars 542 forks source link

Vsync doesn't work #804

Open DonelBueno opened 4 years ago

DonelBueno commented 4 years ago

Hi! First of all, thanks for the great emulator.

One annoying issue I'm facing with the emu is that the vsync option doesn't work, I still get screen tearing in full screen (at least with the OpenGL Hardware Renderer).

Is this a known issue? I know I can force vsync through my GPU driver, but I wouldn't be able to go past 60 fps when disabling frame limit if I did it.

GPU: GTX 1070 8 GB, Drivers 457.09 Windows 10 x64

RSDuck commented 4 years ago

Arisotura said there was some problem hooking it up with QT while allowing it to be on and off switchable without a restart. The button currently does nothing (which admittedly is confusing).

RayyanAnsari commented 3 years ago

As of melonDS 0.9.1, the VSync button has been removed (for the reason above).

Arisotura commented 3 years ago

reason this is shitty is because with Qt we have a new multicontext rendering system, with one context for the UI thread and one for the emu thread, as both are using OpenGL

simply toggling the vsync flag forces the UI refresh rate to match that of your monitor, but the emu thread still runs at its own rate. this also results in shitty performance when fastforwaring (prolly from the emu thread flooding refresh events).

I tried adding a better syncing mechanism, but the results were disappointingly shitty, so you guess how this went.

maybe this will actually be fixed for 0.9.2 or later.