Class

MTLFunctionConstant

A constant used to specialize the behavior of a shader.

Declaration

@interface MTLFunctionConstant : NSObject

Overview

Don’t create a MTLFunctionConstant object directly. Instead, the list of function constants for a function by querying the functionConstants property of a MTLFunction object.

A MTLFunctionConstant object should only be obtained from a nonspecialized function created with the newFunctionWithName: method. You only need a MTLFunctionConstant object if you don’t have sufficient information to create a MTLFunctionConstantValues object used to create a specialized function with the newFunctionWithName:constantValues:error: or newFunctionWithName:constantValues:completionHandler: method.

Topics

Reading the Function Constant's Properties

name

The name of the function constant.

type

The data type of the function constant.

index

The index of the function constant.

required

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

Relationships

Inherits From

See Also

Function Variants

MTLFunctionConstantValues

A set of constant values used to specialize a graphics or compute function.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software