UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Texture2D.cpp File Reference
#include "Engine/Texture2D.h"
#include "Algo/AnyOf.h"
#include "AsyncCompilationHelpers.h"
#include "Containers/ResourceArray.h"
#include "EngineLogs.h"
#include "UObject/AssetRegistryTagsContext.h"
#include "UObject/Package.h"
#include "RenderUtils.h"
#include "RenderGraphBuilder.h"
#include "EngineUtils.h"
#include "DeviceProfiles/DeviceProfile.h"
#include "DeviceProfiles/DeviceProfileManager.h"
#include "DerivedDataCache.h"
#include "Math/GuardedInt.h"
#include "Rendering/Texture2DResource.h"
#include "Streaming/Texture2DStreamOut_AsyncCreate.h"
#include "RenderingThread.h"
#include "Streaming/Texture2DStreamOut_AsyncReallocate.h"
#include "Streaming/Texture2DStreamOut_Virtual.h"
#include "Streaming/Texture2DStreamIn_DDC_AsyncCreate.h"
#include "Streaming/Texture2DStreamIn_DDC_AsyncReallocate.h"
#include "Streaming/Texture2DStreamIn_DerivedData.h"
#include "Streaming/Texture2DStreamIn_IO_AsyncCreate.h"
#include "Streaming/Texture2DStreamIn_IO_AsyncReallocate.h"
#include "Streaming/Texture2DStreamIn_IO_Virtual.h"
#include "Streaming/TextureStreamIn.h"
#include "Streaming/Texture2DMipAllocator_AsyncCreate.h"
#include "Streaming/Texture2DMipAllocator_AsyncReallocate.h"
#include "Streaming/Texture2DMipAllocator_Virtual.h"
#include "Streaming/Texture2DMipDataProvider_DDC.h"
#include "Streaming/Texture2DMipDataProvider_IO.h"
#include "Engine/TextureMipDataProviderFactory.h"
#include "EngineModule.h"
#include "VT/UploadingVirtualTexture.h"
#include "VT/VirtualTextureBuiltData.h"
#include "VT/VirtualTextureScalability.h"
#include "ImageUtils.h"
#include "TextureCompiler.h"
#include "Misc/ScopedSlowTask.h"
#include "UObject/ObjectSaveContext.h"
#include "UObject/StrongObjectPtr.h"
#include "VirtualTextureEnum.h"
#include "ProfilingDebugging/AssetMetadataTrace.h"

Macros

#define LOCTEXT_NAMESPACE   "UTexture2D"
 

Functions

bool TrackRenderAssetEvent (FStreamingRenderAsset *StreamingTexture, UStreamableRenderAsset *Texture, bool bForceMipLevelsToBeResident, const FRenderAssetStreamingManager *Manager)
 

Variables

TAutoConsoleVariable< int32CVarFlushRHIThreadOnSTreamingTextureLocks (TEXT("r.FlushRHIThreadOnSTreamingTextureLocks"), 0, TEXT("If set to 0, we won't do any flushes for streaming textures. This is safe because the texture streamer deals with these hazards explicitly."), ECVF_RenderThreadSafe)
 
int32 GUseGenericStreamingPath = 0
 
int32 GDefragmentationRetryCounter = 10
 
int32 GDefragmentationRetryCounterLong = 100
 

Macro Definition Documentation

◆ LOCTEXT_NAMESPACE

#define LOCTEXT_NAMESPACE   "UTexture2D"

Function Documentation

◆ TrackRenderAssetEvent()

bool TrackRenderAssetEvent ( FStreamingRenderAsset StreamingRenderAsset,
UStreamableRenderAsset RenderAsset,
bool  bForceMipLevelsToBeResident,
const FRenderAssetStreamingManager Manager 
)
extern

Turn on ENABLE_RENDER_ASSET_TRACKING in ContentStreaming.cpp and setup GTrackedTextures to track specific textures/meshes through the streaming system.

Checks a texture/mesh and tracks it if its name contains any of the tracked render asset names (GTrackedRenderAssetNames).

Parameters
RenderAssetTexture/mesh to check
bForceMipLEvelsToBeResidentWhether all mip-levels in the texture/mesh are forced to be resident
Managercan be null

Variable Documentation

◆ CVarFlushRHIThreadOnSTreamingTextureLocks

TAutoConsoleVariable< int32 > CVarFlushRHIThreadOnSTreamingTextureLocks(TEXT("r.FlushRHIThreadOnSTreamingTextureLocks"), 0, TEXT("If set to 0, we won't do any flushes for streaming textures. This is safe because the texture streamer deals with these hazards explicitly."), ECVF_RenderThreadSafe) ( TEXT("r.FlushRHIThreadOnSTreamingTextureLocks")  ,
,
TEXT("If set to 0, we won't do any flushes for streaming textures. This is safe because the texture streamer deals with these hazards explicitly." ,
ECVF_RenderThreadSafe   
)

◆ GDefragmentationRetryCounter

int32 GDefragmentationRetryCounter = 10

Number of times to retry to reallocate a texture before trying a panic defragmentation, the first time.

◆ GDefragmentationRetryCounterLong

int32 GDefragmentationRetryCounterLong = 100

Number of times to retry to reallocate a texture before trying a panic defragmentation, subsequent times.

◆ GUseGenericStreamingPath

int32 GUseGenericStreamingPath = 0