- Moving various UB booleans into a flags enum.
- UB booleans could not be reasonably deprecated without incurring memory overhead, so this will break custom code that uses them.
- Adding UB flag to force the shader compilers to generate reflection for the UB members which are normally excluded from reflection.
- Adding UB flag that tells MeshCommands that a UB will be bound during pass drawing and that it doesn't need to be set via MDCs.
- New flags are not used in this CL, they are prerequisites for subsequent, larger changes.
#rb jeannoe.morissette
[CL 34356503 by christopher waters in ue5-main branch]
There are special cases for semantics when the index is omitted and defaults to zero, e.g. "SV_ClipDistance0" or "SV_ClipDistance[0]".
In those cases, our HlslParser does not provide the semantic index so we have to handle it when re-ordering the interpolators in the DXBC backend.
#rnx
#rb Charles.deRousiers
[CL 34274363 by laura hermanns in ue5-main branch]
When cross-compiling HLSL 2021 to HLSL 2018 for D3D11, DXC/SPIRV-Cross re-arrange the vertex/pixel interpolators in a way that can cause mismatches in the PSO.
The previous method to re-order shader interpolators was to just search the source for their variable declaration semantics, but that search can confuse semantics like TEXCOORD1 with TEXCOORD10.
This change includes two fixes:
1. The new approach parses the semantics and match the entire name, not just searching for the presence of the respective semantic identifier.
2. Always declare system value semantics such as SV_Position after user-defined semantics in case they are not used in the pixel shader to preserve the DXBC register assignments.
This fixes issues with Substrate as we have to cross-compile lots of shaders for D3D11 and some ES31 preview platforms.
#jira UE-214192
#rnx
#rb Jason.Nadro
[CL 34200377 by laura hermanns in ue5-main branch]
- Found while investigating compressed size (by FabianG), seemst to have been that way since 22233889. Shader size down significanty, to about 30-40% of the previous (both disk size and the runtime footprint).
#rb christopher.waters, dan.elksnitis, Laura.Hermanns
[CL 34155347 by arciel rekman in ue5-main branch]
- Removed reliance on ShaderParameterParser for most platforms as it doesn't always parse parameters
#rb Luke.Thatcher
[CL 33822449 by carl lloyd in ue5-main branch]
- Add option for ShaderType to declare which FShaderBindingLayout needs to be used for shader gen and runtime binding
- Add helper function to generate FShaderBindingLayoutContainer from array of uniform buffers and EShaderResourceTableFlags (only supports bindless mode right now)
- Serialize the FRHIShaderBindingLayout in FShaderCompilerEnvironment so it can be used by the shader compiler backends
- FShaderBindingLayout can add required symbols to the FShaderCompilerInput which shouldn't be dead code eliminated (required for Shader resource table building)
- Serialize the hash of RHIShaderResourceTable in the platform specific shader binary data so it can be used during runtime RTPSO validation (all shaders in the RTPSO need the same RHIShaderResourceTable)
- Renamed pRootSignaure member to RootSignature (style guide)
#jira UE-212347
[CL 33624453 by kenzo terelst in ue5-main branch]
Split Work Graph shaders into multiple frequencies.
This is somewhat in anticipation of graphic nodes.
But also it is a replacement for using CFLAG_WorkgraphLocalNodes to differentiate nodes with local or global root signature.
#rb Yuriy.ODonnell
[CL 33146442 by jeremy moore 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]
This re-introduced the backed-out CL for the DXC update including fixes to detect derivitive opcodes in DXIL containers and a null-pointer fix in the DXIL code generator (GitHub draf #6411).
Only the Windows binary is updated since no other platform uses the DXIL code generator. Linux and Mac binary updates will follow in a separate CL.
Also replaced DXIL binary with v1.8 obtained from https://github.com/microsoft/DirectXShaderCompiler/releases/tag/v1.8.2403
#jira UE-203636
#rb Graham.Wihlidal, Jeremy.Moore
[FYI] Bob.Tellez, Dan.Elksnitis
[CL 32257727 by matanshukry in ue5-main branch]
- Only WorkGraph shaders use this currently.
- SM6.8 needs to set the __SHADER_TARGET_MAJOR and __SHADER_TARGET_MINOR defines
- Changing some logic that was SM6.6 specific to now allow the higher shader model.
#rb Jeremy.Moore
[CL 32220197 by christopher waters in ue5-main branch]
Add basic DX12 Work Graph support.
For this first pass there is no exposed RHI functionality for directly dispatching a work graph. Instead shader bundles have been extended to support a work graph based implementation.
Nanite compute materials now can use work graph shader bundles on D3D12 when r.Nanite.AllowWorkGraphMaterials and r.Nanite.Bundle.Shading are both set. Both of these default to off at the moment.
Also DataDrivenPlatformInfo now expose bSupportsWorkGraphs. This is false everywhere, but will be enabled for D3D12_SM6 as soon as we have the latest DXC shader compiler with lib_6_8 support submitted.
#rb Kenzo.Terelst, Yuriy.ODonnell
[CL 32196717 by jeremy moore in ue5-main branch]
[FYI] Laura.Hermanns
Original CL Desc
-----------------------------------------------------------------
[DXC] DXC release-1.8.2403 update
This is the last CL of the DXC update including the binary files and API headers. The other CLs including all source changes are:
- 32164743 SPIRV-Headers
- 32166600 SPIRV-Tools
- 32165724 SPIRV-Cross
- 32165890 DirectXShaderCompiler
- 32165937 ShaderConductor
- 32165762 googletest
- 32165815 cxxopts
#jira UE-203636
#rb Graham.Wihlidal, Carl.Lloyd, JeanNoe.Morissette, Florin.Pascu, Serge.Bernier
[FYI] Dan.Elksnitis, Jason.Nadro, Yuriy.Odonnell, Jeremy.Moore
[CL 32172513 by bob tellez in ue5-main branch]
This is the last CL of the DXC update including the binary files and API headers. The other CLs including all source changes are:
- 32164743 SPIRV-Headers
- 32166600 SPIRV-Tools
- 32165724 SPIRV-Cross
- 32165890 DirectXShaderCompiler
- 32165937 ShaderConductor
- 32165762 googletest
- 32165815 cxxopts
#jira UE-203636
#rb Graham.Wihlidal, Carl.Lloyd, JeanNoe.Morissette, Florin.Pascu, Serge.Bernier
[FYI] Dan.Elksnitis, Jason.Nadro, Yuriy.Odonnell, Jeremy.Moore
[CL 32167352 by laura hermanns in ue5-main branch]
We can't get usage information from reflection with this enabled, mainly for bindless, so we'll need to revisit this later.
#rb Laura.Hermanns
[CL 31741310 by christopher waters in ue5-main branch]
- Adding utility function for easier additions to FShaderCompilerOutput::ShaderStatistics
- Simplified existing uses of FShaderCompilerOutput::ShaderStatistics
- Reworked D3D compilation to allow DXC vs FXC to specify their different shader limits.
- Adding Shader Statistics for D3D SamplerState and Resource usages.
- Adding Shader Statistics for D3D SM6.6 bindless resource usages.
#rb Jason.Nadro, Laura.Hermanns
[CL 31740056 by christopher waters 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]