https://developer.apple.com/documentation/metal/mtlcommandencoder/1458041-pushdebuggroup
PushDebugGroups
https://developer.apple.com/documentation/metal/mtlcommandencoder
这个encoder我之前在其它api里没见过 就对应我tbdr里面提到的renderpass
有四种
An encoder used for graphics rendering tasks. |
|
An encoder used for computational tasks. |
|
An encoder used for memory management tasks. |
|
An encoder used for multiple graphics rendering tasks encoded in parallel. |
https://developer.apple.com/documentation/metal/mtlcommandbuffer/1639924-gpustarttime
https://developer.apple.com/documentation/metal/mtlcommandbuffer/1442997-addcompletedhandler
https://developer.apple.com/documentation/metal/mtlcommandbuffer?language=objc
看了下cmdqueue和cmdbuffer和其它是一致的 只是往cmdbuffer上写命令的时候需要用到以上四种不同encoder来写不同功能的命令并且它们可以
按照次序(一次只能用一种)多个encoder写到一块cmdbuffer上 这样是不是我还是没法用cmd的
commandBuffer.addCompletedHandler { cb in
let executionDuration = cb.gpuEndTime - cb.gpuStartTime
/* ... */
}
拿到renderpass的时间。。。