Commit Graph

645 Commits

Author SHA1 Message Date
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
joe kirchoff
8fc9771156 Don't use static functions in the DirectX module to get paths, it is not guaranteed that this module will exist
#rnx

[CL 27090677 by joe kirchoff in ue5-main branch]
2023-08-14 18:16:33 -04:00
joe kirchoff
b1f4c0f34d Fix several more Shipping compile errors
#rnx
#jira UE-192219
#jira UE-192222
#jira UE-192227
#lockdown Francis.Hurteau
#rb dan.oconnor

[CL 26957940 by joe kirchoff in ue5-main branch]
2023-08-09 11:37:09 -04:00
david harvey
bdb4199eeb Remove unnecessary WindowsHWrapper.h & MinWindows.h include - both files will be automatically included by AllowWindowsPlatformTypes.h
#jira UE-152863
#rnx
#rb Josh.Adams

[CL 26912096 by david harvey in ue5-main branch]
2023-08-08 05:50:53 -04:00
laura hermanns
6322dc3790 Add [loop] attribute to Substrate shader to fix HLSL cross-compilation error on D3D11.
#rb Sebastien.Hillaire
#jira UE-186066
#rnx

[CL 26824400 by laura hermanns in ue5-main branch]
2023-08-03 15:59:21 -04:00
dan elksnitis
9a5a1b6f74 [shaders] minor include cleanup
#rb Jason.Hoerner
#rb Laura.Hermanns

[CL 26817718 by dan elksnitis in ue5-main branch]
2023-08-03 13:40:32 -04:00
charles derousiers
2365ee5308 Change D3D diagnostic buffer to output readable assert message (file/line/condition/message).
Use with check() / checkf()

#rb dan.elksnitis, christopher.waters
[FYI] yuriy.odonnell

[CL 26680005 by charles derousiers in ue5-main branch]
2023-07-28 13:55:18 -04:00
bryan sefcik
64f140d78d Added shader.build.cs file.
Updated build.cs files to use new shader module.

#jira
#rb Joe.Kirchoff and guillaume.abadie

[CL 26664107 by bryan sefcik in ue5-main branch]
2023-07-27 22:53:25 -04:00
christopher waters
111e1d5046 Fixing various issues with shader previews
- PC previews of SM6 platforms weren't going to DXC correctly.
- Preview platform include paths weren't initialized when compiling with local-only shader compiles.
- A few preview platform DDSPI settings weren't being initialized correctly based on the capabilites of the preview format.

#rb arciel.rekman, dan.elksnitis

[CL 26589147 by christopher waters in ue5-main branch]
2023-07-25 17:16:48 -04:00
jason hoerner
7f22080814 Shader Compiler: Made FShaderCompilerDefinitions private, to reduce code publicly visible in ShaderCore.h. For now, it's just marked deprecated for 5.4, but will be hidden more generally in 5.5.
#rnx
#rb yuriy.odonnell dan.elksnitis jason.nadro

[CL 26534998 by jason hoerner in ue5-main branch]
2023-07-22 06:35:10 -04:00
dan elksnitis
45442799b4 [shaders] fix debug compile batchfiles for PC DXC
#rb Laura.Hermanns

[CL 26296674 by dan elksnitis in ue5-main branch]
2023-06-28 15:55:55 -04:00
rweber89
905cbb8e68 PR #10502: D3DShaderCompiler Memleak Fix
#jira UE-187961
#rb Mihnea.Balta
#rnx

[CL 26085505 by rweber89 in ue5-main branch]
2023-06-19 04:11:08 -04:00
tim smith
9cc91976c0 Fix to live coding shutdown to eliminate a somewhat rare crash on exit.
#rb Dan.Engelbrecht
#jira UE-188767

[CL 26055035 by tim smith in ue5-main branch]
2023-06-16 11:55:21 -04:00
dan elksnitis
f765d6f552 [shaders] change d3d backend to not fail on minification failure; ensure preprocess warnings are appended for independent preprocessing shader formats regardless of whether preprocessing fails
#rb Jason.Nadro

[CL 25897074 by dan elksnitis in ue5-main branch]
2023-06-09 12:42:57 -04:00