diff --git a/src/libANGLE/renderer/metal/mtl_utils.mm b/src/libANGLE/renderer/metal/mtl_utils.mm index 2265bb0be8c..299bd710627 100644 --- a/src/libANGLE/renderer/metal/mtl_utils.mm +++ b/src/libANGLE/renderer/metal/mtl_utils.mm @@ -188,51 +188,34 @@ void StartFrameCapture(id metalDevice, id metalCmdQu return; } -# ifdef __MAC_10_15 - if (ANGLE_APPLE_AVAILABLE_XCI(10.15, 13.1, 13)) - { - auto captureDescriptor = mtl::adoptObjCObj([[MTLCaptureDescriptor alloc] init]); - captureDescriptor.get().captureObject = metalDevice; - const std::string filePath = GetMetalCaptureFile(); - NSString *frameCapturePath = nil; - if (filePath != "") - { - frameCapturePath = - [NSString stringWithFormat:@"%s%zu.gputrace", filePath.c_str(), gFrameCaptured - 1]; - captureDescriptor.get().destination = MTLCaptureDestinationGPUTraceDocument; - captureDescriptor.get().outputURL = [NSURL fileURLWithPath:frameCapturePath - isDirectory:false]; - } - else - { - // This will pause execution only if application is being debugged inside Xcode - captureDescriptor.get().destination = MTLCaptureDestinationDeveloperTools; - } - - NSError *error; - if ([captureManager startCaptureWithDescriptor:captureDescriptor.get() error:&error]) - { - ASSERT(!gFrameCapturePath); - gFrameCapturePath = frameCapturePath; - } - else - { - NSLog(@"Failed to start capture, error %@", error); - } + auto captureDescriptor = mtl::adoptObjCObj([[MTLCaptureDescriptor alloc] init]); + captureDescriptor.get().captureObject = metalDevice; + const std::string filePath = GetMetalCaptureFile(); + NSString *frameCapturePath = nil; + if (filePath != "") + { + frameCapturePath = + [NSString stringWithFormat:@"%s%zu.gputrace", filePath.c_str(), gFrameCaptured - 1]; + captureDescriptor.get().destination = MTLCaptureDestinationGPUTraceDocument; + captureDescriptor.get().outputURL = [NSURL fileURLWithPath:frameCapturePath + isDirectory:false]; } else -# endif // __MAC_10_15 - if (ANGLE_APPLE_AVAILABLE_XCI(10.15, 13.1, 13)) - { - auto captureDescriptor = mtl::adoptObjCObj([[MTLCaptureDescriptor alloc] init]); - captureDescriptor.get().captureObject = metalDevice; + { + // This will pause execution only if application is being debugged inside Xcode + captureDescriptor.get().destination = MTLCaptureDestinationDeveloperTools; + } - NSError *error; - if (![captureManager startCaptureWithDescriptor:captureDescriptor.get() error:&error]) - { - NSLog(@"Failed to start capture, error %@", error); - } - } + NSError *error; + if ([captureManager startCaptureWithDescriptor:captureDescriptor.get() error:&error]) + { + ASSERT(!gFrameCapturePath); + gFrameCapturePath = frameCapturePath; + } + else + { + NSLog(@"Failed to start capture, error %@", error); + } #endif // ANGLE_METAL_FRAME_CAPTURE_ENABLED }