Commit Graph

107 Commits

Author SHA1 Message Date
wyatt marvil
f3f58b48d4 [ComputeFramework] Always initialize KernelResources in BeginCacheForCookedPlatformData
* Prevents crash when cooking without calling UpdateResources()

#rb adrien.logut, huw.bowles, Jeremy.Moore, julien.lheureux, ryan.buehler
#jira UE-225285

[CL 36754287 by wyatt marvil in 5.5 branch]
2024-10-01 18:58:16 -04:00
john vanderburg
dbd73ea8bc Added some safety checks to compute graph/optimus to prevent crashes on nullptr.
#rb jack.cai

[CL 36258051 by john vanderburg in 5.5 branch]
2024-09-13 03:10:55 -04:00
dan elksnitis
c4deae64ff [shaders] bytecode sharing between shader and shadermap DDC buckets
- create utility classes (serialization context objects) which allow serialization of shader code blobs independently of "shader object" (i.e. whatever type of thing we're pushing to the cache, shader job or shader map) structure
- commonize bytecode format in cache entries for shadermap and shader DDC (FShaderCodeResource struct)
- rework per-shader caching to use the serialization helpers to separate serialization of job output struct data and bytecode
- rework material and global shadermap DDC serialization to use the serialization helpers to separate serialization of shadermap structural data and bytecode

#rb Laura.Hermanns, Zousar.Shaker
#jira UE-196556

(resubmit with monolithic build fix)

[CL 36153164 by dan elksnitis in 5.5 branch]
2024-09-10 13:06:22 -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
huw bowles
9425ccc3f3 [Compute Framework] Add post graph dispatch virtual function that can be used to perform post execution actions.
#rb Jeremy.Moore
#rnx

[CL 36032864 by huw bowles in ue5-main branch]
2024-09-05 04:00:28 -04:00
luke thatcher
9fb339dda6 Fix macros for RDG GPU stats to support new GPU profiler
- The new GPU profiler uses TStatIDs inside RHI breadcrumbs to assign GPU time to individual stats. As such, we need to pass the stat in the macro that generates the breadcrumb:
 -    1. Whenever a SCOPED_GPU_STAT macro is used, add the stat to the matching SCOPED_DRAW_EVENT if present (or add a scope if there wasn't one), and replace with RHI_BREADCRUMB_EVENT_STAT.
 -    2. Whenever a RDG_GPU_STAT_SCOPE macro is used, add the stat to the matching RDG_EVENT_SCOPE if present (or add a scope if there wasn't one), and replace with RDG_EVENT_SCOPE_STAT.
 -    3. Delete any commented-out scopes.

Additional fixes:
 - Moved DECLARE_GPU_STAT use inside functions to global scope. DECLARE_GPU_STAT is not meant to be used inline.
 - Replace *_GAMETHREAD macros with their RHI_BREADCRUMB equivalents, which also removes the TEXT macro wrapping the format string.
 - Fixed some incorrect uses of SCOPED_GPU_STAT on "GraphBuilder.RHICmdList" when only RDG passes are added, with no immediate RHICmdList work.

RDG_GPU_STAT_SCOPE and SCOPED_GPU_STAT are defined to be empty when the new GPU profiler is enabled. They have been kept to maintain backwards compatibility until we enable RHI_NEW_GPU_PROFILER permanently.

#rb zach.bethel
#jira UE-177299

[CL 35959201 by luke thatcher in ue5-main branch]
2024-09-02 16:02:23 -04:00
huw bowles
c716851dd8 [Compute Framework] Add cvar for triggering RD captures for 1 or more subsequent graph dispatches.
#rb Jeremy.Moore, wyatt.marvil
#rnx

[CL 35924526 by huw bowles in ue5-main branch]
2024-08-30 09:38:08 -04:00
dan elksnitis
de930a972b [shaders] shadermap serialization cleanup
- unify shadermap serialization params into a context object
- deprecate shader code inlining into shader maps; this is no longer needed internally (and should not be used by licensees) and removing it will simplify forthcoming changes related to how shader/shadermap DDC data is structured

#rb Jason.Nadro

[CL 35701243 by dan elksnitis in ue5-main branch]
2024-08-21 10:26:09 -04:00
jack cai
deee2620d2 [Deformer Graph & Control Rig] Added AddDeformer Node in control rig to allow control rigs to add deformers to the skeletal mesh component on demand
+minor rig vm graph pin default value fix & unit test

known issues:
- deformer asset soft ptr is serialized as trait pin default value, which means if the deformer asset is renamed or moved, the automaically fixup process are not triggered and no redirector is created



#jira UE-221053
#rb halfdan.ingvarsson, Helge.Mathee

[CL 35373985 by jack cai in ue5-main branch]
2024-08-07 13:29:12 -04:00
huw bowles
c81d47b8e9 [ShaderPreprocessor] Parse line directives. Apply line number and filename to parser state so that subsequent errors will have line numbers with offsets applied from line directives.
[ComputeFramework] Treat preprocessor issues as warnings if compile succeeded, otherwise errors, which is the standard rule.
[PCG] Adapt error summary to whatever line information is available in the error (if any).

#rb dan.elksnitis, Jeremy.Moore, Laura.Hermanns, wyatt.marvil
#rnx

[CL 35362997 by huw bowles in ue5-main branch]
2024-08-07 04:05:17 -04:00
rex hill
a0419b51c0 Fix struct initialize errors
#rnx
[FYI] Sergio.Gardeazabal

[CL 35223383 by rex hill in ue5-main branch]
2024-07-31 15:28:02 -04:00
robert millar
5ce711f9be Add shader map friendly name and vertex factory/shader type name to assertions
[CL 35087510 by robert millar in ue5-main branch]
2024-07-25 13:30:18 -04:00
huw bowles
6bf30239db [CF] Fix missed errors/warnings due to deduplication of line marker info within shader compiler
[PCG] Fix line numbers for errors/warnings and add them to the error summary when available.

#rb Jeremy.Moore, wyatt.marvil
#rnx

[CL 35012896 by huw bowles in ue5-main branch]
2024-07-23 04:19:04 -04:00
huw bowles
95976b63ac [CF] Add support for argument modifiers on data interface functions
[PCG] Add out params to GetThreadData to clean up this function

#rb Jeremy.Moore, wyatt.marvil
#rnx

[CL 34977145 by huw bowles in ue5-main branch]
2024-07-22 04:06:20 -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
jack cai
f28328fcaa [Deformer Graph] Added a new data interface "Advanced Skeleton" that supports additional features like accessing different skin weight profiles and access per-bone animation attribute
#jira UE-219110
#rb halfdan.ingvarsson

[CL 34745961 by jack cai in ue5-main branch]
2024-06-28 15:29:39 -04:00
jack cai
1b79e3f7e2 [Deformer Graph] Added support for array type variables
UI work to follow next

#rb halfdan.ingvarsson

[CL 34125617 by jack cai in ue5-main branch]
2024-06-05 11:04:31 -04:00
huw bowles
37137d2999 [Compute Framework] Added missing member initialisation
[CL 34066240 by huw bowles in ue5-main branch]
2024-06-03 10:50:45 -04:00
huw bowles
f37c9866b0 [Compute Framework] Add readback support as API through data interface
Readbacks are executed via FRHIGPUBufferReadback. FComputeGraphTaskWorker creates the readbacks and polls active readbacks each frame.

#rb Jeremy.Moore

[CL 34065992 by huw bowles in ue5-main branch]
2024-06-03 10:45:45 -04:00
anton dunchev
8b0b461407 [RHI] Added shader map and shader library listing commands that let you analyse the memory footprint of those structures.
[FYI] j.baumgartner
#rb serge.bernier
#tests local

[CL 34035856 by anton dunchev in ue5-main branch]
2024-05-31 13:17:18 -04:00
kenzo terelst
3df923dab2 - Add FShaderBindingLayout as RenderCore wrapper for FRHIShaderBindingLayout which can also cache static uniform buffer declerations used during shader code gen
- Add option for ShaderType to declare which FShaderBindingLayout needs to be used for shader gen and runtime binding
- Add helper function to generate FShaderBindingLayoutContainer from array of uniform buffers and EShaderResourceTableFlags (only supports bindless mode right now)
- Serialize the FRHIShaderBindingLayout in FShaderCompilerEnvironment so it can be used by the shader compiler backends
- FShaderBindingLayout can add required symbols to the FShaderCompilerInput which shouldn't be dead code eliminated (required for Shader resource table building)
- Serialize the hash of RHIShaderResourceTable in the platform specific shader binary data so it can be used during runtime RTPSO validation (all shaders in the RTPSO need the same RHIShaderResourceTable)
- Renamed pRootSignaure member to RootSignature (style guide)

#jira UE-212347

[CL 33624453 by kenzo terelst in ue5-main branch]
2024-05-14 04:49:23 -04:00
jack cai
c1f56dace8 [Compute Framework] added newline before kernel includes to avoid preprocessor failing to process those includes if a data interface's shader file does not end with an extra empty line
[CL 32798372 by jack cai in ue5-main branch]
2024-04-08 13:43:49 -04:00
kenzo terelst
f1c87d59e6 Add ShouldPrecachePermutation to FShaderType to check if shader permutation needs PSO precaching on startup - by default ShouldCompilePermutation is used
EShaderPermutationPrecacheRequest is returned to define if a permutation is required, not required or development only. Only required PSOs are precached.
DevelopmentOnly should be used for debug permutations and won't trigger an ensure when permutation is used at runtime which isn't requested for precaching.
Validation also runs in editor builds.

#rb christopher.waters

[CL 32297715 by kenzo terelst in ue5-main branch]
2024-03-18 07:49:34 -04:00
jack cai
84381e970c [Compute Graph] Additional fix to generated function shim hlsl when the Function Implementation has fewer input param than the wrap function
#jira UE-209301
#rb Jeremy.Moore

[CL 32134780 by jack cai in ue5-main branch]
2024-03-08 17:38:27 -05:00
jack cai
2ff63aa55f [Compute Framework] fix incorrect parameter indexing in function shim hlsl for data interface function with a return value.
#jira UE-209301
#rb Jeremy.Moore

[CL 32128573 by jack cai in ue5-main branch]
2024-03-08 14:53:42 -05:00