<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLIOCreateCompressionContext",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@F@MTLIOCreateCompressionContext"
  },
  "title" : "MTLIOCreateCompressionContext"
}
-->

# MTLIOCreateCompressionContext

Creates a compression context that you use to compress data into a single file.

```
extern MTLIOCompressionContextMTLIOCreateCompressionContext(const char *path, MTLIOCompressionMethod type, size_t chunkSize);
```

## Parameters

`path`

A location in the file system where the function creates the new, compressed file.

`type`

A compression codec the function uses to compress data resource file’s compression format.

`chunkSize`

The number of uncompressed bytes the compression codec compresses at a time.

## Discussion

---

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)