Files
UnrealEngineUWP/Engine/Plugins/VirtualProduction/TextureShare/Source
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
..