Slate.bAllowThrottling

Slate.bAllowThrottling

#Overview

name: Slate.bAllowThrottling

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Slate.bAllowThrottling is to control whether Slate, Unreal Engine’s UI framework, is allowed to throttle parts of the engine to ensure the UI remains responsive.

This setting variable is primarily used by the Slate subsystem, which is a core part of Unreal Engine’s user interface framework. It’s also referenced in the Avalanche Media plugin and the Level Editor module.

The value of this variable is typically set through the console variable system. It can be modified at runtime using the IConsoleManager.

Several other components interact with this variable:

  1. FSlateThrottleManager uses it to determine if throttling should be applied.
  2. SLevelViewport temporarily modifies it when the viewport has focus.
  3. The Avalanche Media and Avalanche Media Editor plugins set it to false during their module startup.

Developers should be aware that:

  1. This variable’s value is cached on the first tick of SLevelViewport, so changes after that point may not take effect immediately.
  2. Setting this to false can improve UI responsiveness but may impact performance in other areas of the engine.
  3. The Level Editor temporarily disables throttling when a viewport has focus, regardless of this setting.

Best practices when using this variable include:

  1. Consider the performance implications before disabling throttling globally.
  2. If you need to modify this setting, do so early in the application lifecycle, preferably before any SLevelViewport instances are ticked.
  3. Be cautious when disabling throttling in plugins or modules, as it may affect the entire engine’s behavior.
  4. Monitor performance when modifying this setting, especially in complex scenes or on lower-end hardware.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheMedia/Private/AvaMediaModule.cpp:133

Scope (from outer to inner):

file
function     void FAvaMediaModule::StartupModule

Source code excerpt:

		// This has to be done before any SLevelViewport are ticked since the cvar value is cached on first tick.
		static const FSlateThrottleManager & ThrottleManager = FSlateThrottleManager::Get();
		if (IConsoleVariable* AllowThrottling = IConsoleManager::Get().FindConsoleVariable(TEXT("Slate.bAllowThrottling")))
		{
			AllowThrottling->Set(0);
			UE_LOG(LogAvaMedia, Log, TEXT("Setting Slate.bAllowThrottling to false."));
		}
	}

#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheMediaEditor/Private/AvaMediaEditorModule.cpp:122

Scope (from outer to inner):

file
function     void FAvaMediaEditorModule::StartupModule

Source code excerpt:

		// This has to be done before any SLevelViewport are ticked since the cvar value is cached on first tick.
		static const FSlateThrottleManager& ThrottleManager = FSlateThrottleManager::Get();
		if (IConsoleVariable* AllowThrottling = IConsoleManager::Get().FindConsoleVariable(TEXT("Slate.bAllowThrottling")))
		{
			AllowThrottling->Set(0);
			UE_LOG(LogAvaMediaEditor, Log, TEXT("Setting Slate.bAllowThrottling to false."));
		}
	}
	RegisterRundownFilterExpressionFactories();

#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/SLevelViewport.cpp:1169

Scope (from outer to inner):

file
function     void SLevelViewport::Tick

Source code excerpt:

		// We can arrive at this point before creating throttling manager (which registers the cvar), so create it explicitly.
		static const FSlateThrottleManager & ThrottleManager = FSlateThrottleManager::Get();
		static IConsoleVariable* AllowThrottling = IConsoleManager::Get().FindConsoleVariable(TEXT("Slate.bAllowThrottling"));
		check(AllowThrottling);

		if ( bContainsFocus )
		{
			UserAllowThrottlingValue = AllowThrottling->GetInt();
			AllowThrottling->Set(0);

#Loc: <Workspace>/Engine/Source/Runtime/SlateCore/Private/Application/ThrottleManager.cpp:8

Scope (from outer to inner):

file
function     FSlateThrottleManager::FSlateThrottleManager

Source code excerpt:

FSlateThrottleManager::FSlateThrottleManager( )
	: bShouldThrottle(1)
	, CVarAllowThrottle(TEXT("Slate.bAllowThrottling"), bShouldThrottle, TEXT("Allow Slate to throttle parts of the engine to ensure the UI is responsive") )
	, ThrottleCount(0)
	, DisableThrottleCount(0)
{ }


/* FSlateThrottleManager interface