我正在使用 MTKView 绘图
override func draw(_ rect: CGRect) {
var pixelBuffer: CVPixelBuffer?
syncQueue.sync {
pixelBuffer = internalPixelBuffer
}
guard let drawable = currentDrawable,
let currentRenderPassDescriptor = currentRenderPassDescriptor,
let previewPixelBuffer = pixelBuffer else {
return
}
...
}
如果可以设置此渲染通道描述符的 loadAction 和清除颜色,我不会这样做。默认透明色是否设置为黑色?