<!--
{
  "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/init(named:in:constantValues:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer24LowLevelMaterialResourceC13SurfaceShaderC10DescriptorV5named2in14constantValuesAGSS_So10MTLLibrary_pSo019MTLFunctionConstantN0Ctcfc"
  },
  "title" : "init(named:in:constantValues:)"
}
-->

# init(named:in:constantValues:)

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

```
init(named name: String, in library: any MTLLibrary, constantValues: MTLFunctionConstantValues)
```

## Parameters

`name`

The name of the Metal function in the library.

`library`

The Metal library that contains the function.

`constantValues`

The Metal function constant values to specialize the function with. The function descriptor takes a snapshot of the constant values passed in.

---

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)