---
title: MTLResourceStateCommandEncoder
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtlresourcestatecommandencoder
---

# MTLResourceStateCommandEncoder

An encoder that encodes commands that modify resource configurations.

## Declaration

```swift
protocol MTLResourceStateCommandEncoder : MTLCommandEncoder
```

## Mentioned in

Assigning memory to sparse textures

## Overview

Overview Use a resource state command encoder to manage memory mappings for sparse textures. Your app does not define classes that implement this protocol. To create an MTLResourceStateCommandEncoder instance, call the makeResourceStateCommandEncoder() method of the MTLCommandBuffer instance into which you want to encode blit commands. Next, call methods on the MTLResourceStateCommandEncoder instance to enqueue state updates. Finally, call endEncoding() to finish the encoding process.

## Topics

### Updating texture memory assignments

- [updateTextureMapping(_:mode:region:mipLevel:slice:)](metal/mtlresourcestatecommandencoder/updatetexturemapping(_:mode:region:miplevel:slice:).md)
- [updateTextureMappings(_:mode:regions:mipLevels:slices:numRegions:)](metal/mtlresourcestatecommandencoder/updatetexturemappings(_:mode:regions:miplevels:slices:numregions:).md)
- [MTLSparseTextureMappingMode](metal/mtlsparsetexturemappingmode.md)

### Updating texture memory assignments indirectly

- [updateTextureMapping(_:mode:indirectBuffer:indirectBufferOffset:)](metal/mtlresourcestatecommandencoder/updatetexturemapping(_:mode:indirectbuffer:indirectbufferoffset:).md)

### Performing fence operations

- [update(_:)](metal/mtlresourcestatecommandencoder/update(_:).md)
- [wait(for:)](metal/mtlresourcestatecommandencoder/wait(for:).md)

### Instance Methods

- [moveTextureMappings(sourceTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:destinationTexture:destinationSlice:destinationLevel:destinationOrigin:)](metal/mtlresourcestatecommandencoder/movetexturemappings(sourcetexture:sourceslice:sourcelevel:sourceorigin:sourcesize:destinationtexture:destinationslice:destinationlevel:destinationorigin:).md)

## Relationships

### Inherits From

- [MTLCommandEncoder](metal/mtlcommandencoder.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Sparse textures

- [Managing sparse texture memory](metal/managing-sparse-texture-memory.md)
- [Creating sparse heaps and sparse textures](metal/creating-sparse-heaps-and-sparse-textures.md)
- [Converting between pixel regions and sparse tile regions](metal/converting-between-pixel-regions-and-sparse-tile-regions.md)
- [Assigning memory to sparse textures](metal/assigning-memory-to-sparse-textures.md)
- [Reading and writing to sparse textures](metal/reading-and-writing-to-sparse-textures.md)
- [Estimating how often a texture region is accessed](metal/estimating-how-often-a-texture-region-is-accessed.md)
- [MTLResourceStatePassDescriptor](metal/mtlresourcestatepassdescriptor.md)
- [MTLResourceStatePassSampleBufferAttachmentDescriptor](metal/mtlresourcestatepasssamplebufferattachmentdescriptor.md)
- [MTLResourceStatePassSampleBufferAttachmentDescriptorArray](metal/mtlresourcestatepasssamplebufferattachmentdescriptorarray.md)
- [MTLMapIndirectArguments](metal/mtlmapindirectarguments.md)
