dolphin/Source
Dentomologist 1dff22d576 Movie: Fix crash when starting input recording on OpenGL single-core
Use RunOnCPUThread instead of RunAsCPUThread in BeginRecordingInput.

Most OpenGL functions require an OpenGL context to have been created on
that thread before calling the function; when that isn't the case they
return invalid results which can cause crashes when passed into other
functions.

Dolphin creates the OpenGL context in the EmuThread which then becomes
either the CPU-GPU thread or the Video thread for single and dual core
respectively. OpenGL functions must therefore be called from that
thread.

Movie::BeginRecordingInput is called from the Host thread and runs a
block of code which ultimately creates a savestate, which in turn embeds
the framebuffer which requires calling various OpenGL functions.

In single core the use of RunAsCPUThread leads to this all happening on
the Host thread, eventually leading to invalid OpenGL calls and a crash.

In Dual core the crash is avoided because VideoBackendBase::DoState uses
the AsyncRequests::DO_SAVE_STATE event which causes VideoCommon_DoState
and its subsequent OpenGL calls to safely run on the Video thread.

This commit uses RunOnCPUThread instead of RunAsCPUThread, which causes
the subsequent code to run on the CPU-GPU thread in single core which
has the valid OpenGL context and so doesn't crash.
2023-11-08 19:14:54 -08:00
..
Android Merge pull request #12133 from mandar1jn/skylanders-improved-generation 2023-11-05 18:29:19 +01:00
Core Movie: Fix crash when starting input recording on OpenGL single-core 2023-11-08 19:14:54 -08:00
DSPSpy
DSPTool
PCH bump minimum VS version to 17.6 2023-05-16 20:21:36 -07:00
UnitTests Merge pull request #12133 from mandar1jn/skylanders-improved-generation 2023-11-05 18:29:19 +01:00
VSProps DolphinQt: Add function to set a QWidget's window decorations to dark ones on Windows. 2023-08-12 16:54:53 +02:00
.clang-format
CMakeLists.txt
dolphin-emu.sln Add lz4 submodule 2023-10-02 17:28:23 -04:00