216 Commits

Author SHA1 Message Date
kenzo terelst
6bfa613964 - Use non uniform resource index for sampling bindless resources in raytracing shaders
- Re-enable bindless for raytracing

#jira UE-227550
#rb Krzysztof.Narkowicz

[CL 37167932 by kenzo terelst in 5.5 branch]
2024-10-16 05:42:42 -04:00
jeannoe morissette
498403d8d8 VulkanRHI: Add missing 3 component types.
#rb Mihnea.Balta
#jira UE-225212
#rnx

[CL 36758066 by jeannoe morissette in 5.5 branch]
2024-10-01 19:35:49 -04:00
jeannoe morissette
e936e04183 VulkanRHI: Add missing file from 35154013 (fill EShaderResourceUsageFlags at shader compile time)
#rnx

[CL 35196192 by jeannoe morissette in ue5-main branch]
2024-07-30 16:08:32 -04:00
josh adams
8d3923917c - Moved some includes to the .inl where they are needed
#rb josh.adams

[CL 34868040 by josh adams in ue5-main branch]
2024-07-17 11:29:40 -04:00
josh adams
60bd9253d8 - Pulled more functions into the SpirvShaderCompiler.inl
#rb jeannoe.morissette

[CL 34853348 by josh adams in ue5-main branch]
2024-07-16 16:38:00 -04:00
jeannoe morissette
b8bf29f12c VulkanRHI: move some helper functions into an .inl that can be shared (more structure to come). Remove FVulkanSpirv and PatchSpirvReflectionEntries, they were parsing all of the Spirv for information that isn't used anymore.
#rb Josh.Adams
#rnx

[CL 34846878 by jeannoe morissette in ue5-main branch]
2024-07-16 13:40:10 -04:00
jeannoe morissette
0b619da904 VulkanRHI: Add LooseParameterData to shader record for Vulkan ray tracing. Move MaxShaderGroupStride to a Cvar. Fix record out-of-bounds check to use the stride instead of the full size.
#rb Kenzo.Terelst
#rnx

[CL 34646604 by jeannoe morissette in ue5-main branch]
2024-06-25 13:22:29 -04:00
steve robb
f40be2d759 Fixed some 'deprecated' FString usage.
#rb james.hopkin

[CL 34603027 by steve robb in ue5-main branch]
2024-06-24 09:25:50 -04:00
jeannoe morissette
c3902fdd0d VulkanRHI: Add SupportsHighEndRayTracingEffects to DDPI for Vulkan ray tracing. Add PLATFORM_SUPPORTS_CALLABLE_SHADERS to Vulkan shader compiler directly.
#rnx

[CL 34546422 by jeannoe morissette in ue5-main branch]
2024-06-20 17:20:57 -04:00
jeannoe morissette
d3df045ab8 VulkanRHI: adjust assert until LooseParameterData is processed.
#jira UE-218220
#rnx

[CL 34484308 by jeannoe morissette in ue5-main branch]
2024-06-18 18:48:24 -04:00
christopher waters
cfc6f343df Uniform Buffer improvements
- Moving various UB booleans into a flags enum.
- UB booleans could not be reasonably deprecated without incurring memory overhead, so this will break custom code that uses them.
- Adding UB flag to force the shader compilers to generate reflection for the UB members which are normally excluded from reflection.
- Adding UB flag that tells MeshCommands that a UB will be bound during pass drawing and that it doesn't need to be set via MDCs.
- New flags are not used in this CL, they are prerequisites for subsequent, larger changes.

#rb jeannoe.morissette

[CL 34356503 by christopher waters in ue5-main branch]
2024-06-13 17:59:13 -04:00
jeannoe morissette
a090beebd3 VulkanRHI: Also reflect members from non-global ub
#rb christopher.waters
#rnx

[CL 34275375 by jeannoe morissette in ue5-main branch]
2024-06-11 10:00:19 -04:00
jeannoe morissette
ab8d172f29 VulkanRHI: Fix Vulkan bindless and ray tracing with latest descriptor remapping changes.
#jira UE-215948
#rnx

[CL 34206949 by jeannoe morissette in ue5-main branch]
2024-06-07 12:47:34 -04:00
jeannoe morissette
ce9489d3d1 VulkanRHI: Remove remapping of bindings at runtime. Locked packed globals to binding 0 of every stage if present (removed multiple loops). Simplify Vulkan shader compiler by removing more legacy code paths. Reorder EAttachmentType in FVulkanShaderHeader to match with VULKAN_SUBPASS_FETCH.
#jira UE-215948
#rb florian.penzkofer
#rnx

[FYI] Dmitriy.Dyomin, Allan.Bentham

[CL 34131847 by jeannoe morissette in ue5-main branch]
2024-06-05 13:46:34 -04:00
laura hermanns
a34925adb1 [Shaders] SPIRV-Tools pass rewrite (Re-introduced after backout of 34098261)
Interface variable scalar replacement pass rewrite (added as a new pass into spirv-opt, will replace existing one in future).

Things done so far:
- Rewritten to properly handle non-aggregate types and other tricky cases (both for Patch decorated variables and not)
- Matrix scalarization is now optional.
- More test cases added
- Path is now exposed as a command-line flag
- Fixed https://github.com/KhronosGroup/SPIRV-Tools/issues/4795

Few shaders contained loops, which were not unrolled, leading to the scalarization pass to fail. Loops were not unrolled due to "complex" condition expression. Those are changed to be accepted by the loop unroller (induction variable is the only lhs in the condition expression now).

This new pass is now always enabled for both Vulkan/GLES shaders for Android.
Multiple location remapping passes were removed: one was overriding another one results + not needed now due to arrays being removed by the scalarization pass.

#rb carl.lloyd, denys.mentiei
[FYI] Dmitriy.Dyomin, Allan.Bentham

[CL 34122278 by laura hermanns in ue5-main branch]
2024-06-05 09:24:38 -04:00
laura hermanns
434f0c3b84 [Backout] - CL34098261
[FYI] denys.mentiei
Original CL Desc
-----------------------------------------------------------------
[Shaders] SPIRV-Tools pass rewrite

Interface variable scalar replacement pass rewrite (added as a new pass into spirv-opt, will replace existing one in future).

Things done so far:
- Rewritten to properly handle non-aggregate types and other tricky cases (both for Patch decorated variables and not)
- Matrix scalarization is now optional.
- More test cases added
- Path is now exposed as a command-line flag
- Fixed https://github.com/KhronosGroup/SPIRV-Tools/issues/4795

Few shaders contained loops, which were not unrolled, leading to the scalarization pass to fail. Loops were not unrolled due to "complex" condition expression. Those are changed to be accepted by the loop unroller (induction variable is the only lhs in the condition expression now).

This new pass is now always enabled for both Vulkan/GLES shaders for Android.
Multiple location remapping passes were removed: one was overriding another one results + not needed now due to arrays being removed by the scalarization pass.

#rb carl.lloyd, Laura.Hermanns
[FYI] Dmitriy.Dyomin, Allan.Bentham

[CL 34107760 by laura hermanns in ue5-main branch]
2024-06-04 17:30:47 -04:00
denys mentiei
802971f9b4 [Shaders] SPIRV-Tools pass rewrite
Interface variable scalar replacement pass rewrite (added as a new pass into spirv-opt, will replace existing one in future).

Things done so far:
- Rewritten to properly handle non-aggregate types and other tricky cases (both for Patch decorated variables and not)
- Matrix scalarization is now optional.
- More test cases added
- Path is now exposed as a command-line flag
- Fixed https://github.com/KhronosGroup/SPIRV-Tools/issues/4795

Few shaders contained loops, which were not unrolled, leading to the scalarization pass to fail. Loops were not unrolled due to "complex" condition expression. Those are changed to be accepted by the loop unroller (induction variable is the only lhs in the condition expression now).

This new pass is now always enabled for both Vulkan/GLES shaders for Android.
Multiple location remapping passes were removed: one was overriding another one results + not needed now due to arrays being removed by the scalarization pass.

#rb carl.lloyd, Laura.Hermanns
[FYI] Dmitriy.Dyomin, Allan.Bentham

[CL 34100366 by denys mentiei in ue5-main branch]
2024-06-04 13:59:11 -04:00
christopher waters
320aed67bc Reducing allocations when using FShaderParameterMap
- TCHAR* arguments were being used to find elements in a TMap<FString,..> which creates temporary memory allocations.
- We can use FStringView with FindByHash/RemoveByHash to prevent temporary allocations.
- Adding FShaderParameterMap::FindAndRemoveParameterAllocation as a shortcut for Find+Remove (which Uniform Buffer member handling does).
- Fixing a few locations that were going FString->TCHAR*->FString.

#rb Laura.Hermanns

[CL 34065428 by christopher waters in ue5-main branch]
2024-06-03 10:21:45 -04:00
jeannoe morissette
cda501615d VulkanRHI: Remove unused data in shader header. Remove FVulkanShaderHeader::EType and use EShaderParameterType directly instead, removes the need for an extra array in shader compiler.
#jira UE-215948
#rnx

[CL 33990347 by jeannoe morissette in ue5-main branch]
2024-05-29 18:30:40 -04:00
jeannoe morissette
a8ac71a367 VulkanRHI: Clean up shader structures. Remove unused FVulkanBindingTable and EVulkanBindingType. Adding ShaderStage::EStage::NumGraphicsStages to eventually replace ::NumStages where appropriate. Start simplifying VulkanShaderCompiler to remove some back and forth caused by legacy code paths. (WIP)
#rb florian.penzkofer, Laura.Hermanns
#rnx

[CL 33674263 by jeannoe morissette in ue5-main branch]
2024-05-15 18:38:27 -04:00
zach bethel
0674d30d69 Added SRVNonPixel, SHADER_PARAMETER_RDG_NON_PIXEL_SRV, and modified RDG_TEXTURE_ACCESS to support texture subresources.
- SRVNonPixel is needed by mobile to insert a barrier between fragment -> vertex texture fetch, but since this is a heavyweight barrier, it is opt-in with SHADER_PARAMETER_RDG_NON_PIXEL_SRV.
 - Small refactor to FRDGTextureAccess to allow for arbitrary subresources, as the current model only allows full resource transitions.

#rb mihnea.balta, luke.thatcher, serge.bernier
#jira UE-211883

[CL 33179861 by zach bethel in ue5-main branch]
2024-04-23 17:02:48 -04:00
jeannoe morissette
fcde1b58c4 VulkanRHI: Always remove dead code from Vulkan ray tracing shaders (necessary to remove the unused entrypoints).
#rb dan.elksnitis
#rnx

[CL 32901455 by jeannoe morissette in ue5-main branch]
2024-04-11 15:08:46 -04:00
jeannoe morissette
0e683e27ce VulkanRHI: fix Vulkan ray tracing to use indices in shader record for bindless HitGroupSystemIndexBuffer and HitGroupSystemVertexBuffer.
#rb christopher.waters
#rnx

[CL 32896240 by jeannoe morissette in ue5-main branch]
2024-04-11 13:24:57 -04:00
jeannoe morissette
98f1f6fef7 VulkanRHI: Fix some errors in Vulkan ray tracing shader compilation.
[FYI] Laura.Hermanns, christopher.waters

[CL 32778051 by jeannoe morissette in ue5-main branch]
2024-04-05 19:18:00 -04:00
christopher waters
dd2f49d25c Adding RHIResourceCollection RHI resource type which can store bindless indices in a buffer.
#rb Luke.Thatcher

[CL 32764889 by christopher waters in ue5-main branch]
2024-04-05 13:22:22 -04:00