mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 17:44:56 +00:00
Update async load / frame limiter logic
Update nod
This commit is contained in:
@@ -388,10 +388,29 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
const auto targetFrameTime = getTargetFrameTime();
|
||||||
OPTICK_EVENT("Wait for Retrace");
|
bool skipRetrace = false;
|
||||||
m_window->waitForRetrace();
|
if (g_ResFactory != nullptr) {
|
||||||
|
OPTICK_EVENT("Async Load Resources");
|
||||||
|
const auto idleTime = m_limiter.SleepTime(targetFrameTime);
|
||||||
|
skipRetrace = g_ResFactory->AsyncIdle(idleTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (skipRetrace) {
|
||||||
|
// We stopped loading resources to catch the next frame
|
||||||
|
m_limiter.Reset();
|
||||||
|
} else {
|
||||||
|
// No more to load, and we're under frame time
|
||||||
|
{
|
||||||
|
OPTICK_EVENT("Wait for Retrace");
|
||||||
|
m_window->waitForRetrace();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
OPTICK_EVENT("Sleep");
|
||||||
|
m_limiter.Sleep(targetFrameTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OPTICK_FRAME("MainThread");
|
OPTICK_FRAME("MainThread");
|
||||||
|
|
||||||
boo::SWindowRect rect = m_windowCallback.m_lastRect;
|
boo::SWindowRect rect = m_windowCallback.m_lastRect;
|
||||||
@@ -490,17 +509,6 @@ public:
|
|||||||
|
|
||||||
gfxQ->resolveDisplay(m_renderTex);
|
gfxQ->resolveDisplay(m_renderTex);
|
||||||
|
|
||||||
if (g_ResFactory != nullptr) {
|
|
||||||
const auto targetFrameTime = getTargetFrameTime();
|
|
||||||
const auto idleTime = m_limiter.SleepTime(targetFrameTime);
|
|
||||||
if (g_ResFactory->AsyncIdle(idleTime)) {
|
|
||||||
m_limiter.Reset();
|
|
||||||
} else {
|
|
||||||
// No more to load; sleep
|
|
||||||
m_limiter.Sleep(targetFrameTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_voiceEngine) {
|
if (m_voiceEngine) {
|
||||||
m_voiceEngine->pumpAndMixVoices();
|
m_voiceEngine->pumpAndMixVoices();
|
||||||
}
|
}
|
||||||
|
|||||||
2
extern/nod
vendored
2
extern/nod
vendored
Submodule extern/nod updated: 0985c63958...0396cf467b
Reference in New Issue
Block a user