Slate.InvalidationRoot.VerifyWidgetVisibility

Slate.InvalidationRoot.VerifyWidgetVisibility

#Overview

name: Slate.InvalidationRoot.VerifyWidgetVisibility

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Slate.InvalidationRoot.VerifyWidgetVisibility is to enable a debugging feature in Unreal Engine’s Slate UI system that verifies the cached visibility of widgets is properly set on every tick.

This setting variable is primarily used in the Slate subsystem, which is part of Unreal Engine’s UI framework. It’s specifically related to the invalidation and update mechanism of Slate widgets.

The value of this variable is set through a console variable (CVar) system. It’s defined as a boolean (GSlateInvalidationRootVerifyWidgetVisibility) and can be toggled on or off via the console or game settings.

This variable interacts with the FWidgetProxy class, specifically with the bDebug_LastFrameVisible and bDebug_LastFrameVisibleSet flags, which are used to cache and verify the visibility state of widgets.

Developers should be aware that enabling this variable may have a performance impact, as it adds additional verification checks on every tick. It should primarily be used for debugging purposes when issues with widget visibility are suspected.

Best practices for using this variable include:

  1. Only enable it when debugging widget visibility issues.
  2. Use it in conjunction with other Slate debugging tools for a comprehensive analysis.
  3. Remember to disable it in release builds or when not actively debugging to avoid unnecessary performance overhead.
  4. When enabled, pay attention to any warnings or errors related to widget visibility discrepancies in the output log.

This variable is part of a set of debugging tools for Slate, including other verification options for widget pointers, hittest grid, volatility, update list, and attributes. Developers working on complex UI systems in Unreal Engine should familiarize themselves with these tools for effective debugging and optimization.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/SlateCore/Private/FastUpdate/SlateInvalidationRoot.cpp:100

Scope: file

Source code excerpt:

bool GSlateInvalidationRootVerifyWidgetVisibility = false;
static FAutoConsoleVariableRef CVarSlateInvalidationRootVerifyWidgetVisibility(
	TEXT("Slate.InvalidationRoot.VerifyWidgetVisibility"),
	GSlateInvalidationRootVerifyWidgetVisibility,
	TEXT("Every tick, verify that the cached visibility of the widgets is properly set.")
);
void VerifyWidgetVisibility(FSlateInvalidationWidgetList& WidgetList);

bool GSlateInvalidationRootVerifyWidgetVolatile = false;

#Loc: <Workspace>/Engine/Source/Developer/SlateReflector/Private/Widgets/SSlateOptions.cpp:117

Scope (from outer to inner):

file
function     void SSlateOptions::Construct
function     static TSharedRef<SWidget> FillToolbar

Source code excerpt:

				AddMenuEntry(MenuBuilder, Icon, LOCTEXT("VerifyWidgetPtr", "Verify Widget Pointer"), TEXT("Slate.InvalidationRoot.VerifyValidWidgets"));
				AddMenuEntry(MenuBuilder, Icon, LOCTEXT("VerifyHittestGrid", "Verify Hittest Grid"), TEXT("Slate.InvalidationRoot.VerifyHittestGrid"));
				AddMenuEntry(MenuBuilder, Icon, LOCTEXT("VefiryVisibility", "Verify Visibility"), TEXT("Slate.InvalidationRoot.VerifyWidgetVisibility"));
				AddMenuEntry(MenuBuilder, Icon, LOCTEXT("VerifyVolatility", "Verify Volatility"), TEXT("Slate.InvalidationRoot.VerifyWidgetVolatile"));
				AddMenuEntry(MenuBuilder, Icon, LOCTEXT("VerifyUpdateList", "Verify Update List"), TEXT("Slate.InvalidationRoot.VerifyWidgetUpdateList"));
				AddMenuEntry(MenuBuilder, Icon, LOCTEXT("VerifySlateAttributes", "Verify Attributes"), TEXT("Slate.InvalidationRoot.VerifySlateAttribute"));
	#endif // UE_SLATE_WITH_INVALIDATIONWIDGETLIST_DEBUGGING
				MenuBuilder.EndSection();
			}			

#Loc: <Workspace>/Engine/Source/Runtime/SlateCore/Public/FastUpdate/WidgetProxy.h:210

Scope (from outer to inner):

file
class        class FWidgetProxy

Source code excerpt:

		{
		public:
			/** Use with "Slate.InvalidationRoot.VerifyWidgetVisibility". Cached the last FastPathVisible value to find widgets that do not call Invalidate properly. */
			uint8 bDebug_LastFrameVisible : 1;
			uint8 bDebug_LastFrameVisibleSet : 1;
			/** Use with "Slate.InvalidationRoot.VerifyWidgetAttribute". */
			uint8 bDebug_AttributeUpdated : 1;
			/** The widget was updated (paint or ticked/activetimer). */
			uint8 bDebug_Updated : 1;