Commit Graph

186 Commits

Author SHA1 Message Date
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
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
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
dmitriy dyomin
d50ef617bb Bump vulkan shader format version to invalidate Android VK shaders
[CL 22594922 by dmitriy dyomin in ue5-main branch]
2022-10-18 03:18:01 -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
Florin Pascu
3cd6b6da4b - Checking the SF instead of the SP in the Vulkan Shader Compiler
#rb Dmitriy.Dyomin
#jira none
#preflight 6322c8498838676d108e02a1

[CL 22031695 by Florin Pascu in ue5-main branch]
2022-09-15 13:03:31 -04:00
jeannoe morissette
0d54854d1f VulkanRHI: Add implementation of bindless samplers using VK_EXT_descriptor_indexing.
#fyi dmitri.dyomin, carl.lloyd, robert.srinivasiah, yuriy.odonnell, aleksander.netzel
#rb christopher.waters
#jira UE-139618
#preflight 6319f6482b7fe03eb6aab931

[CL 21988350 by jeannoe morissette in ue5-main branch]
2022-09-13 14:16:19 -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
dmitriy dyomin
12eb52b317 Fixed: Water texture missing throughout the map in BR on Android
#rb peter.sauerbrei

[CL 21864603 by dmitriy dyomin in ue5-main branch]
2022-09-07 18:03:53 -04:00
Guillaume Abadie
14c7c688e5 Adds a CompileDXC.bat to vulkan's ShaderDebugInfo
This allows to iterate to compile the USF file to SPIRV and translate to GLSL to verify the sanity of the SPIRV assembly.

#rb jeannoe.morissette
#jira UE-161125
#preflight 62fe8a8157316140a8fa226a
#fyi laura.hermanns

[CL 21449988 by Guillaume Abadie in ue5-main branch]
2022-08-18 17:07:23 -04:00
dmitriy dyomin
8edf003c00 Invalidate GL and Vulkan shaders
#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 21438408 via CL 21438416 via CL 21438418 via CL 21438420
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v981-21435820)

[CL 21438584 by dmitriy dyomin in ue5-main branch]
2022-08-18 02:04:03 -04:00
Guillaume Abadie
960d0420ce Handle TextureExternal for vulkan in our preprocessor, not DXC
#rb jeannoe.morissette
#jira UE-161125
#preflight 62fbf2223c1872b8c97210fa, 62fbd5d6542a7a8d7576900e
#fyi laura.hermanns

[CL 21413162 by Guillaume Abadie in ue5-main branch]
2022-08-16 16:21:14 -04:00
christopher waters
a987160f55 Reworking the parameter rewrite code to do automatic bindless
- Refactoring FShaderParameterParser to use more string views since we can rely on OriginalParsedShader not changing.
- Split FShaderParameterParser::ParseAndMoveShaderParametersToRootConstantBuffer into smaller functions
- Moving FShaderParametersMetadata::IterateShaderParameterMembers into the only module it's used in, ShaderParameterParser.cpp
- Adding CFLAG_BindlessResources which will be set when ENABLE_BINDLESS_RESOURCES is set
- Adding CFLAG_BindlessSamplers which will be set when ENABLE_BINDLESS_SAMPLERS is set
- Adding resource/sampler detection and conversion to bindless in FShaderParameterParser

#jira UE-139616
#rb guillaume.abadie, jeannoe.morissette, yuriy.odonnell, laura.hermanns
#preflight 62d180cce468fcfd0b7001a0

[CL 21111994 by christopher waters in ue5-main branch]
2022-07-15 12:25:44 -04:00
christopher waters
b28a0c467f Moving ShaderParameterParser into its own source files.
#jira none
#rb guillaume.abadie, kenzo.terelst
#preflight 62b0ecb8ec13d14b5a1897ba

[CL 20757788 by christopher waters in ue5-main branch]
2022-06-21 10:49:56 -04:00
christopher waters
46d39f296a Reorganizing reflection handling to funnel through common functions.
This is a prerequisite for upcoming bindless changes as it centralizes key points where we register the different binding types.

#jira none
#rb jason.nadro, eric.mcdaniel, jeannoe.morissette
#preflight 62574453f7476d662c8dd2fe

[CL 19761676 by christopher waters in ue5-main branch]
2022-04-14 15:46:20 -04:00
carl lloyd
379853c1ea Added new android patch pass to fix driver crashes on Adreno devices running Android 10
#rb Laura.Hermanns
#preflight 625540723f5641db59e7628a

[CL 19718421 by carl lloyd in ue5-main branch]
2022-04-12 05:31:35 -04:00
Rolando Caloca
a8289ca1f9 UE5 - Remove non-ShaderConductor Vulkan shader compilation path as it's not used anymore
#rb Will.Damon
#preflight 624f065bc64cf034f4cfbf4c
#fyi Lukas.Hermanns

[CL 19670668 by Rolando Caloca in ue5-main branch]
2022-04-07 11:50:52 -04:00
christopher waters
0a8074d5a5 RemoveUniformBuffersFromSource shouldn't implicitly call TransformStringIntoCharacterArray.
#jira none
#rb jason.nadro
#preflight 624ddf0f090236773a1ad8c1

[CL 19656058 by christopher waters in ue5-main branch]
2022-04-06 17:19:38 -04:00
Charles deRousiers
546f1b27c6 Add ROV type support for shader binding.
#rb mihnea.balta
#jira none
#preflight 623b31aaca34ffd7bf7ca796

[CL 19481254 by Charles deRousiers in ue5-main branch]
2022-03-23 13:02:24 -04:00
JayLu2000
25f73e4907 PR #8976: Add a setting to disable strip-reflect when Android shaders are compiled (Contributed by JayLu2000)
#jira UE-145556
#rb carl.lloyd, laura.hermanns
#preflight 623179958a603798938a9f22

[CL 19405778 by JayLu2000 in ue5-main branch]
2022-03-16 10:34:16 -04:00
Lukas Hermanns
999fb99c6c Enable HLSL 2021 language version (CFLAG_HLSL2021) in shader compiler backends.
#rb Guillaume.Abadie, Will.Damon
#fyi Carl.Lloyd, Ryan.Vance, Christopher.Waters, Mihnea.Balta, Rolando.Caloca, Yuriy.ODonnell, Graham.Wihlidal
#jira UE-138358
#preflight 6227b6b3c653e7ef9f571dc8

[CL 19319858 by Lukas Hermanns in ue5-main branch]
2022-03-09 09:47:28 -05:00
jeannoe morissette
ec21e834f5 Vulkan: Use Vulkan 1.1 environment for shader compilation on desktop platforms. Enable Wave Ops in Vulkan.
#rb mihnea.balta,Lukas.Hermanns
#preflight 61df3429a513f93cd21da888

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18588748 in //UE5/Release-5.0/... via CL 18588757 via CL 18588778
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18588795 by jeannoe morissette in ue5-main branch]
2022-01-12 15:27:31 -05:00
jeannoe morissette
890702676c Spec compliant 64bit image atomics in Vulkan:
- use STORAGE_IMAGE to read from R64 formats when sampling isn't supported.
- leave high level code and HLSL untouched (RDG will continue to consider them read only access), patch SPIRV instead
- create a codepath for hzb that uses UlongType
- update shader guid for Vulkan to force rebuild

Fixes all validation issues with 64bit atomics and allows the use of RADV driver (AMD+Linux) for Nanite/Lumen.

#jira UE-138513
#preflight 61dc4c98af44b4362836a61f
#rb mihnea.balta
[FYI] Lukas.Hermanns

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18563012 in //UE5/Release-5.0/... via CL 18563033
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18563055 by jeannoe morissette in ue5-release-engine-test branch]
2022-01-10 13:56:47 -05:00
dmitriy dyomin
a82a8b7e3b Fixed: missing shader code in material editor for vulkan platforms
#rb jack.porter
#preflight 61d7dca5d17842e547d33f60

#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 18540239 in //UE5/Release-5.0/... via CL 18540246
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18540247 by dmitriy dyomin in ue5-release-engine-test branch]
2022-01-07 01:36:15 -05:00
christopher waters
461deaf0bd Removing new usage of DDSPI in a shader format.
#jira none
#rb arciel.rekman
#preflight 61a55a2cec124631d742da87

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 18321340 in //UE5/Release-5.0/... via CL 18321377
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18321387 by christopher waters in ue5-release-engine-test branch]
2021-11-29 23:22:02 -05:00