Commit Graph

128 Commits

Author SHA1 Message Date
arciel rekman
80c58ff63e Track (first) owners of FShaderMapResource_SharedCode to improve leak investigation.
#rb Jason.Nadro, Rob.Krajcarski, Jeremy.Moore, Eric.Renaud-Houde
#preflight 6402182a59017a559b7df6bd
[REVIEW] [at]Jason.Nadro, [at]Rob.Krajcarski, [at]Jeremy.Moore, [at]Eric.Renaudhoude
#rnx

[CL 24507827 by arciel rekman in ue5-main branch]
2023-03-03 17:02:58 -05:00
arciel rekman
1baa660036 Fix not having materials in DLC cooked against -fastcook builds.
- Fastcook disables chunking of the game content, so when a DLC is cooked against it and its content is split according to regular chunk IDs, the game can no longer find the shader libraries (that get chunk-specific names). To remedy this, chunking of the DLC shader libraries is disabled, especially given that currently the actual DLC pak file isn't split into chunks (if and when it becomes so, we will reconsider).
- Also improved logging to better understand how the libraries are getting opened, given the multitude of possibilities.

#rb Jason.Nadro
[REVIEW] [at]Jason.Nadro
#preflight 63f6ec877064074bd8e15684 , also 63f79cfdef1b24bf940d3624

[CL 24397829 by arciel rekman in ue5-main branch]
2023-02-24 04:00:37 -05:00
christopher waters
1f21b73b25 Ran IWYU on RHI and RenderCore, private only.
#preflight 63d358c85c69f453c1f79c37

[CL 23889591 by christopher waters in ue5-main branch]
2023-01-27 14:54:10 -05:00
kenzo terelst
ed4522e629 PSO precache improvement:
* Add support to boost PSO precache priority (used when render proxy for component is created but PSOs are not compiled yet)
* Add support to skip render proxy creation when PSOs are still compiling
* Add support to provide custom default vertex decleration taking the resource vertex elements into account (implemented for skin cache & spline mesh components)

#jira UE-171563	, UE-171567, UE-171570
#rnx
#rb Benjamin.Rouveyrol, Mihnea.Balta, Arciel.Rekman, Josie.Yang

[CL 23728474 by kenzo terelst in ue5-main branch]
2023-01-16 08:07:51 -05:00
Matt Peters
ae4fe47c8a Cooker LLM Tags: Add more tags around allocations made when cooking.
#rb None, trivial
#rnx
#preflight 6398aa088c5081ee9a3b9727

[CL 23493469 by Matt Peters in ue5-main branch]
2022-12-13 12:10:31 -05:00
axel riffard
1b019b643f Popup window on Metal platforms when no cooked content at startup
#jira UE-170334
#rb adam.kinge
#preflight 638991cb35192facc1a26564

[CL 23382006 by axel riffard in ue5-main branch]
2022-12-02 22:10:38 -05:00
christopher waters
615179b7f8 Adding includes and forward declarations for upcoming include changes.
#preflight 63891e309242c01326e955a5

[CL 23366615 by christopher waters in ue5-main branch]
2022-12-01 18:48:42 -05:00
arciel rekman
95b3818586 Use shader hashes for computing PrecachePSOHash.
- Allows construction of StatePrecachePSOHash in FGraphicsPipelineStateInitializers that are not associated with MDCs.
- Also better reflects the actual PSO compatibility.

[REVIEW] [at]Graham.Wihlidal, [at]Kenzo.TerElst
#preflight

[CL 23300306 by arciel rekman in ue5-main branch]
2022-11-28 19:16:55 -05:00
mickael gilabert
7328a90a2f If UMaterialInterface objects leak past the time at which the shader code library they depend on is closed, their material shader maps stay in the cache even though those shader maps are unusable even if the shader code library is re-opened. This can also affect newly loaded materials which use the same shader map, even if the shader code library has been re-opened.
This change prevents the cache being polluted by shader maps with forcibly released shaders.

[REVIEW] [at]arciel.rekman, [at]robert.millar
#rnx

[CL 23300180 by mickael gilabert in ue5-main branch]
2022-11-28 19:12:38 -05:00
arciel rekman
84798a8aea SCL: fix a deadlock by deleting library contents outside of the NamedLibrariesMutex's scope.
- Library deletion flushes render commands, but the rendering thread may be trying to access the libraries stack (for which it needs to acquire NamedLibrariesMutex), so holding that mutex during the deletion results in a deadlock. This change makes the deletion happen after the mutex is released.

- The mutex only guards the NamedLibrariesStack, not contents of any given library. It is still possible that a library being deleted is accessed by another thread that got a pointer to it beforehand, this change does not change anything in that regard. However, this should not happen if the higher level removes all the content from the unmounted plugin from memory prior to unmounting it (and closing the library), which it should do.

#rb CM Nordin, Justin Marcus
[REVIEW] [at]CarlMagnus.Nordin, [at]Mihnea.Balta, [at]Justin.Marcus
#preflight 637691b7b1509f1cc3094063

[CL 23190970 by arciel rekman in ue5-main branch]
2022-11-18 03:12:05 -05:00
Arciel Rekman
f5f6d47027 Make sure shader refcount cannot be 0 during the creation.
#rb Yuriy O'Donnell
#review @Arne.Schober
#jira
#preflight 636e9116953c19d435584df2

[CL 23101686 by Arciel Rekman in ue5-main branch]
2022-11-11 13:36:14 -05:00
arciel rekman
a042c334d4 Bring back RHI resource deletion when shader library is closed.
- Also, add flushing the pending deletes in the attempt to make sure any leftover RHI resources from the assets that used that library (which should be already queued for deletion at this point) are deleted before we remove the backing storage.

#rb Rex.Hill, Justin.Marcus, Luke.Thatcher
[REVIEW] [at]Rex.Hill
#preflight 636a7adb376a9cd6a856decc

[CL 23034312 by arciel rekman in ue5-main branch]
2022-11-08 14:20:19 -05:00
Arciel Rekman
a9a272c7a9 Support concurrent shader creation within a shadermap (UE-166109).
- Avoids oversubscription deadlock when multiple background threads are creating shaders during the PSO precaching.

#rb CM Nordin, Yuriy O'Donnell
#jira UE-166109
#review
#preflight 6365bb2b4b0e01486a9753be

[CL 23010571 by Arciel Rekman in ue5-main branch]
2022-11-07 10:15:34 -05:00
arciel rekman
8510cb4400 Fix another crash on exit due ot leaked global library's resources.
#rb none
[FYI] Justin.Marcus, CarlMagnus.Nordin
#preflight none

[CL 23000351 by arciel rekman in ue5-main branch]
2022-11-05 00:23:45 -04:00
arciel rekman
8615e858af Change Fatal log to a warning due to Global library's behavior.
#rb CM.Nordin
[FYI] Justin.Marcus, CarlMagnus.Nordin
#preflight none

[CL 22988920 by arciel rekman in ue5-main branch]
2022-11-04 12:17:41 -04:00
justin marcus
c31e3bcd3a Add fatal log to ~FShaderLibraryInstance. It is impossible for it to safely release resources from it's destructor.
[REVIEW] [at]Arciel.Rekman [at]Carl-Magnus.Nordin
#preflight https://horde.devtools.epicgames.com/job/6363c9b5dc30a4ce96fec50f

[CL 22968304 by justin marcus in ue5-main branch]
2022-11-03 17:57:51 -04:00
carlmagnus nordin
2b1c25c510 If a plugin contains a shader code library make sure to close it when unmounting the plugin
#preflight 6350ed84b13bfb29eb372a3b
#rb arciel.rekman

[CL 22651680 by carlmagnus nordin in ue5-main branch]
2022-10-20 04:48:12 -04:00
Matt Peters
9356ad41c4 ShaderCodeLibrary for CookMultiprocess: Fix typo in AppendFromCompactBinary that caused all calls to fail.
#rb None, trivial
#rnx
#preflight 632c7ff1e23e50651b4387f6

[CL 22139676 by Matt Peters in ue5-main branch]
2022-09-22 13:39:33 -04:00
Matt Peters
a8028aafba MPCook: Replicate shaderlibrary from CookWorker to Director.
#rb Jason.Nadro, Robert.Srinivasiah, Arciel.Rekman
#rnx
#preflight 6328bcd20a4ad044de3cbcfc

[CL 22078910 by Matt Peters in ue5-main branch]
2022-09-19 15:44:57 -04:00
Florin Pascu
6b3c1469ba Preview Shader Platform using different ShaderMaps and the DDPI/Cvar values of the Previewable Actual Platform
NumPlatforms limit changed from 64 to 65536, limited by NumBits
#jira UE-120561
#rb Chris.Waters, Jack.Porter, Mihnea.Balta
#preflight 630f1604f92416fb92b373ab

[CL 21718179 by Florin Pascu in ue5-main branch]
2022-08-31 04:38:34 -04:00
Matt Peters
80caf7a021 ShaderCodeLibraryCooker: Separate concerns so that writing shaderlibraries to disk is separate from population during the cook. This supports upcoming multiprocess cooking changes.
Tweak some functions for reduction of duplication and readability.
#rb Jason.Nadro, Rob.Srinivasiah
#rnx
#preflight 630d0a4d501b64ba331b303f

[CL 21685434 by Matt Peters in ue5-main branch]
2022-08-29 15:08:45 -04:00
allan bentham
9a5afd7255 Multiple PSO cache processing.
Splitt PSO cache code to separate out bundled game caches and a single PSO recording user cache.
Any additional PSO caches are enqueued when the shader library state change adds shader library components.
removed unused PSO SaveMode::SortedBoundPSOs.
#rb dmytro.vovk, peter.sauerbrei
#preflight 62d568481062f2e63007eafd
#preflight 62d5a99b2e3e5993c3bd473f

#ROBOMERGE-AUTHOR: allan.bentham
#ROBOMERGE-SOURCE: CL 21152209 via CL 21154820 via CL 21156073
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21181749 by allan bentham in ue5-main branch]
2022-07-20 11:54:53 -04:00
Jason Nadro
9c36c843b8 Removed unacceptable words from RenderCore.
#rb trivial
#jira UE-158668
#preflight 62c840a57e606620fd5c2847

[CL 21007335 by Jason Nadro in ue5-main branch]
2022-07-08 10:54:10 -04:00
Florin Pascu
f64fc575d2 Re-submiting with Mac fixes
Changed ShaderArchive, GlobalShaderCache, ShaderDebugInfo and Autogen to use ShaderPlatformName and not ShaderFormat when naming their output files.
#rb Jack.Porter, Chris.Waters, Mihnea.Balta, Jason.Nadro
#jira UE-120561
#preflight 62c31f6fc9410537282296c6

[CL 20937870 by Florin Pascu in ue5-main branch]
2022-07-04 19:06:33 -04:00
Florin Pascu
09cb19fcfd Backout 20871665 to fix Mac cook
#rb none
#jira none
#preflight 62be0c68d94b57687c3ff309

[CL 20904999 by Florin Pascu in ue5-main branch]
2022-06-30 17:41:55 -04:00