---
title: "init(named:in:constantValues:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/lowlevelmaterialresource/surfaceshader/descriptor/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.

## Declaration

```swift
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.

## See Also

### Creating a descriptor

- [init(named:in:constantValues:uniformsSize:)](realitykit/lowlevelmaterialresource/surfaceshader/descriptor/init(named:in:constantvalues:uniformssize:).md)
- [init(named:in:constantValues:uniformsType:)](realitykit/lowlevelmaterialresource/surfaceshader/descriptor/init(named:in:constantvalues:uniformstype:).md)
