Commit Graph

2593 Commits

Author SHA1 Message Date
graham wihlidal
3e3f33d6b4 Vectorized TMatrix<float>::To3x4MatrixTranspose, FRenderTransform::To3x4MatrixTranspose, and FRenderTransform::ToMatrix44f
#rb fabian.giesen, yuriy.odonnell
#fyi rune.stubbe, brian.karis, ola.olsson, devin.doucette
#jira UE-210917

[CL 32752999 by graham wihlidal in ue5-main branch]
2024-04-04 23:11:03 -04:00
matt peters
24ea789e44 MaterialInterface: Refactor GetMaterialShaderMapKey into RecordOrEmitMaterialShaderMapKey which takes an FMaterialKeyGeneratorContext instead of an FShaderKeyGenerator. FMaterialKeyGeneratorContext can handle any one of three modes: emit hash strings or save/load data needed for hash strings to compact binary. Use the new RecordOrEmitMaterialShaderMapKey to Save/Load and Emit the material dependency hash for incremental cooking.
#jira UE-203846
#rnx
#rb dan.elksnitis

[CL 32725752 by matt peters in ue5-main branch]
2024-04-04 08:29:57 -04:00
graham wihlidal
06166d1975 [Nanite-Skinning] Added missing shader map DDC key values for r.Nanite.AllowSplineMeshes and r.Nanite.AllowSkinnedMeshes
#rb jamie.hayes
#jira none

[CL 32714056 by graham wihlidal in ue5-main branch]
2024-04-03 18:35:58 -04:00
dan elksnitis
765e6b79d6 [shaders] add support in stb_preprocess for #warning directives, and log warnings emitted by preprocessing
#rb Laura.Hermanns

[CL 32700527 by dan elksnitis in ue5-main branch]
2024-04-03 12:12:03 -04:00
graham wihlidal
731e2640e6 [Nanite-Skinning] Initial rasterizer support for linear blend skinning under a permutation to avoid affecting performance of rigid meshes. There are still quite a number of critical missing pieces, such as correct bounding volumes under deformation, and the tangent space basis is currently ref pose, leading to lighting/shading issues. Motion vectors are also not exported yet, so TAA has plenty of ghosting artifacts. All in good time...
#jira UE-210923
#fyi brian.karis, jamie.hayes, rune.stubbe, halfdan.ingvarsson, kiaran.ritchie
#tests CitySample Package and Test

[CL 32690526 by graham wihlidal in ue5-main branch]
2024-04-03 02:30:21 -04:00
dan elksnitis
c4c8592296 [shaders] bugfix - widesource wasn't being set when requested in the case where stripping did not occur, resulting in empty debug usf files (i.e. niagara shaders which don't use preprocessed job cache)
#rb Jason.Nadro

[CL 32665781 by dan elksnitis in ue5-main branch]
2024-04-02 10:05:15 -04:00
zach bethel
b8e518d0b2 Removed FPipe from render command pipe implementation due to race in WaitUntilEmpty.
[CL 32655315 by zach bethel in ue5-main branch]
2024-04-01 19:22:53 -04:00
zach bethel
a095bbf035 Added AddPostExecuteCallback to RDG to support deferring an operation until after graph execution.
[CL 32654692 by zach bethel in ue5-main branch]
2024-04-01 18:51:58 -04:00
chris kulla
5eeed6f9dc Shaders: Add a define to all shaders of the entry point name (defined as itself)
This allows the following pattern when there are multiple shader entrypoints in a single file:

#ifdef MyEntryPointName

void MyEntryPointName(...)
{
}

#endif

This makes it possible to completely hide code and variables that are specific to one shader type from the others, while keeping the convenience of having multiple shader definitions in a single .usf file. This pattern is completely opt-in and therefore does not disrupt any previous idioms, though it does mean some code could be simplified going forward.

Use this pattern to fix warnings from the new DXC compiler in lumen and distance field shaders stemming from a THREADGROUP_SIZE being re-used on an unused entrypoint and creating invalid dimensions. This warnings only occurs when the shader minifier is enabled, but with this new approach, the redundant code is stripped out before the minifier runs, which leads to more savings overall.


#rb graham.wihlidal, Krzysztof.Narkowicz

[CL 32654032 by chris kulla in ue5-main branch]
2024-04-01 18:15:28 -04:00
zach bethel
e6ebd05678 Added FRHIStreamSourceSlot to support updating stream source vertex buffers for mesh draw commands. Also removed unnecessary null vertex streams from being added to mesh draw commands when overridden.
#rb christopher.waters

[CL 32651929 by zach bethel in ue5-main branch]
2024-04-01 16:57:48 -04:00
dan elksnitis
aa061d565d [shaders] fix bug in global shader defines mechanism introduced by CL#32086729; shader format name used for filtering was not set in cache hit early out path.
#rb Arciel.Rekman

[CL 32596097 by dan elksnitis in ue5-main branch]
2024-03-28 17:41:20 -04:00
zach bethel
e7794b8863 Added CVar to control whether render command fence bundling is enabled.
[CL 32569392 by zach bethel in ue5-main branch]
2024-03-28 00:04:10 -04:00
matt peters
236de90692 Shader Keys: Add a keygenerator struct FShaderKeyGenerator than can generate either full string keys or hashed keys. Hashed keys are faster to create and will be used for incremental cook package dependencies.
#jira UE-203846
#rnx
#rb dan.elksnitis, christopher.waters

[CL 32550793 by matt peters in ue5-main branch]
2024-03-27 14:11:21 -04:00
dan elksnitis
3ffa257b2c [shaders] fixing stripped code header length calculation, and account for auto-appended null terminator
#rnx
#rb Christopher.Waters

[CL 32547715 by dan elksnitis in ue5-main branch]
2024-03-27 12:44:40 -04:00
dan elksnitis
1d261111ce [shaders]
- modify the input hash debug dump mechanism to output an empty "debughash_<hash>" file instead of a txt file with the hash in contents, and always dump these files for the instance of the job that actually compiled
- the existing cvar will now just make it so these files are also dumped for jobs which hit in DDC or the job cache; we don't do this by default so there's only a single match for the debug hash for any given shader normally and it is inside the folder containing the full debug info, including those artifacts which are only output as a side effect of the compile step
- add the same hash as the first line in the stripped source code, so "debughash_<hash>" can be used as a search term in Everything to quickly find debug info associated with a shader (i.e. when looking at a capture in renderdoc or similar)

note: this is a resubmit with fixes for mac/linux issues (avoiding printfs and using string builders instead; since wchar_t and TCHAR are not the same size on these platforms using %ls does not work), and a further fix for problems encountered with source compression when using wide chars in preprocessing instead of ansi chars.

#rb Laura.Hermanns
#jira UE-209753

[CL 32542773 by dan elksnitis in ue5-main branch]
2024-03-27 10:15:04 -04:00
jason hoerner
9e94bf0b08 Shader Compiler: Fix use-after-free in FShaderCompilerEnvironment::Merge. Need to not overwrite MemberNameBuffer (FUniformBufferEntry) when appending items to UniformBufferMap, as items in the FUniformResourceEntry array contain internal pointers to the name buffer. Loop over other container's items similar to TMap::Append, but check if the item is already present before adding.
#jira UE-209858
#rnx
#rb dan.elksnitis

[CL 32509436 by jason hoerner in ue5-main branch]
2024-03-26 11:04:47 -04:00
jason hoerner
296c4faa6e Scene capture cube: Support for automatic mip map generation. Upgraded FGenerateMips API to support generating cube mip maps in both compute and raster code paths. Also needed to fix a spurious error in FRHITextureSRVCreateInfo::Validate.
#rb zach.bethel

[CL 32472183 by jason hoerner in ue5-main branch]
2024-03-25 12:03:28 -04:00
eric renaudhoude
e34f40ba3e ColorManagement: Remaining deprecation of headers & color management module, since they were moved to Core at CL 32299544.
#jira UE-201221
#rb Sebastien.Hillaire
#rnx

[CL 32470542 by eric renaudhoude in ue5-main branch]
2024-03-25 11:04:55 -04:00
dan elksnitis
52e25ae283 [Backout] - CL32436224
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders]
- modify the input hash debug dump mechanism to output an empty "debughash_<hash>" file instead of a txt file with the hash in contents, and always dump these files for the instance of the job that actually compiled
- the existing cvar will now just make it so these files are also dumped for jobs which hit in DDC or the job cache; we don't do this by default so there's only a single match for the debug hash for any given shader normally and it is inside the folder containing the full debug info, including those artifacts which are only output as a side effect of the compile step
- add the same hash as the first line in the stripped source code, so "debughash_<hash>" can be used as a search term in Everything to quickly find debug info associated with a shader (i.e. when looking at a capture in renderdoc or similar)

#rb Laura.Hermanns
#jira UE-209753

[CL 32448284 by dan elksnitis in ue5-main branch]
2024-03-22 16:19:02 -04:00
dan elksnitis
82e140d0c5 [shaders]
- modify the input hash debug dump mechanism to output an empty "debughash_<hash>" file instead of a txt file with the hash in contents, and always dump these files for the instance of the job that actually compiled
- the existing cvar will now just make it so these files are also dumped for jobs which hit in DDC or the job cache; we don't do this by default so there's only a single match for the debug hash for any given shader normally and it is inside the folder containing the full debug info, including those artifacts which are only output as a side effect of the compile step
- add the same hash as the first line in the stripped source code, so "debughash_<hash>" can be used as a search term in Everything to quickly find debug info associated with a shader (i.e. when looking at a capture in renderdoc or similar)

#rb Laura.Hermanns
#jira UE-209753

[CL 32436259 by dan elksnitis in ue5-main branch]
2024-03-22 11:55:53 -04:00
dan elksnitis
26c51a106c [shaders] resubmit: add compression for FShaderSource objects and enable by default (Mermaid SuperFast compression). This halves the high watermark for the ShaderCompiler LLM scope in my testing (QAGame cold cook), with minimal measurable impact to preprocessing time (<3% on average, but this may just be noise).
#rb Jason.Nadro, Laura.Hermanns
#jira UE-209037

[CL 32400079 by dan elksnitis in ue5-main branch]
2024-03-21 10:54:56 -04:00
justin moe
98f3892ca5 [Backout] - CL32363267
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders] add compression for FShaderSource objects and enable by default (Mermaid SuperFast compression). This halves the high watermark for the ShaderCompiler LLM scope in my testing (QAGame cold cook), with minimal measurable impact to preprocessing time (<3% on average, but this may just be noise).

#rb Jason.Nadro, Laura.Hermanns
#jira UE-209037

[CL 32383519 by justin moe in ue5-main branch]
2024-03-20 17:42:49 -04:00
justin moe
85510f72e6 [Backout] - CL32368131
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders] also compress the "original" (non-stripped) source if it's set. no downside and also will help memory consumption when doing full cooks with shader debug info enabled.

#rb massimo.tristano

[CL 32382013 by justin moe in ue5-main branch]
2024-03-20 17:10:41 -04:00
christopher waters
cb17f328e6 Unifying bindless code generation.
- Array-based bindless (Vulkan) only needed one more piece of data to use "GenerateBindlessAccess"
- Now all bindless shader platforms will generate a getter function for each bindless resource/sampler.

#rb dan.elksnitis, jeannoe.morissette

[CL 32375983 by christopher waters in ue5-main branch]
2024-03-20 14:41:02 -04:00
dan elksnitis
e598e8d781 [shaders] also compress the "original" (non-stripped) source if it's set. no downside and also will help memory consumption when doing full cooks with shader debug info enabled.
#rb massimo.tristano

[CL 32368239 by dan elksnitis in ue5-main branch]
2024-03-20 11:47:08 -04:00