Configuration used to compile a ``PortalMaterial/Program``.
Members (7)
get · iOS 27.0+
inputValues
TypeScript
get inputValues(): Record<string, MaterialParameters_Value>
Swift declaration
var inputValues: [String : MaterialParameters.Value]
Initial values for the inputs that the shader graph declares.
Each entry binds a graph input by name to a starting value. The
engine applies these values when a ``PortalMaterial`` is first
created from the resulting program; you can change any of them
at runtime by calling
``PortalMaterial/setParameter(name:value:)``.
Inputs that the graph declares as function constants belong in
``constantValues`` instead.
set · iOS 27.0+
inputValues
TypeScript
set inputValues(value: Record<string, MaterialParameters_Value>)
Swift declaration
var inputValues: [String : MaterialParameters.Value]
Initial values for the inputs that the shader graph declares.
Each entry binds a graph input by name to a starting value. The
engine applies these values when a ``PortalMaterial`` is first
created from the resulting program; you can change any of them
at runtime by calling
``PortalMaterial/setParameter(name:value:)``.
Inputs that the graph declares as function constants belong in
``constantValues`` instead.
get · iOS 27.0+
shaderGraph
TypeScript
get shaderGraph(): SDKHandle
Swift declaration
var shaderGraph: ShaderGraph
The shader graph that describes the shading logic for this program.
set · iOS 27.0+
shaderGraph
TypeScript
set shaderGraph(value: SDKHandle)
Swift declaration
var shaderGraph: ShaderGraph
The shader graph that describes the shading logic for this program.
Creates a descriptor with the given shader graph and optional
initial values.
- Parameters:
- shaderGraph: The shader graph that describes the program's
surface and, optionally, geometry-modifier shading.
- inputValues: Initial values for the inputs the shader graph
declares. Defaults to an empty dictionary, leaving each
input at its declared default.
- constantValues: Values for the function-constant inputs the
shader graph declares. Defaults to an empty
`MTLFunctionConstantValues`, leaving each function constant
at its declared default.
get · iOS 27.0+
constantValues
TypeScript
get constantValues(): _Metal_MTLFunctionConstantValues
Swift declaration
var constantValues: MTLFunctionConstantValues
Values for the function-constant inputs that the shader graph
declares.
Function constants are baked into the compiled shader at program
creation time and can't be changed afterward. Use them for
values that don't vary at runtime — for example, a feature flag
that selects between two code paths — to eliminate runtime
branching and produce a leaner shader. To vary a value across
frames or instances, declare it as a regular graph input and
supply it through ``inputValues`` or
``PortalMaterial/setParameter(name:value:)`` instead.
Two descriptors that share the same shader graph but differ in
their function-constant values produce distinct compiled
programs that don't compare equal.
set · iOS 27.0+
constantValues
TypeScript
set constantValues(value: _Metal_MTLFunctionConstantValues)
Swift declaration
var constantValues: MTLFunctionConstantValues
Values for the function-constant inputs that the shader graph
declares.
Function constants are baked into the compiled shader at program
creation time and can't be changed afterward. Use them for
values that don't vary at runtime — for example, a feature flag
that selects between two code paths — to eliminate runtime
branching and produce a leaner shader. To vary a value across
frames or instances, declare it as a regular graph input and
supply it through ``inputValues`` or
``PortalMaterial/setParameter(name:value:)`` instead.
Two descriptors that share the same shader graph but differ in
their function-constant values produce distinct compiled
programs that don't compare equal.