UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FVirtualShadowMapArrayCacheManager Class Reference

#include <VirtualShadowMapCacheManager.h>

+ Inheritance diagram for FVirtualShadowMapArrayCacheManager:

Classes

class  FInvalidatingPrimitiveCollector
 

Public Types

using FEntryMap = TMap< FVirtualShadowMapCacheKey, TSharedPtr< FVirtualShadowMapPerLightCacheEntry > >
 
using FInstanceGPULoadBalancer = TInstanceCullingLoadBalancer< SceneRenderingAllocator >
 

Public Member Functions

 FVirtualShadowMapArrayCacheManager (FScene &InScene)
 
virtual ~FVirtualShadowMapArrayCacheManager ()
 
virtual void InitExtension (FScene &InScene) override
 
virtual ISceneExtensionUpdaterCreateUpdater () override
 
virtual ISceneExtensionRendererCreateRenderer (FSceneRendererBase &InSceneRenderer, const FEngineShowFlags &EngineShowFlags) override
 
void SetPhysicalPoolSize (FRDGBuilder &GraphBuilder, FIntPoint RequestedSize, int RequestedArraySize, uint32 MaxPhysicalPages)
 
void FreePhysicalPool (FRDGBuilder &GraphBuilder)
 
TRefCountPtr< IPooledRenderTargetGetPhysicalPagePool () const
 
TRefCountPtr< FRDGPooledBufferGetPhysicalPageMetaData () const
 
TRefCountPtr< IPooledRenderTargetSetHZBPhysicalPoolSize (FRDGBuilder &GraphBuilder, FIntPoint RequestedSize, int32 RequestedArraySize, const EPixelFormat Format)
 
void FreeHZBPhysicalPool (FRDGBuilder &GraphBuilder)
 
void Invalidate (FRDGBuilder &GraphBuilder)
 
void UpdateUnreferencedCacheEntries (FVirtualShadowMapArray &VirtualShadowMapArray)
 
void ExtractFrameData (FRDGBuilder &GraphBuilder, FVirtualShadowMapArray &VirtualShadowMapArray, const FSceneRenderer &SceneRenderer, bool bAllowPersistentData)
 
TSharedPtr< FVirtualShadowMapPerLightCacheEntryFindCreateLightCacheEntry (int32 LightSceneId, uint32 ViewUniqueID, uint32 NumShadowMaps, uint32 TypeIdTag=0u)
 
bool IsCacheEnabled ()
 
bool IsCacheDataAvailable ()
 
bool IsHZBDataAvailable ()
 
FRHIGPUMask GetCacheValidGPUMask () const
 
void UpdateCacheValidGPUMask (FRHIGPUMask GPUMask, bool bMergeMask)
 
bool IsAccumulatingStats ()
 
bool IsVisualizePassEnabled (const FViewInfo &View, int32 ViewIndex, EVSMVisualizationPostPass Pass) const
 
FScreenPassTexture AddVisualizePass (FRDGBuilder &GraphBuilder, const FViewInfo &View, int32 ViewIndex, EVSMVisualizationPostPass Pass, FScreenPassTexture &SceneColor, FScreenPassRenderTarget &Output)
 
void ProcessInvalidations (FRDGBuilder &GraphBuilder, FSceneUniformBuffer &SceneUniformBuffer, FInvalidatingPrimitiveCollector &InvalidatingPrimitiveCollector)
 
uint64 GetGPUSizeBytes (bool bLogSizes) const
 
const FVirtualShadowMapArrayFrameDataGetPrevBuffers () const
 
uint32 GetStatusFeedbackMessageId () const
 
uint32 GetStatsFeedbackMessageId () const
 
float GetGlobalResolutionLodBias () const
 
FEntryMap::TIterator CreateEntryIterator ()
 
FEntryMap::TConstIterator CreateConstEntryIterator () const
 
UE::Renderer::Private::IShadowInvalidatingInstancesGetInvalidatingInstancesInterface ()
 
FRDGBufferRef UploadCachePrimitiveAsDynamic (FRDGBuilder &GraphBuilder) const
 
void ReallocatePersistentPrimitiveIndices ()
 
uint32 GetPhysicalMaxWidth ()
 
- Public Member Functions inherited from ISceneExtension
 ISceneExtension (FScene &InScene)
 
virtual ~ISceneExtension ()
 

Static Public Member Functions

static bool ShouldCreateExtension (FScene &InScene)
 
- Static Public Member Functions inherited from ISceneExtension
static bool ShouldCreateExtension (FScene &Scene)
 

Static Public Attributes

static constexpr uint32 MaxStatFrames = 512 * 1024U
 

Friends

class FVirtualShadowMapInvalidationSceneUpdater
 
class FVirtualShadowMapInvalidationSceneRenderer
 

Additional Inherited Members

- Protected Attributes inherited from ISceneExtension
FSceneScene
 

Member Typedef Documentation

◆ FEntryMap

◆ FInstanceGPULoadBalancer

Constructor & Destructor Documentation

◆ FVirtualShadowMapArrayCacheManager()

FVirtualShadowMapArrayCacheManager::FVirtualShadowMapArrayCacheManager ( FScene InScene)

◆ ~FVirtualShadowMapArrayCacheManager()

FVirtualShadowMapArrayCacheManager::~FVirtualShadowMapArrayCacheManager ( )
virtual

Member Function Documentation

◆ AddVisualizePass()

FScreenPassTexture FVirtualShadowMapArrayCacheManager::AddVisualizePass ( FRDGBuilder GraphBuilder,
const FViewInfo View,
int32  ViewIndex,
EVSMVisualizationPostPass  Pass,
FScreenPassTexture SceneColor,
FScreenPassRenderTarget Output 
)

◆ CreateConstEntryIterator()

FEntryMap::TConstIterator FVirtualShadowMapArrayCacheManager::CreateConstEntryIterator ( ) const
inline

◆ CreateEntryIterator()

FEntryMap::TIterator FVirtualShadowMapArrayCacheManager::CreateEntryIterator ( )
inline

◆ CreateRenderer()

ISceneExtensionRenderer * FVirtualShadowMapArrayCacheManager::CreateRenderer ( FSceneRendererBase InSceneRenderer,
const FEngineShowFlags EngineShowFlags 
)
overridevirtual

Reimplemented from ISceneExtension.

◆ CreateUpdater()

ISceneExtensionUpdater * FVirtualShadowMapArrayCacheManager::CreateUpdater ( )
overridevirtual

Reimplemented from ISceneExtension.

◆ ExtractFrameData()

void FVirtualShadowMapArrayCacheManager::ExtractFrameData ( FRDGBuilder GraphBuilder,
FVirtualShadowMapArray VirtualShadowMapArray,
const FSceneRenderer SceneRenderer,
bool  bAllowPersistentData 
)

Call at end of frame to extract resouces from the virtual SM array to preserve to next frame.

If bAllowPersistentData is false, all previous frame data is dropped and cache (and HZB!) data will not be available for the next frame. This flag is mostly intended for temporary editor resources like thumbnail rendering that will be used infrequently but often not properly destructed. We need to ensure that the VSM data associated with these renderer instances gets dropped.

◆ FindCreateLightCacheEntry()

TSharedPtr< FVirtualShadowMapPerLightCacheEntry > FVirtualShadowMapArrayCacheManager::FindCreateLightCacheEntry ( int32  LightSceneId,
uint32  ViewUniqueID,
uint32  NumShadowMaps,
uint32  TypeIdTag = 0u 
)

Finds an existing cache entry and moves to the active set or creates a fresh one. TypeIdTag is an arbitrary type ID to make it possible to have more than one shadow map for the same light & view, it is up to the user to make sure there are no collisions.

◆ FreeHZBPhysicalPool()

void FVirtualShadowMapArrayCacheManager::FreeHZBPhysicalPool ( FRDGBuilder GraphBuilder)

◆ FreePhysicalPool()

void FVirtualShadowMapArrayCacheManager::FreePhysicalPool ( FRDGBuilder GraphBuilder)

◆ GetCacheValidGPUMask()

FRHIGPUMask FVirtualShadowMapArrayCacheManager::GetCacheValidGPUMask ( ) const
inline

◆ GetGlobalResolutionLodBias()

float FVirtualShadowMapArrayCacheManager::GetGlobalResolutionLodBias ( ) const
inline

◆ GetGPUSizeBytes()

uint64 FVirtualShadowMapArrayCacheManager::GetGPUSizeBytes ( bool  bLogSizes) const

◆ GetInvalidatingInstancesInterface()

UE::Renderer::Private::IShadowInvalidatingInstances * FVirtualShadowMapArrayCacheManager::GetInvalidatingInstancesInterface ( )
inline

◆ GetPhysicalMaxWidth()

uint32 FVirtualShadowMapArrayCacheManager::GetPhysicalMaxWidth ( )

◆ GetPhysicalPageMetaData()

TRefCountPtr< FRDGPooledBuffer > FVirtualShadowMapArrayCacheManager::GetPhysicalPageMetaData ( ) const
inline

◆ GetPhysicalPagePool()

TRefCountPtr< IPooledRenderTarget > FVirtualShadowMapArrayCacheManager::GetPhysicalPagePool ( ) const
inline

◆ GetPrevBuffers()

const FVirtualShadowMapArrayFrameData & FVirtualShadowMapArrayCacheManager::GetPrevBuffers ( ) const
inline

◆ GetStatsFeedbackMessageId()

uint32 FVirtualShadowMapArrayCacheManager::GetStatsFeedbackMessageId ( ) const
inline

◆ GetStatusFeedbackMessageId()

uint32 FVirtualShadowMapArrayCacheManager::GetStatusFeedbackMessageId ( ) const
inline

◆ InitExtension()

void FVirtualShadowMapArrayCacheManager::InitExtension ( FScene InScene)
overridevirtual

InitExtension is called after all scene extensions have been created, and an extension can therefore query for other extensions here.

Reimplemented from ISceneExtension.

◆ Invalidate()

void FVirtualShadowMapArrayCacheManager::Invalidate ( FRDGBuilder GraphBuilder)

◆ IsAccumulatingStats()

bool FVirtualShadowMapArrayCacheManager::IsAccumulatingStats ( )

◆ IsCacheDataAvailable()

bool FVirtualShadowMapArrayCacheManager::IsCacheDataAvailable ( )

◆ IsCacheEnabled()

bool FVirtualShadowMapArrayCacheManager::IsCacheEnabled ( )

◆ IsHZBDataAvailable()

bool FVirtualShadowMapArrayCacheManager::IsHZBDataAvailable ( )

◆ IsVisualizePassEnabled()

bool FVirtualShadowMapArrayCacheManager::IsVisualizePassEnabled ( const FViewInfo View,
int32  ViewIndex,
EVSMVisualizationPostPass  Pass 
) const

◆ ProcessInvalidations()

void FVirtualShadowMapArrayCacheManager::ProcessInvalidations ( FRDGBuilder GraphBuilder,
FSceneUniformBuffer SceneUniformBuffer,
FInvalidatingPrimitiveCollector InvalidatingPrimitiveCollector 
)

◆ ReallocatePersistentPrimitiveIndices()

void FVirtualShadowMapArrayCacheManager::ReallocatePersistentPrimitiveIndices ( )

◆ SetHZBPhysicalPoolSize()

TRefCountPtr< IPooledRenderTarget > FVirtualShadowMapArrayCacheManager::SetHZBPhysicalPoolSize ( FRDGBuilder GraphBuilder,
FIntPoint  RequestedSize,
int32  RequestedArraySize,
const EPixelFormat  Format 
)

◆ SetPhysicalPoolSize()

void FVirtualShadowMapArrayCacheManager::SetPhysicalPoolSize ( FRDGBuilder GraphBuilder,
FIntPoint  RequestedSize,
int  RequestedArraySize,
uint32  MaxPhysicalPages 
)

◆ ShouldCreateExtension()

bool FVirtualShadowMapArrayCacheManager::ShouldCreateExtension ( FScene InScene)
static

◆ UpdateCacheValidGPUMask()

void FVirtualShadowMapArrayCacheManager::UpdateCacheValidGPUMask ( FRHIGPUMask  GPUMask,
bool  bMergeMask 
)
inline

◆ UpdateUnreferencedCacheEntries()

void FVirtualShadowMapArrayCacheManager::UpdateUnreferencedCacheEntries ( FVirtualShadowMapArray VirtualShadowMapArray)

Called before VSM builds page allocations to reallocate any lights that may not be visible this frame but that may still have cached physical pages. We reallocate new VSM each frame for these to allow the associated physical pages to live through short periods of being offscreen or otherwise culled. This function also removes entries that are too old.

◆ UploadCachePrimitiveAsDynamic()

FRDGBufferRef FVirtualShadowMapArrayCacheManager::UploadCachePrimitiveAsDynamic ( FRDGBuilder GraphBuilder) const

Friends And Related Symbol Documentation

◆ FVirtualShadowMapInvalidationSceneRenderer

◆ FVirtualShadowMapInvalidationSceneUpdater

Member Data Documentation

◆ MaxStatFrames

constexpr uint32 FVirtualShadowMapArrayCacheManager::MaxStatFrames = 512 * 1024U
staticconstexpr

The documentation for this class was generated from the following files: