问题描述
自iOS 14出现以来,我在调用MetalDevice?.makeRenderPipelinestate时,在下面的Metal代码的以下行中崩溃了。
commandQueue = MetalCamera.renderCommandQueue
MetalLibrary = MetalDevice?.makeDefaultLibrary()
if let library = MetalLibrary {
let vertexShader = library.makeFunction(name: "vertexShaderPassthru")
let fragmentShaderYUV = library.makeFunction(name: "fragmentShaderYUV")
let pipelineDescriptorYUV = MTLRenderPipelineDescriptor()
pipelineDescriptorYUV.sampleCount = 1
pipelineDescriptorYUV.colorAttachments[0].pixelFormat = .bgra8Unorm
pipelineDescriptorYUV.depthAttachmentPixelFormat = .invalid
pipelineDescriptorYUV.vertexFunction = vertexShader
pipelineDescriptorYUV.fragmentFunction = fragmentShaderYUV
do {
/* Crashes in the line below */
try pipelinestateYUV = MetalDevice?.makeRenderPipelinestate(descriptor: pipelineDescriptorYUV)
}
catch {
assertionFailure("Failed creating a render state pipeline. Can't render the texture without one.")
return
}
....
}
我在Firebase控制台中看到此崩溃日志,无法重现。
Crashed: com.capturePipeline.videoOut
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000007dffff0008
keyboard_arrow_up
Crashed: com.capturePipeline.videoOut
0 libobjc.A.dylib 0x1ad787978 objc_msgSend + 24
1 Metal 0x1aeed563c validateWithDevice(id<MTLDevice>,MTLRenderPipelineDescriptorPrivate const&) + 324
2 Metal 0x1aeed5458 -[MTLRenderPipelineDescriptorInternal validateWithDevice:error:] + 104
3 AGXMetalA13 0x1e2166774 (Missing)
4 AGXMetalA13 0x1e2168b80 (Missing)
5 MyApp 0x102eaf184 MetalFrameRenderer.setupMetalPipeline() + 332 (MetalFrameRenderer.swift:332)
有人可以告诉我这里有什么问题吗,崩溃日志是什么意思?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)