dolphin-emulator/Source/Core
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
..
AudioCommon Use structs for config callback IDs 2023-08-17 19:19:26 +02:00
Common Netplay: Fix building on clang 17. 2023-11-03 16:15:04 +01:00
Core Movie: Fix crash when starting input recording on OpenGL single-core 2023-11-08 19:14:54 -08:00
DiscIO DiscIO: Remove unintentional use of comma operator 2023-11-05 09:24:49 +01:00
DolphinNoGUI Merge pull request #11873 from AdmiralCurtiss/pause-and-lock-host 2023-06-06 13:50:20 +02:00
DolphinQt Merge pull request #12237 from AdmiralCurtiss/hard-label 2023-11-06 20:22:23 +01:00
DolphinTool Merge pull request #11960 from Minty-Meeo/dolphin-tool-code-review-4 2023-06-17 14:18:21 +02:00
InputCommon ControllerInterface/SDL: Remove Xbox 360 controller disabling hack. 2023-10-26 18:04:11 -05:00
MacUpdater CMake: Fix storyboard copying 2023-04-29 16:10:38 -05:00
UICommon Use structs for config callback IDs 2023-08-17 19:19:26 +02:00
UpdaterCommon CMake: Use targets for all optionally-external dependencies 2023-06-15 01:41:41 -05:00
VideoBackends VideoBackends:OGL: Handle when SSBOs are only supported in some shader stages 2023-10-25 17:47:04 +02:00
VideoCommon Jit64: Recompile asm routines on cache clear 2023-10-31 19:43:49 +01:00
WinUpdater StringUtil: Move CommandLineToUtf8Argv() into Common namespace 2023-05-16 14:23:21 -04:00
CMakeLists.txt
DolphinLib.ARM64.props
DolphinLib.props Merge pull request #12133 from mandar1jn/skylanders-improved-generation 2023-11-05 18:29:19 +01:00
DolphinLib.vcxproj Add lz4 submodule 2023-10-02 17:28:23 -04:00
DolphinLib.vcxproj.user
DolphinLib.x64.props