<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVMetalBufferCacheCreate(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "c:@F@CVMetalBufferCacheCreate"
  },
  "title" : "CVMetalBufferCacheCreate(_:_:_:_:)"
}
-->

# CVMetalBufferCacheCreate(_:_:_:_:)

```
func CVMetalBufferCacheCreate(_ allocator: CFAllocator?, _ cacheAttributes: CFDictionary?, _ metalDevice: any MTLDevice, _ cacheOut: UnsafeMutablePointer<CVMetalBufferCache?>) -> CVReturn
```

## Parameters

`allocator`

The CFAllocatorRef to use for allocating the cache.  May be NULL.

`cacheAttributes`

A CFDictionaryRef containing the attributes of the cache itself. May be NULL.

`metalDevice`

The Metal device for which the buffer objects will be created.

`cacheOut`

The newly created buffer cache will be placed here

## Return Value

Returns kCVReturnSuccess on success

## Discussion

\abstract Creates a new Buffer Cache.

---

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)