         var blocks: [(Block, CIImage)] = []
         
         let _minX = minX / blockSize * blockSize
-        let _minY = minY / blockSize * blockSize - blockSize
+        let _minY = minY / blockSize * blockSize
         
         for y in stride(from: _minY, to: maxY, by: blockSize) {
             for x in stride(from: _minX, to: maxX, by: blockSize) {

        }
    }
    
    func make_context(commandQueue: MTLCommandQueue, outputPremultiplied: Bool) -> CIContext? {
        
        cache.lck.lock()
        defer { cache.lck.unlock() }
        
        if cache.pool[commandQueue] == nil {
            cache.pool[commandQueue] = CIContextPool(commandQueue: commandQueue)
        }
        
        return cache.pool[commandQueue]?.makeContext(colorSpace: colorSpace, outputPremultiplied: outputPremultiplied)
    }
    
    func render(to texture: MTLTexture, commandBuffer: MTLCommandBuffer, bounds: Rect) {
        
        guard let renderer = self.make_context(commandQueue: commandBuffer.commandQueue, outputPremultiplied: colorSpace == nil) else { return }
        guard let texture_renderer = colorSpace == nil ? renderer : self.make_context(commandQueue: commandBuffer.commandQueue, outputPremultiplied: true) else { return }
        let workingColorSpace = texture_renderer.workingColorSpace ?? CGColorSpaceCreateDeviceRGB()
        
        guard let minX = Int(exactly: floor(bounds.minX)) else { return }

            }
        }
        
        for (block, image) in blocks {
            
            let _minX = max(0, block.minX - minX)
            let _minY = max(0, block.minY - minY)
            let _maxX = min(maxX - minX, block.maxX - minX)
            let _maxY = min(maxY - minY, block.maxY - minY)
            
            let width = _maxX - _minX
            let height = _maxY - _minY
            
            guard width > 0 && height > 0 else { return }
            
            let bounds = CGRect(x: _minX, y: _minY, width: width, height: height)
            let _image = image.transformed(by: SDTransform.translate(x: Double(block.minX - minX), y: Double(block.minY - minY)))
            
            texture_renderer.render(_image, to: surface, bounds: bounds, colorSpace: workingColorSpace)
        }
    }
}
