Navigation
API > API/Runtime > API/Runtime/RenderCore
References
| Module | RenderCore |
| Header | /Engine/Source/Runtime/RenderCore/Public/RenderingThread.h |
| Include | #include "RenderingThread.h" |
Syntax
template<typename StructType>
class TRenderThreadStruct
Remarks
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. }
Constructors
| Type | Name | Description | |
|---|---|---|---|
TRenderThreadStruct
(
TArgs&&... Args |
|||
TRenderThreadStruct
(
const TRenderThreadStruct& |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
Operators
| Type | Name | Description | |
|---|---|---|---|
| const StructType & | operator* () |
||
| StructType & | operator* () |
||
| const StructType * | operator-> () |
||
| StructType * | operator-> () |