292 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
Ryan Hummer
4af2fd066d Updating Dev-Release-5.5 from Main at CL #36144969
#okforversepublic

[CL 36146571 by Ryan Hummer in Dev-5.5 branch]
2024-09-10 10:26:02 -04:00
jeannoe morissette
bea4d7e932 VulkanRHI: Add support for VK_KHR_ray_tracing_position_fetch and require it on Windows/Linux. Defer metadata buffer creation until needed.
#rb aleksander.netzel, Kenzo.Terelst
#rnx
#jira UE-219099

[CL 35875652 by jeannoe morissette in ue5-main branch]
2024-08-28 14:26:29 -04:00
JayLu2000
e04a0ccdd5 PR #12150: [MetaXR]: Integrate Adreno Offline Shader Compiler into UE
#jira UE-220969
#rnx
#rb Dmitriy.Dyomin, Florin.Pascu

[CL 35369646 by JayLu2000 in ue5-main branch]
2024-08-07 11:07:33 -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
jeannoe morissette
989a3ddabb VulkanRHI: fill EShaderResourceUsageFlags at shader compile time to accurately set FRHIShader flags at runtime (HasNoDerivates,ShaderBundles).
#rnx
#rb Laura.Hermanns

[CL 35154031 by jeannoe morissette in ue5-main branch]
2024-07-29 17:30:11 -04:00
jeannoe morissette
1bf8298535 VulkanRHI: Add "-fspv-use-legacy-buffer-matrix-order" to shader compilation flags to fix column vs row major reads from byteaddressbuffers. Fix Nanite skinning in Vulkan.
#rb daniele.vettorel, Laura.Hermanns
#rnx
#jira UE-219742

[CL 35146470 by jeannoe morissette in ue5-main branch]
2024-07-29 14:23:54 -04:00
dan elksnitis
0320312a2b [Backout] - CL35053495
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders]
- move population of output.target field into core code so each backend doesn't need to do it manually (do so before calling the compile function so any existing code expecting the output field to be set at any point during the compile process is unaffected)
- add a check in FShaderCompileJob::SerializeOutput and FShaderCompileJob::SerializeWorkerOutput that the FShaderTarget for a job output matches that of its input. This should catch cases of shaders with the wrong frequency being associated with jobs; further the callstack should indicate where this incorrect association is coming from (since SerializeOutput is called in different places for each cache path: duplicate in-flight jobs, jobs which hit in the in-memory job cache, and jobs which hit in the DDC cache, and SerializeWorkerOutput is only called when the job is read back from SCW output).

#rb Laura.Hermanns

[CL 35080902 by dan elksnitis in ue5-main branch]
2024-07-25 10:12:01 -04:00
dan elksnitis
ddbc683598 [shaders]
- move population of output.target field into core code so each backend doesn't need to do it manually (do so before calling the compile function so any existing code expecting the output field to be set at any point during the compile process is unaffected)
- add a check in FShaderCompileJob::SerializeOutput and FShaderCompileJob::SerializeWorkerOutput that the FShaderTarget for a job output matches that of its input. This should catch cases of shaders with the wrong frequency being associated with jobs; further the callstack should indicate where this incorrect association is coming from (since SerializeOutput is called in different places for each cache path: duplicate in-flight jobs, jobs which hit in the in-memory job cache, and jobs which hit in the DDC cache, and SerializeWorkerOutput is only called when the job is read back from SCW output).

#rb Laura.Hermanns

[CL 35053511 by dan elksnitis in ue5-main branch]
2024-07-24 10:09:55 -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