Hooking and capture serialization for MTLCommandBuffer APIs enqueue and waitUntilCompleted (required to capture test programs with enqueue support). These chunks are added to the command buffer record in order that the chunks are only included in the capture when the command buffer is included. The replay support for these APIs treats them at the global scope and not replayed within the command buffer. The enqueue chunk might not be required or used by replay in the future (currently it is used to verify the order of command buffer reply matches what is expected).
Updated the MetalCmdBufferRecordingInfo struct to store the CA::MetalLayer & WrappedMTLTexture from the MTL::Drawable instead of the MTL::Drawable. This avoids validation asserts about accessing the texture of an MTL::Drawable after calling MTLCommandBuffer::presentDrawable.
Changed member data bool present to uint32_t flags to be able to efficiently store more than one flag. Added MetalCmdBufferStatus enum to store different status flags.
Changed the return of WrappedMTLCommandBuffer::GetCommandQueueReturn to be a WrappedMTLCommandQueue * instead of MTL::CommandQueue *. It makes sense and is more natural to return the m_CommandQueue without casting it. The previous API usage was for the Objective C bridge layer which worked with `MTL::CommandQueue *. This is not required now the Objective C and C++ wrapping/unwrapping has been simplified.
This PR represents the final Objective C change in the current Metal development branch 🥳
Description
Hooking and capture serialization for
MTLCommandBuffer
APIsenqueue
andwaitUntilCompleted
(required to capture test programs withenqueue
support). These chunks are added to the command buffer record in order that the chunks are only included in the capture when the command buffer is included. The replay support for these APIs treats them at the global scope and not replayed within the command buffer. Theenqueue
chunk might not be required or used by replay in the future (currently it is used to verify the order of command buffer reply matches what is expected).Updated the
MetalCmdBufferRecordingInfo
struct to store theCA::MetalLayer
&WrappedMTLTexture
from theMTL::Drawable
instead of theMTL::Drawable
. This avoids validation asserts about accessing the texture of anMTL::Drawable
after callingMTLCommandBuffer::presentDrawable
.Changed member data
bool present
touint32_t flags
to be able to efficiently store more than one flag. AddedMetalCmdBufferStatus
enum to store different status flags.Changed the return of
WrappedMTLCommandBuffer::GetCommandQueueReturn
to be aWrappedMTLCommandQueue *
instead ofMTL::CommandQueue *
. It makes sense and is more natural to return them_CommandQueue
without casting it. The previous API usage was for the Objective C bridge layer which worked with `MTL::CommandQueue *. This is not required now the Objective C and C++ wrapping/unwrapping has been simplified.This PR represents the final Objective C change in the current Metal development branch 🥳