Commit Graph

122 Commits

Author SHA1 Message Date
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
Florin Pascu
1844e8e514 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 62bbf93ae353c20ac2361d94

[CL 20871665 by Florin Pascu in ue5-main branch]
2022-06-29 04:19:06 -04:00
Devin Doucette
748e39e3c0 Replaced uses of _SV with TEXTVIEW
#preflight 6266da740634d0904ce6de29
#rb Steve.Robb
#rnx

[CL 19905760 by Devin Doucette in ue5-main branch]
2022-04-25 13:56:30 -04:00
arciel rekman
e3d2d01f9b Fix deadlock when opening plugin shader libraries.
#rb Ben.Ingram, Josh.Adams
#preflight 625f7bb06b458c3f8597af43
[REVIEW] [at]Josh.Adams, [at]Jason.Nadro, [at]Ben.Ingram

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 19854958 via CL 19857024 via CL 19862962 via CL 19863061
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19871027 by arciel rekman in ue5-main branch]
2022-04-22 15:55:14 -04:00
arciel rekman
2c4fba02af Fix hitching while precompiling PSO cache.
- Add a new API to release preloaded shader to provide a way to manage preloaded data (which was previously statically allocated).

#rb James.Doverspike, Richard.Wallis
[REVIEW] [at]Allan.Bentham, [at]Richard.Wallis
#preflight 625e11c4db15ac92db7ee858

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 19832275 via CL 19833640 via CL 19837454 via CL 19854946 via CL 19855339
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19856713 by arciel rekman in ue5-main branch]
2022-04-21 17:47:12 -04:00
markus breyer
64e81f8041 Unblocking workaround for UEFN is hanging on its startup from EGS
#rb acriel.rekman
#rnx
#preflight 625f50f6d41243458717bce1

#ROBOMERGE-AUTHOR: markus.breyer
#ROBOMERGE-SOURCE: CL 19825176 via CL 19826072 via CL 19826094 via CL 19826110
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19834832 by markus breyer in ue5-main branch]
2022-04-20 14:29:48 -04:00
josh adams
95462e7d2a - FIxed loading shader caches from plugins' IOStore files
#rb arciel.rekman
#preflight 625d8938691f49969eab04af

#ROBOMERGE-AUTHOR: josh.adams
#ROBOMERGE-SOURCE: CL 19789816 via CL 19791853 via CL 19791859 via CL 19791865
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19809560 by josh adams in ue5-main branch]
2022-04-19 11:33:37 -04:00