【发布时间】:2019-07-09 11:14:48
【问题描述】:
我想使用 Metal Performance Shaders 处理来自深度缓冲区的信息,例如使用高斯或索贝尔着色器。
在使用MTLTexture 和depth32Float 像素格式时遇到问题。 MPSImageGaussianBlur 或任何其他性能着色器不接受它作为源纹理。
我尝试使用:depthBufferTexture.makeTextureView(pixelFormat: .bgra8Unorm) 进行转换,但出现错误提示:
validateArgumentsForTextureViewOnDevice:1406:断言失败
source texture pixelFormat (MTLPixelFormatDepth32Float) not castable.
有什么方法可以将depth32Float 转换为bgra8UNorm 或任何其他像素格式?
【问题讨论】:
标签: metalkit metal-performance-shaders