---
title: "updateTextureMappings(_:mode:regions:mipLevels:slices:numRegions:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlresourcestatecommandencoder/updatetexturemappings(_:mode:regions:miplevels:slices:numregions:)"
---

# updateTextureMappings(_:mode:regions:mipLevels:slices:numRegions:)

Encodes a command to update memory mappings for multiple regions inside a texture.

## Declaration

```swift
func updateTextureMappings(_ texture: any MTLTexture, mode: MTLSparseTextureMappingMode, regions: UnsafePointer<MTLRegion>, mipLevels: UnsafePointer<Int>, slices: UnsafePointer<Int>, numRegions: Int)
```

```swift
optional func updateTextureMappings(_ texture: any MTLTexture, mode: MTLSparseTextureMappingMode, regions: UnsafePointer<MTLRegion>, mipLevels: UnsafePointer<Int>, slices: UnsafePointer<Int>, numRegions: Int)
```

## Parameters

- `texture`: The sparse texture to update.
- `mode`: The change to make to the texture mapping.
- `regions`: A pointer to an array of regions to change. You need to provide as many regions as you specify in the numRegions parameter.
- `mipLevels`: A pointer to an array of mipmap levels to change. You need to provide as many entries as you specify in the numRegions parameter.
- `slices`: A pointer to an array of slices to change. You need to provide as many entries as you specify in the numRegions parameter.
- `numRegions`: The number of regions to update.

## See Also

### Updating texture memory assignments

- [updateTextureMapping(_:mode:region:mipLevel:slice:)](metal/mtlresourcestatecommandencoder/updatetexturemapping(_:mode:region:miplevel:slice:).md)
- [MTLSparseTextureMappingMode](metal/mtlsparsetexturemappingmode.md)
