---
title: "CVMetalTextureCacheFlush(_:_:)"
framework: corevideo
role: symbol
role_heading: Function
path: "corevideo/cvmetaltexturecacheflush(_:_:)"
---

# CVMetalTextureCacheFlush(_:_:)

Manually flushes the contents of the provided texture cache.

## Declaration

```swift
func CVMetalTextureCacheFlush(_ textureCache: CVMetalTextureCache, _ options: CVOptionFlags)
```

## Parameters

- `textureCache`: The texture cache object to flush.
- `options`: Options for the flush operation. This parameter is currently unused and should be 0.

## Discussion

Discussion Texture caches automatically flush unused resources when you call the CVMetalTextureCacheCreateTextureFromImage(_:_:_:_:_:_:_:_:_:) function and on the time interval specified by kCVMetalTextureCacheMaximumTextureAgeKey. Use this method when you need fine-grained control over cache contents and memory.

## See Also

### Functions

- [CVMetalTextureCacheCreate(_:_:_:_:_:)](corevideo/cvmetaltexturecachecreate(_:_:_:_:_:).md)
- [CVMetalTextureCacheCreateTextureFromImage(_:_:_:_:_:_:_:_:_:)](corevideo/cvmetaltexturecachecreatetexturefromimage(_:_:_:_:_:_:_:_:_:).md)
- [CVMetalTextureCacheGetTypeID()](corevideo/cvmetaltexturecachegettypeid().md)
