---
title: "generateMipmaps(texture:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4computecommandencoder/generatemipmaps(texture:)"
---

# generateMipmaps(texture:)

Encodes a command that generates mipmaps for a texture instance from the base mipmap level up to the highest mipmap level.

## Declaration

```swift
func generateMipmaps(texture: any MTLTexture)
```

## Parameters

- `texture`: A mipmapped, color-renderable or color-filterable doc://com.apple.metal/documentation/Metal/MTLTexture instance the command generates mipmaps for.

## Discussion

Discussion This method generates mipmaps for a mipmapped texture. The texture you provide needs to have a mipmapLevelCount greater than 1, and a color-renderable or color-filterable pixelFormat.
