Commit Graph

202 Commits

Author SHA1 Message Date
christopher waters
364dbe3541 Fixing bad vulkan.h include.
Switching back to referencing VulkanRHI headers correctly.

[CL 24370772 by christopher waters in ue5-main branch]
2023-02-22 17:22:28 -05:00
joe kirchoff
0615aeb033 [Partial Backout] - CL24348577
[FYI] Joe.Kirchoff
Original CL Desc
-----------------------------------------------------------------
Remove unnecessary private include path

#rnx
#jira UE-177808

[CL 24352016 by joe kirchoff in ue5-main branch]
2023-02-21 17:55:23 -05:00
joe kirchoff
4eb0d7b810 Remove unnecessary private include path
#rnx
#jira UE-177808

[CL 24351077 by joe kirchoff in ue5-main branch]
2023-02-21 17:19:34 -05:00
Laura Hermanns
0bd8d62c28 Remove redundant dumping of .spv file in VulkanShaderCompiler.
#rb Dan.Elksnitis
#fyi JeanNoe.Morissette
#jira none
#preflight 63efefc690198dffba0e4378
#rnx

[CL 24291485 by Laura Hermanns in ue5-main branch]
2023-02-17 16:39:16 -05:00
jeannoe morissette
ed793eba07 VulkanRHI: Apply Wave32 hint in Vulkan when VK_EXT_subgroup_size_control is supported. Properly check requiredSubgroupSizeStages before applying wave size. Fixes artifacts on ARC with Vulkan.
#rb Mihnea.Balta
#jira UE-173871
#preflight 63ef9934e832ea950a808150
#rnx

[CL 24282090 by jeannoe morissette in ue5-main branch]
2023-02-17 10:30:38 -05:00
jeannoe morissette
11825bb976 VulkanRHI: Genereate bindless sampler declarations the same way as resources. Vulkan Bindless WIP.
#fyi Christopher.Waters
#preflight 63ebd899514832b2425d7331
#rnx

[CL 24235933 by jeannoe morissette in ue5-main branch]
2023-02-15 13:54:03 -05:00
jeannoe morissette
c96eadede6 VulkanRHI: Fix issue where incorrect TargetEnvironment was selected when previewing other SM5 modes.
#rb Mihnea.Balta
#jira UE-171188
#preflight 63ea8f8f956709374a50bf8a

[CL 24210191 by jeannoe morissette in ue5-main branch]
2023-02-14 09:25:04 -05:00
Laura Hermanns
5a8a3b3063 Unify shader debug name in shader code output for DXC backends to improve cache hits.
The shader code output contains a little bit of plaintext such as I/O identifiers and the shader name, which was generated for the DXC backend in a way that prevents caching.
This unifies the shader name in the output code and improves the cache hit ratio for a Lyra cook from 0% to roughly 50% cache hits (for certain platforms).

#rb Jason.Nadro, Carl.Lloyd
#fyi Brian.White, Arciel.Rekman, Brandon.Schaefer
#jira FORT-548603
#preflight 63e26c6c07207b2570ba2d5b
#rnx

[CL 24050212 by Laura Hermanns in ue5-main branch]
2023-02-07 11:15:47 -05:00
Yuriy ODonnell
1dfc32d42d Enable r.Shaders.RemoveDeadCode by default for all back-ends except Metal and OpenGL
* Significantly reduces the size of shader debug data and improves shader compilation time (reducing parsing cost in the native shader compiler)
* Remove "experimental" label for the feature

#rb Jason.Nadro
#preflight 63d455d9be1970f8824c3f9b

[CL 23894592 by Yuriy ODonnell in ue5-main branch]
2023-01-27 18:24:18 -05:00
jeannoe morissette
d16b138656 VulkanRHI: Fix static analysis warning.
#rb none
#rnx
#preflight trivial

[CL 23880261 by jeannoe morissette in ue5-main branch]
2023-01-26 22:05:31 -05:00
jeannoe morissette
efd5dc3c7a VulkanRHI: Use a single descriptor set for all uniform buffers in Vulkan bindless, separate the stages with offsets inside that single decriptor set. Gets around previous issue with different descriptor sets were using the same descriptor buffer with different offsets. (Vulkan Bindless WIP)
#rb none
#preflight 63d2f6bc3656ea96dca342e9
#rnx

[CL 23877009 by jeannoe morissette in ue5-main branch]
2023-01-26 17:28:35 -05:00
zack neyland
e8eb20415f MetalRT: Laying initial groundwork, disabled by default.
* Enabling requires re-building a metalpp with appropriate flags/defines set along with an OS version that supports the RT headers/libs.

#preflight 63c72f1a0225f00e14c05c46
#jira none

[CL 23750025 by zack neyland in ue5-main branch]
2023-01-17 19:53:36 -05:00
jeannoe morissette
a4b446428f VulkanRHI: Override ShaderParameterParser for Vulkan bindless resource declarations. Use a typedef for each resource's type and declare its variable array with that type, at the end (in SPIRV) collapse all the arrays of a same descriptor type on the same binding. Move 'per-stage' uniform buffer bindings into descriptor sets AFTER the descrciptor sets for the resource arrays (since the resource array bindings will never change, but the ubo will change at a very high frequency). Also add the possibility for platform common headers to overload UB_RESOURCE_MEMBER_RESOURCE to match the altered declaration in ShaderParameterParser (temporary solution). The result gets around the lack of ResourceDescriptorHeap in Vulkan. (Vulkan Bindless WIP)
#rb Yuriy.ODonnell
#fyi Christopher.Waters
#jira UE-162018
#preflight 63c6e1933f587d9e14f6f27c
#rnx

[CL 23741527 by jeannoe morissette in ue5-main branch]
2023-01-17 13:23:40 -05:00
Yuriy ODonnell
bddca76c94 ShaderMinifier - Add support for dead code removal to all shader formats
* Add code to all shader format back-ends to take dead code removal into account when computing the version ID
* Not enabled in Metal and OpenGL back-ends (require further testing)

#rb dan.elksnitis
#preflight 6390f1f15c5308d18c7364fb

[CL 23433448 by Yuriy ODonnell in ue5-main branch]
2022-12-07 15:13:42 -05:00
chris kulla
408b0b8553 Ray Tracing: Compute the maximum payload size from the shader's payload type
Serialize the payload size as part of the raytracing shader so it can be examined in the RHI layer.

Validate that the RTPSO is configured with the appropriate payload size.

Add macros to ensure the payloads have the expected size

Ensure that all raytracing pipelines explicitly bind a miss shader

Add a shared shader header to implement static asserts for those shader compilers that support them (like dxc).

Fix payload type on main deferred reflection raygen shader

Fix incorrect raygen shader included in the deferred RTPSO list for RTGI

Don't add builtin shaders to the RTPSO from the RHI layer as these are unlikely to ever match the required payload type

Add new method to register payload types so that plugins can more easily describe custom payloads they may be using (up to a maximum of 32 unique payload types since we use a bitmask to represent payload sets).

#rb Yuriy.ODonnell
#jira UE-157946
#preflight 636aff4363037c102679f13a
#preflight 63869dde170bc34a93e8c90e

[CL 23337139 by chris kulla in ue5-main branch]
2022-11-30 13:53:00 -05:00
jeannoe morissette
2b32be5f32 VulkanRHI: Quick patch to add support for WAVESIZE in Vulkan.
#rb Guillaume.Abadie
#preflight 6369327edc30a4ce96465e16

[CL 23012164 by jeannoe morissette in ue5-main branch]
2022-11-07 11:48:53 -05: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
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