What's New / Spatial, 3D & RealityKit

What's new in ComputeGraph

+183 NewiOS · macOS · tvOS

ComputeGraph models GPU compute work as a graph of nodes. Programs define structures, state, and binary operations that the runtime schedules onto a command queue.

The 27 SDK adds 183 APIs with no deprecations or removals. New types include the ComputeNodeGraph struct; the AddressSpace, BinaryOperation, and StateType enums; the StructureDefinition, StateDefinition, SwizzleChannels, SamplerSettings, Assembly, and Pipelines structs; plus AdvanceParams and SimulationRate. ComputeGraphSimulation gains commandQueue, simulationRate, and pipelines properties and a new init.

New

183
enum

AddressSpace

NewiOSmacOStvOS
public enum AddressSpace : Equatable, Sendable, Codable

A GPU memory address space.

Used to indicate where variables and buffers reside.

Declaration
public enum AddressSpace : Equatable, Sendable, Codable {

    case constant

    case device

    case threadgroup

    case thread

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: AddressSpace, b: AddressSpace) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
extension

AddressSpace

NewiOSmacOStvOS
extension AddressSpace : Hashable
Declaration
extension AddressSpace : Hashable {
}
struct

AdvanceParams

NewiOSmacOStvOS
public struct AdvanceParams

Parameters for advancing a compute graph simulation by one time step.

Declaration
public struct AdvanceParams {

    /// The time interval, in seconds, to advance the simulation.
    ///
    /// When ``SimulationRate/mode`` is ``SimulationRate/Mode-swift.enum/fixedFrequency``
    /// or ``SimulationRate/Mode-swift.enum/fixedTime``, the simulation takes
    /// between zero and ``maxSteps`` fixed-size steps to consume this interval.
    /// Any remaining time is accumulated and carried into the next advance.
    public var deltaTime: Float

    /// The maximum number of fixed-size steps per advance.
    ///
    /// This value is only used when ``SimulationRate/mode`` is
    /// ``SimulationRate/Mode-swift.enum/fixedFrequency`` or
    /// ``SimulationRate/Mode-swift.enum/fixedTime``.
    public var maxSteps: Int

    /// The command buffer to encode simulation commands into.
    public var commandBuffer: any MTLCommandBuffer

    /// The compute command encoder to encode simulation dispatches with.
    public var computeEncoder: any MTLComputeCommandEncoder

    /// The transform from the system's local space to world space.
    ///
    /// How this matrix is applied depends on the graph's coordinateSpace.
    public var localToWorld: simd_float4x4

    /// The transform from world space to the system's local space.
    ///
    /// How this matrix is applied depends on the graph's coordinateSpace.
    public var worldToLocal: simd_float4x4

    /// The position of the viewer in world space.
    ///
    /// When provided, this value can be used for billboarding or
    /// read within the graph for viewer-relative effects.
    public var viewPosition: SIMD3<Float>?

    /// The forward direction of the viewer in world space.
    ///
    /// When provided, this value can be used for billboarding or
    /// read within the graph for viewer-relative effects.
    public var viewDirection: SIMD3<Float>?

    /// Creates advance parameters with the required Metal objects.
    ///
    /// - Parameters:
    ///   - deltaTime: The time interval, in seconds, to advance the simulation.
    ///   - commandBuffer: The command buffer to encode simulation commands into.
    ///   - computeEncoder: The compute command encoder to use.
    public init(deltaTime: Float, commandBuffer: any MTLCommandBuffer, computeEncoder: any MTLComputeCommandEncoder)
}
enum

BinaryOperation

NewiOSmacOStvOS
public enum BinaryOperation : String, Codable, CaseIterable, Sendable

An enumeration of binary operations.

These follow Metal's rules for compatibility with operands.

Declaration
public enum BinaryOperation : String, Codable, CaseIterable, Sendable {

    case add

    case sub

    case mul

    case div

    case modulus

    case greaterThan

    case lessThan

    case greaterThanOrEqual

    case lessThanOrEqual

    case equalTo

    case notEqualTo

    case bitwiseAnd

    case bitwiseOr

    case bitwiseXor

    case logicalAnd

    case logicalOr

    case shiftRight

    case shiftLeft

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [BinaryOperation]

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [BinaryOperation] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }

Truncated.

extension

BinaryOperation

NewiOSmacOStvOS
extension BinaryOperation : Equatable
Declaration
extension BinaryOperation : Equatable {
}
extension

BinaryOperation

NewiOSmacOStvOS
extension BinaryOperation : Hashable
Declaration
extension BinaryOperation : Hashable {
}
extension

BinaryOperation

NewiOSmacOStvOS
extension BinaryOperation : RawRepresentable
Declaration
extension BinaryOperation : RawRepresentable {
}
extension

ComputeGraphSimulation.AdvanceParams

NewiOSmacOStvOS
extension ComputeGraphSimulation.AdvanceParams
Declaration
extension ComputeGraphSimulation.AdvanceParams {

    public init(deltaTime: Float, commandBuffer: any MTLCommandBuffer, computeEncoder: any MTLComputeCommandEncoder, localToWorld: simd_float4x4, worldToLocal: simd_float4x4, viewPosition: SIMD3<Float>? = nil, viewDirection: SIMD3<Float>? = nil)
}
extension

ComputeGraphSimulation.SimulationRate.Mode

NewiOSmacOStvOS
extension ComputeGraphSimulation.SimulationRate.Mode : Equatable
Declaration
extension ComputeGraphSimulation.SimulationRate.Mode : Equatable {
}
extension

ComputeGraphSimulation.SimulationRate.Mode

NewiOSmacOStvOS
extension ComputeGraphSimulation.SimulationRate.Mode : Hashable
Declaration
extension ComputeGraphSimulation.SimulationRate.Mode : Hashable {
}
extension

ComputeGraphSimulation.SimulationRate.Mode

NewiOSmacOStvOS
extension ComputeGraphSimulation.SimulationRate.Mode : RawRepresentable
Declaration
extension ComputeGraphSimulation.SimulationRate.Mode : RawRepresentable {
}
struct

ComputeNodeGraph

NewiOSmacOStvOS
public struct ComputeNodeGraph : Sendable, Equatable
Declaration
public struct ComputeNodeGraph : Sendable, Equatable {

    public typealias NodeID = Int

    public var nodes: [ComputeNodeGraph.NodeID : ComputeNodeGraph.Node]

    public var edges: [ComputeNodeGraph.Edge] { get }

    public init()

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph, b: ComputeNodeGraph) -> Bool
}
extension

ComputeNodeGraph.Port.Kind

NewiOSmacOStvOS
extension ComputeNodeGraph.Port.Kind : Hashable
Declaration
extension ComputeNodeGraph.Port.Kind : Hashable {
}
extension

ComputeNodeGraph.SamplerSettings

NewiOSmacOStvOS
extension ComputeNodeGraph.SamplerSettings : Codable
Declaration
extension ComputeNodeGraph.SamplerSettings : Codable {

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws
}
extension

ComputeNodeGraph.Stage

NewiOSmacOStvOS
extension ComputeNodeGraph.Stage
Declaration
extension ComputeNodeGraph.Stage {

    /// Spawns new particles into the system.
    public static let emission: ComputeNodeGraph.Stage

    /// Sets initial values for newly spawned particles.
    public static let initialize: ComputeNodeGraph.Stage

    /// A stage that receives events from a simulation (e.g. update or terminate), and
    /// initializes new particles for another simulation.
    public static let eventSource: ComputeNodeGraph.Stage

    /// Updates particle state each frame (position, velocity, lifetime, etc.).
    public static let simulate: ComputeNodeGraph.Stage

    /// Produces final per-particle results for rendering.
    public static let output: ComputeNodeGraph.Stage

    /// A general-purpose computation stage.
    public static let compute: ComputeNodeGraph.Stage

    /// Generates texture data.
    public static let texture: ComputeNodeGraph.Stage

    public init(_ name: String)

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws
}
extension

ComputeNodeGraph.SwizzleChannels

NewiOSmacOStvOS
extension ComputeNodeGraph.SwizzleChannels : Codable
Declaration
extension ComputeNodeGraph.SwizzleChannels : Codable {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
extension

ComputeNodeGraph.SwizzleChannels.Swizzle

NewiOSmacOStvOS
extension ComputeNodeGraph.SwizzleChannels.Swizzle : Equatable
Declaration
extension ComputeNodeGraph.SwizzleChannels.Swizzle : Equatable {
}
extension

ComputeNodeGraph.SwizzleChannels.Swizzle

NewiOSmacOStvOS
extension ComputeNodeGraph.SwizzleChannels.Swizzle : Hashable
Declaration
extension ComputeNodeGraph.SwizzleChannels.Swizzle : Hashable {
}
extension

ComputeNodeGraph.SwizzleChannels.Swizzle

NewiOSmacOStvOS
extension ComputeNodeGraph.SwizzleChannels.Swizzle : RawRepresentable
Declaration
extension ComputeNodeGraph.SwizzleChannels.Swizzle : RawRepresentable {
}
extension

ComputeNodeGraph.Topology

NewiOSmacOStvOS
extension ComputeNodeGraph.Topology : Equatable
Declaration
extension ComputeNodeGraph.Topology : Equatable {
}
extension

ComputeNodeGraph.Topology

NewiOSmacOStvOS
extension ComputeNodeGraph.Topology : Hashable
Declaration
extension ComputeNodeGraph.Topology : Hashable {
}
extension

ComputeNodeGraph.Topology

NewiOSmacOStvOS
extension ComputeNodeGraph.Topology : RawRepresentable
Declaration
extension ComputeNodeGraph.Topology : RawRepresentable {
}
enum

CoordinateSpace

NewiOSmacOStvOS
public enum CoordinateSpace : String, CaseIterable, Sendable, Codable

Simulation coordinate space, controlling how positions and orientations are stored.

Declaration
public enum CoordinateSpace : String, CaseIterable, Sendable, Codable {

    /// Positions and orientations are stored in relative to the Entity
    case local

    /// Positions and orientations are stored in relative to the Scene.
    ///
    /// Useful for attaching world-space particles to Entities, for effects like
    /// smoke trails.
    case world

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [CoordinateSpace]

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [CoordinateSpace] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public var rawValue: String { get }
}
extension

CoordinateSpace

NewiOSmacOStvOS
extension CoordinateSpace : Equatable
Declaration
extension CoordinateSpace : Equatable {
}
extension

CoordinateSpace

NewiOSmacOStvOS
extension CoordinateSpace : Hashable
Declaration
extension CoordinateSpace : Hashable {
}
extension

CoordinateSpace

NewiOSmacOStvOS
extension CoordinateSpace : RawRepresentable
Declaration
extension CoordinateSpace : RawRepresentable {
}
enum

ElementGrouping

NewiOSmacOStvOS
public enum ElementGrouping : String, CaseIterable, Sendable, Codable

An enumeration of how elements are grouped.

Declaration
public enum ElementGrouping : String, CaseIterable, Sendable, Codable {

    case ungrouped

    case strips

    case grouped

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [ElementGrouping]

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [ElementGrouping] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public var rawValue: String { get }
}
extension

ElementGrouping

NewiOSmacOStvOS
extension ElementGrouping : Equatable
Declaration
extension ElementGrouping : Equatable {
}
extension

ElementGrouping

NewiOSmacOStvOS
extension ElementGrouping : Hashable
Declaration
extension ElementGrouping : Hashable {
}
extension

ElementGrouping

NewiOSmacOStvOS
extension ElementGrouping : RawRepresentable
Declaration
extension ElementGrouping : RawRepresentable {
}
struct

ElementSpawnParameters

NewiOSmacOStvOS
public struct ElementSpawnParameters : Sendable

Parameters used to configure the initial state of a particle when it's spawned in the simulation.

The values specified become initial values in the Initialization stage, which can read or overwrite the values.

## Usage

let params = ElementSpawnParameters(
    position: SIMD3<Float>(0, 1, 0),
    velocity: SIMD3<Float>(0, -1, 0),
    size: SIMD2<Float>(0.02, 0.02),
    color: SIMD4<Float>(1, 0.5, 0, 1),
    lifetime: 2.0
)
Declaration
public struct ElementSpawnParameters : Sendable {

    /// The initial 3D position of the particle in world space coordinates.
    ///
    /// This determines where the particle will first appear when spawned. The coordinate system
    /// follows RealityKit's conventions with Y pointing up.
    public var position: SIMD3<Float>

    /// The initial velocity vector of the particle in world space units per second.
    ///
    /// This determines the particle's initial direction and speed of movement. The magnitude
    /// of the vector represents the speed, while the direction represents the movement direction.
    /// A zero velocity means the particle starts stationary.
    public var velocity: SIMD3<Float>

    /// The initial size of the particle as a 2D vector representing width and height.
    ///
    /// For most particle systems, this represents the billboard size in world space units.
    /// - `x` component: width of the particle
    /// - `y` component: height of the particle
    ///
    /// Equal values create square particles, while different values create rectangular particles.
    public var size: SIMD2<Float>

    /// The initial color and alpha (transparency) of the particle.
    ///
    /// Uses RGBA format where each component ranges from 0.0 to 1.0:
    /// - `x` (red): Red color component
    /// - `y` (green): Green color component
    /// - `z` (blue): Blue color component
    /// - `w` (alpha): Transparency (0.0 = fully transparent, 1.0 = fully opaque)
    public var color: SIMD4<Float>

    /// The initial lifetime of the particle in seconds.
    ///
    /// This determines how long the particle will exist before being automatically removed
    /// from the simulation. A value of 0 or negative means the particle will be removed
    /// immediately or never spawn.
    public var lifetime: Float

    /// Creates a new set of particle spawn parameters.
    ///
    /// - Parameters:
    ///   - position: The initial 3D position in world space coordinates
    ///   - velocity: The initial velocity vector in world space units per second (defaults to zero)
    ///   - size: The initial size as width and height in world space units (defaults to 0.01 x 0.01)
    ///   - color: The initial RGBA color (defaults to opaque white)
    ///   - lifetime: The particle lifetime in seconds (defaults to 1.0 second)
    ///
    /// ## Example
    /// ```swift
    /// // Create a particle that starts at the origin, moves upward, is red, and lasts 3 seconds
    /// let params = ElementSpawnParameters(
    ///     position: SIMD3<Float>(0, 0, 0),
    ///     velocity: SIMD3<Float>(0, 2, 0),
    ///     size: SIMD2<Float>(0.05, 0.05),
    ///     color: SIMD4<Float>(1, 0, 0, 1),
    ///     lifetime: 3.0
    /// )
    /// ```
    public init(position: SIMD3<Float>, velocity: SIMD3<Float> = .zero, size: SIMD2<Float> = .init(0.01, 0.01), color: SIMD4<Float> = .init(1, 1, 1, 1), lifetime: Float = 1.0)
}
struct

PortReference

NewiOSmacOStvOS
public struct PortReference : Equatable, Sendable, Codable

A reference to another group's values.

Declaration
public struct PortReference : Equatable, Sendable, Codable {

    public var group: Int

    public var port: Int

    public init(group: Int, port: Int)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: PortReference, b: PortReference) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
enum

Sorting

NewiOSmacOStvOS
public enum Sorting : String, CaseIterable, Sendable

An enumeration of sorting modes.

Declaration
public enum Sorting : String, CaseIterable, Sendable {

    case none

    case age

    case timeToLive

    case frontToBack

    case backToFront

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [Sorting]

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [Sorting] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public var rawValue: String { get }
}
extension

Sorting

NewiOSmacOStvOS
extension Sorting : Codable
Declaration
extension Sorting : Codable {
}
extension

Sorting

NewiOSmacOStvOS
extension Sorting : Equatable
Declaration
extension Sorting : Equatable {
}
extension

Sorting

NewiOSmacOStvOS
extension Sorting : Hashable
Declaration
extension Sorting : Hashable {
}
extension

Sorting

NewiOSmacOStvOS
extension Sorting : RawRepresentable
Declaration
extension Sorting : RawRepresentable {
}
enum

StandardLibraryFunction

NewiOSmacOStvOS
public enum StandardLibraryFunction : String, Codable, CaseIterable, Sendable
Declaration
public enum StandardLibraryFunction : String, Codable, CaseIterable, Sendable {

    case clamp

    case mix

    case saturate

    case sign

    case smoothstep

    case step

    case all

    case any

    case isFinite

    case isInfinite

    case isNaN

    case isNormal

    case isOrdered

    case isUnordered

    case not

    case select

    case signbit

    case acos

    case acosh

    case asin

    case asinh

    case atan

    case atan2

    case atanh

    case ceil

    case copySign

    case cos

    case cosh

    case cospi

    case divide

    case exp

    case exp2

    case exp10

    case abs

    case fdim

    case floor

    case fma

    case max

    case max3

Truncated.

extension

StandardLibraryFunction

NewiOSmacOStvOS
extension StandardLibraryFunction : Equatable
Declaration
extension StandardLibraryFunction : Equatable {
}
extension

StandardLibraryFunction

NewiOSmacOStvOS
extension StandardLibraryFunction : Hashable
Declaration
extension StandardLibraryFunction : Hashable {
}
extension

StandardLibraryFunction

NewiOSmacOStvOS
extension StandardLibraryFunction : RawRepresentable
Declaration
extension StandardLibraryFunction : RawRepresentable {
}
enum

StripOrientation

NewiOSmacOStvOS
public enum StripOrientation : String, Equatable, Sendable, Codable, CaseIterable

An enumeration that specifies how a strip should be oriented.

Declaration
public enum StripOrientation : String, Equatable, Sendable, Codable, CaseIterable {

    /// Automatically derive the orientation of the strip via neighbors and
    /// any provided axisY or axisZ values.
    case auto

    /// Derive the strip's orientation from neighboring points and `axisY` float3 parameter
    case deriveFromYAxis

    /// Derive the strip's orientation from neighboring points and `axisZ` float3 parameter
    case deriveFromZAxis

    /// Use the `axisZ` float3 parameter without re-orienting. Derive Y-axis from
    /// neighboring points and `axisZ`.
    case useZAxis

    /// Use strip's frenet frame for orientation
    case frenet

    case planar

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [StripOrientation]

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [StripOrientation] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public var rawValue: String { get }
}
extension

StripOrientation

NewiOSmacOStvOS
extension StripOrientation : Hashable
Declaration
extension StripOrientation : Hashable {
}
extension

StripOrientation

NewiOSmacOStvOS
extension StripOrientation : RawRepresentable
Declaration
extension StripOrientation : RawRepresentable {
}
enum

Topology

NewiOSmacOStvOS
public enum Topology : String, CaseIterable, Identifiable, Sendable
Declaration
public enum Topology : String, CaseIterable, Identifiable, Sendable {

    /// The stable identity of the entity associated with this instance.
    public var id: Topology { get }

    case point

    case triangle

    case quad

    case octagon

    case strip

    case instances

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [Topology]

    /// A type representing the stable identity of the entity associated with
    /// an instance.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias ID = Topology

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [Topology] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public var rawValue: String { get }
}
extension

Topology

NewiOSmacOStvOS
extension Topology : Codable
Declaration
extension Topology : Codable {
}
extension

Topology

NewiOSmacOStvOS
extension Topology
Declaration
extension Topology {

    @available(*, deprecated, message: "Use OutputInfo._proto_indices_v1(elementCount:) instead")
    public var indicesPerElement: Int { get }

    @available(*, deprecated, message: "Use OutputInfo._proto_vertices_v1(elementCount:) instead")
    public var verticesPerElement: Int { get }
}
extension

Topology

NewiOSmacOStvOS
extension Topology : Equatable
Declaration
extension Topology : Equatable {
}
extension

Topology

NewiOSmacOStvOS
extension Topology : Hashable
Declaration
extension Topology : Hashable {
}
extension

Topology

NewiOSmacOStvOS
extension Topology : RawRepresentable
Declaration
extension Topology : RawRepresentable {
}
enum

UnaryOperation

NewiOSmacOStvOS
public enum UnaryOperation : String, Codable, CaseIterable, Sendable

An enumeration of single-operand operations.

These follow Metal's rules for compatibility with operands.

Declaration
public enum UnaryOperation : String, Codable, CaseIterable, Sendable {

    case negate

    case logicalNot

    case bitwiseNot

    case oneMinus

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [UnaryOperation]

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [UnaryOperation] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public var rawValue: String { get }
}
extension

UnaryOperation

NewiOSmacOStvOS
extension UnaryOperation : Equatable
Declaration
extension UnaryOperation : Equatable {
}
extension

UnaryOperation

NewiOSmacOStvOS
extension UnaryOperation : Hashable
Declaration
extension UnaryOperation : Hashable {
}
extension

UnaryOperation

NewiOSmacOStvOS
extension UnaryOperation : RawRepresentable
Declaration
extension UnaryOperation : RawRepresentable {
}
typealias

BinaryOperation.AllCases

NewiOSmacOStvOS
public typealias AllCases = [BinaryOperation]

A type that can represent a collection of all values of this type.

typealias

BinaryOperation.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

func

ComputeGraphSimulation.addUserResource

NewiOSmacOStvOS
final public func addUserResource(_ resource: any MTLResource)

Registers a resource for residency on all command encoders used by this simulation.

Only needed when buffers or textures are passed indirectly through structures using Metal Tier 2 Argument Buffers, since Metal cannot discover those resources automatically.

func

ComputeGraphSimulation.advance

NewiOSmacOStvOS
final public func advance(_ params: ComputeGraphSimulation.AdvanceParams)

Advances the simulation by one time step, encoding all simulation stage dispatches into the command buffer and encoder provided by params.

Call this once per frame from your render loop. The simulation reads deltaTime to determine how much simulated time to consume, subject to simulationRate. Spatial transforms and optional viewer information in params are forwarded to the simulation graph.

Parameters

params
The advance parameters, including the time delta, command buffer, compute encoder, and spatial transforms for this frame.
func

ComputeGraphSimulation.buffer

NewiOSmacOStvOS
final public func buffer(at index: Int) -> (any MTLBuffer, bufferOffset: Int)?
var

ComputeGraphSimulation.commandQueue

NewiOSmacOStvOS
final public var commandQueue: any MTLCommandQueue { get }
func

ComputeGraphSimulation.fastForward

NewiOSmacOStvOS
final public func fastForward(stepCount: Int, stepDeltaTime: Float)

Advances the particle simulation by multiple steps in a single operation.

This method performs batch simulation updates by executing multiple simulation steps consecutively within a single compute command buffer, skipping any non-simulation work such as updating the output buffers. This is useful for:

Note: The simulation will be advanced by a total time of stepCount * stepDeltaTime seconds.

Parameters

stepCount
The number of simulation steps to execute. Each step represents one iteration of the simulation update cycle. Must be positive.
stepDeltaTime
The time interval (in seconds) to use for each simulation step. This controls how much simulated time passes with each step. Smaller values provide more accurate simulation at the cost of requiring more steps to advance the same amount of time.
func

ComputeGraphSimulation.fastForward

NewiOSmacOStvOS
final public func fastForward()
var

ComputeGraphSimulation.graphUniforms

NewiOSmacOStvOS
final public var graphUniforms: any MTLBuffer { get }

Returns a read-only copy of the uniforms buffer.

Use modifyUniforms(_:) to make modifications.

init

ComputeGraphSimulation.init

NewiOSmacOStvOS
public convenience init(pipelines: ComputeNodeGraph.Pipelines, commandQueue: any MTLCommandQueue)

Initialize a ComputeGraphSimulation for the given pipelines

The simulation will use the provided command queue for operations such as fastForward() and resetting the system.

init

ComputeGraphSimulation.init

NewiOSmacOStvOS
public convenience init(pipelines: ComputeNodeGraph.Pipelines?)

Initialize a ComputeGraphSimulation for the given pipelines, or a default pipeline if not specified.

The simulation will use the ComputeGraphFramework's default queue for operations such as fastForward() and resetting after setting the pipeline.

Prefer init(pipeline:commandQueue:) to this method.

func

ComputeGraphSimulation.isOutputEnabled

NewiOSmacOStvOS
final public func isOutputEnabled(_ outputID: Int) -> Bool

Returns whether the specified output is currently enabled for simulation.

Parameters

outputID
The node identifier of the output to query.

Returnstrue if the output is simulated; false if it is disabled.

func

ComputeGraphSimulation.modifyUniforms

NewiOSmacOStvOS
final public func modifyUniforms<E, R>(_ body: (UnsafeMutableRawBufferPointer) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable

Provides read/write access to the entire uniforms buffer for CPU access.

ComputeGraph will upload the changes to the GPU before the next simulation.

var

ComputeGraphSimulation.pipelines

NewiOSmacOStvOS
final public var pipelines: ComputeNodeGraph.Pipelines
func

ComputeGraphSimulation.reset

NewiOSmacOStvOS
final public func reset(encoder: any MTLComputeCommandEncoder)

Resets the simulation to its initial state, clearing all live elements and accumulated time.

The reset is encoded as a compute dispatch into encoder. You must commit the enclosing command buffer for the reset to take effect on the GPU.

Parameters

encoder
The compute command encoder to encode the reset operation with.
func

ComputeGraphSimulation.resetRandomSeeds

NewiOSmacOStvOS
final public func resetRandomSeeds(using randomness: () -> UInt32)

Resets random seeds using the provided randomness function.

randomness will be called multiple times, for each of seeds used by the simulation

func

ComputeGraphSimulation.setBuffer

NewiOSmacOStvOS
final public func setBuffer(_ buffer: any MTLBuffer, bufferOffset: Int = 0, elementCount: Int, at location: ComputeNodeGraph.Assembly.Location)
func

ComputeGraphSimulation.setBuffer

NewiOSmacOStvOS
final public func setBuffer(_ buffer: (any MTLBuffer)?, bufferOffset: Int = 0, at index: Int)
func

ComputeGraphSimulation.setBuffer

NewiOSmacOStvOS
final public func setBuffer(_ buffer: (any MTLBuffer)?, bufferOffset: Int = 0, at location: ComputeNodeGraph.Assembly.Location)
func

ComputeGraphSimulation.setBuffers

NewiOSmacOStvOS
final public func setBuffers(_ buffers: [(any MTLBuffer)?], bufferOffsets: [Int]? = nil)
func

ComputeGraphSimulation.setOutputEnabled

NewiOSmacOStvOS
final public func setOutputEnabled(_ outputID: Int, enabled: Bool)

Enables or disables execution of the provided output stage, without disabling the system it represents.

Disabling an output is useful when you want to switch between multiple outputs for the simulation, for example two outputs with different topologies for the same elements.

Parameters

outputID
The node identifier of the output to enable or disable.
enabled
true to simulate the output; false to omit it.
func

ComputeGraphSimulation.setTexture

NewiOSmacOStvOS
final public func setTexture(_ texture: (any MTLTexture)?, at index: Int)

Binds a Metal texture to the texture slot at the given index.

Parameters

texture
The MTLTexture to bind, or nil to clear.
index
The zero-based slot index.
func

ComputeGraphSimulation.setTextures

NewiOSmacOStvOS
final public func setTextures(_ textures: [(any MTLTexture)?])
func

ComputeGraphSimulation.setUniform

NewiOSmacOStvOS
final public func setUniform<V>(_ value: V, named name: String) -> Bool where V : BitwiseCopyable

Finds the named uniform and sets it to the given BitwiseCopyable value.

Returns true if the value was found and set successfully

func

ComputeGraphSimulation.setUniformData

NewiOSmacOStvOS
final public func setUniformData(_ data: Data, at location: ComputeNodeGraph.Assembly.Location)
func

ComputeGraphSimulation.setUniformValue

NewiOSmacOStvOS
final public func setUniformValue<V>(_ value: V, at location: ComputeNodeGraph.Assembly.Location) where V : BitwiseCopyable

Copies the contents of value into the location specified by relocation

func

ComputeGraphSimulation.setUserResources

NewiOSmacOStvOS
final public func setUserResources(_ resources: [any MTLResource])

Sets additional resources for residency on all command buffers used by this simulation, replacing any previously added resources.

Only needed when buffers or textures are passed indirectly through structures using Metal Tier 2 Argument Buffers, since Metal cannot discover those resources automatically.

var

ComputeGraphSimulation.simulationRate

NewiOSmacOStvOS
final public var simulationRate: ComputeGraphSimulation.SimulationRate

Specifies the current simulation rate.

struct

ComputeGraphSimulation.SimulationRate

NewiOSmacOStvOS
public struct SimulationRate : Equatable, Sendable

Specifies the rate and mode for simulation.

Declaration
public struct SimulationRate : Equatable, Sendable {

    public enum Mode : String, Sendable, Codable, CaseIterable {

        /// Simulate once per frame, using RealityKit's current time step
        case variable

        /// Simulate using a fixed number of steps per second.
        ///
        /// This can result in zero, one, or more steps per frame, depending
        /// on the frequency specified and the current framerate.
        case fixedFrequency

        /// Simulate using time delta.
        ///
        /// Similar to fixedFrequency except the timeDelta is in seconds.
        ///
        /// This can result in zero, one, or more steps per frame, depending
        /// on the frequency specified and the current framerate.
        case fixedTime

        /// Creates a new instance with the specified raw value.
        ///
        /// If there is no value of the type that corresponds with the specified raw
        /// value, this initializer returns `nil`. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     print(PaperSize(rawValue: "Legal"))
        ///     // Prints "Optional(PaperSize.Legal)"
        ///
        ///     print(PaperSize(rawValue: "Tabloid"))
        ///     // Prints "nil"
        ///
        /// - Parameter rawValue: The raw value to use for the new instance.
        public init?(rawValue: String)

        /// A type that can represent a collection of all values of this type.
        @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
        public typealias AllCases = [ComputeGraphSimulation.SimulationRate.Mode]

        /// The raw type that can be used to represent all values of the conforming
        /// type.
        ///
        /// Every distinct value of the conforming type has a corresponding unique
        /// value of the `RawValue` type, but there may be values of the `RawValue`
        /// type that don't have a corresponding value of the conforming type.
        @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
        public typealias RawValue = String

        /// A collection of all values of this type.
        nonisolated public static var allCases: [ComputeGraphSimulation.SimulationRate.Mode] { get }

        /// The corresponding value of the raw type.
        ///
        /// A new instance initialized with `rawValue` will be equivalent to this
        /// instance. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     let selectedSize = PaperSize.Letter
        ///     print(selectedSize.rawValue)
        ///     // Prints "Letter"
        ///
        ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
        ///     // Prints "true"
        public var rawValue: String { get }
    }

    /// The simulation mode that determines how time steps are calculated.
    public var mode: ComputeGraphSimulation.SimulationRate.Mode

    /// The number of simulation steps per second, used when ``mode`` is ``Mode/fixedFrequency``.
    public var frequency: Float

    /// The fixed time interval in seconds between simulation steps, used when ``mode`` is ``Mode/fixedTime``.

Truncated.

func

ComputeGraphSimulation.spawn

NewiOSmacOStvOS
final public func spawn(elements: borrowing [ElementSpawnParameters], in systemID: Int?, using encoder: any MTLComputeCommandEncoder)

Spawns new elements into the simulation with the given initial parameters.

Each entry in elements produces one new element. The initialization stage of the simulation graph runs on the newly spawned elements before they participate in subsequent simulation steps, and may read or overwrite the values supplied here.

Parameters

elements
The initial state for each element to spawn.
systemID
The index of the particle simulation stage to spawn into, or nil to spawn into all simulations.
encoder
The compute command encoder to encode the spawn operation with.
func

ComputeGraphSimulation.texture

NewiOSmacOStvOS
final public func texture(at index: Int) -> (any MTLTexture)?
typealias

ComputeGraphSimulation.SimulationRate.Mode.AllCases

NewiOSmacOStvOS
public typealias AllCases = [ComputeGraphSimulation.SimulationRate.Mode]

A type that can represent a collection of all values of this type.

typealias

ComputeGraphSimulation.SimulationRate.Mode.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

func

ComputeNodeGraph.addEdge

NewiOSmacOStvOS
public mutating func addEdge(_ edge: ComputeNodeGraph.Edge) throws
func

ComputeNodeGraph.addNode

NewiOSmacOStvOS
public mutating func addNode(_ node: ComputeNodeGraph.Node) throws -> ComputeNodeGraph.NodeID

Adds a node to the graph.

Parameters

node
The node to add.

ReturnsThe key assigned to the newly added node. Throws: A NodeError if the node cannot be added.

struct

ComputeNodeGraph.ArrayDefinition

NewiOSmacOStvOS
public struct ArrayDefinition : Sendable, Equatable
Declaration
public struct ArrayDefinition : Sendable, Equatable {

    public var count: Int

    public var element: ComputeNodeGraph.StateType

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.ArrayDefinition, b: ComputeNodeGraph.ArrayDefinition) -> Bool
}
struct

ComputeNodeGraph.Assembly

NewiOSmacOStvOS
public struct Assembly : Sendable, Equatable

Fully assembled configuration of compute graph nodes.

You can create an assembly from a ComputeNodeGraph to obtain the layout of all buffers and uniforms needed by the graph.

Unless you need the layout before or without compiling the shaders, you can compile Pipelines directly from a ComputeNodeGraph.

Declaration
public struct Assembly : Sendable, Equatable {

    public var uniforms: [ComputeNodeGraph.Port.Address : ComputeNodeGraph.Assembly.Location] { get }

    /// Uniforms that are shared across multiple graphs, keyed by typeName.
    ///
    /// Shared uniforms are stored globally and copied into each simulation's uniform buffer
    /// before GPU execution. Use them for scene-wide values that many simulations read,
    /// such as transform matrices, attractors, or colliders.
    public var sharedUniforms: [String : ComputeNodeGraph.Assembly.UniformBinding] { get }

    /// Uniforms that are named and exposed as parameters of this graph, keyed by name.
    ///
    /// Unlike ``sharedUniforms``, named uniforms are local to this graph and not
    /// shared with other graphs.
    public var namedUniforms: [String : ComputeNodeGraph.Assembly.UniformBinding] { get }

    public var constantBuffers: [ComputeNodeGraph.Assembly.BufferBinding] { get }

    public var deviceBuffers: [ComputeNodeGraph.Assembly.BufferBinding] { get }

    public var textures: [ComputeNodeGraph.Assembly.TextureBinding] { get }

    public var uniformBufferSize: Int { get }

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Assembly, b: ComputeNodeGraph.Assembly) -> Bool
}
func

ComputeNodeGraph.canAddEdge

NewiOSmacOStvOS
public func canAddEdge(_ edge: ComputeNodeGraph.Edge) -> Bool

Returns whether the given edge can be added to the graph.

This is the non-throwing preflight check for addEdge(_:). Use it to validate a connection — for example, to highlight compatible ports during drag-and-drop — without modifying the graph.

Parameters

edge
The edge to test.

Returnstrue if calling addEdge(_:) with this edge would succeed.

func

ComputeNodeGraph.canAddNode

NewiOSmacOStvOS
public func canAddNode(_ node: ComputeNodeGraph.Node) -> Bool

Returns whether the given node can be added to the graph.

This is the non-throwing preflight check for addNode(_:). Use it to validate a node — for example, to gate UI affordances — without modifying the graph.

Parameters

node
The node to test.

Returnstrue if calling addNode(_:) with this node would succeed.

func

ComputeNodeGraph.contains

NewiOSmacOStvOS
public func contains(node: ComputeNodeGraph.NodeID) -> Bool

Returns whether the graph contains a node with the given key.

Parameters

node
The key of the node to look up.

Returnstrue if the graph contains the node; otherwise, false.

func

ComputeNodeGraph.contains

NewiOSmacOStvOS
public func contains(edge: ComputeNodeGraph.Edge) -> Bool

Returns whether the graph contains the given edge.

Parameters

edge
The edge to look up.

Returnstrue if the graph contains the edge; otherwise, false.

struct

ComputeNodeGraph.Edge

NewiOSmacOStvOS
public struct Edge : Sendable, Equatable, Hashable
Declaration
public struct Edge : Sendable, Equatable, Hashable {

    /// Source of the data, event, or execution flow
    ///
    /// Refers to an output port of a node.
    public var source: ComputeNodeGraph.Port.Address

    /// Target of the data, event, or execution flow
    ///
    /// Refers to an input port of a node.
    public var target: ComputeNodeGraph.Port.Address

    public init(source: ComputeNodeGraph.Port.Address, target: ComputeNodeGraph.Port.Address)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Edge, b: ComputeNodeGraph.Edge) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
struct

ComputeNodeGraph.LibraryReference

NewiOSmacOStvOS
public struct LibraryReference : Sendable

A Metal library and an optional bundle identifier that locates shader functions.

Use addLibrary(_:bundle:) rather than constructing this type directly.

Declaration
public struct LibraryReference : Sendable {

    /// The Metal library containing compiled shader functions.
    public var library: any MTLLibrary

    /// The bundle identifier used to scope shader function lookup, or `nil` if
    /// the library does not require one.
    public var bundle: String?

    public init(library: any MTLLibrary, bundle: String? = nil)
}
struct

ComputeNodeGraph.Metadata

NewiOSmacOStvOS
public struct Metadata : Sendable, Equatable, ExpressibleByDictionaryLiteral
Declaration
public struct Metadata : Sendable, Equatable, ExpressibleByDictionaryLiteral {

    public var values: [String : String]

    public init(values: [String : String] = [String: String]())

    /// Creates an instance initialized with the given key-value pairs.
    public init(dictionaryLiteral elements: (String, String)...)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Metadata, b: ComputeNodeGraph.Metadata) -> Bool

    /// The key type of a dictionary literal.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias Key = String

    /// The value type of a dictionary literal.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias Value = String
}
struct

ComputeNodeGraph.Node

NewiOSmacOStvOS
public struct Node : Sendable, Equatable
Declaration
public struct Node : Sendable, Equatable {

    /// Type of the node
    public var kind: ComputeNodeGraph.Node.Kind

    /// Optional user-provided label for the node
    public var label: String?

    public var definition: ComputeNodeGraph.NodeDefinition

    /// Uniform values for the node.
    ///
    /// Order of values matches ``NodeDefinition.inputs``
    public var uniforms: [Data?]

    /// Node metadata -- data which is not needed during compilation but might be useful
    /// at edit time.
    public var metadata: ComputeNodeGraph.Metadata?

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Node, b: ComputeNodeGraph.Node) -> Bool
}
struct

ComputeNodeGraph.NodeDefinition

NewiOSmacOStvOS
public struct NodeDefinition : Sendable, Equatable
Declaration
public struct NodeDefinition : Sendable, Equatable {

    /// Name of the NodeDefinition.
    ///
    /// Definitions whose kind is ``ComputeNodeGraph/NodeDefinition/Kind/function``  will match
    /// their MTLFunction via name.
    public var name: String

    public var bundle: String?

    public var inputs: [ComputeNodeGraph.PortDefinition]

    public var outputs: [ComputeNodeGraph.PortDefinition]

    public var kind: ComputeNodeGraph.NodeDefinition.Kind

    public init(name: String, bundle: String? = nil, inputs: [ComputeNodeGraph.PortDefinition] = [], outputs: [ComputeNodeGraph.PortDefinition] = [], kind: ComputeNodeGraph.NodeDefinition.Kind)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.NodeDefinition, b: ComputeNodeGraph.NodeDefinition) -> Bool
}
struct

ComputeNodeGraph.Pipelines

NewiOSmacOStvOS
public struct Pipelines : Sendable

Fully-compiled shaders for a compute graph.

You use pipelines to construct ComputeGraphSimulation objects. A pipeline can be used by many simulations at the same time.

Declaration
public struct Pipelines : Sendable {

    public var options: ComputeNodeGraph.Pipelines.Options { get }

    public var assembly: ComputeNodeGraph.Assembly { get }
}
struct

ComputeNodeGraph.PipelinesDescriptor

NewiOSmacOStvOS
public struct PipelinesDescriptor : Sendable

Specifies the configuration used to compile a set of compute pipelines for a compute graph effect.

Use a descriptor when you need explicit control over pipeline compilation — for example, to supply Metal libraries from multiple bundles or to enable debug draw. Pass the configured descriptor to init(descriptor:) to compile.

var descriptor = ComputeNodeGraph.PipelinesDescriptor(assembly: assembly)
descriptor.addLibrary(myMTLLibrary, bundle: "com.example.MyEffects")
descriptor.options.debugDraw = true
let pipelines = try await ComputeNodeGraph.Pipelines(descriptor: descriptor)
Declaration
public struct PipelinesDescriptor : Sendable {

    /// The assembled compute graph layout that defines the graph's buffer, uniform,
    /// and texture configuration.
    public var assembly: ComputeNodeGraph.Assembly

    /// Options controlling pipeline compilation, such as whether debug draw is enabled.
    public var options: ComputeNodeGraph.Pipelines.Options

    /// The Metal libraries that provide shader function implementations for the graph's nodes.
    public var libraries: [ComputeNodeGraph.LibraryReference]

    /// Creates a descriptor configured for the given graph assembly.
    ///
    /// `options` defaults to ``Pipelines/Options/init()`` and `libraries` is empty.
    /// Add shader libraries with ``addLibrary(_:bundle:)`` before compiling.
    ///
    /// - Parameter assembly: The assembled compute graph to compile pipelines for.
    public init(assembly: ComputeNodeGraph.Assembly)
}
struct

ComputeNodeGraph.PointerDefinition

NewiOSmacOStvOS
public struct PointerDefinition : Sendable, Equatable
Declaration
public struct PointerDefinition : Sendable, Equatable {

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.PointerDefinition, b: ComputeNodeGraph.PointerDefinition) -> Bool
}
enum

ComputeNodeGraph.Port

NewiOSmacOStvOS
public enum Port
Declaration
public enum Port {

    /// A location of a specific port on a node, identified by the node and the port's index.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public struct Address : Sendable, Equatable, Hashable {

        /// The node that owns this port.
        public var node: ComputeNodeGraph.NodeID

        /// The index of the port within the node's input or output list.
        public var index: Int

        public init(node: ComputeNodeGraph.NodeID, index: Int)

        /// Returns a Boolean value indicating whether two values are equal.
        ///
        /// Equality is the inverse of inequality. For any values `a` and `b`,
        /// `a == b` implies that `a != b` is `false`.
        ///
        /// - Parameters:
        ///   - lhs: A value to compare.
        ///   - rhs: Another value to compare.
        public static func == (a: ComputeNodeGraph.Port.Address, b: ComputeNodeGraph.Port.Address) -> Bool

        /// Hashes the essential components of this value by feeding them into the
        /// given hasher.
        ///
        /// Implement this method to conform to the `Hashable` protocol. The
        /// components used for hashing must be the same as the components compared
        /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
        /// with each of these components.
        ///
        /// - Important: In your implementation of `hash(into:)`,
        ///   don't call `finalize()` on the `hasher` instance provided,
        ///   or replace it with a different instance.
        ///   Doing so may become a compile-time error in the future.
        ///
        /// - Parameter hasher: The hasher to use when combining the components
        ///   of this instance.
        public func hash(into hasher: inout Hasher)

        /// The hash value.
        ///
        /// Hash values are not guaranteed to be equal across different executions of
        /// your program. Do not save hash values to use during a future execution.
        ///
        /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
        ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
        ///   The compiler provides an implementation for `hashValue` for you.
        public var hashValue: Int { get }
    }

    /// The semantic role of a port, determining what it carries along an edge
    /// and whether the edge imposes execution ordering between its endpoints.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public enum Kind : Sendable, Equatable {

        /// Carries an ambient runtime context handle injected by the graph at
        /// execution time. Destination reads the handle; no ordering effect.
        case context

        /// Carries a typed data value from source to destination. One-way read,
        /// no ordering effect.
        case value

        /// Carries a read/write binding to named external storage (element,
        /// emitter, group, output attribute, threadgroup memory). Type is always
        /// `.state(definition:)`. No ordering effect.
        case state

        /// Carries a typed event payload. Triggers downstream execution per event
        /// AND carries data (e.g. spawn/update/terminate events with element data).
        case event

        /// Execution-ordering edge whose destination is conceptually a consumer
        /// of the source's typed output. No runtime payload is transferred, but
        /// type compatibility is enforced. Used for stage → stage sequencing.
        case flow

        /// Pure "happens-after" edge. No runtime payload, no type lineage, no

Truncated.

struct

ComputeNodeGraph.PortDefinition

NewiOSmacOStvOS
public struct PortDefinition : Sendable, Equatable
Declaration
public struct PortDefinition : Sendable, Equatable {

    public var name: String

    public var kind: ComputeNodeGraph.Port.Kind

    public var type: ComputeNodeGraph.ValueType

    public var options: ComputeNodeGraph.Port.Options

    public init(name: String, kind: ComputeNodeGraph.Port.Kind, type: ComputeNodeGraph.ValueType, options: ComputeNodeGraph.Port.Options = [])

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.PortDefinition, b: ComputeNodeGraph.PortDefinition) -> Bool
}
func

ComputeNodeGraph.removeEdge

NewiOSmacOStvOS
public mutating func removeEdge(_ edge: ComputeNodeGraph.Edge) -> Bool

Removes an edge from the graph.

Parameters

edge
The edge to remove.

ReturnsThrows: if the edge cannot be removed. true if the edge was found and removed.

func

ComputeNodeGraph.removeNode

NewiOSmacOStvOS
public mutating func removeNode(_ node: ComputeNodeGraph.NodeID) throws

Removes a node from the graph.

Parameters

node
The key of the node to remove.

ReturnsThrows: if the node cannot be removed.

func

ComputeNodeGraph.replaceAll

NewiOSmacOStvOS
public mutating func replaceAll(nodes: [ComputeNodeGraph.NodeID : ComputeNodeGraph.Node], edges: [ComputeNodeGraph.Edge]) throws

Replaces all nodes and edges in the graph with the provided collections.

This bulk operation allows for efficient wholesale replacement of the graph's structure.

Parameters

nodes
A sequence of nodes and their keys to add to the graph.
edges
A sequence of edges to add to the graph.

ReturnsThrows: An error if the replacement operation fails.

struct

ComputeNodeGraph.SamplerSettings

NewiOSmacOStvOS
public struct SamplerSettings : Equatable, Sendable
Declaration
public struct SamplerSettings : Equatable, Sendable {

    public var texture: MTLTextureType

    public var address: MTLSamplerAddressMode

    public var filter: MTLSamplerMinMagFilter

    public init(texture: MTLTextureType, address: MTLSamplerAddressMode, filter: MTLSamplerMinMagFilter)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.SamplerSettings, b: ComputeNodeGraph.SamplerSettings) -> Bool
}
struct

ComputeNodeGraph.Scope

NewiOSmacOStvOS
public struct Scope : Sendable, Equatable, Codable

A scope is a named region of memory, indicating where a value lives

A value that exists on each element of a simulation would have a scope of element, whereas a value that exists on the emitter stage would have a scope of emitter.

Each stage of execution provides a subset of available scopes. Stages such as group are available only when grouping is enabled for particles.

Declaration
public struct Scope : Sendable, Equatable, Codable {

    public let name: String

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Scope, b: ComputeNodeGraph.Scope) -> Bool
}
struct

ComputeNodeGraph.StateDefinition

NewiOSmacOStvOS
public struct StateDefinition : Sendable, Equatable

A declaration of a named state value and where it lives in the simulation.

State definitions are used by loadState(definition:) and storeState(definition:) nodes to read and write values at a particular scope.

Declaration
public struct StateDefinition : Sendable, Equatable {

    /// The scope that owns this state. For example, ``ComputeNodeGraph/Scope/element``
    /// stores a value per particle, while ``ComputeNodeGraph/Scope/emitter`` stores
    /// a single value used by the emission stage.
    public var scope: ComputeNodeGraph.Scope

    /// Whether this state is read, written, or both. See ``ComputeNodeGraph/StateDefinition/Options``.
    public var options: ComputeNodeGraph.StateDefinition.Options

    /// The data type of the stored value.
    public var type: ComputeNodeGraph.StateType

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.StateDefinition, b: ComputeNodeGraph.StateDefinition) -> Bool
}
enum

ComputeNodeGraph.StateType

NewiOSmacOStvOS
public enum StateType : Sendable, Equatable
Declaration
public enum StateType : Sendable, Equatable {

    /// Value is a primitive with the given type
    case dataType(type: MTLDataType)

    /// Value is a fixed number of untyped bytes
    case data(length: Int)

    /// Value is a structure with the given layout
    case structure(typeName: String, layout: ComputeNodeGraph.StructureLayout)

    /// Value is an array with the provided definition
    case array(definition: ComputeNodeGraph.ArrayDefinition)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.StateType, b: ComputeNodeGraph.StateType) -> Bool
}
struct

ComputeNodeGraph.StructureDefinition

NewiOSmacOStvOS
public struct StructureDefinition : Sendable, Equatable
Declaration
public struct StructureDefinition : Sendable, Equatable {

    public var typeName: String

    public var layout: ComputeNodeGraph.StructureLayout

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.StructureDefinition, b: ComputeNodeGraph.StructureDefinition) -> Bool
}
struct

ComputeNodeGraph.StructureLayout

NewiOSmacOStvOS
public struct StructureLayout : Equatable, Sendable
Declaration
public struct StructureLayout : Equatable, Sendable {

    public var members: [ComputeNodeGraph.StructureLayout.Member]

    public var size: Int

    public var stride: Int

    public init()

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.StructureLayout, b: ComputeNodeGraph.StructureLayout) -> Bool
}
subscript

ComputeNodeGraph.subscript

NewiOSmacOStvOS
public subscript(node: ComputeNodeGraph.NodeID) -> ComputeNodeGraph.Node? { get }

Accesses the node associated with the given key.

Parameters

node
The key identifying the node to retrieve.

ReturnsThe node if it exists, or nil if no node is associated with the key.

struct

ComputeNodeGraph.SwizzleChannels

NewiOSmacOStvOS
public struct SwizzleChannels : Equatable, Sendable
Declaration
public struct SwizzleChannels : Equatable, Sendable {

    public enum Swizzle : UInt8, Sendable {

        case zero

        case one

        case red

        case green

        case blue

        case alpha

        /// Creates a new instance with the specified raw value.
        ///
        /// If there is no value of the type that corresponds with the specified raw
        /// value, this initializer returns `nil`. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     print(PaperSize(rawValue: "Legal"))
        ///     // Prints "Optional(PaperSize.Legal)"
        ///
        ///     print(PaperSize(rawValue: "Tabloid"))
        ///     // Prints "nil"
        ///
        /// - Parameter rawValue: The raw value to use for the new instance.
        public init?(rawValue: UInt8)

        /// The raw type that can be used to represent all values of the conforming
        /// type.
        ///
        /// Every distinct value of the conforming type has a corresponding unique
        /// value of the `RawValue` type, but there may be values of the `RawValue`
        /// type that don't have a corresponding value of the conforming type.
        @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
        public typealias RawValue = UInt8

        /// The corresponding value of the raw type.
        ///
        /// A new instance initialized with `rawValue` will be equivalent to this
        /// instance. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     let selectedSize = PaperSize.Letter
        ///     print(selectedSize.rawValue)
        ///     // Prints "Letter"
        ///
        ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
        ///     // Prints "true"
        public var rawValue: UInt8 { get }
    }

    public var red: ComputeNodeGraph.SwizzleChannels.Swizzle

    public var green: ComputeNodeGraph.SwizzleChannels.Swizzle

    public var blue: ComputeNodeGraph.SwizzleChannels.Swizzle

    public var alpha: ComputeNodeGraph.SwizzleChannels.Swizzle

    public init(red: ComputeNodeGraph.SwizzleChannels.Swizzle = .red, green: ComputeNodeGraph.SwizzleChannels.Swizzle = .green, blue: ComputeNodeGraph.SwizzleChannels.Swizzle = .blue, alpha: ComputeNodeGraph.SwizzleChannels.Swizzle = .alpha)

    public init()

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.

Truncated.

enum

ComputeNodeGraph.Topology

NewiOSmacOStvOS
public enum Topology : String, CaseIterable, Sendable
Declaration
public enum Topology : String, CaseIterable, Sendable {

    case point

    case triangle

    case quad

    case octagon

    case strip

    case instances

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init?(rawValue: String)

    /// A type that can represent a collection of all values of this type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias AllCases = [ComputeNodeGraph.Topology]

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = String

    /// A collection of all values of this type.
    nonisolated public static var allCases: [ComputeNodeGraph.Topology] { get }

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public var rawValue: String { get }
}
func

ComputeNodeGraph.updateNode

NewiOSmacOStvOS
public mutating func updateNode(_ node: ComputeNodeGraph.Node, forKey nodeID: ComputeNodeGraph.NodeID) throws

Updates an existing node in the graph.

Parameters

node
The updated node data.
forKey
The key of the node to update.

ReturnsThrows: if the node cannot be updated.

enum

ComputeNodeGraph.Assembly.Attachment

NewiOSmacOStvOS
public enum Attachment : Sendable, Equatable

Identifies where a resource is attached in the compute graph.

Each buffer and texture bound to a compute pipeline is sourced from a specific attachment point: the graph itself, or a named input or output port on a node.

Declaration
public enum Attachment : Sendable, Equatable {

    /// The resource is owned by the graph and shared across all stages.
    case graph

    /// The resource is read by an input port at the given address.
    case input(ComputeNodeGraph.Port.Address)

    /// The resource is produced by an output port at the given address.
    case output(ComputeNodeGraph.Port.Address)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Assembly.Attachment, b: ComputeNodeGraph.Assembly.Attachment) -> Bool
}
struct

ComputeNodeGraph.Assembly.BufferBinding

NewiOSmacOStvOS
public struct BufferBinding : Sendable, Equatable

Describes how a Metal buffer is bound to a compute pipeline stage.

A buffer binding pairs an Attachment (how the buffer is connected to the graph) with an optional StateType describing the element layout of the buffer's contents.

Declaration
public struct BufferBinding : Sendable, Equatable {

    /// The attachment point that provides this buffer.
    public var attachment: ComputeNodeGraph.Assembly.Attachment

    /// The element type stored in the buffer, or `nil` if untyped.
    public var type: ComputeNodeGraph.StateType?

    public init(attachment: ComputeNodeGraph.Assembly.Attachment, type: ComputeNodeGraph.StateType? = nil)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Assembly.BufferBinding, b: ComputeNodeGraph.Assembly.BufferBinding) -> Bool
}
enum

ComputeNodeGraph.Assembly.Location

NewiOSmacOStvOS
public enum Location : Sendable, Equatable
Declaration
public enum Location : Sendable, Equatable {

    /// Value is a context type
    case context

    /// Value is located in uniforms. Its value is located at ``offset`` in the uniforms with length ``length``.
    case uniform(offset: Int, length: Int)

    /// Value is a texture with the given index
    case texture(index: Int)

    /// Buffer that's bound separately from other data. Size of buffer is stored at sizeOffset in uniforms
    case buffer(index: Int, sizeOffset: Int)

    /// Value is the output of another node
    case port(node: Int, index: Int)

    /// Value is in the deviceBuffers table at the specified index and offset
    case deviceBuffer(index: Int, offset: Int)

    /// Value is in the constantBuffers table at the specified index and offset
    case constantBuffer(index: Int, offset: Int)

    /// Value is a fixed 64-bit constant
    case constant(value: Int64)

    /// A context-dependent state value.
    ///
    /// Index references into the states table
    case state(index: Int, offset: Int, length: Int)

    /// Attribute which is a default value and should be considered "not bound"
    case unbound

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Assembly.Location, b: ComputeNodeGraph.Assembly.Location) -> Bool
}
struct

ComputeNodeGraph.Assembly.TextureBinding

NewiOSmacOStvOS
public struct TextureBinding : Sendable, Equatable

Describes how a Metal texture is bound to a compute pipeline stage.

A texture binding pairs an Attachment (how the texture is connected to the graph) with an optional MTLTextureType indicating the texture's dimensionality.

Declaration
public struct TextureBinding : Sendable, Equatable {

    /// The attachment point that provides this texture.
    public var attachment: ComputeNodeGraph.Assembly.Attachment

    /// The texture type (e.g. `.type2D`, `.typeCube`), or `nil` if unspecified.
    public var type: MTLTextureType?

    public init(attachment: ComputeNodeGraph.Assembly.Attachment, type: MTLTextureType? = nil)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Assembly.TextureBinding, b: ComputeNodeGraph.Assembly.TextureBinding) -> Bool
}
struct

ComputeNodeGraph.Assembly.UniformBinding

NewiOSmacOStvOS
public struct UniformBinding : Sendable, Equatable

Describes how a uniform value is located within the graph's uniform buffer.

A uniform binding combines a Relocation_v1 (the byte offset and size within the uniform buffer) with a StateType describing the data layout at that location.

Declaration
public struct UniformBinding : Sendable, Equatable {

    /// The location of this uniform within the uniform buffer.
    public var location: ComputeNodeGraph.Assembly.Location

    /// The data type stored at this location.
    public var type: ComputeNodeGraph.StateType

    public init(location: ComputeNodeGraph.Assembly.Location, type: ComputeNodeGraph.StateType)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Assembly.UniformBinding, b: ComputeNodeGraph.Assembly.UniformBinding) -> Bool
}
func

ComputeNodeGraph.Library.definition

NewiOSmacOStvOS
final public func definition(named name: String, in bundle: String? = nil) -> ComputeNodeGraph.NodeDefinition?

Returns the first node definition with the given name, or nil if none is found.

Pass nil for bundle to search across all bundles.

func

ComputeNodeGraph.Library.definition

NewiOSmacOStvOS
final public func definition(stage: ComputeNodeGraph.Stage) -> ComputeNodeGraph.NodeDefinition?

Returns a definition for the given stage.

var

ComputeNodeGraph.Library.definitions

NewiOSmacOStvOS
final public var definitions: [ComputeNodeGraph.NodeDefinition] { get }

The collection of all node definitions available in this library.

func

ComputeNodeGraph.Library.definitionsMatching

NewiOSmacOStvOS
final public func definitionsMatching(input type: ComputeNodeGraph.ValueType) -> [ComputeNodeGraph.NodeDefinition]

Returns all definitions that have at least one input matching the given value type.

func

ComputeNodeGraph.Library.definitionsMatching

NewiOSmacOStvOS
final public func definitionsMatching(inputs inputTypes: [ComputeNodeGraph.ValueType]) -> [ComputeNodeGraph.NodeDefinition]

Returns all definitions whose user-editable inputs, in order, match the given value types.

Non-user-editable inputs (framework-injected contexts, state bindings, etc.) are skipped when comparing the input sequence — callers pass only the user-visible types.

func

ComputeNodeGraph.Library.definitionsMatching

NewiOSmacOStvOS
final public func definitionsMatching(output type: ComputeNodeGraph.ValueType) -> [ComputeNodeGraph.NodeDefinition]

Returns all definitions that have at least one output matching the given value type.

init

ComputeNodeGraph.Library.init

NewiOSmacOStvOS
public convenience init(from library: any MTLLibrary, bundleIdentifier: String?)

Creates a library by extracting node definitions from a Metal library.

init

ComputeNodeGraph.Library.init

NewiOSmacOStvOS
public convenience init?(bundle: Bundle)

Creates a library from the Metal default library in the given bundle, if available.

func

ComputeNodeGraph.Library.merge

NewiOSmacOStvOS
final public func merge(contentsOf library: ComputeNodeGraph.Library)

Merges nodes from specified library into this library.

Use this method to merge libraries. If two nodes have the same name and bundle, the nodes in library will replace ones in self.

let

ComputeNodeGraph.Library.shared

NewiOSmacOStvOS
public static let shared: ComputeNodeGraph.Library
typealias

ComputeNodeGraph.Metadata.Key

NewiOSmacOStvOS
public typealias Key = String

The key type of a dictionary literal.

typealias

ComputeNodeGraph.Metadata.Value

NewiOSmacOStvOS
public typealias Value = String

The value type of a dictionary literal.

init

ComputeNodeGraph.Node.init

NewiOSmacOStvOS
public init(definition: ComputeNodeGraph.NodeDefinition, label: String? = nil)
enum

ComputeNodeGraph.Node.Kind

NewiOSmacOStvOS
public enum Kind : Sendable, Equatable
Declaration
public enum Kind : Sendable, Equatable {

    /// Node is standalone operation
    case primitive

    /// Node is a sequence of nodes, which have implicit flow dependencies between them.
    case sequence(nodes: [ComputeNodeGraph.NodeID])

    /// Node is a visual grouping of nodes. This can be presented as, for example, a box around
    /// the nodes, indicating that they are related, but without changing their structure.
    case grouping(nodes: [ComputeNodeGraph.NodeID])

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Node.Kind, b: ComputeNodeGraph.Node.Kind) -> Bool
}
enum

ComputeNodeGraph.NodeDefinition.Kind

NewiOSmacOStvOS
public enum Kind : Sendable, Equatable
Declaration
public enum Kind : Sendable, Equatable {

    /// Node refers to a MTLFunction
    case function

    /// Node represents an execution stage in the graph, for example 'simulation'
    /// or 'emission'
    case stage(type: ComputeNodeGraph.Stage)

    /// Node loads stored state into the graph
    case loadState(definition: ComputeNodeGraph.StateDefinition)

    /// Node stores state into the graph.
    case storeState(definition: ComputeNodeGraph.StateDefinition)

    /// Node contains a reference to a field of another stage, containing
    /// the given layout
    case fieldReference(type: ComputeNodeGraph.StateType)

    case textureReference(port: PortReference)

    /// An arithmetic node with one operand of the given data type, performing the specified operation
    case unaryArithmetic(type: MTLDataType, operation: UnaryOperation)

    /// An arithmetic node with two operands of the given type, performing the specified operation
    case binaryArithmetic(a: MTLDataType, b: MTLDataType, operation: BinaryOperation)

    /// A call to a standard library function with the specified data type.
    case standardLibrary(type: MTLDataType, function: StandardLibraryFunction)

    /// A swizzle operation for the given vector data type and channel specification
    case swizzle(type: MTLDataType, channels: ComputeNodeGraph.SwizzleChannels)

    /// A texture sampling operation with specified settings.
    case sampleTexture(ComputeNodeGraph.SamplerSettings)

    /// A node which composes a structure or vector type from its components
    case compose(type: ComputeNodeGraph.StateType)

    /// A node which decomposes a structure or vector type, providing access to individual components
    case decompose(type: ComputeNodeGraph.StateType)

    /// Convert from one primitive MTLDataType to another.
    ///
    /// Equivalent to calling Metal's constructor of `to` with a value of type `from`
    case convert(from: MTLDataType, to: MTLDataType)

    /// Reinterpret one type scalar or vector type as another of the
    /// same number of size and bytes.
    ///
    /// Equivalent to calling Metal's `as_type<>`
    case reinterpret(from: MTLDataType, to: MTLDataType)

    /// Return a uniform value supplied externally.
    ///
    /// If no inputs exist on the node, space for the output will be allocated.
    ///
    /// Constants can be specified on the node, which can contain external configuration.
    case graphInput

    /// A node which contains global constants affecting the graph
    case graphGlobal

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.NodeDefinition.Kind, b: ComputeNodeGraph.NodeDefinition.Kind) -> Bool
}
init

ComputeNodeGraph.Pipelines.init

NewiOSmacOStvOS
public init(descriptor: ComputeNodeGraph.PipelinesDescriptor) async throws
init

ComputeNodeGraph.Pipelines.init

NewiOSmacOStvOS
public init(descriptor: ComputeNodeGraph.PipelinesDescriptor) throws
init

ComputeNodeGraph.Pipelines.init

NewiOSmacOStvOS
public init(_ graph: ComputeNodeGraph) async throws

Assembles and compiles pipelines from the provided graph.

Compilation is performed asynchronously.

init

ComputeNodeGraph.Pipelines.init

NewiOSmacOStvOS
public init(_ graph: ComputeNodeGraph) throws

Assembles and compiles pipelines from the provided graph.

Compilation is performed synchronously.

struct

ComputeNodeGraph.Pipelines.Options

NewiOSmacOStvOS
public struct Options : Equatable, Sendable
Declaration
public struct Options : Equatable, Sendable {

    /// Whether debug draw should be included in pipelines.
    ///
    /// Debug Draw is disabled by default and its code is removed from
    /// shaders for optimal performance.
    public var debugDraw: Bool

    public init()

    public init(debugDraw: Bool = false)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Pipelines.Options, b: ComputeNodeGraph.Pipelines.Options) -> Bool
}
func

ComputeNodeGraph.PipelinesDescriptor.addLibrary

NewiOSmacOStvOS
public mutating func addLibrary(_ library: any MTLLibrary, bundle: String?)
func

ComputeNodeGraph.PipelinesDescriptor.setLibrary

NewiOSmacOStvOS
public mutating func setLibrary(_ library: ComputeNodeGraph.Library)
struct

ComputeNodeGraph.Port.Address

NewiOSmacOStvOS
public struct Address : Sendable, Equatable, Hashable

A location of a specific port on a node, identified by the node and the port's index.

Declaration
public struct Address : Sendable, Equatable, Hashable {

    /// The node that owns this port.
    public var node: ComputeNodeGraph.NodeID

    /// The index of the port within the node's input or output list.
    public var index: Int

    public init(node: ComputeNodeGraph.NodeID, index: Int)

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Port.Address, b: ComputeNodeGraph.Port.Address) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
enum

ComputeNodeGraph.Port.Kind

NewiOSmacOStvOS
public enum Kind : Sendable, Equatable

The semantic role of a port, determining what it carries along an edge and whether the edge imposes execution ordering between its endpoints.

Declaration
public enum Kind : Sendable, Equatable {

    /// Carries an ambient runtime context handle injected by the graph at
    /// execution time. Destination reads the handle; no ordering effect.
    case context

    /// Carries a typed data value from source to destination. One-way read,
    /// no ordering effect.
    case value

    /// Carries a read/write binding to named external storage (element,
    /// emitter, group, output attribute, threadgroup memory). Type is always
    /// `.state(definition:)`. No ordering effect.
    case state

    /// Carries a typed event payload. Triggers downstream execution per event
    /// AND carries data (e.g. spawn/update/terminate events with element data).
    case event

    /// Execution-ordering edge whose destination is conceptually a consumer
    /// of the source's typed output. No runtime payload is transferred, but
    /// type compatibility is enforced. Used for stage → stage sequencing.
    case flow

    /// Pure "happens-after" edge. No runtime payload, no type lineage, no
    /// type compatibility check. The destination is ordered after the source
    /// but does not consume its output. Use this to splice a node (e.g. a
    /// compute stage) into execution order between two unrelated nodes.
    case dependency

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.Port.Kind, b: ComputeNodeGraph.Port.Kind) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
struct

ComputeNodeGraph.Port.Options

NewiOSmacOStvOS
public struct Options : OptionSet, Sendable, Equatable

Flags that modify how a port's value is treated during compilation and execution.

Declaration
public struct Options : OptionSet, Sendable, Equatable {

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public let rawValue: UInt

    /// Creates a new option set from the given raw value.
    ///
    /// This initializer always succeeds, even if the value passed as `rawValue`
    /// exceeds the static properties declared as part of the option set. This
    /// example creates an instance of `ShippingOptions` with a raw value beyond
    /// the highest element, with a bit mask that effectively contains all the
    /// declared static members.
    ///
    ///     let extraOptions = ShippingOptions(rawValue: 255)
    ///     print(extraOptions.isStrictSuperset(of: .all))
    ///     // Prints "true"
    ///
    /// - Parameter rawValue: The raw value of the option set to create. Each bit
    ///   of `rawValue` potentially represents an element of the option set,
    ///   though raw values may include bits that are not defined as distinct
    ///   values of the `OptionSet` type.
    public init(rawValue: UInt)

    /// Port affects compilation.
    ///
    /// Changes to ``compile`` values require recompiling the pipeline
    public static let compile: ComputeNodeGraph.Port.Options

    /// Port is constant and doesn't need to be changeable.
    ///
    /// Parameters with ``constant`` that are available at compile time can aid in optimization.
    public static let constant: ComputeNodeGraph.Port.Options

    /// Port is an argument to a runtime function.
    ///
    /// These correspond to a function parameter.
    public static let argument: ComputeNodeGraph.Port.Options

    /// The value of this port is optional (may be nil)
    public static let optional: ComputeNodeGraph.Port.Options

    /// The port references a value outside of the graph, such as by filename
    public static let externalReference: ComputeNodeGraph.Port.Options

    /// The type of the elements of an array literal.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias ArrayLiteralElement = ComputeNodeGraph.Port.Options

    /// The element type of the option set.
    ///
    /// To inherit all the default implementations from the `OptionSet` protocol,
    /// the `Element` type must be `Self`, the default.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias Element = ComputeNodeGraph.Port.Options

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = UInt
}
typealias

ComputeNodeGraph.Port.Options.ArrayLiteralElement

NewiOSmacOStvOS
public typealias ArrayLiteralElement = ComputeNodeGraph.Port.Options

The type of the elements of an array literal.

typealias

ComputeNodeGraph.Port.Options.Element

NewiOSmacOStvOS
public typealias Element = ComputeNodeGraph.Port.Options

The element type of the option set.

To inherit all the default implementations from the OptionSet protocol, the Element type must be Self, the default.

typealias

ComputeNodeGraph.Port.Options.RawValue

NewiOSmacOStvOS
public typealias RawValue = UInt

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

func

ComputeNodeGraph.Scope.encode

NewiOSmacOStvOS
public func encode(to encoder: any Encoder) throws

Encodes this value into the given encoder.

If the value fails to encode anything, encoder will encode an empty keyed container in its place.

This function throws an error if any values are invalid for the given encoder's format.

Parameters

encoder
The encoder to write data to.
init

ComputeNodeGraph.Scope.init

NewiOSmacOStvOS
public init(_ name: String)
init

ComputeNodeGraph.Scope.init

NewiOSmacOStvOS
public init(from decoder: any Decoder) throws

Creates a new instance by decoding from the given decoder.

This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

Parameters

decoder
The decoder to read data from.
struct

ComputeNodeGraph.StateDefinition.Options

NewiOSmacOStvOS
public struct Options : OptionSet, Sendable, Equatable
Declaration
public struct Options : OptionSet, Sendable, Equatable {

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public let rawValue: UInt

    /// Creates a new option set from the given raw value.
    ///
    /// This initializer always succeeds, even if the value passed as `rawValue`
    /// exceeds the static properties declared as part of the option set. This
    /// example creates an instance of `ShippingOptions` with a raw value beyond
    /// the highest element, with a bit mask that effectively contains all the
    /// declared static members.
    ///
    ///     let extraOptions = ShippingOptions(rawValue: 255)
    ///     print(extraOptions.isStrictSuperset(of: .all))
    ///     // Prints "true"
    ///
    /// - Parameter rawValue: The raw value of the option set to create. Each bit
    ///   of `rawValue` potentially represents an element of the option set,
    ///   though raw values may include bits that are not defined as distinct
    ///   values of the `OptionSet` type.
    public init(rawValue: UInt)

    /// This port indicates that it is reading from its state.
    public static let read: ComputeNodeGraph.StateDefinition.Options

    /// This port indicates that is writing to the state.
    public static let write: ComputeNodeGraph.StateDefinition.Options

    /// The type of the elements of an array literal.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias ArrayLiteralElement = ComputeNodeGraph.StateDefinition.Options

    /// The element type of the option set.
    ///
    /// To inherit all the default implementations from the `OptionSet` protocol,
    /// the `Element` type must be `Self`, the default.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias Element = ComputeNodeGraph.StateDefinition.Options

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, tvOS 27.0, *)
    public typealias RawValue = UInt
}
typealias

ComputeNodeGraph.StateDefinition.Options.ArrayLiteralElement

NewiOSmacOStvOS
public typealias ArrayLiteralElement = ComputeNodeGraph.StateDefinition.Options

The type of the elements of an array literal.

typealias

ComputeNodeGraph.StateDefinition.Options.Element

NewiOSmacOStvOS
public typealias Element = ComputeNodeGraph.StateDefinition.Options

The element type of the option set.

To inherit all the default implementations from the OptionSet protocol, the Element type must be Self, the default.

typealias

ComputeNodeGraph.StateDefinition.Options.RawValue

NewiOSmacOStvOS
public typealias RawValue = UInt

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

func

ComputeNodeGraph.StateType.loadBuffer

NewiOSmacOStvOS
public func loadBuffer(from data: Data) throws -> (data: Data, elementCount: Int)
struct

ComputeNodeGraph.StructureLayout.Member

NewiOSmacOStvOS
public struct Member : Equatable, Sendable
Declaration
public struct Member : Equatable, Sendable {

    /// Name of this member in the containing structure
    public var name: String

    /// Offset, in bytes, of this member in its containing structure
    public var offset: Int

    public var type: ComputeNodeGraph.StateType

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ComputeNodeGraph.StructureLayout.Member, b: ComputeNodeGraph.StructureLayout.Member) -> Bool
}
var

ComputeNodeGraph.StructureLayout.Member.dataType

NewiOSmacOStvOS
public var dataType: MTLDataType? { get }

Data type. For types such as .struct and .pointer, see typeName and components for additional information.

init

ComputeNodeGraph.StructureLayout.Member.init

NewiOSmacOStvOS
public init(name: String, type: MTLDataType, offset: Int)
var

ComputeNodeGraph.StructureLayout.Member.lengthInBytes

NewiOSmacOStvOS
public var lengthInBytes: Int { get }
var

ComputeNodeGraph.StructureLayout.Member.members

NewiOSmacOStvOS
public var members: [ComputeNodeGraph.StructureLayout.Member]? { get }
var

ComputeNodeGraph.StructureLayout.Member.typeName

NewiOSmacOStvOS
public var typeName: String? { get }
typealias

ComputeNodeGraph.SwizzleChannels.Swizzle.RawValue

NewiOSmacOStvOS
public typealias RawValue = UInt8

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

ComputeNodeGraph.Topology.AllCases

NewiOSmacOStvOS
public typealias AllCases = [ComputeNodeGraph.Topology]

A type that can represent a collection of all values of this type.

typealias

ComputeNodeGraph.Topology.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

CoordinateSpace.AllCases

NewiOSmacOStvOS
public typealias AllCases = [CoordinateSpace]

A type that can represent a collection of all values of this type.

typealias

CoordinateSpace.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

ElementGrouping.AllCases

NewiOSmacOStvOS
public typealias AllCases = [ElementGrouping]

A type that can represent a collection of all values of this type.

typealias

ElementGrouping.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

Sorting.AllCases

NewiOSmacOStvOS
public typealias AllCases = [Sorting]

A type that can represent a collection of all values of this type.

typealias

Sorting.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

StandardLibraryFunction.AllCases

NewiOSmacOStvOS
public typealias AllCases = [StandardLibraryFunction]

A type that can represent a collection of all values of this type.

typealias

StandardLibraryFunction.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

StripOrientation.AllCases

NewiOSmacOStvOS
public typealias AllCases = [StripOrientation]

A type that can represent a collection of all values of this type.

typealias

StripOrientation.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

Topology.AllCases

NewiOSmacOStvOS
public typealias AllCases = [Topology]

A type that can represent a collection of all values of this type.

typealias

Topology.ID

NewiOSmacOStvOS
public typealias ID = Topology

A type representing the stable identity of the entity associated with an instance.

typealias

Topology.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

UnaryOperation.AllCases

NewiOSmacOStvOS
public typealias AllCases = [UnaryOperation]

A type that can represent a collection of all values of this type.

typealias

UnaryOperation.RawValue

NewiOSmacOStvOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

No APIs match your filter.

← More in Spatial, 3D & RealityKit