Editor.AsyncTextureCompilationMaxConcurrency
Editor.AsyncTextureCompilationMaxConcurrency
#Overview
name: Editor.AsyncTextureCompilationMaxConcurrency
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Set the maximum number of concurrent textures compilation, -1 for unlimited.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Editor.AsyncTextureCompilationMaxConcurrency is to control the maximum number of concurrent texture compilation tasks in the Unreal Engine editor. This setting is part of the texture compilation system, which is responsible for processing and optimizing textures for use in the engine.
This setting variable is primarily used by the texture compilation subsystem within Unreal Engine. Based on the callsites, it’s evident that the Engine module, specifically the TextureCompiler.cpp file, relies on this setting.
The value of this variable is set through the AsyncCompilationHelpers::EnsureInitializedCVars function, which is called in the TextureCompilingManagerImpl namespace. This function initializes the console variable (CVar) for async texture compilation.
The Editor.AsyncTextureCompilationMaxConcurrency variable interacts closely with another variable named bEnableAsyncTextureCompilation. This associated variable is a boolean flag that enables or disables async texture compilation in the editor.
Developers should be aware that:
- This variable directly affects the performance of texture compilation in the editor.
- Setting it too high might overwhelm system resources, while setting it too low could slow down the compilation process.
- It’s part of the experimental settings, which means its behavior or existence might change in future engine versions.
Best practices when using this variable include:
- Adjusting it based on the available system resources (CPU cores, memory) of the development machine.
- Monitoring performance impact when changing this value.
- Considering the project’s size and complexity when setting this value.
Regarding the associated variable bEnableAsyncTextureCompilation:
The purpose of bEnableAsyncTextureCompilation is to enable or disable asynchronous texture compilation in the Unreal Engine editor. This setting is part of the EditorExperimentalSettings class and is used to improve PIE (Play In Editor) and map load time performance when texture compilation is required.
This variable is used in the Editor subsystem, specifically in the UnrealEd module. It’s defined in the EditorExperimentalSettings class and initialized in the constructor of this class.
The value of this variable is set to false by default in the UEditorExperimentalSettings constructor. However, it can be modified through the editor’s project settings UI or configuration files.
Developers should be aware that:
- This is an experimental feature, so its behavior may change in future engine versions.
- Enabling this feature can improve performance but may also introduce new issues or instabilities.
Best practices when using this variable include:
- Testing thoroughly after enabling or disabling this feature to ensure it doesn’t introduce unexpected behavior in your project.
- Considering the trade-off between improved compilation speed and potential instabilities.
- Keeping track of any performance improvements or issues when this feature is enabled.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureCompiler.cpp:67
Scope (from outer to inner):
file
namespace TextureCompilingManagerImpl
function static void EnsureInitializedCVars
Source code excerpt:
AsyncCompilationHelpers::EnsureInitializedCVars(
TEXT("texture"),
CVarAsyncTextureStandard.AsyncCompilation,
CVarAsyncTextureStandard.AsyncCompilationMaxConcurrency,
GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncTextureCompilation));
}
}
}
#Associated Variable and Callsites
This variable is associated with another variable named bEnableAsyncTextureCompilation
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:10
Scope (from outer to inner):
file
class class UEditorExperimentalSettings : public UObject
Source code excerpt:
#include "EditorExperimentalSettings.generated.h"
/**
* Implements Editor settings for experimental features.
*/
UCLASS(config=EditorPerProjectUserSettings, MinimalAPI)
class UEditorExperimentalSettings
: public UObject
{
GENERATED_UCLASS_BODY()
public:
/** Enable async texture compilation to improve PIE and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async texture compilation and loading"))
bool bEnableAsyncTextureCompilation;
/** Enable async static mesh compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async static mesh compilation and loading"))
bool bEnableAsyncStaticMeshCompilation;
/** Enable async skeletal mesh compilation to improve import and map load time performance when compilation is required */
UE_DEPRECATED(5.1, "Deprecated & replaced by bEnableAsyncSkinnedAssetCompilation.")
UPROPERTY(/*EditAnywhere - deprecated & replaced by bEnableAsyncSkinnedAssetCompilation, */config/*, Category = Performance, meta = (DisplayName = "Enable async skeletal mesh compilation and loading")*/)
bool bEnableAsyncSkeletalMeshCompilation;
/** Enable async skinned asset compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async skinned asset compilation and loading"))
bool bEnableAsyncSkinnedAssetCompilation;
/** Enable async sound compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async sound compilation and loading"))
bool bEnableAsyncSoundWaveCompilation;
/** Allows the editor to run on HDR monitors on Windows 10 */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ConfigRestartRequired = true, DisplayName = "Enable Editor Support for HDR Monitors"))
bool bHDREditor;
/** The brightness of the slate UI on HDR monitors */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ClampMin = "100.0", ClampMax = "300.0", UIMin = "100.0", UIMax = "300.0"))
float HDREditorNITLevel;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:171
Scope (from outer to inner):
file
function UEditorExperimentalSettings::UEditorExperimentalSettings
Source code excerpt:
static TAutoConsoleVariable<int32> CVarEditorHDRSupport(
TEXT("Editor.HDRSupport"),
0,
TEXT("Sets whether or not we should allow the editor to run on HDR monitors"),
ECVF_Default);
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
TEXT("Editor.HDRNITLevel"),
160.0f,
TEXT("Sets The desired NIT level of the editor when running on HDR"),
ECVF_Default);
UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
: Super(ObjectInitializer)
, bEnableAsyncTextureCompilation(false)
, bEnableAsyncStaticMeshCompilation(false)
, bEnableAsyncSkeletalMeshCompilation(true) // This was false and set to True in /Engine/Config/BaseEditorPerProjectUserSettings.ini. The setting is removed from .ini so change it to default True.
, bEnableAsyncSkinnedAssetCompilation(false)
, bEnableAsyncSoundWaveCompilation(false)
, bHDREditor(false)
, HDREditorNITLevel(160.0f)
, bUseOpenCLForConvexHullDecomp(false)
, bAllowPotentiallyUnsafePropertyEditing(false)
, bPackedLevelActor(true)
, bLevelInstance(true)
{
}
void UEditorExperimentalSettings::PostInitProperties()
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
// bEnableAsyncSkeletalMeshCompilation's default to True (see comment in constructor above).
// To be backwards compatible, if a user project overrides it to False, pass on the value to bEnableAsyncSkinnedAssetCompilation.
if (!bEnableAsyncSkeletalMeshCompilation)
{
UE_LOG(LogSettingsClasses, Warning, TEXT("bEnableAsyncSkeletalMeshCompilation is deprecated and replaced with bEnableAsyncSkinnedAssetCompilation. Please update the config. Setting bEnableAsyncSkinnedAssetCompilation to False."));
bEnableAsyncSkinnedAssetCompilation = false;
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS
CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TextureCompiler.cpp:58
Scope (from outer to inner):
file
namespace TextureCompilingManagerImpl
function static void EnsureInitializedCVars
Source code excerpt:
}
static void EnsureInitializedCVars()
{
static bool bIsInitialized = false;
if (!bIsInitialized)
{
bIsInitialized = true;
AsyncCompilationHelpers::EnsureInitializedCVars(
TEXT("texture"),
CVarAsyncTextureStandard.AsyncCompilation,
CVarAsyncTextureStandard.AsyncCompilationMaxConcurrency,
GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncTextureCompilation));
}
}
}
FTextureCompilingManager::FTextureCompilingManager()
: Notification(MakeUnique<FAsyncCompilationNotification>(GetAssetNameFormat()))
{
TextureCompilingManagerImpl::EnsureInitializedCVars();
}
FName FTextureCompilingManager::GetStaticAssetTypeName()
{
return TEXT("UE-Texture");
}
bool FTextureCompilingManager::IsCompilingTexture(UTexture* InTexture) const
{
check(IsInGameThread());
if (!InTexture)
{
return false;
}
const TWeakObjectPtr<UTexture> InWeakTexturePtr = InTexture;
uint32 Hash = GetTypeHash(InWeakTexturePtr);