<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/CustomMaterial/ResourceStorage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation14CustomMaterialV15ResourceStorageV"
  },
  "title" : "CustomMaterial.ResourceStorage"
}
-->

# CustomMaterial.ResourceStorage

A container for resources that will be encoded into a CustomMaterial’s custom uniforms argument buffer.

```
struct ResourceStorage<UniformsType>
```

## Overview

An object of this type is passed to you in the callback closure passed to [`withMutableUniforms(ofType:stage:_:)`](/documentation/RealityKit/CustomMaterial/withMutableUniforms(ofType:stage:_:))
and allows you to set [`TextureResource`](/documentation/RealityKit/TextureResource) values within your custom uniforms argument buffer.

## Topics

### Subscripts

[`subscript<BufferType>(buffer _: KeyPath<UniformsType, UnsafeMutablePointer<BufferType>?>) -> LowLevelBuffer?`](/documentation/RealityKit/CustomMaterial/ResourceStorage/subscript(buffer:))

[`subscript(textureResource _: KeyPath<UniformsType, UInt64>) -> TextureResource`](/documentation/RealityKit/CustomMaterial/ResourceStorage/subscript(textureResource:))

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)