mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 23:07:42 +00:00
Merge remote-tracking branch 'darkszero/feature/lazy-commit-resources'
# Conflicts: # extern/boo
This commit is contained in:
@@ -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 char* 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) {
|
||||
|
||||
Reference in New Issue
Block a user