mirror of https://github.com/AxioDL/metaforce.git
Support lazy CGraphics::CommitResources
This commit is contained in:
parent
0b523f98c3
commit
d2ae2b3818
|
@ -397,6 +397,7 @@ public:
|
||||||
m_window->waitForRetrace();
|
m_window->waitForRetrace();
|
||||||
}
|
}
|
||||||
OPTICK_FRAME("MainThread");
|
OPTICK_FRAME("MainThread");
|
||||||
|
CGraphics::SetCommitResourcesAsLazy(true);
|
||||||
|
|
||||||
boo::SWindowRect rect = m_windowCallback.m_lastRect;
|
boo::SWindowRect rect = m_windowCallback.m_lastRect;
|
||||||
rect.location = {0, 0};
|
rect.location = {0, 0};
|
||||||
|
@ -465,6 +466,11 @@ public:
|
||||||
m_imGuiConsole.ShowAboutWindow(false, m_errorString);
|
m_imGuiConsole.ShowAboutWindow(false, m_errorString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
OPTICK_EVENT("Flush");
|
||||||
|
CGraphics::SetCommitResourcesAsLazy(false);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
OPTICK_EVENT("Draw");
|
OPTICK_EVENT("Draw");
|
||||||
gfxQ->setRenderTarget(m_renderTex);
|
gfxQ->setRenderTarget(m_renderTex);
|
||||||
|
|
|
@ -37,6 +37,7 @@ u32 CGraphics::g_FrameCounter = 0;
|
||||||
u32 CGraphics::g_Framerate = 0;
|
u32 CGraphics::g_Framerate = 0;
|
||||||
u32 CGraphics::g_FramesPast = 0;
|
u32 CGraphics::g_FramesPast = 0;
|
||||||
frame_clock::time_point CGraphics::g_FrameStartTime = frame_clock::now();
|
frame_clock::time_point CGraphics::g_FrameStartTime = frame_clock::now();
|
||||||
|
bool CGraphics::g_commitAsLazy = false;
|
||||||
|
|
||||||
const std::array<zeus::CMatrix3f, 6> CGraphics::skCubeBasisMats{{
|
const std::array<zeus::CMatrix3f, 6> CGraphics::skCubeBasisMats{{
|
||||||
/* Right */
|
/* Right */
|
||||||
|
|
|
@ -346,8 +346,30 @@ public:
|
||||||
|
|
||||||
static const boo::SystemChar* PlatformName() { return g_BooPlatformName; }
|
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) {
|
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) {
|
static void SetShaderDataBinding(const boo::ObjToken<boo::IShaderDataBinding>& binding) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 542191fd70e8835576f2d1320859291518972e8a
|
Subproject commit c6aed360e6bb0537afc4f597104810f76e1340fc
|
Loading…
Reference in New Issue