 		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)")
 

			// vertex buffer should be filled with vertexes then draw it

			do {

				let encoder = commandBuffer.makeRenderCommandEncoder(descriptor: context.renderPassDescriptor)
				encoder.setRenderPipelineState(self.renderPipelineState)

				encoder.setFrontFacing(.clockwise)
				encoder.setVertexBuffer(vertexBuffer.buffer, offset: 0, at: 0)
				encoder.setVertexBuffer(uniformsBuffer, offset: 0, at: 1)

				encoder.setFragmentTexture(texture, at: 0)
				encoder.setFragmentSamplerState(self.colorSamplerState, at: 0)

				encoder.drawPrimitives(type: .point, vertexStart: 0, vertexCount: vertexBuffer.count)
				encoder.endEncoding()
			}


		guard cgPaths.count > 0 else { return }

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

