diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-29 14:10:16 -0400 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-07-14 02:50:35 -0400 |
commit | 05cb10530fbd34635b06f75dea488a8896a763ac (patch) | |
tree | 990f0a010352eb3f72db4e80d6894954941a4e75 /src/yuzu | |
parent | 9fc0d1d701dbf4f775b25ee3f5b02a850eb5ffee (diff) |
OpenGL: Use MakeCurrent/DoneCurrent for multithreaded rendering.
Diffstat (limited to 'src/yuzu')
-rw-r--r-- | src/yuzu/bootmanager.cpp | 5 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 833085559..159b2c32b 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -20,7 +20,10 @@ EmuThread::EmuThread(GRenderWindow* render_window) : render_window(render_window) {} void EmuThread::run() { - render_window->MakeCurrent(); + if (!Settings::values.use_multi_core) { + // Single core mode must acquire OpenGL context for entire emulation session + render_window->MakeCurrent(); + } MicroProfileOnThreadCreate("EmuThread"); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9ce8d7c27..16812e077 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -374,6 +374,8 @@ bool GMainWindow::LoadROM(const QString& filename) { const Core::System::ResultStatus result{system.Load(render_window, filename.toStdString())}; + render_window->DoneCurrent(); + if (result != Core::System::ResultStatus::Success) { switch (result) { case Core::System::ResultStatus::ErrorGetLoader: @@ -916,6 +918,7 @@ int main(int argc, char* argv[]) { QCoreApplication::setApplicationName("yuzu"); QApplication::setAttribute(Qt::AA_X11InitThreads); + QApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); QApplication app(argc, argv); // Qt changes the locale and causes issues in float conversion using std::to_string() when |