Description

r.ShaderpipelineCache.StartupMode=0 is a option for stop precompile using PSO Caching, but it doesn't work properly.

After CL-5837455, FShaderPipelineCache::ResumeBatching() is always called in FEngineLoop::Init(). So precompile always run if using r.ShaderpipelineCache.StartupMode=0.

FEngineLoop::Init()
{
...
   FShaderPipelineCache::PauseBatching();
   {
#if defined(WITH_CODE_GUARD_HANDLER) && WITH_CODE_GUARD_HANDLER
   void CheckImageIntegrity();
   CheckImageIntegrity();
#endif
   }

   {
   SCOPED_BOOT_TIMING("FCoreDelegates::OnFEngineLoopInitComplete.Broadcast()");
   FCoreDelegates::OnFEngineLoopInitComplete.Broadcast();
   }
   FShaderPipelineCache::ResumeBatching();
...
}

This issue can be solved by a following code. 

void FShaderPipelineCache::Initialize(EShaderPlatform Platform)
{
   check(ShaderPipelineCache == nullptr);
   if (FShaderCodeLibrary::IsEnabled())
   {
      FPipelineFileCache::Initialize(GetGameVersionForPSOFileCache());
      ShaderPipelineCache = new FShaderPipelineCache(Platform);
      // add
      if (CVarPSOFileCacheStartupMode.GetValueOnAnyThread() == 0)
      {
         // for ShaderPipelineCache->PausedCount++; 
         PauseBatching();
      }
      // add
   }
}

 

 

Steps to Reproduce
  1. Set up to use PSO Caching using our document https://docs.unrealengine.com/ja/Engine/Rendering/PSOCaching/index.html
  2. set r.ShaderpipelineCache.StartupMode to 0 using device profile
  3. launch on Android or iOS device

expect : Precompile using PSO Caching doesn't work
result : it work 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-99713 in the post.

0
Login to Vote

Won't Fix
ComponentUE - Graphics Features
Affects Versions4.25.3
CreatedSep 16, 2020
ResolvedJun 8, 2022
UpdatedJun 14, 2022