示例#1
0
        // 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));
            }
        }
示例#2
0
 private bool ShouldShowMetalFrameCaptureGUI()
 {
     return(FrameCapture.IsDestinationSupported(FrameCaptureDestination.DevTools) ||
            FrameCapture.IsDestinationSupported(FrameCaptureDestination.GPUTraceDocument));
 }
示例#3
0
 void UpdateState()
 {
     style.display = FrameCapture.IsDestinationSupported(FrameCaptureDestination.DevTools) ||
                     FrameCapture.IsDestinationSupported(FrameCaptureDestination.GPUTraceDocument) ? DisplayStyle.Flex : DisplayStyle.None;
 }