Regression was introduced in #1954
GSdx caused the emulator to crash when the renderer was restarted.
It may have affected older gpus from nvidia/amd
with older OpenGL support as well.
If emulation is paused and resumed, vsync may become enabled even if the
frame limiter is currently disabled. This state persists until the
settings are changed or the hotkeys are used.
Fix the inconsistent framelimiter/vsync behaviour so that vsync isn't
enabled whenever the framelimiter is disabled, which matches the
behaviour in the rest of the code.
The swap interval function must be called on the same thread that
rendering takes place on. This fixes an issue where the turbo speed and
frame limiter hotkeys fail to disable vsync when the OpenGL renderer is
used.
Using range loops where possible (correctly).
Using auto where possible (minimize code changes whenever it's decided to change back to a std container).
Use more efficient erase pattern (where possible).
Minor code tweaks.
PCSX2 sends a negative value (-1) to GSdx when adaptive mode is
specified for Vsync, this mode is exclusive to OpenGL at the moment
and is unimplemented on the D3D11 renderer. Also the present function
of swapchain only accepts values from 0 to 4 as parameter, hence
passing negative values to the function is undefined behavior.
So let's fallback to standard synchronization method on D3D11 when
PCSX2 requests for adaptive mode.
* Remove redundant mention of MTVU hack speedhack.
(It's grayed out at safest preset)
* Change ``Note 1/2`` into a single notes header with
multiple lists, also modified the "is in active development"
part as it's no longer the case.
[skip ci]
The safest preset should ideally try to provide
the highest accuracy and stability when emulating the
PS2, allowing the manipulation of the MTVU hack could
just destroy both of these things, hence the following patch
force disables the hack on safest preset.
v2: allow all combinations of framelimiter and vsync options
v3:
* disable vsync when the user disable framelimiter with F4
* Use g_Conf->EmuOptions instead of EmuConfig