// we already have renderdoc integration done in GUIView but in cpp // for metal we need a bit more convoluted logic and we can push more things to cs internal void CaptureMetalScene() { if (FrameCapture.IsDestinationSupported(FrameCaptureDestination.DevTools)) { FrameCapture.BeginCaptureToXcode(); RenderCurrentSceneForCapture(); FrameCapture.EndCapture(); } else if (FrameCapture.IsDestinationSupported(FrameCaptureDestination.GPUTraceDocument)) { string path = EditorUtility.SaveFilePanel("Save Metal GPU Capture", "", PlayerSettings.productName + ".gputrace", "gputrace"); if (System.String.IsNullOrEmpty(path)) { return; } FrameCapture.BeginCaptureToFile(path); RenderCurrentSceneForCapture(); FrameCapture.EndCapture(); System.Console.WriteLine("Metal capture saved to " + path); System.Diagnostics.Process.Start(System.IO.Path.GetDirectoryName(path)); } }
private bool ShouldShowMetalFrameCaptureGUI() { return(FrameCapture.IsDestinationSupported(FrameCaptureDestination.DevTools) || FrameCapture.IsDestinationSupported(FrameCaptureDestination.GPUTraceDocument)); }
void UpdateState() { style.display = FrameCapture.IsDestinationSupported(FrameCaptureDestination.DevTools) || FrameCapture.IsDestinationSupported(FrameCaptureDestination.GPUTraceDocument) ? DisplayStyle.Flex : DisplayStyle.None; }