mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 19:13:40 +01:00
Merge pull request #16156 from hrydgard/opengl-thread-refactor
OpenGL threading refactor
This commit is contained in:
23 files changed
+224
-286
No files matched your search
+5
-5
@@ -327,14 +327,14 @@ void Core_ProcessStepping() {
|
||||
|
||||
// Many platforms, like Android, do not call this function but handle things on their own.
|
||||
// Instead they simply call NativeRender and NativeUpdate directly.
|
||||
void Core_Run(GraphicsContext *ctx) {
|
||||
bool Core_Run(GraphicsContext *ctx) {
|
||||
host->UpdateDisassembly();
|
||||
while (true) {
|
||||
if (GetUIState() != UISTATE_INGAME) {
|
||||
Core_StateProcessed();
|
||||
if (GetUIState() == UISTATE_EXIT) {
|
||||
UpdateRunLoop();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
Core_RunLoop(ctx);
|
||||
continue;
|
||||
@@ -347,7 +347,7 @@ void Core_Run(GraphicsContext *ctx) {
|
||||
Core_RunLoop(ctx);
|
||||
if (coreState == CORE_POWERDOWN) {
|
||||
Core_StateProcessed();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -358,10 +358,10 @@ void Core_Run(GraphicsContext *ctx) {
|
||||
// Exit loop!!
|
||||
Core_StateProcessed();
|
||||
|
||||
return;
|
||||
return true;
|
||||
|
||||
case CORE_NEXTFRAME:
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -27,8 +27,10 @@ class GraphicsContext;
|
||||
// called from emu thread
|
||||
void UpdateRunLoop();
|
||||
|
||||
void Core_Run(GraphicsContext *ctx);
|
||||
// Returns false when an UI exit state is detected.
|
||||
bool Core_Run(GraphicsContext *ctx);
|
||||
void Core_Stop();
|
||||
|
||||
// For platforms that don't call Core_Run
|
||||
void Core_SetGraphicsContext(GraphicsContext *ctx);
|
||||
|
||||
|
||||
+8
-5
@@ -233,16 +233,14 @@ void Shutdown()
|
||||
ClearPendingEvents();
|
||||
UnregisterAllEvents();
|
||||
|
||||
while(eventPool)
|
||||
{
|
||||
while (eventPool) {
|
||||
Event *ev = eventPool;
|
||||
eventPool = ev->next;
|
||||
delete ev;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lk(externalEventLock);
|
||||
while(eventTsPool)
|
||||
{
|
||||
while (eventTsPool) {
|
||||
Event *ev = eventTsPool;
|
||||
eventTsPool = ev->next;
|
||||
delete ev;
|
||||
@@ -251,7 +249,12 @@ void Shutdown()
|
||||
|
||||
u64 GetTicks()
|
||||
{
|
||||
return (u64)globalTimer + slicelength - currentMIPS->downcount;
|
||||
if (currentMIPS) {
|
||||
return (u64)globalTimer + slicelength - currentMIPS->downcount;
|
||||
} else {
|
||||
// Reporting can actually end up here during weird task switching sequences on Android
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
u64 GetIdleTicks()
|
||||
|
||||
Reference in new issue
Block a user