UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NaniteFeedback.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "GPUMessaging.h"
6
7
8namespace Nanite
9{
10#if !UE_BUILD_SHIPPING
12{
13 GPUMessage::FSocket StatusFeedbackSocket;
14 FDelegateHandle ScreenMessageDelegate;
15
16 struct FBufferState
17 {
18 double LatestOverflowTime = -MAX_dbl;
19 uint32 LatestOverflowPeak = 0;
20 uint32 HighWaterMark = 0;
21
22 bool Update(const uint32 Peak, const uint32 Capacity);
23 };
24
25 FBufferState NodeState;
26 FBufferState CandidateClusterState;
27 FBufferState VisibleClusterState;
28
29 // Must guard the (complex) data as the on-screen feedback delegate is called from the game thread.
30 FCriticalSection DelgateCallbackCS;
31
32 // Map to track non-nanite page area items that are shown on screen
33 struct FMaterialWarningItem
34 {
35 double LastTimeSeen = -MAX_dbl;
36 double LastTimeLogged = -MAX_dbl;
37 };
38 TMap<FString, FMaterialWarningItem> MaterialWarningItems;
39public:
42
43 uint32 GetStatusMessageId() const { return StatusFeedbackSocket.GetMessageId().GetIndex(); }
44
45 void ReportMaterialPerformanceWarning(const FString& MaterialName);
46
47};
48
50
51#endif
52
53} // namespace Nanite
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define MAX_dbl
Definition NumericLimits.h:31
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition IDelegateInstance.h:14
Definition GPUMessaging.h:40
const FMessageId GetMessageId() const
Definition GPUMessaging.h:62
Definition NaniteFeedback.h:12
uint32 GetStatusMessageId() const
Definition NaniteFeedback.h:43
void ReportMaterialPerformanceWarning(const FString &MaterialName)
Definition NaniteFeedback.cpp:144
FFeedbackManager()
Definition NaniteFeedback.cpp:24
~FFeedbackManager()
Definition NaniteFeedback.cpp:126
Definition UnrealString.h.inl:34
IndexType GetIndex() const
Definition RenderGraphDefinitions.h:358
Definition SkinnedMeshComponent.h:50
bool ShouldReportFeedbackMaterialPerformanceWarning()
Definition NaniteFeedback.cpp:165