Commit Graph

658 Commits

Author SHA1 Message Date
laura hermanns
1daf299a10 Patch order of entry point parameters in cross-compiled HLSL of D3D11 backend using HlslParser.
#jira UE-186066
#rb Dan.Elksnitis
#rnx

[CL 29257708 by laura hermanns in ue5-main branch]
2023-10-30 19:37:05 -04:00
dan elksnitis
54fb5cf56d [shaders] further deprecation (SupportsIndependentPreprocessing/OptionalFinalShaderSource/bIndependentPreprocessed are no longer needed since all backends are migrated)
#rb Laura.Hermanns

[CL 29117027 by dan elksnitis in ue5-main branch]
2023-10-25 22:21:30 -04:00
jason hoerner
0e18ea7e81 Shader Preprocessor: Roll TEXT macro substitution into the C preprocessor step, via custom macro callback feature, making it effectively free. Saves 3% overall on preprocess, but also represents a simplification by reducing the number of unique preprocess passes.
#jira UE-198496
#rnx
#rb dan.elksnitis yuriy.odonnell jason.nadro

[CL 29100104 by jason hoerner in ue5-main branch]
2023-10-25 16:01:11 -04:00
laura hermanns
01a703a287 Removed dead code from D3D12 shader backend.
#rb Jason.Nadro
#rnx

[CL 29044354 by laura hermanns in ue5-main branch]
2023-10-24 09:04:59 -04:00
christopher waters
0403f2caa0 Always set the HLSL version and don't assume the default is 2018.
#rb David.Harvey, Yuriy.Odonnell

[CL 28692390 by christopher waters in ue5-main branch]
2023-10-11 19:52:44 -04:00
joe kirchoff
be5805fdca Fix some comments that give the wrong instructions when a module is forcing cpp17
#rnx

[CL 28690858 by joe kirchoff in ue5-main branch]
2023-10-11 19:24:34 -04:00
laura hermanns
0320f2f528 D3D11 cross-compilation fixes:
- 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]
2023-10-10 15:30:19 -04:00
christopher waters
ec680fbdc7 Fixing NonUnity compile error.
[CL 28569952 by christopher waters in ue5-main branch]
2023-10-07 15:02:44 -04:00
christopher waters
6859d15ab4 Shader Parameter Parser changes
- 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]
2023-10-07 11:24:14 -04:00
laura hermanns
558f635cd4 Fix invalid virtual file paths from intermediate HLSL shader in D3D11 backend.
#rb Dan.Elksnitis
#jira UE-186066
#rnx

[CL 28511030 by laura hermanns in ue5-main branch]
2023-10-05 15:20:13 -04:00
joe kirchoff
540c318bfa Disable PCH for remaining C++17 modules to prevent making PCH variants
#rnx

[CL 28482531 by joe kirchoff in ue5-main branch]
2023-10-04 19:25:49 -04:00
joe kirchoff
aeca895d45 Fix compile issue with cl-clang
#rnx

[CL 28427476 by joe kirchoff in ue5-main branch]
2023-10-03 15:38:41 -04:00
joe kirchoff
73351e628e UnrealBuildTool: Remove VS2019 as a supported source code access ide
#jira UE-190039

[CL 28384888 by joe kirchoff in ue5-main branch]
2023-10-02 13:37:03 -04:00
christopher waters
cf3272d4e6 Bumping the SM6 version to force all D3D RT shaders to rebuild.
#jira UE-196567

[CL 28313514 by christopher waters in ue5-main branch]
2023-09-28 07:08:10 -04:00
graham wihlidal
5605de3a9d Refactored DXC RemoveContainerReflection into RemoveContainerParts that can remove additional parts. Also disabled post compile signing step for now.
#rb christopher.waters

[CL 28262563 by graham wihlidal in ue5-main branch]
2023-09-26 23:49:12 -04:00
christopher waters
bb0a274b8c Reworking UniformBuffer code generation to not use an intermediate struct
- When generating Uniform Buffer HLSL code, a 'static const struct {} Name' was created which has been causing compiler issues off and on for years.
- When RemoveUniformBuffersFromSource removed said struct, it parsed the struct's structure to figure out how to translate UniformBuffer.Member into UniformBuffer_Member in code that accessed Uniform Buffers.
- Now, instead of a struct, a "UniformBuffer <Name>" declaration is created and filled with mappings from "UniformBuffer.Member" into the correct code.
- This allows ConstantBuffer objects to be used differently from cbuffer where the former generates "UniformBuffer.Member" and the latter generates "UniformBuffer_Member"
- This also allows resources to always be translated to "UniformBuffer_Member"
- Shader define 'PLATFORM_SUPPORTS_UB_STRUCT' is now 'PLATFORM_SUPPORTS_CONSTANTBUFFER_OBJECT' and will be set on shader formats that support ConstantBuffer<> objects.
- Removed lots of unused code from BindlessResources.ush

#jira UE-195103
#rb dan.elksnitis, jeannoe.morissette

[CL 28058373 by christopher waters in ue5-main branch]
2023-09-20 17:33:36 -04:00
graham wihlidal
d38867b1ec Do post-compile signing of DXIL containers to work around some validation issues.
[CL 27900803 by graham wihlidal in ue5-main branch]
2023-09-14 19:00:38 -04:00
christopher waters
09e058f7e6 D3D Shader Compiler changes
- PLATFORM_SUPPORTS_UB_STRUCT was set for RT shaders, but RemoveUniformBuffersFromSource was still being called.
- New IsUsingSM66 function to keep consistent usage of ELanguage::SM6 since not all RT shaders use that 'language'
- Removing USE_SHADER_MODEL_6_6 since SM6.6 is locked in
- Changing FShaderFormatD3D versions to be Guids instead of numbers to better handle resolving changes in different branches.

#jira UE-195102
#rb yuriy.odonnell

[CL 27872532 by christopher waters in ue5-main branch]
2023-09-14 05:20:15 -04:00
michael wanderson
42e2411043 Add support for previewing platforms on PC D3D that support more than 16 samplers (max: 32). To acheive this the following changes were required:
- Added support for up to 32 samplers to the D3D12 RHI.
- Added 'MaxSamplers' to ShaderPlatform in DataDrivenPlatformInfo, this is defaulted to 16 for all shader platforms and can be modified the the DDPI ini files. This value will set the shader compiler define 'PLATFORM_MAX_SAMPLERS'.
- Added a 'RequiredSamplersSwitch' material editor node to branch based on a given shader platform's maximum sampler count.
- To support more than 16 samplers on feature level SM5 platforms Dxc and sm6.0 are used to compile the shader. On platforms that don't support Dxc and sm6.0 the preivew menu item will be disabled.

#jira UE-191404
#rb florin.pascu

[CL 27850133 by michael wanderson in ue5-main branch]
2023-09-13 16:56:08 -04:00
graham wihlidal
cd14a292ce Change no derivative op DXC output to be stored in PRIV instead of RDEF to avoid some incompabilities with a couple tools creating PSOs.
[FYI] dan.elksnitis, laura.hermanns

[CL 27819477 by graham wihlidal in ue5-main branch]
2023-09-12 21:45:41 -04:00
graham wihlidal
db0fea1270 Modified DirectXShaderCompiler to add a custom UserInfo container part, and check for derivative ops. The final output currently encoded the derivative ops into the ResourceDef part instead of UserInfo due to official validator issues, but I will follow up with Microsoft on a clean solution.
#rb laura.hermanns
[FYI] jason.nadro, yuriy.odonnell, rune.stubbe, brian.karis

[CL 27737340 by graham wihlidal in ue5-main branch]
2023-09-09 02:14:45 -04:00
dan elksnitis
1970e203b8 [shaders] don't include shader name in the warning printed when we trigger a DXC precompile due to an FXC crash. This is causing non-deterministic warnings when enabling the preprocessed job cache.
#rb Jason.Hoerner

[CL 27553466 by dan elksnitis in ue5-main branch]
2023-09-01 09:11:46 -04:00
carl lloyd
34d53bc691 Added validation to ensure UAV/SRV types and UB sizes match the ones generated by the shader compiler
#rb jeannoe.morissette
#jira UE-82353

[CL 27399050 by carl lloyd in ue5-main branch]
2023-08-25 22:19:10 -04:00
graham wihlidal
0082a49c02 Add missed files in last submit
[FYI] luke.thatcher

[CL 27369193 by graham wihlidal in ue5-main branch]
2023-08-25 02:19:04 -04:00
graham wihlidal
2f29df1243 Shader root constants support (initially) for DX12 - shader bundles now have a very fast path that pushes record index and 3 arbitrary pass data parms into root constants without the need for a global uniform buffer.
#rb luke.thatcher, yuriy.odonnell
[FYI] brian.karis, rune.stubbe, zach.bethel, mihnea.balta

[CL 27369189 by graham wihlidal in ue5-main branch]
2023-08-25 02:18:58 -04:00