mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 17:04:55 +00:00
Support lazy CGraphics::CommitResources
This commit is contained in:
@@ -397,6 +397,7 @@ public:
|
||||
m_window->waitForRetrace();
|
||||
}
|
||||
OPTICK_FRAME("MainThread");
|
||||
CGraphics::SetCommitResourcesAsLazy(true);
|
||||
|
||||
boo::SWindowRect rect = m_windowCallback.m_lastRect;
|
||||
rect.location = {0, 0};
|
||||
@@ -465,6 +466,11 @@ public:
|
||||
m_imGuiConsole.ShowAboutWindow(false, m_errorString);
|
||||
}
|
||||
|
||||
{
|
||||
OPTICK_EVENT("Flush");
|
||||
CGraphics::SetCommitResourcesAsLazy(false);
|
||||
}
|
||||
|
||||
{
|
||||
OPTICK_EVENT("Draw");
|
||||
gfxQ->setRenderTarget(m_renderTex);
|
||||
|
||||
@@ -37,6 +37,7 @@ u32 CGraphics::g_FrameCounter = 0;
|
||||
u32 CGraphics::g_Framerate = 0;
|
||||
u32 CGraphics::g_FramesPast = 0;
|
||||
frame_clock::time_point CGraphics::g_FrameStartTime = frame_clock::now();
|
||||
bool CGraphics::g_commitAsLazy = false;
|
||||
|
||||
const std::array<zeus::CMatrix3f, 6> CGraphics::skCubeBasisMats{{
|
||||
/* Right */
|
||||
|
||||
@@ -346,8 +346,30 @@ public:
|
||||
|
||||
static const boo::SystemChar* PlatformName() { return g_BooPlatformName; }
|
||||
|
||||
|
||||
static bool g_commitAsLazy;
|
||||
static void SetCommitResourcesAsLazy(bool newStatus) {
|
||||
if (newStatus != g_commitAsLazy) {
|
||||
g_commitAsLazy = newStatus;
|
||||
if (!newStatus && g_BooFactory) {
|
||||
g_BooFactory->commitPendingTransaction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void CommitResources(const boo::FactoryCommitFunc& commitFunc __BooTraceArgs) {
|
||||
g_BooFactory->commitTransaction(commitFunc __BooTraceArgsUse);
|
||||
CommitResources(commitFunc __BooTraceArgsUse, g_commitAsLazy);
|
||||
}
|
||||
|
||||
static void CommitResources(const boo::FactoryCommitFunc& commitFunc __BooTraceArgs, bool lazy) {
|
||||
if (!g_BooFactory) {
|
||||
return;
|
||||
}
|
||||
if (lazy) {
|
||||
g_BooFactory->lazyCommitTransaction(commitFunc __BooTraceArgsUse);
|
||||
} else {
|
||||
g_BooFactory->commitTransaction(commitFunc __BooTraceArgsUse);
|
||||
}
|
||||
}
|
||||
|
||||
static void SetShaderDataBinding(const boo::ObjToken<boo::IShaderDataBinding>& binding) {
|
||||
|
||||
2
extern/boo
vendored
2
extern/boo
vendored
Submodule extern/boo updated: 542191fd70...c6aed360e6
Reference in New Issue
Block a user