UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TRenderThreadStruct< StructType > Class Template Reference

#include <RenderingThread.h>

Public Member Functions

template<typename... TArgs>
 TRenderThreadStruct (TArgs &&... Args)
 
 ~TRenderThreadStruct ()
 
 TRenderThreadStruct (const TRenderThreadStruct &)=delete
 
const StructType * operator-> () const
 
StructType * operator-> ()
 
const StructType & operator* () const
 
StructType & operator* ()
 
const StructType * Get () const
 
StructType * Get ()
 

Detailed Description

template<typename StructType>
class TRenderThreadStruct< StructType >

Represents a struct with a lifetime that spans multiple render commands with scoped initialization and release on the render thread.

Example:

struct FMyStruct : public FRenderThreadStructBase { FInitializer { int32 Foo; int32 Bar; };

FMyStruct(const FInitializer& InInitializer) : Initializer(InInitializer) { // Called immediately by TRenderThreadStruct when created. }

~FMyStruct() { // Called on the render thread when TRenderThreadStruct goes out of scope. }

void InitRHI(FRHICommandListImmediate& RHICmdList) { // Called on the render thread by TRenderThreadStruct when created. }

void ReleaseRHI(FRHICommandListImmediate& RHICmdList) { // Called on the render thread when TRenderThreadStruct goes out of scope. }

FInitializer Initializer; };

// On Main Thread

{ TRenderThreadStruct<FMyStruct> MyStruct(FMyStruct::FInitializer{1, 2});

ENQUEUE_RENDER_COMMAND(CommandA)[MyStruct = MyStruct.Get()](FRHICommandListImmediate& RHICmdList) { // Do something with MyStruct. };

ENQUEUE_RENDER_COMMAND(CommandB)[MyStruct = MyStrucft.Get()](FRHICommandListImmediate& RHICmdList) { // Do something else with MyStruct. };

// MyStruct instance is automatically released and deleted on the render thread. }

Constructor & Destructor Documentation

◆ TRenderThreadStruct() [1/2]

template<typename StructType >
template<typename... TArgs>
TRenderThreadStruct< StructType >::TRenderThreadStruct ( TArgs &&...  Args)
inline

◆ ~TRenderThreadStruct()

template<typename StructType >
TRenderThreadStruct< StructType >::~TRenderThreadStruct ( )
inline

◆ TRenderThreadStruct() [2/2]

template<typename StructType >
TRenderThreadStruct< StructType >::TRenderThreadStruct ( const TRenderThreadStruct< StructType > &  )
delete

Member Function Documentation

◆ Get() [1/2]

template<typename StructType >
StructType * TRenderThreadStruct< StructType >::Get ( )
inline

◆ Get() [2/2]

template<typename StructType >
const StructType * TRenderThreadStruct< StructType >::Get ( ) const
inline

◆ operator*() [1/2]

template<typename StructType >
StructType & TRenderThreadStruct< StructType >::operator* ( )
inline

◆ operator*() [2/2]

template<typename StructType >
const StructType & TRenderThreadStruct< StructType >::operator* ( ) const
inline

◆ operator->() [1/2]

template<typename StructType >
StructType * TRenderThreadStruct< StructType >::operator-> ( )
inline

◆ operator->() [2/2]

template<typename StructType >
const StructType * TRenderThreadStruct< StructType >::operator-> ( ) const
inline

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