UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RenderGraphEvent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
9#include "HAL/Platform.h"
10#include "HAL/PlatformCrt.h"
12#include "MultiGPU.h"
17#include "RHI.h"
18#include "RHICommandList.h"
21#include "RendererInterface.h"
22#include "Stats/Stats.h"
24#include "UObject/NameTypes.h"
25
27//
28// GPU Events - Named hierarchical events emitted to external profiling tools.
29//
31
32class FRDGScopeState;
33
37class FRDGEventName final
38{
39public:
40 FRDGEventName() = default;
41
42 // Constructors require a string that matches the RDG builder lifetime, as copies are not made in all configurations.
43 RENDERCORE_API explicit FRDGEventName(const TCHAR* EventFormat, ...);
45
48
49 RENDERCORE_API const TCHAR* GetTCHAR() const;
50
51 bool HasFormattedString() const
52 {
53 #if RDG_EVENTS == RDG_EVENTS_STRING_COPY
54 return !FormattedEventName.IsEmpty();
55 #else
56 return false;
57 #endif
58 }
59
60private:
61#if RDG_EVENTS >= RDG_EVENTS_STRING_REF
62 // Event format kept around to still have a clue what error might be causing the problem in error messages.
63 const TCHAR* EventFormat = TEXT("");
64#endif
65
66#if RDG_EVENTS == RDG_EVENTS_STRING_COPY
67 FString FormattedEventName;
68#endif
69};
70
71
72
74{
75 None = 0,
76
77 // Disables any nested scopes of the same type.
78 Final = 1 << 0,
79
80 // Ensures the scope is always emitted (ignores cvars that disable scopes)
81 AlwaysEnable = 1 << 1,
82
83 // The scope includes a GPU stat, so may need to be enabled even when cvars are disabling scopes.
84 Stat = 1 << 2,
85};
87
88#if HAS_GPU_STATS && (RHI_NEW_GPU_PROFILER == 0)
89// Scope type for the legacy "realtime" GPU profiler and draw call counter stats
90struct FRDGScope_GPU
91{
94
95 FName StatName;
96 TStatId StatId;
97 FString StatDescription;
98
100 FRHIDrawStatsCategory const* CurrentCategory = nullptr;
102
103 inline FRDGScope_GPU(FRDGScopeState& State, FRHIGPUMask GPUMask, const FName& CsvStatName, const TStatId& Stat, const TCHAR* Description, FRHIDrawStatsCategory const& Category);
104 inline ~FRDGScope_GPU();
105
106 inline void ImmediateEnd(FRDGScopeState& State);
107
108 inline void BeginCPU(FRHIComputeCommandList& RHICmdList, bool bPreScope);
109 inline void EndCPU (FRHIComputeCommandList& RHICmdList, bool bPreScope);
110
111 inline void BeginGPU(FRHIComputeCommandList& RHICmdList);
112 inline void EndGPU (FRHIComputeCommandList& RHICmdList);
113};
114#endif // HAS_GPU_STATS && (RHI_NEW_GPU_PROFILER == 0)
115
116#if CSV_PROFILER_STATS
118{
119 const char* const StatName;
120
121 FRDGScope_CSVExclusive(FRDGScopeState&, const char* StatName)
122 : StatName(StatName)
123 {
124 FCsvProfiler::BeginExclusiveStat(StatName);
125 }
126
127 void ImmediateEnd(FRDGScopeState&)
128 {
129 FCsvProfiler::EndExclusiveStat(StatName);
130 }
131
132 void BeginCPU(FRHIComputeCommandList& RHICmdList, bool bPreScope)
133 {
134 FCsvProfiler::BeginExclusiveStat(StatName);
135 }
136
137 void EndCPU(FRHIComputeCommandList& RHICmdList, bool bPreScope)
138 {
139 FCsvProfiler::EndExclusiveStat(StatName);
140 }
141
142 void BeginGPU(FRHIComputeCommandList& RHICmdList)
143 {
144 }
145
146 void EndGPU(FRHIComputeCommandList& RHICmdList)
147 {
148 }
149};
150#endif // CSV_PROFILER_STATS
151
167
168#if RDG_EVENTS
169
170 // Scope type for inserting named events on the CPU and GPU timelines.
171 class FRDGScope_RHI
172 {
173 FRHIBreadcrumbNode* Node = nullptr;
174
175 inline FRDGScope_RHI(FRDGScopeState& State, FRHIBreadcrumbNode* Node);
176
177 public:
178 template <typename TDesc, typename... TValues>
180
181 inline void ImmediateEnd(FRDGScopeState& State);
182
183 void BeginCPU(FRHIComputeCommandList& RHICmdList, bool bPreScope)
184 {
185 if (Node)
186 {
187 RHICmdList.BeginBreadcrumbCPU(Node, !bPreScope);
188 if (!bPreScope)
189 {
190 RHICmdList.BeginBreadcrumbGPU(Node, RHICmdList.GetPipeline());
191 }
192 }
193 }
194
195 void EndCPU(FRHIComputeCommandList& RHICmdList, bool bPreScope)
196 {
197 if (Node)
198 {
199 if (!bPreScope)
200 {
201 RHICmdList.EndBreadcrumbGPU(Node, RHICmdList.GetPipeline());
202 }
203 RHICmdList.EndBreadcrumbCPU(Node, !bPreScope);
204 }
205 }
206
207 // Nothing to do for Begin/EndGPU. The RHI API only requires breadcrumbs to be
208 // begun/ended once, and will automatically fixup other pipelines whenever we switch.
209 void BeginGPU(FRHIComputeCommandList& RHICmdList) {}
210 void EndGPU (FRHIComputeCommandList& RHICmdList) {}
211
212 TCHAR const* GetTCHAR(FRHIBreadcrumb::FBuffer& Buffer) const
213 {
214 return Node->GetTCHAR(Buffer);
215 }
216 };
217
218#endif // RDG_EVENTS
219
220//
221// Main RDG scope class.
222//
223// A tree of these scopes is created by the render thread as the RenderGraph is built.
224// Each scope type implementation uses the following functions, which are called during different RDG phases:
225//
226// Constructor / ImmediateEnd() - Render thread timeline. Called once, either side of scoped graph building work.
227//
228// BeginCPU / EndCPU - Parallel threads. Called during RDG pass lambdas execution. Scopes may be
229// entered / exited multiple times depending on parallel pass set bucketing.
230//
231// BeginGPU / EndGPU - Parallel threads. Called once for each GPU pipeline the scope covers.
232// Used for inserting commands on the RHICmdList. The command list passed to
233// Begin / End may be different in each, depending on parallel pass set bucketing.
234//
236{
242
243 template <typename... TTypes>
245 {
247 TImpl Impl;
248
249 public:
250 template <typename TCallback>
251 void Dispatch(TCallback&& Callback)
252 {
253 size_t Index = Impl.GetIndex();
254 check(Index > 0);
255 ((Index == Impl.template IndexOfType<TTypes>() ? Callback(Impl.template Get<TTypes>()),0 : 0), ...);
256 }
257
258 template <typename TScopeType, typename... TArgs>
259 void Emplace(TArgs&&... Args)
260 {
261 Impl.template Emplace<TScopeType>(Forward<TArgs>(Args)...);
262 }
263
264 template <typename TScopeType>
265 static constexpr SIZE_T GetTypeIndex()
266 {
267 return TImpl::template IndexOfType<TScopeType>();
268 }
269
270 template <typename TScopeType>
272 {
273 return Impl.GetIndex() == Impl.template IndexOfType<TScopeType>()
274 ? &Impl.template Get<TScopeType>()
275 : nullptr;
276 }
277
278 template <typename TScopeType>
279 TScopeType const* Get() const
280 {
281 return const_cast<TStorage&>(*this).Get<TScopeType>();
282 }
283 };
284
285 typedef TStorage<
287#if RDG_EVENTS
289#endif
290#if HAS_GPU_STATS && (RHI_NEW_GPU_PROFILER == 0)
292#endif
293#if CSV_PROFILER_STATS
295#endif
297
299
300 template <typename TScopeType>
301 static constexpr uint32 GetTypeMask()
302 {
303 return 1u << FStorage::GetTypeIndex<TScopeType>();
304 }
305
306#if RDG_ENABLE_TRACE
307 bool bVisited = false;
308#endif
309
313
314 void ImmediateEnd(FRDGScopeState& State) { Impl.Dispatch([&](auto& Scope) { Scope.ImmediateEnd(State); }); }
315
316 void BeginCPU(FRHIComputeCommandList& RHICmdList, bool bPreScope) { Impl.Dispatch([&](auto& Scope) { Scope.BeginCPU(RHICmdList, bPreScope); }); }
317 void BeginGPU(FRHIComputeCommandList& RHICmdList ) { Impl.Dispatch([&](auto& Scope) { Scope.BeginGPU(RHICmdList ); }); }
318 void EndCPU (FRHIComputeCommandList& RHICmdList, bool bPreScope) { Impl.Dispatch([&](auto& Scope) { Scope.EndCPU (RHICmdList, bPreScope); }); }
319 void EndGPU (FRHIComputeCommandList& RHICmdList ) { Impl.Dispatch([&](auto& Scope) { Scope.EndGPU (RHICmdList ); }); }
320
321 template <typename TScopeType> TScopeType * Get() { return Impl.Get<TScopeType>(); }
322 template <typename TScopeType> TScopeType const* Get() const { return Impl.Get<TScopeType>(); }
323
324 FString GetFullPath(FRDGEventName const& PassName);
325};
326
327template <typename TScopeType>
329{
330 FRDGScopeState& State;
331 FRDGScope* const Scope;
332
335
336public:
337 template <typename... TArgs>
339 inline ~TRDGEventScopeGuard();
340
341private:
342 static constexpr uint32 TypeMask = 1u << FRDGScope::FStorage::GetTypeIndex<TScopeType>();
343};
344
345
352#if RDG_EVENTS
353
354 namespace UE::RHI::Breadcrumbs::Private
355 {
356 template <>
357 struct TValue<FRDGEventName>
358 {
359 static constexpr bool bValidType = true;
360
361 TCHAR const* StringPointer;
362 TCHAR StringStorage[FRHIBreadcrumb::MaxLength];
363
364 TValue(FRDGEventName const& Value)
365 {
366 if (Value.HasFormattedString())
367 {
368 // We must take a string copy as RHI breadcrumb TValues must be trivially destructable.
371 }
372 else
373 {
374 StringPointer = Value.GetTCHAR();
375 }
376 }
377
378 struct FConvert
379 {
380 TCHAR const* Inner;
381 FConvert(TValue const& Value)
383 {}
384 };
385
387 {
388 Serializer.AppendValue(StringPointer);
389 }
390 };
391
392 // Type to force the selection of the below TValue specialization.
393 struct FRDGFormatTag {};
394
395 template <typename... TValues>
396 struct TValue<std::tuple<FRDGFormatTag&, TValues...>>
397 {
398 static constexpr bool bValidType = true;
399
400 TCHAR Value[FRHIBreadcrumb::MaxLength];
401
402 TValue(std::tuple<FRDGFormatTag&, TValues...> const& Wrapper)
403 {
404 std::apply([this](FRDGFormatTag&, auto&& FormatString, auto&&... Values)
405 {
406 FCString::Snprintf(Value, UE_ARRAY_COUNT(Value), FormatString, std::forward<decltype(Values)>(Values)...);
407 }, Wrapper);
408 }
409
410 struct FConvert
411 {
412 TCHAR const* Inner;
413 FConvert(TValue const& Value)
414 : Inner(Value.Value)
415 {}
416 };
417
419 {
420 Serializer.AppendValue(Value);
421 }
422 };
423 }
424
425 // Returns an RHI breadcrumb initializer appropriate for the given varargs.
426 #define RDG_BREADCRUMB_DESC_FORWARD_VALUES(StaticName, FormatString, GPUStatArgs) \
427 [&](UE::RHI::Breadcrumbs::Private::FRDGFormatTag&& Tag, auto&&... Values) -> auto \
428 { \
429 using namespace UE::RHI::Breadcrumbs::Private; \
430 if constexpr (std::is_same_v<TRemoveCVRef<decltype(FormatString)>, FRDGEventName>) \
431 { \
432 /* Single FRDGEventName */ \
433 static_assert(sizeof...(Values) == 0, "Unexpected additional arguments"); \
434 return RHI_BREADCRUMB_DESC_FORWARD_VALUES(StaticName, FForceNoSprintf(), GPUStatArgs)( \
435 std::forward<decltype(FormatString)>(FormatString) \
436 ); \
437 } \
438 else if constexpr (TIsValidArgs<decltype(Values)...>::Value) \
439 { \
440 /* Varargs are compatible with RHI breadcrumbs. Forward the args directly. */ \
441 return RHI_BREADCRUMB_DESC_FORWARD_VALUES(StaticName, FormatString, GPUStatArgs)( \
442 std::forward<decltype(Values)>(Values)... \
443 ); \
444 } \
445 else \
446 { \
447 /* Args are not compatible with RHI breadcrumbs. Do the snprintf now */ \
448 return RHI_BREADCRUMB_DESC_COPY_VALUES(StaticName, FForceNoSprintf(), GPUStatArgs)( \
449 std::forward_as_tuple( \
450 Tag \
451 , FormatString \
452 , std::forward<decltype(Values)>(Values)... \
453 ) \
454 ); \
455 } \
456 }
457
458 #define RDG_EVENT_SCOPE_CONSTRUCT(ObjectName, GraphBuilder, Condition, ScopeFlags, GPUStatArgs, StaticName, FormatString, ...) \
459 do \
460 { \
461 if ((Condition) && ((GraphBuilder).ShouldAllocScope((ObjectName), ScopeFlags))) \
462 { \
463 (ObjectName).Emplace( \
464 (GraphBuilder) \
465 , ScopeFlags \
466 , RDG_BREADCRUMB_DESC_FORWARD_VALUES( \
467 StaticName \
468 , FormatString \
469 , GPUStatArgs \
470 )(UE::RHI::Breadcrumbs::Private::FRDGFormatTag(), ##__VA_ARGS__) \
471 ); \
472 } \
473 } while (false)
474
475 #define RDG_EVENT_SCOPE_IMPL(GraphBuilder, Condition, ScopeFlags, GPUStatArgs, StaticName, FormatString, ...) \
476 TOptional<TRDGEventScopeGuard<FRDGScope_RHI>> PREPROCESSOR_JOIN(__RDG_ScopeRef_, __LINE__); \
477 RDG_EVENT_SCOPE_CONSTRUCT( \
478 PREPROCESSOR_JOIN(__RDG_ScopeRef_, __LINE__) \
479 , GraphBuilder \
480 , Condition \
481 , ScopeFlags \
482 , GPUStatArgs \
483 , StaticName \
484 , FormatString \
485 , ##__VA_ARGS__ \
486 )
487
488 #if WITH_RHI_BREADCRUMBS_FULL
489
490 #if RDG_EVENTS >= RDG_EVENTS_STRING_COPY
491 #define RDG_SCOPE_ARGS(Format, ...) TEXT(Format), ##__VA_ARGS__
492 #else
493 #define RDG_SCOPE_ARGS(Format, ...) nullptr
494 #endif
495
496 // Skip expensive string formatting for the relatively common case of no varargs. We detect this by stringizing the varargs and checking if the string is non-empty (more than just a null terminator).
497 #define RDG_EVENT_NAME(Format, ...) (sizeof(#__VA_ARGS__ "") > 1 ? FRDGEventName(TEXT(Format), ##__VA_ARGS__) : FRDGEventName(1, TEXT(Format)))
498
499 #define RDG_EVENT_SCOPE( GraphBuilder, Format, ...) RDG_EVENT_SCOPE_IMPL(GraphBuilder, true, ERDGScopeFlags::None , RHI_GPU_STAT_ARGS_NONE , TEXT(Format) , RDG_SCOPE_ARGS(Format, ##__VA_ARGS__))
500 #define RDG_EVENT_SCOPE_STAT( GraphBuilder, StatName, Format, ...) RDG_EVENT_SCOPE_IMPL(GraphBuilder, true, ERDGScopeFlags::Stat , RHI_GPU_STAT_ARGS(StatName), TEXT(Format) , RDG_SCOPE_ARGS(Format, ##__VA_ARGS__))
501 #define RDG_EVENT_SCOPE_CONDITIONAL( GraphBuilder, Condition, Format, ...) RDG_EVENT_SCOPE_IMPL(GraphBuilder, Condition, ERDGScopeFlags::None , RHI_GPU_STAT_ARGS_NONE , TEXT(Format) , RDG_SCOPE_ARGS(Format, ##__VA_ARGS__))
502 #define RDG_EVENT_SCOPE_CONDITIONAL_STAT(GraphBuilder, Condition, StatName, Format, ...) RDG_EVENT_SCOPE_IMPL(GraphBuilder, Condition, ERDGScopeFlags::Stat , RHI_GPU_STAT_ARGS(StatName), TEXT(Format) , RDG_SCOPE_ARGS(Format, ##__VA_ARGS__))
503 // The 'Final' version disables any further child scopes or pass events. It is intended to group overlapping passes as events can disable overlap on certain GPUs.
504 #define RDG_EVENT_SCOPE_FINAL( GraphBuilder, Format, ...) RDG_EVENT_SCOPE_IMPL(GraphBuilder, true, ERDGScopeFlags::Final, RHI_GPU_STAT_ARGS_NONE , TEXT(Format) , RDG_SCOPE_ARGS(Format, ##__VA_ARGS__))
505 // Used in places which have an existing FRDGEventName, e.g. RDG pass name scopes. Prefer to use the other RDG scope macros instead.
506 #define RDG_EVENT_SCOPE_CONDITIONAL_NAME(GraphBuilder, Condition, EventName ) RDG_EVENT_SCOPE_IMPL(GraphBuilder, Condition, ERDGScopeFlags::None , RHI_GPU_STAT_ARGS_NONE , TEXT("RDGEvent"), EventName)
507
508 #else // WITH_RHI_BREADCRUMBS_MINIMAL
509
510 //
511 // Keep only the STAT RDG scopes enabled in MINIMAL mode.
512 // Also disable the varargs. We don't capture the format strings and varargs in MINIMAL mode
513 //
514
515 #define RDG_EVENT_NAME(Format, ...) FRDGEventName()
516
517 #define RDG_EVENT_SCOPE_STAT( GraphBuilder, StatName, Format, ...) RDG_EVENT_SCOPE_IMPL(GraphBuilder, true, ERDGScopeFlags::Stat , RHI_GPU_STAT_ARGS(StatName), TEXT(Format), nullptr)
518 #define RDG_EVENT_SCOPE_CONDITIONAL_STAT(GraphBuilder, Condition, StatName, Format, ...) RDG_EVENT_SCOPE_IMPL(GraphBuilder, Condition, ERDGScopeFlags::Stat , RHI_GPU_STAT_ARGS(StatName), TEXT(Format), nullptr)
519
520 #define RDG_EVENT_SCOPE( GraphBuilder, Format, ...) do { } while (false)
521 #define RDG_EVENT_SCOPE_CONDITIONAL( GraphBuilder, Condition, Format, ...) do { } while (false)
522 #define RDG_EVENT_SCOPE_FINAL( GraphBuilder, Format, ...) do { } while (false)
523 #define RDG_EVENT_SCOPE_CONDITIONAL_NAME(GraphBuilder, Condition, EventName ) do { } while (false)
524
525 #endif
526
527#else
528
529 #define RDG_EVENT_NAME(...) FRDGEventName()
530
531 #define RDG_EVENT_SCOPE(...) do { } while (false)
532 #define RDG_EVENT_SCOPE_STAT(...) do { } while (false)
533 #define RDG_EVENT_SCOPE_CONDITIONAL(...) do { } while (false)
534 #define RDG_EVENT_SCOPE_CONDITIONAL_STAT(...) do { } while (false)
535 #define RDG_EVENT_SCOPE_FINAL(...) do { } while (false)
536 #define RDG_EVENT_SCOPE_CONDITIONAL_NAME(...) do { } while (false)
537
538#endif
539
540#if HAS_GPU_STATS && (RHI_NEW_GPU_PROFILER == 0)
541 #define RDG_GPU_STAT_SCOPE(GraphBuilder, StatName) TRDGEventScopeGuard<FRDGScope_GPU> PREPROCESSOR_JOIN(__RDG_GPUStatEvent_##StatName,__LINE__) ((GraphBuilder), ERDGScopeFlags::AlwaysEnable, (GraphBuilder).RHICmdList.GetGPUMask(), CSV_STAT_FNAME(StatName), GET_STATID(Stat_GPU_##StatName), nullptr , DrawcallCountCategory_##StatName);
542 #define RDG_GPU_STAT_SCOPE_VERBOSE(GraphBuilder, StatName, Description) TRDGEventScopeGuard<FRDGScope_GPU> PREPROCESSOR_JOIN(__RDG_GPUStatEvent_##StatName,__LINE__) ((GraphBuilder), ERDGScopeFlags::AlwaysEnable, (GraphBuilder).RHICmdList.GetGPUMask(), CSV_STAT_FNAME(StatName), GET_STATID(Stat_GPU_##StatName), Description, DrawcallCountCategory_##StatName);
543#else
544 #define RDG_GPU_STAT_SCOPE(GraphBuilder, StatName)
545 #define RDG_GPU_STAT_SCOPE_VERBOSE(GraphBuilder, StatName, Description)
546#endif
547
548#if CSV_PROFILER_STATS
549 #define RDG_CSV_STAT_EXCLUSIVE_SCOPE(GraphBuilder, StatName) TRDGEventScopeGuard<FRDGScope_CSVExclusive> PREPROCESSOR_JOIN(__RDG_CSVStat_##StatName,__LINE__) ((GraphBuilder), ERDGScopeFlags::AlwaysEnable, #StatName);
550#else
551 #define RDG_CSV_STAT_EXCLUSIVE_SCOPE(GraphBuilder, StatName)
552#endif
553
555#define RDG_RHI_EVENT_SCOPE( GraphBuilder, Name) RDG_EVENT_SCOPE(GraphBuilder, #Name); RHI_BREADCRUMB_EVENT(GraphBuilder.RHICmdList, #Name)
556#define RDG_RHI_EVENT_SCOPE_STAT(GraphBuilder, Stat, Name) RDG_EVENT_SCOPE_STAT(GraphBuilder, Stat, #Name); RHI_BREADCRUMB_EVENT_STAT(GraphBuilder.RHICmdList, Stat, #Name)
557#define RDG_RHI_GPU_STAT_SCOPE( GraphBuilder, StatName) RDG_GPU_STAT_SCOPE(GraphBuilder, StatName); SCOPED_GPU_STAT(GraphBuilder.RHICmdList, StatName);
558
559namespace DynamicRenderScaling
560{
561 class FRDGScope final : public TRDGEventScopeGuard<FRDGScope_Budget>
562 {
563 public:
564 FRDGScope(FRDGScopeState& State, FBudget const& Budget)
566 {}
567 };
568
569} // namespace DynamicRenderScaling
570
572{
573 Disabled = 0,
574 TopLevelOnly = 1,
575 AllEvents = 2,
577};
578
580{
581protected:
582 struct FState
583 {
584 struct FRDGScope* Current = nullptr;
586
588
589 bool const bImmediate;
591
592#if RDG_EVENTS == RDG_EVENTS_NONE
594#else
596#endif
597
599
601
602 struct
603 {
604 // Allocator for all root graph allocations on the graph builder thread.
606
607 // Allocator for async pass and parallel execute setup.
609
610 // Allocator for all allocations related to states / transitions.
612
613 int32 GetByteCount() const
614 {
616 }
617
619
620public:
623
624#if WITH_RHI_BREADCRUMBS
625
626protected:
627 FRHIBreadcrumbNode* LocalCurrentBreadcrumb = FRHIBreadcrumbNode::Sentinel;
630
631public:
633
635 {
637 {
638 return RHICmdList.GetBreadcrumbAllocator();
639 }
640 else
641 {
642 if (!LocalBreadcrumbAllocator.IsValid())
643 {
645 }
646
648 }
649 }
650
651#endif // WITH_RHI_BREADCRUMBS
652
653public:
654 FRDGScopeState(FRHICommandListImmediate& InRHICmdList, bool bImmediate, bool bParallelExecute)
655 : ScopeState(bImmediate, bParallelExecute)
659#endif
660 {}
661
662 bool ShouldEmitEvents() const
663 {
665 }
666
667 template <typename TScopeType>
669
670 template <typename TScopeType>
673#if HAS_GPU_STATS && (RHI_NEW_GPU_PROFILER == 0)
674 friend FRDGScope_GPU;
675#endif
676#if RDG_EVENTS
677 friend FRDGScope_RHI;
678#endif
679 friend DynamicRenderScaling::FRDGScope;
680};
681
682#include "RenderGraphEvent.inl" // IWYU pragma: export
#define check(expr)
Definition AssertionMacros.h:314
@ InPlace
Definition CoreMiscDefines.h:162
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define WITH_RHI_BREADCRUMBS
Definition RHIBreadcrumbs.h:25
ERDGScopeMode
Definition RenderGraphEvent.h:572
ERDGScopeFlags
Definition RenderGraphEvent.h:74
#define UE_ARRAY_COUNT(array)
Definition UnrealTemplate.h:212
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition DynamicRenderScaling.h:83
Definition NameTypes.h:617
Definition RenderGraphAllocator.h:24
int32 GetByteCount() const
Definition RenderGraphAllocator.h:113
Definition RenderGraphEvent.h:38
RENDERCORE_API const TCHAR * GetTCHAR() const
Definition RenderGraphEvent.cpp:288
FRDGEventName(const FRDGEventName &Other)=default
FRDGEventName & operator=(const FRDGEventName &Other)=default
bool HasFormattedString() const
Definition RenderGraphEvent.h:51
FRDGEventName()=default
Definition RenderGraphPass.h:217
Definition RenderGraphEvent.h:580
FRDGAllocator Task
Definition RenderGraphEvent.h:608
struct FRDGScopeState::@1708 Allocators
bool ShouldAllocScope(TOptional< TRDGEventScopeGuard< TScopeType > > const &, ERDGScopeFlags Flags) const
Definition RenderGraphEvent.inl:180
FRDGAllocator Transition
Definition RenderGraphEvent.h:611
struct FRDGScopeState::FState ScopeState
FRHICommandListImmediate & RHICmdList
Definition RenderGraphEvent.h:622
FRDGAllocator Root
Definition RenderGraphEvent.h:605
FRDGScopeState(FRHICommandListImmediate &InRHICmdList, bool bImmediate, bool bParallelExecute)
Definition RenderGraphEvent.h:654
bool ShouldEmitEvents() const
Definition RenderGraphEvent.h:662
friend FRDGScope_Budget
Definition RenderGraphEvent.h:672
Definition RenderGraphEvent.h:245
TScopeType const * Get() const
Definition RenderGraphEvent.h:279
TScopeType * Get()
Definition RenderGraphEvent.h:271
static constexpr SIZE_T GetTypeIndex()
Definition RenderGraphEvent.h:265
void Dispatch(TCallback &&Callback)
Definition RenderGraphEvent.h:251
void Emplace(TArgs &&... Args)
Definition RenderGraphEvent.h:259
Definition RenderGraphEvent.cpp:12
ERHIPipeline GetPipeline() const
Definition RHICommandList.h:675
Definition RHICommandList.h:4626
Definition RHICommandList.h:2735
Definition RenderGraphEvent.h:329
~TRDGEventScopeGuard()
Definition RenderGraphEvent.inl:162
Definition RHIPipeline.h:55
Definition SharedPointer.h:692
Definition TVariant.h:48
Definition GpuProfilerTrace.h:69
RHI_API void AppendValue(const ANSICHAR *Value)
Definition GpuProfilerTrace.cpp:490
Definition DynamicRenderScaling.cpp:14
Definition ExpressionParserTypes.h:21
U16 Index
Definition radfft.cpp:71
Definition TVariant.h:29
Definition RenderGraphEvent.h:583
bool const bImmediate
Definition RenderGraphEvent.h:589
uint32 Mask
Definition RenderGraphEvent.h:587
static constexpr ERDGScopeMode const ScopeMode
Definition RenderGraphEvent.h:593
bool const bParallelExecute
Definition RenderGraphEvent.h:590
struct FRDGScope * Current
Definition RenderGraphEvent.h:584
DynamicRenderScaling::FBudget const * ActiveBudget
Definition RenderGraphEvent.h:585
Definition RenderGraphEvent.h:153
bool bPop
Definition RenderGraphEvent.h:156
RENDERCORE_API void BeginGPU(FRHIComputeCommandList &RHICmdList)
Definition RenderGraphEvent.cpp:351
void EndCPU(FRHIComputeCommandList &RHICmdList, bool bPreScope)
Definition RenderGraphEvent.h:162
RENDERCORE_API void EndGPU(FRHIComputeCommandList &RHICmdList)
Definition RenderGraphEvent.cpp:359
RENDERCORE_API void ImmediateEnd(FRDGScopeState &State)
Definition RenderGraphEvent.cpp:343
class FRDGTimingFrame * Frame
Definition RenderGraphEvent.h:154
int32 ScopeId
Definition RenderGraphEvent.h:155
void BeginCPU(FRHIComputeCommandList &RHICmdList, bool bPreScope)
Definition RenderGraphEvent.h:161
Definition RenderGraphEvent.h:236
TScopeType * Get()
Definition RenderGraphEvent.h:321
void EndGPU(FRHIComputeCommandList &RHICmdList)
Definition RenderGraphEvent.h:319
void BeginCPU(FRHIComputeCommandList &RHICmdList, bool bPreScope)
Definition RenderGraphEvent.h:316
void EndCPU(FRHIComputeCommandList &RHICmdList, bool bPreScope)
Definition RenderGraphEvent.h:318
FRDGScope(FRDGScope *Parent)
Definition RenderGraphEvent.h:310
TStorage< FRDGScope_Budget > FStorage
Definition RenderGraphEvent.h:296
TRHIPipelineArray< FRDGPass * > GPULastPass
Definition RenderGraphEvent.h:241
TRHIPipelineArray< FRDGPass * > GPUFirstPass
Definition RenderGraphEvent.h:240
void BeginGPU(FRHIComputeCommandList &RHICmdList)
Definition RenderGraphEvent.h:317
void ImmediateEnd(FRDGScopeState &State)
Definition RenderGraphEvent.h:314
FRDGPass * CPULastPass
Definition RenderGraphEvent.h:239
FStorage Impl
Definition RenderGraphEvent.h:298
FString GetFullPath(FRDGEventName const &PassName)
Definition RenderGraphEvent.cpp:313
TScopeType const * Get() const
Definition RenderGraphEvent.h:322
static constexpr uint32 GetTypeMask()
Definition RenderGraphEvent.h:301
FRDGPass * CPUFirstPass
Definition RenderGraphEvent.h:238
FRDGScope *const Parent
Definition RenderGraphEvent.h:237
Definition RHIStats.h:110
Definition MultiGPU.h:33
static int32 Snprintf(CharType *Dest, int32 DestSize, const FmtType &Fmt, Types... Args)
Definition CString.h:581
static CharType * Strncpy(CharType *Dest, const CharType *Src, SIZE_T MaxLen)
Definition CString.h:991
Definition Optional.h:131
Definition LightweightStats.h:416