Commit Graph

55 Commits

Author SHA1 Message Date
arciel rekman
ab92d0298a Only separate PCD3D_SM5 RT shaders for compression.
- The reason for the separate grouping was that PCD3D_SM5 is shared between SM5 and SM6 platforms and as such compressing raytracing shaders together with non-RT ones would affect memory footprint for D3D11.
- For PCD3D_SM6 users this is less of a concern. While this change can regress memory footprint for users who disable raytracing in the settings, it will improve memory footprint for those who do not (presumably, the majority). Also, it saves more in the disk space for everyone.

#rb Jason.Nadro, Dan.Elksnitis
[REVIEW] [at]Jason.Nadro, [at]Dan.Elksnitis
#preflight 6400bdcc5f3b94d2920ec788
#rnx

[CL 24508791 by arciel rekman in ue5-main branch]
2023-03-03 17:36:00 -05:00
arciel rekman
c751135be1 Speculative fix for inability to decompress the shaders.
- IoStore chunks must be getting recompressed along the way. Do not trust the header info and use the IoStore chunk info instead.

#rb CM.Nordin
[REVIEW] [at]Dan.Thompson, [at]Allan.Bentham, [at]CarlMagnus.Nordin
#preflight 63ed0204e558a2dbb278ff39

[CL 24251530 by arciel rekman in ue5-main branch]
2023-02-16 01:48:17 -05:00
arciel rekman
341540b911 Log extra info when failing to decompress the shaders.
#rb Allan.Bentham
[REVIEW] [at]Allan.Bentham, [at]CarlMagnus.Nordin, [at]Dan.Thompson
#preflight 63ebd393b91ae11c1c5cb111

[CL 24219679 by arciel rekman in ue5-main branch]
2023-02-14 15:20:57 -05:00
dan thompson
4a6b8c8b00 Removal of the r.Shaders.CompressionFormat CVar, and shader group compression during UnrealPak now inherits the packaging compresison level.
Due to the fact that UnrealPak doesn't load INIs, the cvar was always its default value. This, combined with the fact that shaders don't store what codec they are compressed with means that setting this cvar to anything other than default (oodle) causes a crash in UnrealPak as DecompressShader will try to decompress with Oodle independent of the actual codec. Rather than plumb this information down through ProjectParams, I felt it prudent to just always use Oodle.

Additionally, in order to facilitate faster iteration times for development build farm jobs, the shader compression level used during UnrealPak will inherit from the overall package compression level set via Project Settings (PackageCompressionLevel_*).

This tacitly avoids patch issues as the default shader compression level happens to be the default package compression level, except now it inherits any faster levels for iteration time.

Note that we still use Mermaid as the codec as it's faster for decompressing than Kraken, which we care about for shaders.

#rb Fabian.Giesen
#rb Arciel.Rekman
#preflight 63e2f94c786751d1e0ffb290

[CL 24092953 by dan thompson in ue5-main branch]
2023-02-09 00:35:55 -05:00
carlmagnus nordin
fbfd0703f0 IoStore:
* Fixed inderministic sort order for shaders of the same size, leading to different shader group chunks being generated
* Fixed memory leak when generating shader groups
* Fixed indeterministic classification of shaders appearing in two shader maps with the same hash
#rb pj.kack
#preflight 63e36695797b029c0a96297d

[CL 24070666 by carlmagnus nordin in ue5-main branch]
2023-02-08 06:20:22 -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
christopher waters
6e30ddb01e Dependency cleanup around DataDrivenShaderPlatformInfo and a few other headers.
#preflight 63921e6a67018b14b5925197

[CL 23454104 by christopher waters in ue5-main branch]
2022-12-08 15:35:35 -05:00
fredrik lindh
162393fa21 Fix some logging thresholds and add a possibility to customize it.
#rb Arciel.Rekman
#preflight 637bdd3c815e4b9b750be7f0

[CL 23226097 by fredrik lindh in ue5-main branch]
2022-11-21 15:22:35 -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
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