Commit Graph

46 Commits

Author SHA1 Message Date
aleksander netzel
c07eb3fff0 Initial support for switching ray tracing on/off at runtime:
* Split IsRayTracingEnabled() into 2 parts: IsRayTracingEnabled() which can be changed at runtime and IsRayTracingAllowed() for checking if ray tracing can be enabled.
* r.Raytracing can now have following values: 0 - disabled, 1 - enabled all the time, 2 - enabled dynamic
* When ray tracing is dynamic, RayTracingGeometryManager will collect all FRayTracingGeometry and allocate/release RHI objects as needed depending on if ray tracing is enabled or not.
* Ray tracing can be switched on/off with r.Raytracing.Enable (default is 1).
* Add support to most features used in CitySample/Lyra for switching ray tracing at runtime.
* TODO: Hair geometries are not yet released.

#rb yuriy.odonnell
#preflight 634feac68176062ea7da933f

[CL 22622885 by aleksander netzel in ue5-main branch]
2022-10-19 09:00:41 -04:00
arciel rekman
1ad6c3648e Fix Lyra crash due to shader decompression failure (UE-165785).
- PCD3D_SM5 and PCD3D_SM6 had a unique situation of having identical (bytecode-wise and output hash-wise) shaders (raytracing is allowed in PCD3D_SM5). This resulted in those IoStore chunks being deduplicated, however, the actual contents were not identical due to optional data (which isn't included in the shader hash, see UE-166389).
- This fix makes sure we don't use just the shader hash alone to produce IoStore chunk hashes. Hash will now include the shader size and the shader format name.
- A few early guards added here and there to detect the problem early.

Also fixed a memory leak in UnrealPak pointed by CM.

#rb [at]Yuriy.ODonnell, [at]CarlMagnus.Nordin, [at]Christopher.Waters, [at]Jason.Nadro
#jira UE-165785
#preflight 633f3beed718720d2d58f37e

[CL 22402802 by arciel rekman in ue5-main branch]
2022-10-07 12:32:35 -04:00
kenzo terelst
fbb26600d0 Small PSO precache fixes:
- reduce the amount PSOs precached which won't be used during rendering
- fixes a few missing PSOs
- add some profile tags
- Minor fixes when running with PSO precaching turned on in the editor (won't do a lot right now but also won't fail or assert)

#jira UE-139584
#rb Mihnea.Balta
#preflight 6332c8c5c7791417aaae035d
#rnx

[CL 22203962 by kenzo terelst in ue5-main branch]
2022-09-27 08:31:27 -04:00
Arciel Rekman
0a803fe046 Allow global shaders to load before precaching PSOs (UE-163502)
- Also, only issue the warning if we waited at least 1ms in that call.

#rb Kenzo ter Elst, Jason Nadro
#jira UE-163502
#review @Kenzo.Terelst, @Jason.Nadro
#preflight 632b0f15b40000c8f0c4705a

[CL 22116865 by Arciel Rekman in ue5-main branch]
2022-09-21 13:28:58 -04:00
Matt Peters
5f9bf2c4d7 Fix build error: ! and & together are ambiguous precedence so wrap in parentheses to clarify.
#rb None, trivial
#rnx
#preflight None, unavailable

[CL 22086075 by Matt Peters in ue5-main branch]
2022-09-19 21:04:51 -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
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
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
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
arciel rekman
47184fc696 Harden preload entry management in shader library (FORT-446306).
#rb James.Doverspike, Chris.Genova
[REVIEW] [at]James.Doverspike, [at]Chris.Genova
#preflight 6238ddacb3653cf6afccd690

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 19458861 via CL 19459145 via CL 19459355 via CL 19459815 via CL 19463246 via CL 19475214 via CL 19475273
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v935-19464907)

[CL 19475936 by arciel rekman in ue5-main branch]
2022-03-22 23:24:15 -04:00
carlmagnus nordin
73b0e31128 Fixed double delete when destroying shader code libraries
#rnx
#rb arciel.rekman

#ROBOMERGE-AUTHOR: carlmagnus.nordin
#ROBOMERGE-SOURCE: CL 18976878 via CL 18976901 via CL 18976906 via CL 18992591 via CL 18992966
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18997224 by carlmagnus nordin in ue5-main branch]
2022-02-15 11:30:47 -05:00
arciel rekman
35ecf94fcb Do not attempt to split 1 shader groups even if they are larger than the threshold (UE-141903).
#rb PJ.Kack
#jira UE-141903
[REVIEW] [at]PJ.Kack
#preflight 6203d3c30927956f66b87cc2

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18917857 in //UE5/Release-5.0/... via CL 18926686 via CL 18928199
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18928444 by arciel rekman in ue5-main branch]
2022-02-09 19:03:46 -05:00
pj kack
6a68bde0d8 Fix non-deterministic sorting in iostore shader group compression logic.
Replace the map with an array for efficiency.

#jira UE-141110
#rb arciel.rekman
#rnx
#preflight 61fc374ca540d6e61bba7104

#ROBOMERGE-AUTHOR: pj.kack
#ROBOMERGE-SOURCE: CL 18886818 in //UE5/Release-5.0/... via CL 18886830 via CL 18887180
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18887383 by pj kack in ue5-main branch]
2022-02-07 12:30:43 -05:00
arciel rekman
992e7bffaa Do not skip loading RT shaders if we force all shaders to be created (UE-135175).
#rb Jason.Nadro
#jira UE-135175
#preflight none

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18729247 in //UE5/Release-5.0/... via CL 18729277 via CL 18729354
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18729372 by arciel rekman in ue5-main branch]
2022-01-25 17:39:37 -05:00
arciel rekman
89d1b1ca68 Fix crash on packaging (cannot use per-platform CVar in UnrealPak) (UE-139676).
#rb none
#jira UE-139676
#preflight none

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18671686 in //UE5/Release-5.0/... via CL 18671693 via CL 18671713
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v901-18665521)

[CL 18671722 by arciel rekman in ue5-main branch]
2022-01-19 23:51:00 -05:00
arciel rekman
71c0fe40e8 Compress shaders as groups for cooked games.
- Saves disk size and runtime memory on all platforms that use IoStore-based shader archive (on some - significantly).
- Decompression time is small and seems to get lost in noise given how rarely shaders are actually created.
- Also changed IoStore-based archive to allocate preload entries on demand, and disabled preloading singular shaders (used by the PSO cache) as the API needs more work.

#rb CM.Nordin, Serge.Bernier, Ben.Ingram
[REVIEW] [at]CarlMagnus.Nordin, [at]Serge.Bernier, [at]Ben.Ingram

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18657587 via CL 18657664 via CL 18657670 via CL 18662749 via CL 18662792 via CL 18662871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18662941 by arciel rekman in ue5-main branch]
2022-01-19 14:35:49 -05:00
arciel rekman
f1e9a0ff06 Fix non-unity CIS (ShaderCodeArchive.cpp)
#rb none

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18531363 via CL 18531384 via CL 18531388 via CL 18531727 via CL 18531731
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18531736 by arciel rekman in ue5-release-engine-test branch]
2022-01-06 10:55:44 -05:00
arciel rekman
0b17540895 Add visualization of the runtime shader usage.
- Produces an image in Saved/Profiling with the preloaded and created shaders, helping to understand preloading / creation patterns.
- Only works on desktop platforms in Development. Disabled by default (set r.ShaderCodeLibrary.VisualizeShaderUsage=1 in ini to enable).

#rb Ben.Ingram
[REVIEW] [at]Ben.Ingram

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18528155 via CL 18528185 via CL 18528187 via CL 18528288 via CL 18528302
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18528308 by arciel rekman in ue5-release-engine-test branch]
2022-01-05 22:36:59 -05:00
arciel rekman
2a499437fe Change shader compression method to Oodle Selkie6 by default (UE-136845).
- Provides about 8% runtime memory savings (in local tests).
- Also, adds more compression types for shaders.
- Impact on the shader compilation (in SCWs) seems to be negligible in local tests.

#rb Devin.Doucette, Charles.Bloom
[REVIEW] [at]Devin.Doucette, [at]Charles.Bloom, [at]Jason.Nadro
#jira UE-136845

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18502862 via CL 18503105 via CL 18503112 via CL 18505939 via CL 18505950
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18505961 by arciel rekman in ue5-release-engine-test branch]
2022-01-04 00:58:30 -05:00
yuriy odonnell
7f82e90db3 Add separate RHI capability properties for full ray tracing shaders and inline ray tracing. While most RHIs may support both features, some may only support one.
#preflight 619ce604f934c1a291f81cfe
#rb aleksander.netzel

#ROBOMERGE-AUTHOR: yuriy.odonnell
#ROBOMERGE-SOURCE: CL 18270186 in //UE5/Release-5.0/... via CL 18270194
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18270205 by yuriy odonnell in ue5-release-engine-test branch]
2021-11-23 10:25:31 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00