UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPrimitiveSceneInfoData Struct Reference

#include <PrimitiveSceneInfoData.h>

Public Member Functions

ENGINE_API void SetLastRenderTime (float InLastRenderTime, bool bUpdateLastRenderTimeOnScreen) const
 
 FPrimitiveSceneInfoData ()
 

Public Attributes

FPrimitiveSceneProxySceneProxy = nullptr
 
float LastRenderTime = -1000.0f
 
float LastRenderTimeOnScreen = -1000.0f
 
FThreadSafeCounter AttachmentCounter
 
FPrimitiveComponentId PrimitiveSceneId
 
int32 bAlwaysVisible: 1
 
FActorLastRenderTimeOwnerLastRenderTimePtr = nullptr
 

Static Protected Attributes

static ENGINE_API FThreadSafeCounter NextPrimitiveId
 

Constructor & Destructor Documentation

◆ FPrimitiveSceneInfoData()

FPrimitiveSceneInfoData::FPrimitiveSceneInfoData ( )
inline

Member Function Documentation

◆ SetLastRenderTime()

void FPrimitiveSceneInfoData::SetLastRenderTime ( float  InLastRenderTime,
bool  bUpdateLastRenderTimeOnScreen 
) const

Member Data Documentation

◆ AttachmentCounter

FThreadSafeCounter FPrimitiveSceneInfoData::AttachmentCounter

Incremented by the main thread before being attached to the scene, decremented by the rendering thread after removal. This counter exists to assert that operations are safe in order to help avoid race conditions.

      *** Runtime logic should NEVER rely on this value. ***

The only safe assertions to make are:

AttachmentCounter == 0: The primitive is not exposed to the rendering
                        thread, it is safe to modify shared members.
                        This assertion is valid ONLY from the main thread.

AttachmentCounter >= 1: The primitive IS exposed to the rendering
                        thread and therefore shared members must not
                        be modified. This assertion may be made from
                        any thread. Note that it is valid and expected
                        for AttachmentCounter to be larger than 1, e.g.
                        during reattachment.

◆ bAlwaysVisible

int32 FPrimitiveSceneInfoData::bAlwaysVisible

Whether the primitive is always visible. If true the last render time will be unset.

◆ LastRenderTime

float FPrimitiveSceneInfoData::LastRenderTime = -1000.0f
mutable

The value of WorldSettings->TimeSeconds for the frame when this component was last rendered. This is written from the render thread, which is up to a frame behind the game thread, so you should allow this time to be at least a frame behind the game thread's world time before you consider the actor non-visible.

◆ LastRenderTimeOnScreen

float FPrimitiveSceneInfoData::LastRenderTimeOnScreen = -1000.0f
mutable

Same as LastRenderTime but only updated if the component is on screen. Used by the texture streamer.

◆ NextPrimitiveId

FThreadSafeCounter FPrimitiveSceneInfoData::NextPrimitiveId
staticprotected

Next id to be used by a component.

◆ OwnerLastRenderTimePtr

FActorLastRenderTime* FPrimitiveSceneInfoData::OwnerLastRenderTimePtr = nullptr

Pointer to the last render time variable on the primitive's owning actor or other UObject (if owned), which is written to by the RT and read by the GT. The value of LastRenderTime will therefore not be deterministic due to race conditions, but the GT uses it in a way that allows this. Storing a pointer to the UObject member variable only works in the AActor/UPrimitiveComponent case because: UPrimitiveComponent's outer is its owning AActor, so it prevents the owner from being garbage collected while the component lives. If the UPrimitiveComponent is GC'd during the Actor's lifetime, OwnerLastRenderTime is still valid so there is no issue. If the UPrimitiveComponent and the Actor are GC'd together, neither will be deleted until FinishDestroy has been executed on both. UPrimitiveComponent's FinishDestroy will not execute until the primitive has been detached from the Scene through it's DetachFence. In general feedback from the renderer to the game thread like this should be avoided.

Any other user of this struct that intends to add it's own primitives in the Scene must provide the same guarantees.

◆ PrimitiveSceneId

FPrimitiveComponentId FPrimitiveSceneInfoData::PrimitiveSceneId

Used by the renderer, to identify a primitive across re-registers.

◆ SceneProxy

FPrimitiveSceneProxy* FPrimitiveSceneInfoData::SceneProxy = nullptr

The primitive's scene info.


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