 */
 
 class PoiRenderer {
+	typealias PoiPrimitive = PoiPlane.PoiPlanePrimitive
+	typealias RenderList = ContiguousArray<PoiPrimitive>
+	
 	static let kMaxVisibleInstances = 1024
 	enum Visibility {
 		static let FadeInDuration = 0.4

		encoder.setVertexBuffer(instanceUniforms[bufferIndex], offset: 0, index: 2)
		
		var instanceCursor = 0
		for poiPlane in renderList {
			encoder.setVertexBufferOffset(instanceCursor, index: 2)
			render(primitive: poiPlane.primitive, into: encoder)
			
			instanceCursor += MemoryLayout<InstanceUniforms>.stride
		}

			self.instanceUniforms = (0..<bufferCount).map { _ in
				return device.makeBuffer(length: PoiRenderer.kMaxVisibleInstances * MemoryLayout<InstanceUniforms>.stride, options: .storageModeShared)!
			}
			self.renderLists = Array(repeating: ContiguousArray(), count: bufferCount)
		} catch let error {
			fatalError(error.localizedDescription)
		}
