<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer24LowLevelMaterialResourceC13SurfaceShaderC10DescriptorV"
  },
  "title" : "LowLevelMaterialResource.SurfaceShader.Descriptor"
}
-->

# LowLevelMaterialResource.SurfaceShader.Descriptor

The name and library for a user-authored Metal surface shader function.

```
struct Descriptor
```

## Topics

### Creating a descriptor

[`init(named: String, in: any MTLLibrary, constantValues: MTLFunctionConstantValues)`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor/init(named:in:constantValues:))

Creates a descriptor referencing the named function in the given library,
with the provided function constant values.

[`init(named: String, in: any MTLLibrary, constantValues: MTLFunctionConstantValues, uniformsSize: Int)`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor/init(named:in:constantValues:uniformsSize:))

Creates a descriptor for a surface shader that accepts a custom uniforms argument buffer.

[`init<UniformsType>(named: String, in: any MTLLibrary, constantValues: MTLFunctionConstantValues, uniformsType: UniformsType.Type)`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor/init(named:in:constantValues:uniformsType:))

Creates a descriptor for a surface shader that accepts a custom uniforms argument buffer,
deriving the buffer size from `uniformsType`.

### Configuring the shader function

[`var library: any MTLLibrary`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor/library)

The Metal library that contains the function.

[`var constantValues: MTLFunctionConstantValues`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor/constantValues)

The constant values to use when creating the function. These correspond to constants
defined in your Metal code.

### Initializers

[`init(named: String, in: any MTLLibrary)`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor/init(named:in:))

Creates a descriptor referencing the named function in the given library.

### Instance Properties

[`var name: String`](/documentation/RealityKit/LowLevelMaterialResource/SurfaceShader/Descriptor/name)

The name of the Metal function in the library.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)