Hello, I have been working on a metal project recently, in which I am using metal performance shader.
Here is my problem: every time I try use GPU frame capture as long as I am using functions in MPS framework, the GPU frame capture fails.
If I don't use functions in MPS framework, the GPU frame capture works fine. The error only shows that a property "_descriptor" of command buffer is null.
Below is how I use MPS framework, is it my implementation wrong or gpu frame capture simply broke when using mps ?
let commandBuffer = commandQueue.makeCommandBuffer()
let renderPassDescriptor = MTLRenderPassDescriptor()
renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColor(red: 0.0, green:0.0 , blue: 0.0, alpha: 0.0)
renderPassDescriptor.colorAttachments[0].texture = pointTxt
renderPassDescriptor.colorAttachments[0].loadAction = .clear
renderPassDescriptor.colorAttachments[0].storeAction = .store
let renderEncoder = commandBuffer.makeRenderCommandEncoder(descriptor: renderPassDescriptor)
renderEncoder.pushDebugGroup("render points")
renderEncoder.label = "points"
renderEncoder.setRenderPipelineState(pipelineState)
renderEncoder.setVertexBuffer(vertexBuffer, offset: 0, at: 0)
renderEncoder.setVertexBuffer(uniformBuffer, offset: 0, at: 1)
renderEncoder.drawPrimitives(type: .point, vertexStart: 0, vertexCount: particleCount, instanceCount: 1)
renderEncoder.popDebugGroup()
renderEncoder.endEncoding()
let kernel = MPSImageGaussianBlur(device: device, sigma: 10.0)
kernel.encode(commandBuffer: commandBuffer, sourceTexture: pointTxt, destinationTexture: blurTxt)
commandBuffer.commit()
I will be extremely to any advice and commnent. Thank you!