Skip to content

Commit eebeae9

Browse files
authored
Merge pull request #19435 from apple/update-arkit-metal
2 parents 6930a0f + a3f5eb8 commit eebeae9

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

stdlib/public/SDK/ARKit/ARKit.swift

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,60 @@ extension ARPlaneGeometry {
190190
return Array(buffer)
191191
}
192192
}
193+
194+
@available(iOS, introduced: 12.0)
195+
extension ARPlaneAnchor {
196+
/**
197+
A value describing the classification of a plane anchor.
198+
*/
199+
public enum Classification {
200+
201+
public enum Status {
202+
203+
/** Plane classification is currently unavailable. */
204+
case notAvailable
205+
206+
/** ARKit has not yet determined the classification of this plane. */
207+
case undetermined
208+
209+
/** ARKit is confident the plane is not any of the known classes. */
210+
case unknown
211+
}
212+
213+
/** The classification is not any of the known classes. */
214+
case none(Status)
215+
216+
case wall
217+
218+
case floor
219+
220+
case ceiling
221+
222+
case table
223+
224+
case seat
225+
}
226+
227+
228+
/**
229+
Classification of the plane.
230+
*/
231+
public var classification: ARPlaneAnchor.Classification {
232+
switch __classification {
233+
case .wall: return .wall
234+
case .floor: return .floor
235+
case .ceiling: return .ceiling
236+
case .table: return .table
237+
case .seat: return .seat
238+
case .none: fallthrough
239+
default:
240+
switch __classificationStatus {
241+
case .notAvailable: return .none(.notAvailable)
242+
case .unknown: return .none(.unknown)
243+
case .undetermined: fallthrough
244+
case .known: fallthrough
245+
default: return .none(.undetermined)
246+
}
247+
}
248+
}
249+
}

stdlib/public/SDK/Metal/Metal.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ extension MTLRenderCommandEncoder {
156156
public func useHeaps(_ heaps: [MTLHeap]) {
157157
__use(heaps, count: heaps.count)
158158
}
159-
160-
#if os(macOS)
161-
@available(macOS 10.13, *)
159+
160+
#if os(macOS) || os(iOS)
161+
@available(macOS 10.13, iOS 12.0, *)
162162
public func setViewports(_ viewports: [MTLViewport]) {
163163
__setViewports(viewports, count: viewports.count)
164164
}
165165

166-
@available(macOS 10.13, *)
166+
@available(macOS 10.13, iOS 12.0, *)
167167
public func setScissorRects(_ scissorRects: [MTLScissorRect]) {
168168
__setScissorRects(scissorRects, count: scissorRects.count)
169169
}

0 commit comments

Comments
 (0)