Commit Graph

54 Commits

Author SHA1 Message Date
ben ingram
d9d0535ddc Add freezable hash table, use to accelerate lookup of shaders within ShaderMap
- 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]
2020-04-06 21:12:18 -04:00
arciel rekman
15a2eef5e0 Fix running -nullrhi with native shader libraries (UE-91432).
#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]
2020-04-01 20:32:33 -04:00
ben ingram
73961fa70d Updates to FileCache to work better with shader preloading
- 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]
2020-03-30 17:41:29 -04:00
arciel rekman
55c833b9fd Fix cooking builds with SCL and -nullrhi (UE-91021).
#rb none
#jira UE-91021

#ROBOMERGE-SOURCE: CL 12358137 in //UE4/Release-4.25/... via CL 12358144
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v671-12333473)

[CL 12358154 by arciel rekman in Main branch]
2020-03-20 21:58:24 -04:00
dmitriy dyomin
5292331cfe Changed shader library logging for plugins from Display to Verbose
#jira none
#rb none

#ROBOMERGE-SOURCE: CL 12332483 in //UE4/Release-4.25/... via CL 12332484
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v670-12295787)

[CL 12332486 by dmitriy dyomin in Main branch]
2020-03-20 06:17:35 -04:00
arciel rekman
ad17c24f15 Fixing (blindly) merge of SCL sorting from a 4.24 codebase.
- Functions did not get carried over.

#rb none


#ROBOMERGE-SOURCE: CL 12253797
#ROBOMERGE-BOT: (v668-12245121)

[CL 12253799 by arciel rekman in Main branch]
2020-03-18 17:45:06 -04:00
Arciel Rekman
e970ef5ea2 ShaderLibrary sorted by file open order, with other fixes (FORT-265600).
- 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]
2020-03-18 15:35:20 -04:00
ben ingram
ccb40fe20c #jira none
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]
2020-03-13 15:50:49 -04:00
arciel rekman
65b2d3c88a Vulkan: prevent crash on exit due to SCL (UE-89478).
#rb Ben.Ingram
[FYI] Dmitriy.Dyomin
#jira UE-89478

#ROBOMERGE-SOURCE: CL 11619652 in //UE4/Release-4.25/... via CL 11619657
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v655-11596533)

[CL 11619677 by arciel rekman in Main branch]
2020-02-25 16:56:18 -05:00
Arciel Rekman
f6b2c6df54 Make shader library determinism optional per platform.
#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]
2020-02-15 10:16:44 -05:00
Rolando Caloca
5b82f15def Copying //UE4/Dev-RenderPlat-Staging@11388153 to //UE4/Main
#rb none
#rnx

[CL 11388545 by Rolando Caloca in Main branch]
2020-02-12 13:27:19 -05:00
Josh Adams
aa9705149b Copying Private-LoadTimes-4.24 stream to Main. Biggest changes are in Materials/Shader memory freezing.
#rb none

[CL 11282608 by Josh Adams in Main branch]
2020-02-06 13:13:41 -05:00
arciel rekman
650c7ce628 Resubmitting: stabilize the order of shaders in the shader library (FORT-255406)
- 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]
2020-02-05 12:49:12 -05:00
bob tellez
0fa930ad38 Back out changelist 11224248. CIS error
[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]
2020-02-04 22:32:52 -05:00
arciel rekman
77f933e4ce Stabilize the order of shaders in the shader library (FORT-255406).
- 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]
2020-02-04 22:30:44 -05:00
Rolando Caloca
f63a3e857e Merging //UE4/Main@11178322 to Dev-RenderPlat-Staging
#rnx
#rb none

[CL 11195678 by Rolando Caloca in Dev-RenderPlat-Staging branch]
2020-01-31 10:34:10 -05:00
devin doucette
6eec62bcf6 Optimize ShaderPipelineCacheToolsCommandlet
- 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]
2020-01-29 15:15:45 -05:00
Juan Canada
2ecf4f9708 Merging //UE4/Dev-Main@10877709 to Dev-RenderPlat-Staging(//UE4/Dev-Rendering)
#rnx
#rb none

[CL 10895568 by Juan Canada in Dev-RenderPlat-Staging branch]
2020-01-07 13:45:01 -05:00
ryan durand
0f0464a30e Updating copyright for Engine Runtime.
#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]
2019-12-26 14:45:42 -05:00
arciel rekman
324add1e80 Support shader pipelines in the shader code library's stable map.
- 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]
2019-11-01 12:56:00 -04:00
chris bunner
71500ad073 Fixing up header in shadercode library CSV, previously the first entry would append to the same line and result in "OutputHashempty" as a header field. Standard line break appended to correct.
[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]
2019-10-28 09:28:29 -04:00
rolando caloca
e521bb5ed4 Delete Library file handle on close (Non native ShaderCodeLibrary implementation only), unfortunatly this also means we have to wait on any outstanding read tasks.
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]
2019-10-22 08:30:35 -04:00
yuriy odonnell
3e4eb41ade Added support for creating ray tracing shaders through FShaderCodeLibrary
#rb Luke.Thatcher
#jira none

#ROBOMERGE-SOURCE: CL 9730989 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v539-9700858)

[CL 9730990 by yuriy odonnell in Main branch]
2019-10-21 07:50:05 -04:00
Rolando Caloca
f83ae4807a Copying //UE4/Dev-Rendering@9317594 to Dev-RenderPlat-Staging
#rb none
#rnx

[CL 9317904 by Rolando Caloca in Dev-RenderPlat-Staging branch]
2019-10-01 13:03:04 -04:00
ben marsh
781fa83d9a FShaderCodeLibrary - Editor fixes. It's up to the caller if we want to initialize the code library - if we have an implementation then allow shader creation. Impl creation was checked against FPlatformProperties::RequiresCookedData() but its a bit more complex than that. Logic for creation is in LaunchEngineLoop.cpp.
#jira
[FYI] Richard.Wallis
#rb none
#rnx

#ROBOMERGE-OWNER: ben.marsh
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 9098039 via CL 9098044
#ROBOMERGE-BOT: (v443-9013191)

[CL 9100475 by ben marsh in Main branch]
2019-09-25 14:29:32 -04:00