---
title: resourceOptions
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtltexturedescriptor/resourceoptions
---

# resourceOptions

The behavior of a new memory allocation.

## Declaration

```swift
var resourceOptions: MTLResourceOptions { get set }
```

## Discussion

Discussion This property only has an effect when you are allocating a new texture. If you are creating a texture whose data comes from another MTLResource object, this property value is ignored, and the value of the original resource is used instead. The value of this property aggregates the values of storageMode, cpuCacheMode, and hazardTrackingMode. If you modify this property, the other properties also change, and vice versa.

## See Also

### Specifying texture attributes

- [textureType](metal/mtltexturedescriptor/texturetype.md)
- [pixelFormat](metal/mtltexturedescriptor/pixelformat.md)
- [width](metal/mtltexturedescriptor/width.md)
- [height](metal/mtltexturedescriptor/height.md)
- [depth](metal/mtltexturedescriptor/depth.md)
- [mipmapLevelCount](metal/mtltexturedescriptor/mipmaplevelcount.md)
- [sampleCount](metal/mtltexturedescriptor/samplecount.md)
- [arrayLength](metal/mtltexturedescriptor/arraylength.md)
- [cpuCacheMode](metal/mtltexturedescriptor/cpucachemode.md)
- [storageMode](metal/mtltexturedescriptor/storagemode.md)
- [hazardTrackingMode](metal/mtltexturedescriptor/hazardtrackingmode.md)
- [allowGPUOptimizedContents](metal/mtltexturedescriptor/allowgpuoptimizedcontents.md)
- [usage](metal/mtltexturedescriptor/usage.md)
- [swizzle](metal/mtltexturedescriptor/swizzle.md)
- [MTLTextureSwizzleChannels](metal/mtltextureswizzlechannels.md)
