From 3729a48929f3a3604300b45682d24701d55d0ac0 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Thu, 20 Sep 2018 15:48:41 -0700 Subject: [PATCH] Update ARKit and Metal for Xcode 10 --- stdlib/public/SDK/ARKit/ARKit.swift | 57 +++++++++++++++++++++++++++++ stdlib/public/SDK/Metal/Metal.swift | 8 ++-- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/stdlib/public/SDK/ARKit/ARKit.swift b/stdlib/public/SDK/ARKit/ARKit.swift index 4d1b3c9a25ab0..f09ab01839090 100644 --- a/stdlib/public/SDK/ARKit/ARKit.swift +++ b/stdlib/public/SDK/ARKit/ARKit.swift @@ -190,3 +190,60 @@ extension ARPlaneGeometry { return Array(buffer) } } + +@available(iOS, introduced: 12.0) +extension ARPlaneAnchor { + /** + A value describing the classification of a plane anchor. + */ + public enum Classification { + + public enum Status { + + /** Plane classification is currently unavailable. */ + case notAvailable + + /** ARKit has not yet determined the classification of this plane. */ + case undetermined + + /** ARKit is confident the plane is not any of the known classes. */ + case unknown + } + + /** The classification is not any of the known classes. */ + case none(Status) + + case wall + + case floor + + case ceiling + + case table + + case seat + } + + + /** + Classification of the plane. + */ + public var classification: ARPlaneAnchor.Classification { + switch __classification { + case .wall: return .wall + case .floor: return .floor + case .ceiling: return .ceiling + case .table: return .table + case .seat: return .seat + case .none: fallthrough + default: + switch __classificationStatus { + case .notAvailable: return .none(.notAvailable) + case .unknown: return .none(.unknown) + case .undetermined: fallthrough + case .known: fallthrough + default: return .none(.undetermined) + } + } + } +} diff --git a/stdlib/public/SDK/Metal/Metal.swift b/stdlib/public/SDK/Metal/Metal.swift index 586e244b156e1..c1f24c8455b53 100644 --- a/stdlib/public/SDK/Metal/Metal.swift +++ b/stdlib/public/SDK/Metal/Metal.swift @@ -156,14 +156,14 @@ extension MTLRenderCommandEncoder { public func useHeaps(_ heaps: [MTLHeap]) { __use(heaps, count: heaps.count) } - -#if os(macOS) - @available(macOS 10.13, *) + +#if os(macOS) || os(iOS) + @available(macOS 10.13, iOS 12.0, *) public func setViewports(_ viewports: [MTLViewport]) { __setViewports(viewports, count: viewports.count) } - @available(macOS 10.13, *) + @available(macOS 10.13, iOS 12.0, *) public func setScissorRects(_ scissorRects: [MTLScissorRect]) { __setScissorRects(scissorRects, count: scissorRects.count) }