Contents

setConstantValue(_:type:index:)

Sets a value for a function constant at a specific index.

Declaration

func setConstantValue(_ value: UnsafeRawPointer, type: MTLDataType, index: Int)

Parameters

  • value:

    A pointer to the constant value.

  • type:

    The data type of the function constant.

  • index:

    The index of the function constant.

Discussion

Declare a single function constant in Metal Shading Language (MSL).

constant bool a [[ function_constant(0) ]];

Set its value by assigning with a specific index.

See Also

Related Documentation

  • Metal Shading Language Guide
  • Metal Programming Guide

Setting constant values