<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLIOScratchBuffer",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLIOScratchBuffer"
  },
  "title" : "MTLIOScratchBuffer"
}
-->

# MTLIOScratchBuffer

A protocol your app implements that wraps a Metal buffer instance to serve as scratch memory for an input/output command queue.

```
protocol MTLIOScratchBuffer : NSObjectProtocol
```

## Overview

Your app can reintegrate an [`MTLIOScratchBuffer`](/documentation/Metal/MTLIOScratchBuffer) instance’s underlying memory back into a memory pool by overriding your type’s <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/dealloc> method. The system calls the method when an input/output command queue no longer needs a scratch buffer.

## Topics

### Wrapping a buffer

[`buffer`](/documentation/Metal/MTLIOScratchBuffer/buffer)

A Metal buffer that serves as scratch memory for an input/output command queue.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)