Commit Graph

171 Commits

Author SHA1 Message Date
jeannoe morissette
f30a320eeb VulkanRHI: Fix Vulkan bindless and ray tracing shader compilation to work with new UB generation code.
#rb none
#jira UE-171798
#rnx

[CL 28125266 by jeannoe morissette in ue5-main branch]
2023-09-22 04:12:24 -04:00
christopher waters
bb0a274b8c Reworking UniformBuffer code generation to not use an intermediate struct
- When generating Uniform Buffer HLSL code, a 'static const struct {} Name' was created which has been causing compiler issues off and on for years.
- When RemoveUniformBuffersFromSource removed said struct, it parsed the struct's structure to figure out how to translate UniformBuffer.Member into UniformBuffer_Member in code that accessed Uniform Buffers.
- Now, instead of a struct, a "UniformBuffer <Name>" declaration is created and filled with mappings from "UniformBuffer.Member" into the correct code.
- This allows ConstantBuffer objects to be used differently from cbuffer where the former generates "UniformBuffer.Member" and the latter generates "UniformBuffer_Member"
- This also allows resources to always be translated to "UniformBuffer_Member"
- Shader define 'PLATFORM_SUPPORTS_UB_STRUCT' is now 'PLATFORM_SUPPORTS_CONSTANTBUFFER_OBJECT' and will be set on shader formats that support ConstantBuffer<> objects.
- Removed lots of unused code from BindlessResources.ush

#jira UE-195103
#rb dan.elksnitis, jeannoe.morissette

[CL 28058373 by christopher waters in ue5-main branch]
2023-09-20 17:33:36 -04:00
jeannoe morissette
b7c12c8b0e VulkanRHI: VK RT WIP: Use tighly packed indices for the bindless UBs in the shader parameters, and at runtime use ConstantDataOriginalBindingIndex to write the handle in the correct slot.
#rb none
#jira UE-171798
#rnx

[CL 27409804 by jeannoe morissette in ue5-main branch]
2023-08-28 09:44:39 -04:00
jeannoe morissette
235b6cbfd3 VulkanRHI: Actually enable scalar_block_layout in raytracing and sm6 shaders to fix multiple alignment issues. Rename ReflectionSlot param to align with ShaderCommon code.
#rb carl.lloyd
#jira UE-171798
#rnx

[CL 27399055 by jeannoe morissette in ue5-main branch]
2023-08-25 22:19:15 -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
jeannoe morissette
ec701f8ca4 VulkanRHI: VK RT WIP: Shader compiler changes for Vulkan RT. Add an option for extra blobs for AnyHit and Intersection shaders in HitGroup. Add option of bindless UBs for ray tracing shaders. Correctly set GRHISupportsRayTracingDispatchIndirect.
#rb Aleksander.Netzel
#jira UE-190075
#rnx

[CL 27231539 by jeannoe morissette in ue5-main branch]
2023-08-19 19:17:32 -04:00
jeannoe morissette
e97f023224 VulkanRHI: Add handling of multiple entrypoints for RayHitGroup shaders (VK RT WIP, does not change current output)
#rb carl.lloyd
[FYI] aleksander.netzel
#jira UE-171798
#rnx

[CL 27209304 by jeannoe morissette in ue5-main branch]
2023-08-18 13:12:21 -04:00
jeannoe morissette
4e65bdc179 VulkanRHI: Start adding code in VulkanShaderCompiler to track bindless UB and handle RootParametersStructure. (VK RT WIP, disabled for now)
#rb none
#jira UE-171798
#rnx

[CL 27185944 by jeannoe morissette in ue5-main branch]
2023-08-17 17:14:45 -04:00
jeannoe morissette
150748bbaa VulkanRHI: (VK RT WIP) Move all serialized parameter of the shader compilation process into a struct together (Header, SRT, Spirv).
#rb none
#jira UE-171798
#rnx

[CL 27151506 by jeannoe morissette in ue5-main branch]
2023-08-16 15:44:45 -04:00
jeannoe morissette
8102581292 VulkanRHI: Remove unnecessary code in VulkanShaderCompiler (clean up WIP). Remove some of the CombinedImageSampler code (and some ImmutableSamplers). Removed some parts of FOLDVulkanCodeHeader. Remove the use of FHlslccHeaderWriter and FHlslccHeader to generate a string and then parse it, work directly from SPIRV and reflection.
#rb Laura.Hermanns
#jira UE-176887,UE-176175
#rnx

[CL 27132998 by jeannoe morissette in ue5-main branch]
2023-08-16 00:42:57 -04:00
jeannoe morissette
01c3ef3a8f VulkanRHI: Start a clean up of the VulkanShaderCompiler, small steps at first (WIP). Reduce parameters in shader compilation functions by batching them together in a struct (more params coming with RT). Remove FCompilerInfo class. Replace repeated loops with lambdas.
#rb carl.lloyd
#rnx

[CL 26867591 by jeannoe morissette in ue5-main branch]
2023-08-04 23:59:50 -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
dan elksnitis
78b1767069 [shaders] implement independent preprocessing API for vulkan shader format
#rb Massimo.Tristano

[CL 26739541 by dan elksnitis in ue5-main branch]
2023-08-01 11:03:24 -04:00
dan elksnitis
5f85b46590 [shaders] remove unnecessary passing of hlslcc flags as an option to debug info output. this was just used to pass a switch on the SCW directcompile cmdline which SCW no longer does anything with. also cleaned up some additional unnecessary code related to these flags in backends that no longer use hlslcc at all.
#rb Laura.Hermanns

[CL 26685354 by dan elksnitis in ue5-main branch]
2023-07-28 15:58:01 -04:00
dan elksnitis
64a5c76444 [shaders] move custom vulkan bindless parameter parser behaviour into baseclass (parameter parser being part of the serialized preprocess output means subclassing is problematic)
#rb JeanNoe.Morissette

[CL 26674182 by dan elksnitis in ue5-main branch]
2023-07-28 11:11:42 -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
jeannoe morissette
28b4d2dc2a VulkanRHI: VKRT WIP: Add SystemParameters as shader_record to all ray tracing shaders.
#rb Aleksander.Netzel
#jira UE-171798
#rnx

[CL 26355446 by jeannoe morissette in ue5-main branch]
2023-06-30 16:53:02 -04:00
guillaume abadie
fb96324861 Adds bSupportsRealTypes=RuntimeDependent in Vulkan SM5 and SM6
#rb jeannoe.morissette
#jira UE-179496

[CL 26269642 by guillaume abadie in ue5-main branch]
2023-06-27 16:32:12 -04:00
jeannoe morissette
b2d04ae516 VulkanRHI: VKRT WIP: Add bindless uniform buffer support needed by RT. Rename existing uniform buffers to "single use uniform buffers".
#rb carl.lloyd
#rnx

[CL 25818162 by jeannoe morissette in ue5-main branch]
2023-06-06 12:00:44 -04:00
jeannoe morissette
9663b51553 VulkanRHI: Fix issues with globallycoherent in Vulkan bindless, move it to heap decl for now (properly adds the "OpDecorate Coherent" in SPIRV).
#preflight 646fccb3407983b998237f01
#rnx

[CL 25629723 by jeannoe morissette in ue5-main branch]
2023-05-25 17:27:56 -04:00
jason hoerner
88d847a0ad GlobalBeginCompileShader optimizations. 3.2x improvement in performance of the function on Lyra cook:
* Early out when adding uniform buffer resource entries, by checking if uniform buffer had been processed, before processing individual entries.
* Changed resource entry list from a map to an array, saving the cost of map operations adding items to it.
* Resource entries for global uniform buffers cached once at startup.
* Resource entry member names stored in an external buffer, to avoid per-entry string memory allocation overhead.
* Miscellaneous smaller optimizations -- for example, using ByHash to avoid redundant hashing and FString construction.

#jira none
#rnx
#rb jason.nadro dan.elksnitis
#preflight 646cfdbc1134ffac7034af60

[CL 25596308 by jason hoerner in ue5-main branch]
2023-05-23 20:16:11 -04:00
jeannoe morissette
56a0d8dd97 VulkanRHI: VKRT WIP: Increase size of bitfield to track uniform buffer usage. Fix copy-paste error where acceleration structures were sent to wrong bindless descriptor set.
#fyi yuriy.odonnell,aleksander.netzel
#preflight 646797578720894fb6a3eaab
#rnx

[CL 25545955 by jeannoe morissette in ue5-main branch]
2023-05-19 12:02:01 -04:00
Steve Robb
0f44db07d5 Replaced some container operator new usage.
#rb james.hopkin
#jira none
#preflight 6459670f28155a0f41565a34

[CL 25384456 by Steve Robb in ue5-main branch]
2023-05-09 05:17:49 -04:00
jeannoe morissette
f843d3c482 VulkanRHI: VULKAN_SM6 fix for some shaders getting compiled for Vulkan 1.2 even when MinTargetEnvironment is set to 1.3.
#preflight 64501ee66538e45f75cdf65e
#rnx

[CL 25290877 by jeannoe morissette in ue5-main branch]
2023-05-01 16:39:57 -04:00
jeannoe morissette
7f0f8a8d55 VulkanRHI: Fix Vulkan shader compilation by enabling VK_EXT_scalar_block_layout in all shaders for VULKAN_SM6 (its presence is verified by the profile).
#preflight 6449923c1150e908d0b337c3
#rnx

[CL 25207366 by jeannoe morissette in ue5-main branch]
2023-04-26 17:18:51 -04:00