Navigation
API > API/Runtime > API/Runtime/RenderCore
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
ENQUEUE_RENDER_COMMAND(CommandA)MyStruct = MyStruct.Get() { // Do something with MyStruct. };
ENQUEUE_RENDER_COMMAND(CommandB)MyStruct = MyStrucft.Get() { // Do something else with MyStruct. };
// MyStruct instance is automatically released and deleted on the render thread. }
| Name | TRenderThreadStruct |
| Type | class |
| Header File | /Engine/Source/Runtime/RenderCore/Public/RenderingThread.h |
| Include Path | #include "RenderingThread.h" |
Syntax
template<typename StructType>
class TRenderThreadStruct
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TRenderThreadStruct
(
TArgs&&... Args |
RenderingThread.h | ||
TRenderThreadStruct
(
const TRenderThreadStruct& |
RenderingThread.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TRenderThreadStruct() |
RenderingThread.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Struct | StructType * | RenderingThread.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const StructType * Get () |
RenderingThread.h | ||
StructType * Get () |
RenderingThread.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const StructType & operator* () |
RenderingThread.h | ||
StructType & operator* () |
RenderingThread.h | ||
const StructType * operator-> () |
RenderingThread.h | ||
StructType * operator-> () |
RenderingThread.h |