UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SlateGlobals.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Stats/Stats.h"
8#include "Trace/SlateTrace.h"
9
10// Enabled cvar GSlateCheckUObjectRenderResources that will check for invalid reference in the slate resources manager
11#define SLATE_CHECK_UOBJECT_RENDER_RESOURCES !UE_BUILD_SHIPPING
12
13// Enabled cvar GSlateCheckUObjectShapedGlyphSequence that will check for invalid reference before using them
14#define SLATE_CHECK_UOBJECT_SHAPED_GLYPH_SEQUENCE !UE_BUILD_SHIPPING
15
16#ifndef SLATE_CULL_WIDGETS
17 #define SLATE_CULL_WIDGETS 1
18#endif
19
20/* Globals
21 *****************************************************************************/
22
23 // Compile all the RichText and MultiLine editable text?
24#define WITH_FANCY_TEXT 1
25
26 // If you want to get really verbose stats out of Slate to get a really in-depth
27 // view of what widgets are causing you the greatest problems, set this define to 1.
28#ifndef WITH_VERY_VERBOSE_SLATE_STATS
29 #define WITH_VERY_VERBOSE_SLATE_STATS 0
30#endif
31
32#ifndef SLATE_VERBOSE_NAMED_EVENTS
33 #define SLATE_VERBOSE_NAMED_EVENTS !UE_BUILD_SHIPPING
34#endif
35
37#ifndef UE_SLATE_WITH_WIDGET_UNIQUE_IDENTIFIER
38 #define UE_SLATE_WITH_WIDGET_UNIQUE_IDENTIFIER UE_SLATE_TRACE_ENABLED || WITH_SLATE_DEBUGGING
39#endif
40
42#ifndef UE_SLATE_WITH_DYNAMIC_INVALIDATION
43 #define UE_SLATE_WITH_DYNAMIC_INVALIDATION WITH_EDITOR
44#endif
45
46// HOW TO GET AN IN-DEPTH PERFORMANCE ANALYSIS OF SLATE
47//
48// Step 1)
49// Set WITH_VERY_VERBOSE_SLATE_STATS to 1.
50//
51// Step 2)
52// When running the game (outside of the editor), run these commandline options
53// in order and you'll get a large dump of where all the time is going in Slate.
54//
55// stat group enable slateverbose
56// stat group enable slateveryverbose
57// stat dumpave -root=stat_slate -num=120 -ms=0
58
61
66
69
72
75
78
81
83
84#if SLATE_CHECK_UOBJECT_RENDER_RESOURCES
86// When we detect a none valid resource, should we log a fatal error (crash) or log it (ensure).
88#endif
89
90#if SLATE_CHECK_UOBJECT_SHAPED_GLYPH_SEQUENCE
92#endif
93
94#if WITH_SLATE_DEBUGGING
97#endif
98/* Forward declarations
99*****************************************************************************/
101enum class EActiveTimerReturnType : uint8;
102
104
106#define SLATE_CROSS_THREAD_CHECK() checkf(IsInGameThread() || IsInSlateThread(), TEXT("Slate can only be accessed from the GameThread or the SlateLoadingThread!"));
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define DECLARE_STATS_GROUP(GroupDesc, GroupId, GroupCat)
Definition Stats.h:689
#define DECLARE_STATS_GROUP_MAYBE_COMPILED_OUT(GroupDesc, GroupId, GroupCat, CompileIn)
Definition Stats.h:692
#define DECLARE_STATS_GROUP_VERBOSE(GroupDesc, GroupId, GroupCat)
Definition Stats.h:690
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
EActiveTimerReturnType
Definition SlateEnums.h:329
SLATECORE_API bool GSlateEnableGlobalInvalidation
Definition SlateCoreClasses.cpp:52
SLATECORE_API bool GSlateUseSharedBreakIterator
Definition SlateCoreClasses.cpp:111
SLATECORE_API bool GSlateNavigationDebugging
SLATECORE_API bool GSlateCheckUObjectRenderResources
SLATECORE_API bool GSlateIsOnFastUpdatePath
Definition SlateCoreClasses.cpp:59
SLATECORE_API bool GSlateIsOnFastProcessInvalidation
Definition SlateCoreClasses.cpp:60
SLATECORE_API bool GSlateCheckUObjectRenderResourcesShouldLogFatal
SLATECORE_API bool GSlateFastWidgetPath
Definition SlateCoreClasses.cpp:43
SLATECORE_API bool GSlateCheckUObjectShapedGlyphSequence
SLATECORE_API bool GSlateHitTestGridDebugging
SLATECORE_API bool GSlateIsInInvalidationSlowPath
Definition SlateCoreClasses.cpp:61
#define WITH_VERY_VERBOSE_SLATE_STATS
Definition SlateGlobals.h:29
SLATECORE_API int32 GSlateLayoutGeneration
Definition SlateCoreClasses.cpp:39
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition ActiveTimerHandle.h:12