#jira UE-210757
#rb
#tests Integrated //UE5/Partner-Latte-5.4/... @32408657 (the last non-robomerge change)
[CL 32557111 by Wojciech Krywult in 5.4 branch]
* Fix reporting line numbers in shader compile errors/warnings
#rb Laura.Hermanns
#jira UE-207792
#ushell-cherrypick of 31714435 by Yuriy.ODonnell
[CL 31725235 by Yuriy ODonnell in 5.4 branch]
- Disabled by default
- Removed MetalDerivedData and moved shader compiler specific code to seperate files
#rb Laura.Hermanns
#jira UE-204112
[CL 31524725 by carl lloyd in 5.4 branch]
DxcCreateBlob apparently force adds this on creation of strings, so we need to account for that when creating a view of the result.
#rb dan.elksnitis, Laura.Hermanns
[CL 31306629 by christopher waters in 5.4 branch]
[FYI] rune.stubbe, brian.karis, john.huelin, jian.ru, jamie.hayes
#[robomerge][bot5] -FNMain
Fixed case on consoles where Nanite export depth would not fully clear all non-Nanite pixels, leaving corrupt rendering in certain cases (like disabling the transient allocator, or running with -rdgimmediate).
#rb yuriy.odonnell
#[fyi] brian.karis, rune.stubbe, jamie.hayes, zach.bethel
#jira UE-202941, UE-205770
Fixed some additional ISA issues by adding v_fmaak_f32, v_fmamk_f32, v_fmamk_f16, and v_fmaak_f16 to the trailing literal check
[FYI] rune.stubbe, brian.karis, jian.ru, jamie.hayes, luke.thatcher
#[robomerge][bot5] -FNMain
Add NANITE_TESSELLATION permutation to Nanite SW rasterizer shaders to fix issues where we were assuming that if displacement is connected in the material shader parameters, that displacement would not be disabled in the final compiled material.
#rb graham.wihlidal
#[fyi] rune.stubbe, brian.karis
Fix for flickering tessellated triangles with corrupt values in raster bin meta between tessellated cluster and patch raster.
#rb jamie.hayes
#[fyi] rune.stubbe, brian.karis
#changelist validated
#virtualized
#ushell-cherrypick of 31148557 by graham.wihlidal
#ushell-cherrypick of 31154834 by graham.wihlidal
#ushell-cherrypick of 31164583 by graham.wihlidal
#ushell-cherrypick of 31182678 by jamie.hayes
#ushell-cherrypick of 31228365 by graham.wihlidal
[CL 31281009 by graham wihlidal in 5.4 branch]
It's about 1/4 of CoreMinimal.h but rarely needed (Compression.h pulls on CriticalSection.h and Map.h that are costly).
#rb Yoan.StAmant
[CL 30683417 by aris theophanidis in ue5-main branch]
- add support to shaderconductor to load shader source from a FAnsiStringView
- remove internal string conversion helpers in favour of using FAnsiString
- don't make copies of input strings if they are provided in ANSI format
#rb Laura.Hermanns
[CL 30594203 by dan elksnitis in ue5-main branch]
- add FShaderSource class which wraps source as populated by preprocessing and subsequently accessed by compilation and other debug features; this class automatically inserts zeroed padding such that 16-byte-wide SIMD string comparison operations do not require a non-SIMD tail to process any overhang.
- add typedefs for the string/view/character types and update preprocessing code to use these typedefs instead of the explicit types
- add explicit if constexprs in minifier code around char width to disable simd optimizations for char width != 2 (and subsequently skip the non-simd tail if char width == 2 since FShaderSource automatically adds the required padding)
#rb Jason.Nadro, Yuriy.ODonnell
[CL 30358137 by dan elksnitis in ue5-main branch]
- move sequence of preprocessing steps out of ShaderPreprocessor module and into UE::ShaderCompilerCommon::ExecuteShaderPreprocessingSteps; the former is now explicitly just the low-level preprocessor lib
- add an implementation of PreprocessShader in FBaseShaderFormat so backends which have no custom code to execute as part of preprocessing can just automatically inherit this implementation, and fix up such backends to eliminate now-unnecessary overrides
#rb christopher.waters, Laura.Hermanns
[CL 30178136 by dan elksnitis in ue5-main branch]
- never append the environment defines as commented code to the source used for further preprocessing/compilation; instead only append it to the debug USF
- strip comments after loading the debug usf in direct compile mode as some backends expect comments to have already been removed and the extra ones we add to the debug dump cause them to barf
- change all #if 0s in the debug usf to block comments instead so the above can strip them (said backends also don't like preprocessor directives left in the file)
#rb Jason.Nadro, rob.krajcarski
[CL 30161438 by dan elksnitis in ue5-main branch]
- move uniform buffer cleanup and dead stripping into ShaderPreprocessor module's PreprocessShader function
- add "required symbols" to compiler input struct to specify additional symbols to keep during minification aside from those specified by the entrypoint; modify API such that both an entry point string and additional symbols can be specified (to avoid each backend needing to manually parse the compound RT entry point string)
- make use of ModifyShaderCompilerInput in all backends to set additional defines and required symbols on input struct up front; only use the AdditionalDefines map in cases where it's actually necessary
- remove the various per-platform defines for enabling minifier, no longer required now that this has been rolled out for all backends
- fix SCW directcompile mode; this had rotted due to pieces of the FShaderCompilerEnvironment having been added that weren't explicitly serialized to either cmdline or in the shader source. this now serializes as a base64 string written inside the USF containing all portions of the environment required for compilation (using the same serialization function as is used to write/read the SCW input file)
- use a debug flag for indicating we're in "direct compile" mode and should load the debug USF off disk, rather than the poorly named "bSkipPreprocessedCache" (this name is both inaccurate and also confusing due to the addition of the preprocessed job cache)
- modify platform "force wave32" mechanism to use a pragma directive to set a compiler define, instead of doing string replacement in the preprocessed source
- add a view version of the RT entrypoint parsing to use in preprocessing, note that other paths still need to construct fstrings due to further manipulation so keeping the FString path around too
- clean up backends manually checking the "directcompile" cmdline arg
#rb christopher.waters, Yuriy.ODonnell
#rb Chris.Waters
#rb Laura.Hermanns
[CL 30023082 by dan elksnitis in ue5-main branch]
The PDB name is either retrieved from the PDB blob part of DXC's output, or is generated using the shader hash that DXC reports even when no PDB is requested. We don't export PDBs because it would result in duplicate data as we use embedded PDBs.
#rb christopher.waters, Laura.Hermanns
[CL 29723169 by daniele vettorel in ue5-main branch]