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

# CVMetalTextureCacheFlush(_:_:)

Manually flushes the contents of the provided texture cache.

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

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

---

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)