<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKTextureLoader/Option/allocateMipmaps",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:@MTKTextureLoaderOptionAllocateMipmaps"
  },
  "title" : "allocateMipmaps"
}
-->

# allocateMipmaps

A key used to specify whether the texture loader should allocate memory for mipmaps in the texture.

```
static let allocateMipmaps: MTKTextureLoader.Option
```

## Discussion

The value for this key is an <doc://com.apple.documentation/documentation/Foundation/NSNumber> object containing a boolean value.

This option applies only if the texture being loaded does not contain mipmap data. When loading such a texture, if the value is <doc://com.apple.documentation/documentation/Swift/false>, only the texture is loaded and its mipmap contents are undefined. If the value is <doc://com.apple.documentation/documentation/Swift/true>, a full set of mipmap levels are allocated for the texture when the texture is loaded, and it is your responsibility to generate the mipmap contents. If this key is not specified and the image being loaded contains data for mipmaps, the mipmap memory is allocated and the image data is loaded.

> Note:
> This option only allocates mipmap memory for the texture. To generate the actual mipmaps for the texture, use the ``doc://com.apple.metalkit/documentation/MetalKit/MTKTextureLoader/Option/generateMipmaps`` option and set it to <doc://com.apple.documentation/documentation/Swift/true>.

---

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)