- Shaders are searched by TypeName and PermutationId, so move those fields out of FShader and into separate arrays inside ShaderMap, to reduce cache misses while finding shaders
#rb none
#ROBOMERGE-OWNER: ben.ingram
#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 12646854 via CL 12646966 via CL 12646981
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v675-12543919)
[CL 12646995 by ben ingram in Main branch]
#rb Ben.Ingram
#jira UE-91432
#ROBOMERGE-SOURCE: CL 12513296 in //UE4/Release-4.25/... via CL 12513299 via CL 12513301
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v673-12478461)
[CL 12513305 by arciel rekman in Main branch]
- FileCache can dynamically allocate/release memory as needed
- Preloaded lines are locked in the cache. One the preloaded memory has been read, the line is unlocked. This prevents preloaded lines from being evicted before they're needed.
- Cache line size changed from 64k to 16k, reduce fragmentation due to locked preloaded lines
#rb none
#ROBOMERGE-SOURCE: CL 12491121 via CL 12491126 via CL 12491130
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v673-12478461)
[CL 12491133 by ben ingram in Main branch]
- Functions did not get carried over.
#rb none
#ROBOMERGE-SOURCE: CL 12253797
#ROBOMERGE-BOT: (v668-12245121)
[CL 12253799 by arciel rekman in Main branch]
- Each shadermap is now associated with one or more assets, and shaders are laid out according to the
open order of those assets, if provided. If not provided, the original ordering is kept. The original ordering
will not be always deterministic, particularly if shader compilation needs to happen, because jobs can get
reordered during the compilation.
Other fixes:
- Fixed sorting within the shadermap not being deterministic (FCompareShaderPrimaryKey)
- Fixed Niagara shadermap duplicating Platform property and not initializing it properly.
- Removed (unused) support for Child shader libraries (would not be deterministic).
#rb Ben.Ingram, Rob.Krajcarski
#ROBOMERGE-OWNER: Arciel.Rekman
#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 12249260 via CL 12249262 via CL 12250173
#ROBOMERGE-BOT: (v668-12245121)
[CL 12250313 by Arciel Rekman in Main branch]
Don't crash the editor if 'cooked content in editor' is enabled along with shared shader code library
#rb none
#ROBOMERGE-SOURCE: CL 12166697 in //UE4/Release-4.25/... via CL 12166704
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v661-12148976)
[CL 12166707 by ben ingram in Main branch]
#rb Josh.Adams, Ben.Woodhouse
#rnx
#ROBOMERGE-OWNER: Arciel.Rekman
#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 11450810 via CL 11452365 via CL 11452390 via CL 11452432
#ROBOMERGE-BOT: (v654-11333218)
[CL 11456136 by Arciel Rekman in Main branch]
- Previously the order of shaders would be defined by the order of adding them, which can vary even without any change due to SCWs finishing the jobs at a different time.
- Fixed a previous compile issue and added comments re: TSortedMap and TMap compatibility after checking with the Core team.
#rb Daniel.Lamb (discussed)
[CODEREVIEW] Dmitriy.Dyomin
#ROBOMERGE-SOURCE: CL 11248093 via CL 11248095 via CL 11248101
#ROBOMERGE-BOT: (v647-11244347)
[CL 11254818 by arciel rekman in Main branch]
[FYI] Arciel.Rekman
#ROBOMERGE-SOURCE: CL 11225960 via CL 11228025 via CL 11228838
#ROBOMERGE-BOT: (v644-11213502)
[CL 11241725 by bob tellez in Main branch]
- Previously the order of shaders would be defined by the order of adding them, which can vary even without any change due to SCWs finishing the jobs at a different time.
#rb Daniel.Lamb (discussed)
[CODEREVIEW] Dmitriy.Dyomin
#ROBOMERGE-SOURCE: CL 11224248 via CL 11227707 via CL 11228378
#ROBOMERGE-BOT: (v644-11213502)
[CL 11241606 by arciel rekman in Main branch]
- Optimize parsing of FVertexElement, FDepthStencilStateInitializerRHI, FBlendStateInitializerRHI, FPipelineFileCacheRasterizerState, FPipelineCacheFileFormatPSO using FStringView and TArray<FStringView, TInlineAllocator<N>> to avoid temporary allocations.
- Optimize parsing and string conversion of FCompactFullName, FStableShaderKeyAndValue using FStringView and T[Ansi]StringBuilder to avoid temporary allocations.
- Use TInlineAllocator<16> for FCompactFullName to eliminate dynamic allocations. The size was selected by profiling a title with many shaders.
- Serialize FEditorShaderStableInfo directly to UTF-8 instead of converting to it later to avoid converting every name from ASCII to UTF-16 to UTF-8 during the serialization process.
- Load input files in parallel now that millions of allocations have been eliminated.
- Make the PSOSC serialization self-test only run when verbose logging is enabled.
- Optimize ParseQuoteComma by using FStringView and TArray<FStringView, TInlineAllocator<N>> to avoid temporary allocations.
These changes reduced the execution time of the build command by 90% on a large title. The time savings affect full, iterative, and single-package cooks.
#rb Arciel Rekman, Zousar.Shaker
#ushell-cherrypick of 10860101 by devin.doucette
#ROBOMERGE-SOURCE: CL 11163162 via CL 11163163 via CL 11163164
#ROBOMERGE-BOT: (v640-11091645)
[CL 11166858 by devin doucette in Main branch]
#rnx
#rb none
#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)
[CL 10870549 by ryan durand in Main branch]
- Added shader pipeline hash as a key attribute.
- Added shaders from shader pipelines (they can have different code if RHI removes unused interpolators between the stages, like D3D does).
#rb Dmitriy.Dyomin, Richard.Wallis
#ROBOMERGE-SOURCE: CL 9959336 via CL 9959339 via CL 9959342
#ROBOMERGE-BOT: (v558-9892490)
[CL 9959347 by arciel rekman in Main branch]
[REVIEW] Ben.Salem, Richard.Wallis
#ROBOMERGE-SOURCE: CL 9868558 via CL 9868562 via CL 9868563
#ROBOMERGE-BOT: (v548-9842178)
[CL 9868569 by chris bunner in Main branch]
Plus - Fix rare shutdown check() failure when async file reads are still wainting in the FShaderPipelineCache.
Plus - Put back correct order of shutdown for FShaderCodeLibrary and FShaderPipelineCache as they can have outstanding aync file handles and we'll get a crash if they are closed after the module shutdown has deleted the FPakPrecacher singleton.
#jira UE-79315
#rb Dmitriy.Dyomin, Michael.Trepka
[FYI] Michael.Trepka
#fyi Richard.Wallis
#ROBOMERGE-OWNER: rolando.caloca
#ROBOMERGE-AUTHOR: richard.wallis
#ROBOMERGE-SOURCE: CL 9743659 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v542-9736015)
[CL 9744080 by rolando caloca in Main branch]