 		var uniforms = Uniforms(transform: transform, zoomScale: Float(context.zoomScale))
 		let uniformsBuffer = device.makeBuffer(bytes: &uniforms, length: MemoryLayout<Uniforms>.size, options: MTLResourceOptions())
 
+		let elementsBuffer = device.makeBuffer(length: MemoryLayout<BezierPathElement>.size * elementsCapacity, options: [.storageModeShared])
+		let vertexBuffer = device.makeBuffer(length: MemoryLayout<Vertex>.size * vertexCapacity, options: [.storageModePrivate])
+
 		for (index, elements) in elementsArray.enumerated() {
 			print("pass = \(index)")
 

		guard cgPaths.count > 0 else { return }

		let vertexCapacity = 10_000
		var elementsArray = [[BezierPathElement]]()
		let (w1, w2) = (32, 32)



			// build contiguous vertexes using computing shader from PathElement
			
			do {
				let encoder = commandBuffer.makeComputeCommandEncoder()
				encoder.setComputePipelineState(self.computePipelineState)
				let destinationArray = UnsafeMutablePointer<BezierPathElement>(OpaquePointer(elementsBuffer.contents()))
				for index in 0 ..< elements.count {
					destinationArray[index] = elements[index]
				}
				encoder.setBuffer(elementsBuffer, offset: 0, at: 0)
				encoder.setBuffer(vertexBuffer, offset: 0, at: 1)
				let threadgroupsPerGrid = MTLSizeMake(elements.count, 1, 1)
				let threadsPerThreadgroup = MTLSizeMake(1, 1, 1)
				encoder.dispatchThreadgroups(threadgroupsPerGrid, threadsPerThreadgroup: threadsPerThreadgroup)
