草庐IT

threadsPerThreadgroup

全部标签

ios - 如何使用 Metal 自定义计算着色器并获得非常流畅的性能?

我正在尝试使用苹果提供的默认MPSKernal滤镜和自定义computeShaders通过Metal应用实时相机滤镜。在计算着色器中,我使用MPSImageGaussianBlur进行了就地编码代码在这里funcencode(tocommandBuffer:MTLCommandBuffer,sourceTexture:MTLTexture,destinationTexture:MTLTexture,cropRect:MTLRegion=MTLRegion.init(),offset:CGPoint){letblur=MPSImageGaussianBlur(device:device,