 	func render(context: RenderContext, texture: MTLTexture, cgPaths: [CGPath]) {
 		guard cgPaths.count > 0 else { return }
 
-		let vertexCapacity = 10_000
-		let elementsCapacity = 1_000
+		let vertexCapacity = 40_000
+		let elementsCapacity = 4_000
 		var elementsArray = [[BezierPathElement]]()
 		let (w1, w2) = (32, 32)
 

			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)


		var elements = [BezierPathElement]()
		var vertexCount: Int = 0
		var elementCount: Int = 0

		// due to limited memory resource, all vertexes may not be able to render at a time, but on the other hand, it should not render segment
		// by segment because of performance.  Following code sprits line segments by vertex buffer's capacity.

		for segment in segments {
			let count = Int(segment.length / 2)
			if vertexCount + count > vertexCapacity || elementCount + 1 > elementsCapacity {
				elementsArray.append(elements)
				elements = [BezierPathElement]()
				vertexCount = 0
				elementCount = 0
			}
			let element = BezierPathElement(type: segment.type, numberOfVertexes: count, vertexIndex: vertexCount, w1: w1, w2: w2,
					p0: Point(segment.p0), p1: Point(segment.p1), p2: Point(segment.p2), p3: Point(segment.p3))
			elements.append(element)
			vertexCount += count
			elementCount += 1
		}
		if elements.count > 0 {
			elementsArray.append(elements)
