412 Commits

Author SHA1 Message Date
carl lloyd
906ea67138 Added missing entry for Metal 3.1 to GetMetalFamilyVersionString
#rb Mihnea.Balta
#jira UE-223695

[CL 37016311 by carl lloyd in 5.5 branch]
2024-10-10 08:16:49 -04:00
dan elksnitis
5bcff15345 [shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.
resubmit with following fixes:
- static analysis error which caught an >=0 check on a uint64 which should have been >0
- fix for an inverted guard on multiprocess cook sending bytecode to director (was only sending code across if empty instead of non-empty)
- fix for uninitialized padding in the FShaderCodeResource::FHeader struct causing nondeterministic puts
- fix for incorrect size passed to job cache hashing on receiving buffers from DDC

#rb Devin.Doucette, Laura.Hermanns, Zousar.Shaker
#lockdown Marc.Audy

[CL 36754792 by dan elksnitis in 5.5 branch]
2024-10-01 19:02:22 -04:00
dan elksnitis
fd01802612 [Backout] - CL36470025
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.

#rb Devin.Doucette, Zousar.Shaker
#lockdown Marc.Audy
resubmit with SA+MP cook fix

[CL 36747522 by dan elksnitis in 5.5 branch]
2024-10-01 17:45:02 -04:00
dan elksnitis
8c666d2108 [shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.
#rb Devin.Doucette, Zousar.Shaker
#lockdown Marc.Audy

resubmit with SA+MP cook fix

[CL 36746984 by dan elksnitis in 5.5 branch]
2024-10-01 17:40:02 -04:00
dan elksnitis
c02d3f0517 [Backout] - CL36437712
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.

#rb Zousar.Shaker
#lockdown marc.audy

[CL 36440265 by dan elksnitis in 5.5 branch]
2024-09-19 13:16:02 -04:00
dan elksnitis
c7dfb5d9b6 [shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.
#rb Zousar.Shaker
#lockdown marc.audy

[CL 36437741 by dan elksnitis in 5.5 branch]
2024-09-19 12:21:59 -04:00
florian penzkofer
77ae86207a Use min16float precision in mobile preview
#rb carl.lloyd, Laura.Hermanns
#jira UE-213149

[CL 35935275 by florian penzkofer in ue5-main branch]
2024-08-30 15:41:56 -04:00
steve robb
1be01bcb1a Renamed container allocator function parameters to make them less ambiguous about whether they refer to a current state or new (desired) state, and refer to the 'num' (how many elements are constructed inside an allocation) or the 'max' (the total number of elements that the allocation could hold), as it was unclear.
Added a comment to clarify that TNonRelocatableInlineAllocator is itself non-trivially-relocatable, not that it's for non-trivially-relocatable elements.

#rb devin.doucette

[CL 35869531 by steve robb in ue5-main branch]
2024-08-28 11:34:16 -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
alex kahn
9eaacc953a [Backout] - CL34912307 - CIS Valk Error
#rnx
[FYI] ben.clayton
Original CL Desc
-----------------------------------------------------------------
[AutoRTFM] Migrate more critical sections to using the transactionally safe variants.

#rb neil.henning

[CL 34914957 by alex kahn in ue5-main branch]
2024-07-18 17:03:37 -04:00
ben clayton
413ba81556 [AutoRTFM] Migrate more critical sections to using the transactionally safe variants.
#rb neil.henning

[CL 34912428 by ben clayton in ue5-main branch]
2024-07-18 15:43:46 -04:00
tom holmes
3abe8cbada Fix Shader SymbolsInfo Causing Non-Determinism and Defeating Deduplication
Info is now stored in shader map in editor only data alongside platform data
Includes shader bump

#jira UE-218748
#rb dan.elksnitis
#tests local tests on Lyra cooking and DDC-Verify
[FYI] Zousar.Shaker

[CL 34906103 by tom holmes in ue5-main branch]
2024-07-18 13:35:59 -04:00
dan elksnitis
49e65b9086 [shaders]
- add strings as an option for shader statistics, and a flags member/option to hide specific shader statistics from UI (so we can use statistics for other internal usage)
- add debug output for shader platform hashes (use to track down cases of shader job output which has identical bytecode but differing metadata), using the above to record a stat containing the shader hash computed by the compiler. currently only implemented for a subset of platforms
- fix a bug in shader diagnostic remapping for cache hits - the value stored in the cache/DDC for a job should contain non-remapped diagnostics (so cache hits can properly remap them to their version of the unstripped shader code). this also slightly improves deduplication within the job cache/DDC. fixed by storing the job output in the cache/DDC before running the job oncomplete callback (which performs the remapping)
- cleanup dxc hash retrieval code to use actual type instead of hacking around with an offset into the opaque blob

#rb Jason.Nadro

[CL 34864220 by dan elksnitis in ue5-main branch]
2024-07-17 08:55:02 -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
steve robb
7e54d6b019 Fixed wrong FString constructor being used to construct from a range.
#rb james.hopkin

[CL 34600674 by steve robb in ue5-main branch]
2024-06-24 06:49:39 -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
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
stu mckenna
8ae75bcbb6 [Backout] - CL33681066
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33671805
[FYI] stu.mckenna
Original CL Desc
-----------------------------------------------------------------
- Fix for AddUsedInputMembers having inverted source / destination for arrays

#rb Laura.Hermanns

[CL 33726075 by stu mckenna in ue5-main branch]
2024-05-17 11:55:38 -04:00
bob tellez
6aeccfaf4e [Backout] - CL33671805
[FYI] stu.mckenna
Original CL Desc
-----------------------------------------------------------------
- Fix for AddUsedInputMembers having inverted source / destination for arrays

#rb Laura.Hermanns

[CL 33681068 by bob tellez in ue5-main branch]
2024-05-16 03:24:36 -04:00
stu mckenna
da68d46d3d - Fix for AddUsedInputMembers having inverted source / destination for arrays
#rb Laura.Hermanns

[CL 33671939 by stu mckenna in ue5-main branch]
2024-05-15 17:38:28 -04:00
aleksander netzel
d33a06efeb HWRT: Reducing RHI_RAYTRACING throughout the engine - Editor
#jira UE-213513

[CL 33441267 by aleksander netzel in ue5-main branch]
2024-05-03 19:21:04 -04:00
laura hermanns
ca07d105fc [Shaders] Remove unused state in FShaderConductorContext and ignore unknown attributes in shader backends.
This adds "-Wno-unknown-attributes" to DXC backends and platform specific compiler argument to their respective backend.

#rnx
#rb Yuriy.ODonnell

[CL 33437776 by laura hermanns in ue5-main branch]
2024-05-03 17:13:42 -04:00