Initial support for title switching + better Wii U menu compatibility (#907)

This commit is contained in:
Exzap 2023-07-21 13:54:07 +02:00 committed by GitHub
parent bfbeeae6f6
commit 2200cc0ddf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
95 changed files with 2549 additions and 746 deletions

View file

@ -183,9 +183,8 @@ int Latte_ThreadEntry()
// before doing anything with game specific shaders, we need to wait for graphic packs to finish loading
GraphicPack2::WaitUntilReady();
// load/init shader cache file
LatteShaderCache_load();
// load disk shader cache
LatteShaderCache_Load();
// init registers
Latte_LoadInitialRegisters();
// let CPU thread know the GPU is done initializing
@ -196,7 +195,7 @@ int Latte_ThreadEntry()
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::milliseconds(1));
LatteThread_HandleOSScreen();
if (!Latte_IsActive())
if (Latte_GetStopSignal())
LatteThread_Exit();
}
gxRingBufferReadPtr = gx2WriteGatherPipe.gxRingBuffer;
@ -232,20 +231,24 @@ void Latte_Stop()
sLatteThread.join();
}
bool Latte_IsActive()
bool Latte_GetStopSignal()
{
return sLatteThreadRunning;
return !sLatteThreadRunning;
}
void LatteThread_Exit()
{
if (g_renderer)
g_renderer->Shutdown();
// clean up vertex/uniform cache
LatteBufferCache_UnloadAll();
// clean up texture cache
LatteTC_UnloadAllTextures();
// clean up runtime shader cache
// todo
// destroy renderer but make sure that g_renderer remains valid until the destructor has finished
LatteSHRC_UnloadAll();
// close disk cache
LatteShaderCache_Close();
// destroy renderer but make sure that g_renderer remains valid until the destructor has finished
if (g_renderer)
{
Renderer* renderer = g_renderer.get();