Commit Graph

556 Commits

Author SHA1 Message Date
Zak Middleton
73efd27f6c #ue5 - Truncation fixes for modules:
StatsViewer
StatusBar
TargetDeviceServices
TargetPlatform
Teleporter
TimeManagement
TranslationEditor
ViewportInteraction
Virtualization
WindowsPlatformFeatures
WindowsTargetPlatform

#jira UE-160837, UE-160843
#rb Andrew.Davidson, Dave.Jones2
#preflight 636024751c75ff834a526197

[CL 22873932 by Zak Middleton in ue5-main branch]
2022-10-31 18:33:27 -04:00
yuriy odonnell
9de862ab0b Add UE::ShaderCompilerCommon::RemoveDeadCode() high-level wrapper for shader minifier, to be consistently used in all shader compiler back-ends
#preflight 635af3aa1b7de936a5295629
#rb jason.nadro

[CL 22850483 by yuriy odonnell in ue5-main branch]
2022-10-29 01:51:27 -04:00
dan elksnitis
ecab3b4a9a [shaders] refactor usf/directcompile.txt dump into a utility in ShaderCompilerCommon to reduce code duplication in the shader backends
#rb Jason.Nadro
#rb Christopher.Waters
#preflight 635bf1e1df01edd149f5727e

[CL 22829548 by dan elksnitis in ue5-main branch]
2022-10-28 11:45:49 -04:00
laura hermanns
7785c20330 Abstract number of instructions for complexity visualization by estimated metric.
#preflight 6356f6b30313c24974fc5535
#jira UE-168166
#rb jason.nadro

[CL 22788160 by laura hermanns in ue5-main branch]
2022-10-26 16:15:17 -04:00
chris kulla
b00b7d70d0 Organize Ray Tracing shaders by their payload
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]
2022-10-24 20:11:02 -04:00
henrik karlsson
bd5352a0c3 [UE]
* More fixes to be preprocessor conformant (/Zc:preprocessor)

#rb none
#preflight skipped

[CL 22705198 by henrik karlsson in ue5-main branch]
2022-10-21 19:52:08 -04:00
henrik karlsson
dbe0123ff5 * Fixed so preprocessor conforms to C99 and C++11 (/Zc:preprocessor)
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]
2022-10-21 19:50:32 -04:00
dan elksnitis
b81ae6648c [shader compilation] changes to error handling in ShaderCompileWorker
- 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]
2022-10-20 09:43:50 -04:00
Tim Smith
d087b03671 Improved Live Coding startup time to make starting the console an asyncronous task.
#rb Robert.Miller
#preflight 635143efc9559712ed540c11

[CL 22654049 by Tim Smith in ue5-main branch]
2022-10-20 09:21:20 -04:00
christopher waters
f5ff98f2e1 ShaderParameterParser cleanup
- 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]
2022-10-18 15:25:05 -04:00
christopher waters
1b8ad85eaa Working around DXC issue https://github.com/microsoft/DirectXShaderCompiler/issues/4715
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]
2022-10-11 11:06:47 -04:00
Yuriy ODonnell
9ab9403717 ShaderMinifier - Track and output line directives
#rb Jason.Nadro
#preflight 63406dd22a0a2c1ead8d1145

[CL 22405822 by Yuriy ODonnell in ue5-main branch]
2022-10-07 14:31:38 -04:00
christopher waters
281072e217 Don't count shader parameters that we don't bind through resource tables. Resources like UEDiagnosticBuffer and vendor extensions are handled through Root Signatures.
#jira
#rb yuriy.odonnell, elizabeth.baumel
#preflight 633ef2f7511dd8cb01cc51db

[CL 22381598 by christopher waters in ue5-main branch]
2022-10-06 15:23:50 -04:00
christopher waters
38cc1eb3b2 Instead of adding the different D3D shader format versions together, combine their hashes. This will prevent version overlaps when someone changes the shared version.
#jira none
#rb yuriy.odonnell
#preflight 633e43653a20cf302c9fee76

[CL 22371688 by christopher waters in ue5-main branch]
2022-10-05 23:57:45 -04:00
yuriy odonnell
0e08f4aa38 Add bindless resource support as a requirement for ray tracing on PC (SM 6.6 + Resource Binding Tier 3).
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]
2022-09-30 23:05:36 -04:00
christopher waters
74c6a9d8fb When changing SM6 raytracing shaders to use lib_6_6 from lib_6_5, the __SHADER_TARGET_MINOR value wasn't updated to 6.
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]
2022-09-30 00:44:25 -04:00
Laura Hermanns
32c8d9eb49 Don't remove PDB from DXIL container if it wasn't generated in the first place to prevent hlsl::Exception to be thrown by DXC if PDB part is not present.
#rb Yuriy.ODonnell
#fyi Christopher.Waters
#jira UE-164622
#preflight 6334c8ea691c0168b71d7e0d
#rnx

[CL 22233889 by Laura Hermanns in ue5-main branch]
2022-09-28 18:43:53 -04:00
bryan sefcik
0beee50b45 Updated ../Engine/Source/Developer/... to inline gen.cpp files
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]
2022-09-24 13:31:25 -04:00
yuriy odonnell
095c4ceee5 ShaderMinifier - Add experimental CFLAG_RemoveDeadCode to run shader rewriting step that removes unused functions and types from shader source before compilation to improve compile times
#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]
2022-09-24 13:27:11 -04:00
jason nadro
5ec1160356 Adding Total Thread Preprocess Time for shader compilation.
- 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]
2022-09-21 17:34:15 -04:00
Yuriy ODonnell
6db429d732 ShaderMinifier - Add experimental CFLAG_RemoveDeadCode to run shader rewriting step that removes unused functions and types from shader source before compilation to improve compile times
#rb Jason.Nadro
#preflight 632363a75a44869a7d025585

[CL 22036834 by Yuriy ODonnell in ue5-main branch]
2022-09-15 15:45:20 -04:00
Yuriy ODonnell
e741d25317 Add CVar r.RayTracing.RequireSM6 (default=0) to explicitly control when ray tracing shaders/features should be available, instead of relying on project target platform shader model settings. This is required because target platform settings are not available when running a packaged game.
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]
2022-09-12 16:27:08 -04:00
florin pascu
dbcd6198d0 Add the Frequency name to the "Unrecognized shader frequency" Shader Compiler error
#jira none
#rb Carl.Lloyd
#preflight 6319e1662b7fe03eb6a70f52

[CL 21907568 by florin pascu in ue5-main branch]
2022-09-08 19:36:17 -04:00
david harvey
10b05a8cf3 Capture platform-specific project analytics for launching, cooking & packaging in the editor.
#jira UE-142191
#rb Brian.White, Wojciech.Krywult
#preflight 6319a11bd135b61bc5f729c9

[CL 21907474 by david harvey in ue5-main branch]
2022-09-08 19:33:14 -04:00
Yuriy ODonnell
bdcb1cc814 Move duplicated implementations of ParseRayTracingEntryPoint() to ShaderCommon module
#preflight 631a28a0967ffc68fbe3d8a7
#rb jason.nadro

[CL 21900443 by Yuriy ODonnell in ue5-main branch]
2022-09-08 15:20:52 -04:00