CookCommandlet: Remove remaining CookByTheBookInCommandlet pollables into PumpPollables, and add a sleep command when we are busy with no pollables ready.

#preflight 6216f12cdb60b6b5920733b9
#preflight 6217c144bd28238bde887478

[CL 19117710 by Matt Peters in ue5-main branch]
This commit is contained in:
Matt Peters
2022-02-24 12:53:54 -05:00
parent be0e9e0d04
commit 26641909e1
6 changed files with 92 additions and 28 deletions
@@ -1005,21 +1005,11 @@ bool UCookCommandlet::CookByTheBook( const TArray<ITargetPlatform*>& Platforms)
DECLARE_SCOPE_CYCLE_COUNTER( TEXT( "CookByTheBook.MainLoop" ), STAT_CookByTheBook_MainLoop, STATGROUP_LoadTime );
{
uint32 TickResults = 0;
const float CookOnTheSideTimeSlice = 10.0f;
uint32 UnusedVariable = 0;
TickResults = CookOnTheFlyServer->TickCookOnTheSide( CookOnTheSideTimeSlice, UnusedVariable,
ShowProgress ? ECookTickFlags::None : ECookTickFlags::HideProgressDisplay );
TickResults = CookOnTheFlyServer->TickCookOnTheSide( MAX_flt, UnusedVariable,
ShowProgress ? ECookTickFlags::None : ECookTickFlags::HideProgressDisplay, MAX_int32);
{
UE_SCOPED_COOKTIMER_AND_DURATION(CookByTheBook_ShaderProcessAsync, DetailedCookStats::TickLoopShaderProcessAsyncResultsTimeSec);
GShaderCompilingManager->ProcessAsyncResults(true, false);
}
{
UE_SCOPED_COOKTIMER(CookByTheBook_TickAssetRegistry);
FAssetRegistryModule::TickAssetRegistry(-1.0f);
}
if ((TickResults & UCookOnTheFlyServer::COSR_RequiresGC) != 0)
{
FString GCReason;
@@ -1097,16 +1087,6 @@ bool UCookCommandlet::CookByTheBook( const TArray<ITargetPlatform*>& Platforms)
DumpMemStats();
}
{
UE_SCOPED_COOKTIMER_AND_DURATION(CookByTheBook_ProcessDeferredCommands, DetailedCookStats::TickLoopProcessDeferredCommandsTimeSec);
ProcessDeferredCommands();
}
}
{
UE_SCOPED_COOKTIMER_AND_DURATION(CookByTheBook_TickCommandletStats, DetailedCookStats::TickLoopTickCommandletStatsTimeSec);
FStats::TickCommandletStats();
}
}
} while (bTestCook);