This question was created in reference to: [Reliable shader compilation for automated [Content removed]
Hi [Content removed] which looks as follows in 5.4:
`/**
- This will cause the test to wait for the shaders to finish compiling before moving on.
*/
bool FWaitForShadersToFinishCompilingInGame::Update()
{
#if WITH_EDITOR
static double TimeShadersFinishedCompiling = 0;
static double LastReportTime = FPlatformTime::Seconds();
static bool DidCompileSomething = false;
const double TimeToWaitForJobsToStart = 2.0;
bool ShadersCompiling = GShaderCompilingManager && GShaderCompilingManager->IsCompiling();
bool AssetsCompiling = FAssetCompilingManager::Get().GetNumRemainingAssets() > 0;
double TimeNow = FPlatformTime::Seconds();
if (ShadersCompiling || AssetsCompiling)
{
if (TimeNow - LastReportTime > 5.0)
{
LastReportTime = TimeNow;
if (ShadersCompiling)
{
UE_LOG(LogEditorAutomationTests, Log, TEXT(“Waiting for %i shaders to finish.”), GShaderCompilingManager->GetNumRemainingJobs() + GShaderCompilingManager->GetNumPendingJobs());
}
if (AssetsCompiling)
{
UE_LOG(LogEditorAutomationTests, Log, TEXT(“Waiting for %i assets to finish.”), FAssetCompilingManager::Get().GetNumRemainingAssets());
}
}
TimeShadersFinishedCompiling = 0;
DidCompileSomething = true;
return false;
}
// Current jobs are done, but things may still come in on subsequent frames..
if (TimeShadersFinishedCompiling == 0)
{
TimeShadersFinishedCompiling = FPlatformTime::Seconds();
}
if (FPlatformTime::Seconds() - TimeShadersFinishedCompiling < TimeToWaitForJobsToStart)
{
return false;
}
// may not be necessary, but just double-check everything is finished and ready
GShaderCompilingManager->FinishAllCompilation();
FAssetCompilingManager::Get().FinishAllCompilation();
if (DidCompileSomething)
{
UE_LOG(LogEditorAutomationTests, Log, TEXT(“Done waiting for shaders to finish.”));
DidCompileSomething = false;
}
#endif
return true;
}`Should we additionally call UMaterialInterface::SubmitRemainingJobsForWorld(CurrentWorld) and wait on FinishAllCompilation() as you suggest or should FWaitForShadersToFinishCompilingInGame latent command effectively do the same thing?
Also, I’m concerned the machines we are running on may be a factor here as they are relatively old. As you can see, the CPU alone is about a decade old. I’m imaging that could also be a factor here? (see attached aboutPC.PNG)
[Image Removed]
For additional context, here is an representative example of the command line we run for tests as well leveraging software rendering (which is our standard for core tests to eliminate factors related to GPU HW variability):
C:\path\to\project.uproject LevelName -game -ExecCmds="Automation Now; RunTests System.Engine.Rendering Framework" -FIXEDSEED -BENCHMARK -FPS=60 -WARP -AllowSoftwareRendering -ResX=1440 -ResY=810 -ForceRes -Windowed -unattended -nopause -stdout -RunningLocal -FullSizeScreenshots -d3ddebug -testexit="Automation Test Queue Empty" -ABSLOG="C:\path\to\log.txt" -d3d11