Commit Graph

715 Commits

Author SHA1 Message Date
christopher waters
cfc6f343df Uniform Buffer improvements
- 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]
2024-06-13 17:59:13 -04:00
maxime mercier
f602aaf8b6 Fix LiveCoding hitting a check upon starting.
#rb matt.breindel, Tim.Smith

[CL 34285568 by maxime mercier in ue5-main branch]
2024-06-11 14:50:11 -04:00
laura hermanns
dd3eb79c6b [Shaders] Add special case to parsing HLSL semantics in cross-compilation pipeline.
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]
2024-06-11 09:27:37 -04:00
laura hermanns
5c17f21798 [Shaders] Fixed re-ordering of shader interpolators in D3D ES31 backend.
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]
2024-06-07 09:38:41 -04:00
arciel rekman
7818ba6bae Fix reflection data unnecessarily kept in compiled PCD3D_SM6 shaders.
- 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]
2024-06-06 09:37:28 -04:00
joe kirchoff
748e7aac60 UnrealBuildTool: Auto disable SharedPCH if a module is compiling using a CppStandard older than the engine
#rnx
#jira UE-207533

[CL 33955046 by joe kirchoff in ue5-main branch]
2024-05-28 17:53:24 -04:00
carl lloyd
d64722152b RHI Validation
- 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]
2024-05-22 04:15:09 -04:00
florian penzkofer
f45f20f45b Fix fatal error when using Editor Preview
#jira UE-215384
#rb dan.elksnitis, Laura.Hermanns, Yuriy.ODonnell

[CL 33792687 by florian penzkofer in ue5-main branch]
2024-05-21 09:36:25 -04:00
Yuriy ODonnell
29ef258f59 Support GPU diagnostic buffer binding when using static root signature
#rb graham.wihlidal
#jira none

[CL 33634764 by Yuriy ODonnell in ue5-main branch]
2024-05-14 15:13:55 -04:00
kenzo terelst
3df923dab2 - Add FShaderBindingLayout as RenderCore wrapper for FRHIShaderBindingLayout which can also cache static uniform buffer declerations used during shader code gen
- 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]
2024-05-14 04:49:23 -04:00
jonathan bard
f4d3ad0c59 Dump internal FXC compiler warnings when FXC fails to compile but DXC manages to, so that the user can know what failed and eventually correct it or at least make an informed decision about whether to bypass the error using DXC pre-compilation
#rb Laura.Hermanns

[CL 33296329 by jonathan bard in ue5-main branch]
2024-04-29 06:02:19 -04:00
steve robb
92463911c8 Fixed mismatched printf format arguments.
#rb brandon.schaefer

[CL 33264801 by steve robb in ue5-main branch]
2024-04-26 11:02:47 -04:00
tim smith
956cd96221 Added documentation to the PreloadNamedModules live coding setting
#rnx
#rb Tim.Smith

[CL 33260287 by tim smith in ue5-main branch]
2024-04-26 06:57:17 -04:00
jeremy moore
ba42a867b2 #jira UE-209673
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]
2024-04-22 14:59:28 -04:00
henrik karlsson
16360300e5 Fixed non unity compile errors
[CL 32947049 by henrik karlsson in ue5-main branch]
2024-04-12 18:02:03 -04:00
VesCodes
004d5cae1c PR #11437: LiveCoding: Fix crash patching headless editor instances
#jira UE-206330
#rb Tim.Smith

[CL 32589028 by VesCodes in ue5-main branch]
2024-03-28 15:19:29 -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
matanshukry
4de594b05f [DXC] DXC release-1.8.2403 update; Re-introduce CL 32167265 with fixes.
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]
2024-03-14 16:16:24 -04:00
christopher waters
63dcb443e0 Removing LogD3D11ShaderCompiler and LogD3D12ShaderCompiler in favor of LogD3DShaderCompiler.
#rb Laura.Hermanns

[CL 32250370 by christopher waters in ue5-main branch]
2024-03-14 13:29:58 -04:00
christopher waters
5a8c01556a Adding proper SM6.8 support to ShaderFormatD3D
- 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]
2024-03-13 13:48:54 -04:00
christopher waters
cd0d92d515 Moving copy-pasted code into ShaderCompilerCommon.
#rb dan.elksnitis, jeannoe.morissette

[CL 32215186 by christopher waters in ue5-main branch]
2024-03-13 11:33:04 -04:00
julien stjean
67d9048ae5 Large perf improvement for the editor in a large project:
Reworked the ClassDataSource so that it doesn't require a full data refresh when a module is Loaded, Unloaded or Reloaded.
Deprecated the capacity for a ContentBrowser Data Source to request a full data refresh since this doesn't well scale on large projects.

Added a way to query a IReload for the classes that were reinstancited.

Fixed a bug in the FNativeClassHierarchy::GatherMatchingNodesForPaths function. It failed a getting a existing class node if a folder in its path had the same name has the class.

#jira UE-208789

#rb kevin.macaulayvacher

[CL 32212553 by julien stjean in ue5-main branch]
2024-03-13 10:24:34 -04:00
jeremy moore
804418158d #jira UE-206245, UE-206247
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]
2024-03-12 18:42:09 -04:00
bob tellez
786acc30b5 [Backout] - CL32167265
[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]
2024-03-11 23:38:27 -04:00
laura hermanns
183be489c9 [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 32167352 by laura hermanns in ue5-main branch]
2024-03-11 17:55:53 -04:00