2020-01-24 23:36:12 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2020-01-24 18:07:01 -05:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
|
|
|
|
|
class FRHICommandListImmediate;
|
|
|
|
|
|
2021-03-18 15:20:03 -04:00
|
|
|
/** Easy to use interface for IRenderCaptureProvider. */
|
2020-01-24 18:07:01 -05:00
|
|
|
namespace RenderCaptureInterface
|
|
|
|
|
{
|
2021-01-08 19:56:07 -04:00
|
|
|
/**
|
2021-03-18 15:20:03 -04:00
|
|
|
* Helper for capturing within a scope.
|
|
|
|
|
* Handles both game and render thread. Fails gracefully if no IRenderCaptureProvider exists.
|
2021-01-08 19:56:07 -04:00
|
|
|
*/
|
2020-01-24 18:07:01 -05:00
|
|
|
class FScopedCapture
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
/** Use this constructor if not on rendering thread. Use bEnable to allow control over the capture frequency. */
|
2021-03-18 15:20:03 -04:00
|
|
|
RENDERCORE_API FScopedCapture(bool bEnable, TCHAR const* InEventName = nullptr, TCHAR const* InFileName = nullptr);
|
2020-01-24 18:07:01 -05:00
|
|
|
/** Use this constructor if on rendering thread. Use bEnable to allow control over the capture frequency. */
|
2021-03-18 15:20:03 -04:00
|
|
|
RENDERCORE_API FScopedCapture(bool bEnable, FRHICommandListImmediate* InRHICommandList, TCHAR const* InEventName = nullptr, TCHAR const* InFileName = nullptr);
|
2020-01-24 18:07:01 -05:00
|
|
|
|
|
|
|
|
RENDERCORE_API ~FScopedCapture();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool bCapture;
|
2021-03-18 15:20:03 -04:00
|
|
|
bool bEvent;
|
|
|
|
|
FRHICommandListImmediate* RHICommandList;
|
2020-01-24 18:07:01 -05:00
|
|
|
};
|
|
|
|
|
}
|