Every shader now has the ability to declare which payload it uses. HitGroup, Miss and Callable shaders may only specify a single type, whereas Raygen shaders may provide more than one.
The global raytracing shader libraries have been categorized according to their payload type, which helps facilitate the creation of minimal ray-tracing pipelines.
Avoid adding callable shaders to the RTPSO if they are not being used.
All RHI shader compilers and shader loaders that support ray tracing have been modified to track an extra uint representing the payload type flagged in the source (at time of compilation).
Add the RayTracingPayloadType to the shadermap DDC key so that we can properly detect when a shader's payload type is invalidated. This is required because we serialize the payload type into the shaders from the C++ side.
#rb Yuriy.ODonnell
#jira none
#preflight 635715cae6096564af4dd28e
[CL 22742893 by chris kulla in ue5-main branch]
Not proud over the LC_* files but don't dare touching the actual log macros since that is hard to get right and I don't know how to test this code
#preflight 6351d6de777a77c440123e2c
#rb none
[CL 22705170 by henrik karlsson in ue5-main branch]
- each platform compilation request is now wrapped in __try/__except rather than a single exception handling block at the top level of the worker; this allows us to log an exception (with callstack) as a compilation error and continue the batch
- remove SEH code from ShaderConductorContext, the above makes this redundant (and it didn't provide any actionable information)
- strip down SEH code in D3DShaderCompiler; now only used for the purposes of pre-compiling with DXC in the case of an FXC crash. dumping preprocessed source will be handled in a different manner in a forthcoming CL
- minor change in the DXC precompile path to not log an unnecessary warning when performing an explicitly-requested DXC precompile
#rb Jason.Nadro
#rb Laura.Hermanns
#rb Yuriy.ODonnell
#preflight 63514c798176062ea73acb41
#jira FORT-524383
[CL 22654436 by dan elksnitis in ue5-main branch]
- Making ConstantBufferType a constructor only argument. This removes the duplicated logic of calling ShouldUseStableConstantBuffer.
- Moving ShouldUseStableConstantBuffer to ShaderCompilerCommon.
- Made UE::ShaderCompilerCommon::ParseParameterType array arguments const
#jira UE-166341
#rb Guillaume.Abadie
#preflight 634eeceea1527f6b3bda9ff0
[CL 22608320 by christopher waters in ue5-main branch]
When filling out D3D12_FUNCTION_DESC, DXC does not populate RequiredFeatureFlags. Given we rely on these flags to validate bindless support at runtime, we need to emulate these flags being set.
#jira UE-162014
#rb elizabeth.baumel
#preflight 634488a6c272487ed4784593
[CL 22458354 by christopher waters in ue5-main branch]
Compile DXR shaders using the same profile when targeting PCD3D_SM5 and PCD3D_SM6 (i.e. lib_6_6 or lib_6_5 based on USE_SHADER_MODEL_6_6 define).
#rb christopher.waters
#preflight 63376cc6466fb43669315f62
[CL 22286556 by yuriy odonnell in ue5-main branch]
When changing SM5 raytracing shaders to use lib_6_5 from lib_6_3, the __SHADER_TARGET_MINOR value wasn't updated to 5.
Bumping SM6 and SM5 shader versions.
#jira none
#rb yuriy.odonnell
#preflight 6335b2abf76de2d4d559891a
[CL 22263071 by christopher waters in ue5-main branch]
Before:
Total CPU Time: 53783.640625 s
Total time in Parallel executor: 558.66 seconds
After:
Total CPU Time: 47886.140625 s
Total time in Parallel executor: 498.81 seconds
#jira
[CL 22173145 by bryan sefcik in ue5-main branch]
#rb Jason.Nadro
#preflight 632e0ecae23e50651ba4c5a0
#ushell-cherrypick of 21900443 by Yuriy.ODonnell
#ushell-cherrypick of 21931128 by Yuriy.ODonnell
#ushell-cherrypick of 22029907 by Yuriy.ODonnell
#ushell-cherrypick of 22036834 by Yuriy.ODonnell
[CL 22173105 by yuriy odonnell in ue5-main branch]
- Instrument how long shader preprocessing takes for each shader compilation job.
- Keep a running total in our shader stats per shader type.
- Add logging to track total thread preprocessing time for all shaders.
- Fixup local variable names to match the output log names.
#rb Dan.Elksnitis
#preflight 632a224ab40000c8f08c5815
[CL 22125080 by jason nadro in ue5-main branch]
The engine uses GRayTracingPlaformMask to compute ShouldCompilePermutation() for shaders. This is filled based on platform settings and capabilities when running the editor. When running a standalone game, the mask is filled purely based on whether ray tracing is enabled for the project (r.RayTracing) and the current runtime environment supports it (GRHISupportsRayTracing).
The new CVar is meant to be consistent between the cook time and run time. This is achieved by setting GRHISupportsRayTracing=false when running on SM5 if r.RayTracing.RequireSM6 is 1.
#rb christopher.waters
#preflight 631f8c8680642a7fa783ca18
#jira UE-163012
[CL 21971785 by Yuriy ODonnell in ue5-main branch]