UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MetalTexture.cpp File Reference
#include "MetalRHIPrivate.h"
#include "MetalDynamicRHI.h"
#include "MetalProfiler.h"
#include "MetalCommandBuffer.h"
#include "RenderUtils.h"
#include "Containers/ResourceArray.h"
#include "Misc/ScopeRWLock.h"
#include "MetalLLM.h"
#include "RHILockTracker.h"
#include "RHICoreStats.h"
#include "RHICoreTextureInitializer.h"
#include "MetalBindlessDescriptors.h"
#include "HAL/LowLevelMemStats.h"
#include "ProfilingDebugging/AssetMetadataTrace.h"
#include "RHICoreTexture.h"
#include <CoreVideo/CVMetalTexture.h>

Classes

class  FMetalDeferredStats
 
struct  FMetalInitializerMemory
 
class  FMetalTextureReference
 
struct  TMetalResourceTraits< FRHITextureReference >
 

Functions

FAutoConsoleVariableRef CVarMetalMaxOutstandingAsyncTexUploads (TEXT("rhi.Metal.MaxOutstandingAsyncTexUploads"), GMetalMaxOutstandingAsyncTexUploads, TEXT("The maximum number of outstanding asynchronous texture uploads allowed to be pending in Metal. After the limit is reached the next upload will wait for all outstanding operations to complete and purge the waiting free-lists in order to reduce peak memory consumption. Defaults to 0 (infinite), set to a value > 0 limit the number."), ECVF_ReadOnly|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarMetalDisableIOSMemoryless (TEXT("rhi.Metal.DisableIOSMemoryless"), GMetalDisableIOSMemoryless, TEXT("If true, disabled the use of Memoryless textures on iOS"), ECVF_ReadOnly|ECVF_RenderThreadSafe)
 
bool ShouldUseMemoryless (ETextureCreateFlags Flags)
 
bool AllowMSAA ()
 
FMetalSurfaceGetMetalSurfaceFromRHITexture (FRHITexture *Texture)
 
MTL::PixelFormat UEToMetalFormat (FMetalDevice &Device, EPixelFormat UEFormat, bool bSRGB)
 
uint8 GetMetalPixelFormatKey (MTL::PixelFormat Format)
 
bool MetalRHICopyTexutre_IsTextureFormatCompatible (EPixelFormat SrcFmt, EPixelFormat DstFmt)
 

Variables

int32 GMetalMaxOutstandingAsyncTexUploads = 100 * 1024 * 1024
 
int32 GMetalForceIOSTexturesShared = !WITH_IOS_SIMULATOR
 
FAutoConsoleVariableRef CVarMetalForceIOSTexturesShared (TEXT("rhi.Metal.ForceIOSTexturesShared"), GMetalForceIOSTexturesShared, TEXT("If true, forces all textures to be Shared on iOS"), ECVF_RenderThreadSafe)
 
int32 GMetalDisableIOSMemoryless = 0
 

Function Documentation

◆ AllowMSAA()

bool AllowMSAA ( )

◆ CVarMetalDisableIOSMemoryless()

FAutoConsoleVariableRef CVarMetalDisableIOSMemoryless ( TEXT("rhi.Metal.DisableIOSMemoryless")  ,
GMetalDisableIOSMemoryless  ,
TEXT("If true, disabled the use of Memoryless textures on iOS" ,
ECVF_ReadOnly ECVF_RenderThreadSafe 
)

◆ CVarMetalMaxOutstandingAsyncTexUploads()

FAutoConsoleVariableRef CVarMetalMaxOutstandingAsyncTexUploads ( TEXT("rhi.Metal.MaxOutstandingAsyncTexUploads")  ,
GMetalMaxOutstandingAsyncTexUploads  ,
TEXT("The maximum number of outstanding asynchronous texture uploads allowed to be pending in Metal. After the limit is reached the next upload will wait for all outstanding operations to complete and purge the waiting free-lists in order to reduce peak memory consumption. Defaults to 0 (infinite), set to a value > 0 limit the number." ,
ECVF_ReadOnly ECVF_RenderThreadSafe 
)

◆ GetMetalPixelFormatKey()

uint8 GetMetalPixelFormatKey ( MTL::PixelFormat  Format)

◆ GetMetalSurfaceFromRHITexture()

FMetalSurface * GetMetalSurfaceFromRHITexture ( FRHITexture Texture)

Given a pointer to a RHI texture that was created by the Metal RHI, returns a pointer to the FMetalTextureBase it encapsulates.

◆ MetalRHICopyTexutre_IsTextureFormatCompatible()

bool MetalRHICopyTexutre_IsTextureFormatCompatible ( EPixelFormat  SrcFmt,
EPixelFormat  DstFmt 
)
inline

◆ ShouldUseMemoryless()

bool ShouldUseMemoryless ( ETextureCreateFlags  Flags)

◆ UEToMetalFormat()

MTL::PixelFormat UEToMetalFormat ( FMetalDevice Device,
EPixelFormat  UEFormat,
bool  bSRGB 
)

Variable Documentation

◆ CVarMetalForceIOSTexturesShared

FAutoConsoleVariableRef CVarMetalForceIOSTexturesShared(TEXT("rhi.Metal.ForceIOSTexturesShared"), GMetalForceIOSTexturesShared, TEXT("If true, forces all textures to be Shared on iOS"), ECVF_RenderThreadSafe) ( TEXT("rhi.Metal.ForceIOSTexturesShared")  ,
GMetalForceIOSTexturesShared  ,
TEXT("If true, forces all textures to be Shared on iOS" ,
ECVF_RenderThreadSafe   
)

◆ GMetalDisableIOSMemoryless

int32 GMetalDisableIOSMemoryless = 0

◆ GMetalForceIOSTexturesShared

int32 GMetalForceIOSTexturesShared = !WITH_IOS_SIMULATOR

◆ GMetalMaxOutstandingAsyncTexUploads

int32 GMetalMaxOutstandingAsyncTexUploads = 100 * 1024 * 1024