---
title: "CVMetalBufferCacheCreate(_:_:_:_:)"
framework: corevideo
role: symbol
role_heading: Function
path: "corevideo/cvmetalbuffercachecreate(_:_:_:_:)"
---

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

## Declaration

```swift
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

Return Value Returns kCVReturnSuccess on success

## Discussion

Discussion Creates a new Buffer Cache.

## See Also

### Functions

- [CVMetalBufferCacheCreateBufferFromImage(_:_:_:_:)](corevideo/cvmetalbuffercachecreatebufferfromimage(_:_:_:_:).md)
- [CVMetalBufferCacheFlush(_:_:)](corevideo/cvmetalbuffercacheflush(_:_:).md)
- [CVMetalBufferCacheGetTypeID()](corevideo/cvmetalbuffercachegettypeid().md)
- [CVMetalBufferGetBuffer(_:)](corevideo/cvmetalbuffergetbuffer(_:).md)
- [CVMetalBufferGetTypeID()](corevideo/cvmetalbuffergettypeid().md)
