summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorDentomologist <dentomologist@gmail.com>2023-11-08 18:43:00 -0800
committerDentomologist <dentomologist@gmail.com>2023-11-08 19:14:54 -0800
commit1dff22d5768d6860ef6ed6ee8ad3a353bbea0093 (patch)
tree87f669a14b53b189fdb88bbb025eb854a413e60f /Source/Core/VideoCommon/TextureCacheBase.cpp
parent8140d6b1d3b0fa1d3ab793b4a52b61d50b3faf76 (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
0 files changed, 0 insertions, 0 deletions