2

3D オブジェクトを表示するための簡単な金属コードを作成しました。これで、私の Mac でコードが正常に動作するようになりました。

同じxcode 8がインストールされた別の同一のMacマシンに移動すると、次のエラーが表示されます

/BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-85.83/ToolsLayers/Debug/MTLDebugRenderCommandEncoder.mm:969: failed assertion `For depth attachment, the renderPipelineState pixelFormat must be MTLPixelFormatInvalid, as no texture is set.'

そして、次の地域でエラーを示しています:

let renderPassDescriptor = MTLRenderPassDescriptor()
        renderPassDescriptor.colorAttachments[0].texture = drawable.texture
        renderPassDescriptor.colorAttachments[0].loadAction = .Clear
        renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
        renderPassDescriptor.colorAttachments[0].storeAction = .Store
        renderPassDescriptor.depthAttachment.loadAction = .Clear
        renderPassDescriptor.depthAttachment.clearDepth = 1.0
        renderPassDescriptor.depthAttachment.storeAction = .MultisampleResolve
        let commandBuffer = commandQueue.commandBuffer()
        commandBuffer.addCompletedHandler { (commandBuffer) -> Void in
            dispatch_semaphore_signal(self.bufferProvider.avaliableResourcesSemaphore)
        }
        renderEncoder = commandBuffer.renderCommandEncoderWithDescriptor(renderPassDescriptor)
        //For now cull mode is used instead of depth buffer
        renderEncoder.setCullMode(.None)
       // renderEncoder.setDepthClipMode(.Clip)
        renderEncoder.setDepthStencilState(depthStencilStateE)
        renderEncoder.setRenderPipelineState(pipelineState)

彼は最後の行でこのエラーが発生しています。誰でも助けることができますか?

4

0 に答える 0