<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSTemporaryImage/init(commandBuffer:imageDescriptor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSTemporaryImage(cm)temporaryImageWithCommandBuffer:imageDescriptor:"
  },
  "title" : "init(commandBuffer:imageDescriptor:)"
}
-->

# init(commandBuffer:imageDescriptor:)

Initializes a temporary image for use on a command buffer.

```
convenience init(commandBuffer: any MTLCommandBuffer, imageDescriptor: MPSImageDescriptor)
```

## Parameters

`commandBuffer`

The command buffer on which the temporary image will be exclusively used.

`imageDescriptor`

An image descriptor that describes the image to create.

## Return Value

A valid [`MPSTemporaryImage`](/documentation/MetalPerformanceShaders/MPSTemporaryImage) object.

## Discussion

The temporary image will be released when the command buffer is committed. The underlying texture will become invalid before this time due to the action of the [`readCount`](/documentation/MetalPerformanceShaders/MPSTemporaryImage/readCount) property.

---

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)