Contents

makeScratchBuffer(minimumSize:)

Creates a scratch memory buffer for an input/output command queue.

Declaration

func makeScratchBuffer(minimumSize: Int) -> (any MTLIOScratchBuffer)?

Parameters

  • minimumSize:

    The number of bytes the input/output command buffer needs to successfully run a command buffer.

Return Value

An MTLIOScratchBuffer instance that your app implements or nil.

Discussion

Your app can reduce additional callbacks from the framework by providing additional memory above minimumSize. If your implementation returns nil, the input/output command queue cancels the MTLIOCommandBuffer instance that needs the scratch buffer memory.