Skip to content

Commit

Permalink
Merge pull request #19517 from apple/xcode-10-swift-4.2
Browse files Browse the repository at this point in the history
Update ARKit and Metal for Xcode 10
  • Loading branch information
shahmishal authored Sep 25, 2018
2 parents 01644d5 + 3729a48 commit f4134eb
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 4 deletions.
57 changes: 57 additions & 0 deletions stdlib/public/SDK/ARKit/ARKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}
8 changes: 4 additions & 4 deletions stdlib/public/SDK/Metal/Metal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f4134eb

Please sign in to comment.