---
title: "setPurgeableState(_:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsimage/setpurgeablestate(_:)"
---

# setPurgeableState(_:)

Set (or query) the purgeable state of the image’s underlying texture.

## Declaration

```swift
func setPurgeableState(_ state: MPSPurgeableState) -> MPSPurgeableState
```

## Parameters

- `state`: The desired purgeable state of the image’s underlying texture.

## Return Value

Return Value Returns the prior purgeable state of the image’s underlying texture.

## Discussion

Discussion This method behaves the same as the setPurgeableState(_:) method of the MTLResource class, except that the state might be MPSPurgeableState.allocationDeferred, which means there is no underlying texture to mark as volatile or non-volatile. Attempts to set a purgeable state on MTLTexture objects that have not yet been allocated will be ignored.

## See Also

### Methods

- [MPSPurgeableState](metalperformanceshaders/mpspurgeablestate.md)
