- 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]
- 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]
- Forcing EShaderResourceUsageFlags bindless flags when bindless is enabled to avoid ping ponging issues at runtime.
#jira UE-162014
#rb dan.elksnitis
[CL 30001874 by christopher waters in ue5-main branch]
- Only log a system error message if we didn't get any error messages back from the DXC error blob.
#rb Laura.Hermanns
#rnx
[CL 29810728 by jason nadro in ue5-main branch]
- Adding EShaderCodeFeatures::Barycentrics
- Adding GRHIGlobals.SupportsBarycentricsSemantic
- Adding FDataDrivenShaderPlatformInfo::GetSupportsBarycentricsIntrinsics to control COMPILER_SUPPORTS_BARYCENTRIC_INTRINSICS
- Adding FDataDrivenShaderPlatformInfo::GetSupportsBarycentricsSemantic to control PLATFORM_SUPPORTS_BARYCENTRICS_SEMANTIC
#jira UE-193429
#rb graham.wihlidal, mihnea.balta
[CL 29771745 by christopher waters 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]
- ELanguage and Input flags were being used inconsistently to determine defines and shader profiles to use.
- ED3DShaderModel now communicates the exact shader model to use to the FXC and DXC backends.
- Moved all D3D custom definitions to ModifyShaderCompilerInput
- D3D definitions have been fixed to be based on specific needs of input flags. ie- "PLATFORM_MAX_SAMPLERS" doesn't imply that wave operations are wanted/supported.
#jira UE-199838
#rb laura.hermanns, michael.wanderson
[CL 29632531 by christopher waters in ue5-main branch]
- Removing the need for COMPILER_DEFINE on GetResourceFromHeap and GetSamplerFromHeap
- FShaderParameterParser constructor now requires a FPlatformConfiguration object that each shader format can configure.
- FPlatformConfiguration::GenerateBindlessAccess allows each platform to generate the code for accessing a bindless resource or sampler.
- Added EShaderParameterParserConfigurationFlags to specify support for stable constant buffers and bindless.
- Moved EBindlessParameterMode into EShaderParameterParserConfigurationFlags::BindlessUsesArrays
- While moving things around, I was able to convert some TCHAR* uses to FStringView
#jira UE-166341
#rb mihnea.balta
[CL 29533376 by christopher waters in ue5-main branch]
- Compile a 2nd time internally defined rule disabled.
- Compile a 3rd time without optimizations as a last resort.
#jira UE-197481
#rb Jason.Nadro, Dan.Elksnitis, Sebastien.Hillaire
#rnx
[CL 29408297 by laura hermanns in ue5-main branch]
- Patch HLSL to support SV_DepthGreaterEqual and SV_DepthLessEqual.
- Maintain order of shader input/output variables in cross-compiled HLSL.
#rb Jason.Nadro
#jira UE-186066, UE-192125
#rnx
[CL 28633421 by laura hermanns in ue5-main branch]
- Moving more uses of ShaderParameterParse from Preprocessing to Compile step.
- Adding a "DidModifyShader" flag to ShaderParameterParser to determine if Output.ModifiedShaderSource needs to be updated.
#jira UE-197328
#rb dan.elksnitis
[CL 28569175 by christopher waters in ue5-main branch]