---
title: rootResource
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtltexture/rootresource
---

# rootResource

The resource that owns the storage for this texture.

## Declaration

```swift
var rootResource: (any MTLResource)? { get }
```

## Discussion

Discussion If the value is nil, then this texture image owns its own data. Otherwise, this value is the MTLResource instance used to create the texture. For example, it might be a texture that uses the contents of an MTLBuffer object or a texture view that reinterprets the contents of another MTLTexture.

## See Also

### Getting information about ancestor resources

- [parent](metal/mtltexture/parent.md)
- [parentRelativeLevel](metal/mtltexture/parentrelativelevel.md)
- [parentRelativeSlice](metal/mtltexture/parentrelativeslice.md)
- [buffer](metal/mtltexture/buffer.md)
- [bufferOffset](metal/mtltexture/bufferoffset.md)
- [bufferBytesPerRow](metal/mtltexture/bufferbytesperrow.md)
