Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Public/RenderCommandFence.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

42 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Async/TaskGraphInterfaces.h"
////////////////////////////////////
// Render fences
////////////////////////////////////
/**
* Used to track pending rendering commands from the game thread.
*/
class RENDERCORE_API FRenderCommandFence
{
public:
/**
* Adds a fence command to the rendering command queue.
* Conceptually, the pending fence count is incremented to reflect the pending fence command.
* Once the rendering thread has executed the fence command, it decrements the pending fence count.
* @param bSyncToRHIAndGPU, true if we should wait for the RHI thread or GPU, otherwise we only wait for the render thread.
*/
void BeginFence(bool bSyncToRHIAndGPU = false);
/**
* Waits for pending fence commands to retire.
* @param bProcessGameThreadTasks, if true we are on a short callstack where it is safe to process arbitrary game thread tasks while we wait
*/
void Wait(bool bProcessGameThreadTasks = false) const;
// return true if the fence is complete
bool IsFenceComplete() const;
private:
/** Graph event that represents completion of this fence **/
mutable FGraphEventRef CompletionEvent;
/** Thread that will trigger the CompletionEvent **/
ENamedThreads::Type TriggerThreadIndex;
};