---
title: required
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlfunctionconstant/required
---

# required

A Boolean value indicating whether the function constant needs to be provided to specialize the function.

## Declaration

```swift
var required: Bool { get }
```

## Discussion

Discussion This value is true if a constant value needs to be provided for the function constant. A function constant is optional only if it is referenced in a call to the built-in is_function_constant_defined(name) function. Refer to the Metal Shading Language Guide for more information.

## See Also

### Reading the function constant’s properties

- [name](metal/mtlfunctionconstant/name.md)
- [type](metal/mtlfunctionconstant/type.md)
- [index](metal/mtlfunctionconstant/index.md)
