Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Public/RenderCaptureInterface.h
jeremy moore 136e2497e7 Add RenderCaptureInterface support for RDG deferred work.
#rb none
#preflight 61083e85484c100001c97eb2


#ROBOMERGE-SOURCE: CL 17019123
#ROBOMERGE-BOT: (v839-17012307)

[CL 17019159 by jeremy moore in ue5-main branch]
2021-08-02 15:13:18 -04:00

36 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
class FRDGBuilder;
class FRHICommandListImmediate;
/** Easy to use interface for IRenderCaptureProvider. */
namespace RenderCaptureInterface
{
/**
* Helper for capturing within a scope.
* Handles both game and render thread. Fails gracefully if no IRenderCaptureProvider exists.
*/
class FScopedCapture
{
public:
/** Use this constructor if not on rendering thread. Use bEnable to allow control over the capture frequency. */
RENDERCORE_API FScopedCapture(bool bEnable, TCHAR const* InEventName = nullptr, TCHAR const* InFileName = nullptr);
/** Use this constructor if on rendering thread. Use bEnable to allow control over the capture frequency. */
RENDERCORE_API FScopedCapture(bool bEnable, FRHICommandListImmediate* InRHICommandList, TCHAR const* InEventName = nullptr, TCHAR const* InFileName = nullptr);
/** Use this constructor if using RenderGraph to schedule work. Use bEnable to allow control over the capture frequency. */
RENDERCORE_API FScopedCapture(bool bEnable, FRDGBuilder& InGraphBuilder, TCHAR const* InEventName = nullptr, TCHAR const* InFileName = nullptr);
RENDERCORE_API ~FScopedCapture();
private:
bool bCapture;
bool bEvent;
FRHICommandListImmediate* RHICommandList;
FRDGBuilder* GraphBuilder;
};
}