Files
UnrealEngine/Engine/Source/Runtime/Apple/MetalRHI/Private/MetalCaptureManager.h
2025-05-18 13:04:45 +08:00

47 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MetalRHIPrivate.h"
class FMetalCommandQueue;
class FMetalCaptureManager
{
public:
FMetalCaptureManager(MTL::Device* Device, FMetalCommandQueue& Queue);
~FMetalCaptureManager();
// Called by the MetalRHI code to trigger the provided capture scopes visible in Xcode.
void PresentFrame(uint32 FrameNumber);
// Programmatic captures without an Xcode capture scope.
// Use them to instrument the code manually to debug issues.
void BeginCapture(void);
void EndCapture(void);
private:
MTL::Device* Device;
FMetalCommandQueue& Queue;
bool bSupportsCaptureManager;
private:
enum EMetalCaptureType
{
EMetalCaptureTypeUnknown,
EMetalCaptureTypeFrame, // (BeginFrame-EndFrame) * StepCount
EMetalCaptureTypePresent, // (Present-Present) * StepCount
EMetalCaptureTypeViewport, // (Present-Present) * Viewports * StepCount
};
struct FMetalCaptureScope
{
EMetalCaptureType Type;
uint32 StepCount;
uint32 LastTrigger;
MTL::CaptureScope* MTLScope;
};
TArray<FMetalCaptureScope> ActiveScopes;
};