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

# generateMipmaps

A key used to specify whether the texture loader should generate mipmaps for the texture.

```
static let generateMipmaps: MTKTextureLoader.Option
```

## Discussion

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

If the value is <doc://com.apple.documentation/documentation/Swift/true>, the resulting texture will be created with mipmaps. If the file being loaded contains data for mipmaps (such as in a PVR or KTX file), specifying this option will overwrite the existing mipmap data in the loaded texture.

This option can be used only if the pixel format of the texture is filterable and color-renderable; see the [Pixel Format Capabilities](https://developer.apple.com/metal/capabilities/) for more information.

This option also implies that [`allocateMipmaps`](/documentation/MetalKit/MTKTextureLoader/Option/allocateMipmaps) is <doc://com.apple.documentation/documentation/Swift/true>. Specifying this option causes the [`MTKTextureLoader`](/documentation/MetalKit/MTKTextureLoader) object to submit work to the GPU on your behalf.

---

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)