<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLIOCreateCompressionContext(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:5Metal29MTLIOCreateCompressionContextySvSgSS_So22MTLIOCompressionMethodVSitF"
  },
  "title" : "MTLIOCreateCompressionContext(_:_:_:)"
}
-->

# MTLIOCreateCompressionContext(_:_:_:)

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

```
func MTLIOCreateCompressionContext(_ path: String, _ type: MTLIOCompressionMethod, _ chunkSize: Int) -> MTLIOCompressionContext?
```

## 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.

---

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)