Commit Graph

642 Commits

Author SHA1 Message Date
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
christopher waters
2a7a142bfc Fixing CompileFXC.bat issues.
- Setting FXC="..." is different from setting "FXC=...", the former will break uses of just %FXC% when the path has spaces in it.
- Switching to all "FXC=..." and "%FXC%" to make the variable consistent.
- Tweaking the bat file formatting inside of D3DShaderCompiler to make it more readable.

#rb dan.elksnitis

[CL 25853249 by christopher waters in ue5-main branch]
2023-06-07 15:02:30 -04:00
dan elksnitis
2acbcb9533 [shaders]
- add new fields to FShaderCompilerOutput which should be populated with the shader source and entry point name if modified by a backend compile process (in a format implementing the independent preprocessing API). this is intended to supercede "OptionalFinalShaderSource" for such shader formats, as well as being used as the source for preprocessed debug dumps when enabled.
- modify the PCD3D shader format to use these fields as intended (and so fix the debug output for pipelines which remove unused interpolators to match the final modified source).

#rb Laura.Hermanns
#preflight 64777f850848b7126dda194c

[CL 25706448 by dan elksnitis in ue5-main branch]
2023-05-31 13:31:39 -04:00
christopher waters
1fab74d63a Restricting PLATFORM_SUPPORTS_STATIC_SAMPLERS to SM6 and RayTracing shaders and making sure that PC DX12 SM6 requires Resource Binding Tier 2 or higher.
We don't want to restrict other shaders to resource binding tier 2 or higher even for CFLAG_ForceDXC or CFLAG_WaveOperations.
Invalidating PCD3D_SM5 and PCD3D_SM6 shaders.

#rb yuriy.odonnell
#preflight 646cd8d764351d76f32b449c

[CL 25585973 by christopher waters in ue5-main branch]
2023-05-23 13:05:47 -04:00