diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 933f03236f..2ec51dc1fb 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -110,9 +110,17 @@ void SysMtgsThread::ShutdownThread() void SysMtgsThread::ThreadEntryPoint() { - m_thread_handle = Threading::ThreadHandle::GetForCallingThread(); Threading::SetNameOfCurrentThread("GS"); + if (GSinit() != 0) + { + Host::ReportErrorAsync("Error", "GSinit() failed."); + m_open_or_close_done.Post(); + return; + } + + m_thread_handle = Threading::ThreadHandle::GetForCallingThread(); + for (;;) { // wait until we're actually asked to initialize (and config has been loaded, etc) @@ -154,6 +162,8 @@ void SysMtgsThread::ThreadEntryPoint() // we need to reset sem_event here, because MainLoop() kills it. m_sem_event.Reset(); } + + GSshutdown(); } void SysMtgsThread::ResetGS() diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index a61e1bf448..82dd1fdf02 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -647,19 +647,6 @@ bool VMManager::Initialize(const VMBootParameters& boot_params) ScopedGuard close_cdvd = [] { DoCDVDclose(); }; Console.WriteLn("Opening GS..."); - - // TODO: Get rid of thread state nonsense and just make it a "normal" thread. - static bool gs_initialized = false; - if (!gs_initialized) - { - if (GSinit() != 0) - { - Console.WriteLn("Failed to initialize GS."); - return false; - } - - gs_initialized = true; - } if (!GetMTGS().WaitForOpen()) { // we assume GS is going to report its own error diff --git a/pcsx2/gui/SysCoreThread.cpp b/pcsx2/gui/SysCoreThread.cpp index 7a9d4fbbec..35f441d1d6 100644 --- a/pcsx2/gui/SysCoreThread.cpp +++ b/pcsx2/gui/SysCoreThread.cpp @@ -112,7 +112,6 @@ void SysCoreThread::OnSuspendInThread() void SysCoreThread::Start() { - GSinit(); SPU2init(); PADinit(); DEV9init();