摘自:
https://www.jb51.cc/swift/443956.html
核心代码
let ptr: UnsafeRawPointer = ...
let length: Int = ...
let float4Ptr = ptr.bindMemory(to: float4.self,capacity: length)
let float4Buffer = UnsafeBufferPointer(start: float4Ptr,count: length)
let output = Array(float4Buffer)
网友评论