---
title: allowGPUOptimizedContents
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtltexturedescriptor/allowgpuoptimizedcontents
---

# allowGPUOptimizedContents

A Boolean value indicating whether the GPU is allowed to adjust the texture’s contents to improve GPU performance.

## Declaration

```swift
var allowGPUOptimizedContents: Bool { get set }
```

## Mentioned in

Optimizing texture data

## Discussion

Discussion The default value is true, which means that the Metal device is allowed to adjust the private layout of the texture in memory to improve GPU performance. For a shared or managed texture, this optimization can cause slower performance when accessing the texture from the CPU. Setting this property to false improves CPU performance at the cost of some GPU performance.

## 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)
- [resourceOptions](metal/mtltexturedescriptor/resourceoptions.md)
- [cpuCacheMode](metal/mtltexturedescriptor/cpucachemode.md)
- [storageMode](metal/mtltexturedescriptor/storagemode.md)
- [hazardTrackingMode](metal/mtltexturedescriptor/hazardtrackingmode.md)
- [usage](metal/mtltexturedescriptor/usage.md)
- [swizzle](metal/mtltexturedescriptor/swizzle.md)
- [MTLTextureSwizzleChannels](metal/mtltextureswizzlechannels.md)
