#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]
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]
- 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]
[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]
- 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]
[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]
[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]
- 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]