mpsrayintersector

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package mpsrayintersector provides purego-based Go bindings for the macOS MPSRayIntersector framework.

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acl_entry_id_t

type Acl_entry_id_t int64
const (
	ACL_FIRST_ENTRY Acl_entry_id_t = 0
	ACL_NEXT_ENTRY  Acl_entry_id_t = -1
	ACL_LAST_ENTRY  Acl_entry_id_t = -2
)

func (Acl_entry_id_t) String

func (e Acl_entry_id_t) String() string

type Acl_flag_t

type Acl_flag_t int64
const (
	ACL_FLAG_DEFER_INHERIT      Acl_flag_t = 1
	ACL_FLAG_NO_INHERIT         Acl_flag_t = 131072
	ACL_ENTRY_INHERITED         Acl_flag_t = 16
	ACL_ENTRY_FILE_INHERIT      Acl_flag_t = 32
	ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64
	ACL_ENTRY_LIMIT_INHERIT     Acl_flag_t = 128
	ACL_ENTRY_ONLY_INHERIT      Acl_flag_t = 256
)

func (Acl_flag_t) String

func (e Acl_flag_t) String() string

type Acl_perm_t

type Acl_perm_t int64
const (
	ACL_READ_DATA           Acl_perm_t = 2
	ACL_LIST_DIRECTORY      Acl_perm_t = 2
	ACL_WRITE_DATA          Acl_perm_t = 4
	ACL_ADD_FILE            Acl_perm_t = 4
	ACL_EXECUTE             Acl_perm_t = 8
	ACL_SEARCH              Acl_perm_t = 8
	ACL_DELETE              Acl_perm_t = 16
	ACL_APPEND_DATA         Acl_perm_t = 32
	ACL_ADD_SUBDIRECTORY    Acl_perm_t = 32
	ACL_DELETE_CHILD        Acl_perm_t = 64
	ACL_READ_ATTRIBUTES     Acl_perm_t = 128
	ACL_WRITE_ATTRIBUTES    Acl_perm_t = 256
	ACL_READ_EXTATTRIBUTES  Acl_perm_t = 512
	ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024
	ACL_READ_SECURITY       Acl_perm_t = 2048
	ACL_WRITE_SECURITY      Acl_perm_t = 4096
	ACL_CHANGE_OWNER        Acl_perm_t = 8192
	ACL_SYNCHRONIZE         Acl_perm_t = 1048576
)

func (Acl_perm_t) String

func (e Acl_perm_t) String() string

type Acl_tag_t

type Acl_tag_t int64
const (
	ACL_UNDEFINED_TAG  Acl_tag_t = 0
	ACL_EXTENDED_ALLOW Acl_tag_t = 1
	ACL_EXTENDED_DENY  Acl_tag_t = 2
)

func (Acl_tag_t) String

func (e Acl_tag_t) String() string

type Acl_type_t

type Acl_type_t int64
const (
	ACL_TYPE_EXTENDED Acl_type_t = 256
	ACL_TYPE_ACCESS   Acl_type_t = 0
	ACL_TYPE_DEFAULT  Acl_type_t = 1
	ACL_TYPE_AFS      Acl_type_t = 2
	ACL_TYPE_CODA     Acl_type_t = 3
	ACL_TYPE_NTFS     Acl_type_t = 4
	ACL_TYPE_NWFS     Acl_type_t = 5
)

func (Acl_type_t) String

func (e Acl_type_t) String() string

type Clockid_t

type Clockid_t int64

func (Clockid_t) String

func (e Clockid_t) String() string

type Dispatch_autorelease_frequency_t

type Dispatch_autorelease_frequency_t uint64
const (
	DISPATCH_AUTORELEASE_FREQUENCY_INHERIT   Dispatch_autorelease_frequency_t = 0
	DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1
	DISPATCH_AUTORELEASE_FREQUENCY_NEVER     Dispatch_autorelease_frequency_t = 2
)

func (Dispatch_autorelease_frequency_t) String

type Dispatch_block_flags_t

type Dispatch_block_flags_t uint64
const (
	DISPATCH_BLOCK_BARRIER           Dispatch_block_flags_t = 1
	DISPATCH_BLOCK_DETACHED          Dispatch_block_flags_t = 2
	DISPATCH_BLOCK_ASSIGN_CURRENT    Dispatch_block_flags_t = 4
	DISPATCH_BLOCK_NO_QOS_CLASS      Dispatch_block_flags_t = 8
	DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16
	DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32
)

func (Dispatch_block_flags_t) String

func (e Dispatch_block_flags_t) String() string

type Filesec_property_t

type Filesec_property_t int64
const (
	FILESEC_OWNER         Filesec_property_t = 1
	FILESEC_GROUP         Filesec_property_t = 2
	FILESEC_UUID          Filesec_property_t = 3
	FILESEC_MODE          Filesec_property_t = 4
	FILESEC_ACL           Filesec_property_t = 5
	FILESEC_GRPUUID       Filesec_property_t = 6
	FILESEC_ACL_RAW       Filesec_property_t = 100
	FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101
)

func (Filesec_property_t) String

func (e Filesec_property_t) String() string

type Idtype_t

type Idtype_t int64
const (
	P_ALL  Idtype_t = 0
	P_PID  Idtype_t = 1
	P_PGID Idtype_t = 2
)

func (Idtype_t) String

func (e Idtype_t) String() string

type Ipc_info_object_type_t

type Ipc_info_object_type_t int64
const (
	IPC_OTYPE_NONE                 Ipc_info_object_type_t = 0
	IPC_OTYPE_THREAD_CONTROL       Ipc_info_object_type_t = 1
	IPC_OTYPE_TASK_CONTROL         Ipc_info_object_type_t = 2
	IPC_OTYPE_HOST                 Ipc_info_object_type_t = 3
	IPC_OTYPE_HOST_PRIV            Ipc_info_object_type_t = 4
	IPC_OTYPE_PROCESSOR            Ipc_info_object_type_t = 5
	IPC_OTYPE_PROCESSOR_SET        Ipc_info_object_type_t = 6
	IPC_OTYPE_PROCESSOR_SET_NAME   Ipc_info_object_type_t = 7
	IPC_OTYPE_TIMER                Ipc_info_object_type_t = 8
	IPC_OTYPE_PORT_SUBST_ONCE      Ipc_info_object_type_t = 9
	IPC_OTYPE_MIG                  Ipc_info_object_type_t = 10
	IPC_OTYPE_MEMORY_OBJECT        Ipc_info_object_type_t = 11
	IPC_OTYPE_XMM_PAGER            Ipc_info_object_type_t = 12
	IPC_OTYPE_XMM_KERNEL           Ipc_info_object_type_t = 13
	IPC_OTYPE_XMM_REPLY            Ipc_info_object_type_t = 14
	IPC_OTYPE_UND_REPLY            Ipc_info_object_type_t = 15
	IPC_OTYPE_HOST_NOTIFY          Ipc_info_object_type_t = 16
	IPC_OTYPE_HOST_SECURITY        Ipc_info_object_type_t = 17
	IPC_OTYPE_LEDGER               Ipc_info_object_type_t = 18
	IPC_OTYPE_MAIN_DEVICE          Ipc_info_object_type_t = 19
	IPC_OTYPE_TASK_NAME            Ipc_info_object_type_t = 20
	IPC_OTYPE_SUBSYSTEM            Ipc_info_object_type_t = 21
	IPC_OTYPE_IO_DONE_QUEUE        Ipc_info_object_type_t = 22
	IPC_OTYPE_SEMAPHORE            Ipc_info_object_type_t = 23
	IPC_OTYPE_LOCK_SET             Ipc_info_object_type_t = 24
	IPC_OTYPE_CLOCK                Ipc_info_object_type_t = 25
	IPC_OTYPE_CLOCK_CTRL           Ipc_info_object_type_t = 26
	IPC_OTYPE_IOKIT_IDENT          Ipc_info_object_type_t = 27
	IPC_OTYPE_NAMED_ENTRY          Ipc_info_object_type_t = 28
	IPC_OTYPE_IOKIT_CONNECT        Ipc_info_object_type_t = 29
	IPC_OTYPE_IOKIT_OBJECT         Ipc_info_object_type_t = 30
	IPC_OTYPE_UPL                  Ipc_info_object_type_t = 31
	IPC_OTYPE_MEM_OBJ_CONTROL      Ipc_info_object_type_t = 32
	IPC_OTYPE_AU_SESSIONPORT       Ipc_info_object_type_t = 33
	IPC_OTYPE_FILEPORT             Ipc_info_object_type_t = 34
	IPC_OTYPE_LABELH               Ipc_info_object_type_t = 35
	IPC_OTYPE_TASK_RESUME          Ipc_info_object_type_t = 36
	IPC_OTYPE_VOUCHER              Ipc_info_object_type_t = 37
	IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38
	IPC_OTYPE_WORK_INTERVAL        Ipc_info_object_type_t = 39
	IPC_OTYPE_UX_HANDLER           Ipc_info_object_type_t = 40
	IPC_OTYPE_UEXT_OBJECT          Ipc_info_object_type_t = 41
	IPC_OTYPE_ARCADE_REG           Ipc_info_object_type_t = 42
	IPC_OTYPE_EVENTLINK            Ipc_info_object_type_t = 43
	IPC_OTYPE_TASK_INSPECT         Ipc_info_object_type_t = 44
	IPC_OTYPE_TASK_READ            Ipc_info_object_type_t = 45
	IPC_OTYPE_THREAD_INSPECT       Ipc_info_object_type_t = 46
	IPC_OTYPE_THREAD_READ          Ipc_info_object_type_t = 47
	IPC_OTYPE_SUID_CRED            Ipc_info_object_type_t = 48
	IPC_OTYPE_HYPERVISOR           Ipc_info_object_type_t = 49
	IPC_OTYPE_TASK_ID_TOKEN        Ipc_info_object_type_t = 50
	IPC_OTYPE_TASK_FATAL           Ipc_info_object_type_t = 51
	IPC_OTYPE_KCDATA               Ipc_info_object_type_t = 52
	IPC_OTYPE_EXCLAVES_RESOURCE    Ipc_info_object_type_t = 53
	IPC_OTYPE_THREAD_RESUME        Ipc_info_object_type_t = 54
	IPC_OTYPE_UNKNOWN              Ipc_info_object_type_t = 4294967295
)

func (Ipc_info_object_type_t) String

func (e Ipc_info_object_type_t) String() string

type Launch_data_type_t

type Launch_data_type_t int64
const (
	LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1
	LAUNCH_DATA_ARRAY      Launch_data_type_t = 2
	LAUNCH_DATA_FD         Launch_data_type_t = 3
	LAUNCH_DATA_INTEGER    Launch_data_type_t = 4
	LAUNCH_DATA_REAL       Launch_data_type_t = 5
	LAUNCH_DATA_BOOL       Launch_data_type_t = 6
	LAUNCH_DATA_STRING     Launch_data_type_t = 7
	LAUNCH_DATA_OPAQUE     Launch_data_type_t = 8
	LAUNCH_DATA_ERRNO      Launch_data_type_t = 9
	LAUNCH_DATA_MACHPORT   Launch_data_type_t = 10
)

func (Launch_data_type_t) String

func (e Launch_data_type_t) String() string

type MDLabelDomain

type MDLabelDomain int64

@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().

const (
	KMDLabelUserDomain  MDLabelDomain = 0
	KMDLabelLocalDomain MDLabelDomain = 1
)

func (MDLabelDomain) String

func (e MDLabelDomain) String() string

type MDQueryOptionFlags

type MDQueryOptionFlags int64
const (
	KMDQuerySynchronous        MDQueryOptionFlags = 1
	KMDQueryWantsUpdates       MDQueryOptionFlags = 4
	KMDQueryAllowFSTranslation MDQueryOptionFlags = 8
)

func (MDQueryOptionFlags) String

func (e MDQueryOptionFlags) String() string

type MDQuerySortOptionFlags

type MDQuerySortOptionFlags int64

@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.

const (
	KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)

func (MDQuerySortOptionFlags) String

func (e MDQuerySortOptionFlags) String() string

type MPSAccelerationStructure

type MPSAccelerationStructure struct {
	mpscore.MPSKernel
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsaccelerationstructure

func MPSAccelerationStructureFromID

func MPSAccelerationStructureFromID(id objc.ID) *MPSAccelerationStructure

func (*MPSAccelerationStructure) BoundingBox

@brief The bounding box fully enclosing the geometry this acceleration structure was built over. @discussion The value of this property is not available until the acceleration structure has finished rebuilding or refitting

func (*MPSAccelerationStructure) CopyWithZoneGroup

@brief Create a a copy of this acceleration structure @discussion The acceleration structure may be copied with a different acceleration structure group. Buffer properties of the acceleration structure such as the vertex buffer, instance buffer, etc. are set to nil. Copy these buffers with the new Metal device and assign them to the new acceleration structure instead. Do not copy the acceleration structure until any prior refit or rebuild operations have completed. @param zone This parameter is ignored. Memory zones are no longer used by Objective-C. @param group New acceleration structure group

func (*MPSAccelerationStructure) EncodeRefitToCommandBuffer

func (o *MPSAccelerationStructure) EncodeRefitToCommandBuffer(commandBuffer metal.MTLCommandBuffer)

@brief Refit the existing acceleration structure to new data @discussion This method is used to refit the acceleration structure to new vertex data, index data, instance data, etc. while preserving the existing acceleration structure topology. This is typically much faster than a full rebuild of the acceleration structure. Refitting can also be pipelined with other GPU work such as ray intersection. Until the command buffer has completed, the acceleration structure cannot be copied, encoded with NSSecureCoding, or rebuilt. Changes to properties such as the triangle count or instance count might not be reflected. These changes require that the acceleration structure be rebuilt instead. The acceleration structure must be rebuilt at least once before this method can be called.

func (*MPSAccelerationStructure) EncodeWithCoder

func (o *MPSAccelerationStructure) EncodeWithCoder(coder *foundation.NSCoder)

@brief Encode the acceleration structure with an NSCoder @discussion Buffer properties such as the vertex buffer, index buffer, etc. are not be encoded. Encode and decode these buffers along with the acceleration structure instead. Do not encode the acceleration structure until any prior refit or rebuild operations have completed. @param coder An archiver object

func (*MPSAccelerationStructure) Group

@brief The group this acceleration structure was created with

func (*MPSAccelerationStructure) InitWithCoderDevice

func (o *MPSAccelerationStructure) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSAccelerationStructure

@brief Initialize the acceleration structure with an NSCoder and a Metal device. Buffer properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with the acceleration structure instead.

func (*MPSAccelerationStructure) InitWithCoderGroup

@brief Initialize the acceleration structure with an NSCoder and an acceleration structure group, if the acceleration structure will be used in an instance hierarchy. All acceleration structures in the instance hierarchy must share the same group. Buffer properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with the acceleration structure instead.

func (*MPSAccelerationStructure) InitWithDevice

@brief Initialize the acceleration structure with a Metal device

func (*MPSAccelerationStructure) InitWithGroup

@brief Initialize the acceleration structure with an acceleration structure group, if the acceleration structure will be used in an instance hierarchy. @discussion The Metal device is determined from the acceleration structure group. All acceleration structures in the instance hierarchy must share the same group.

func (*MPSAccelerationStructure) Rebuild

func (o *MPSAccelerationStructure) Rebuild()

@brief Rebuild the acceleration structure @discussion This method must be called before any intersection tests can be scheduled with this acceleration structure. Before calling this method, fill out the properties of the acceleration structure such as vertex buffer, instance buffer, etc. The acceleration structure should be rebuilt when its contents (e.g. vertices in a triangle acceleration structure) have been modified significantly and must be rebuilt when properties such as triangle count, vertex stride, etc. have changed. When the contents of the acceleration structure have only been modified slightly, it may be cheaper to refit the acceleration structure instead. This method blocks until the acceleration structure has been rebuilt. Until the rebuild has completed, the acceleration structure cannot be copied, encoded with NSSecureCoding, rebuilt, or refit. Before this method can be called, any pending GPU writes to the vertex buffer, index buffer, etc. must be completed (and, for managed buffers, synchronized). Any prior intersection tests must also be completed before the acceleration structure can be rebuilt.

func (*MPSAccelerationStructure) RebuildWithCompletionHandler

func (o *MPSAccelerationStructure) RebuildWithCompletionHandler(completionHandler func(*MPSAccelerationStructure))

@brief Rebuild the acceleration structure asynchronously @discussion This method must be called before any intersection tests can be scheduled with this acceleration structure. Before calling this method, fill out the properties of the acceleration structure such as vertex buffer, instance buffer, etc. The acceleration structure should be rebuilt when its contents (e.g. vertices in a triangle acceleration structure) have been modified significantly and must be rebuilt when properties such as triangle count, vertex stride, etc. have changed. When the contents of the acceleration structure have only been modified slightly, it may be cheaper to refit the acceleration structure instead. Until the rebuild has completed, the acceleration structure cannot be copied, encoded with NSSecureCoding, rebuilt, or refit. Before this method can be called, any pending GPU writes to the vertex buffer, index buffer, etc. must be completed (and, for managed buffers, synchronized). Any prior intersection tests must also be completed before the acceleration structure can be rebuilt.

func (*MPSAccelerationStructure) SetUsage

func (*MPSAccelerationStructure) Status

@brief Status indicating whether the acceleration structure has finished building

func (*MPSAccelerationStructure) Usage

@brief Acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.

type MPSAccelerationStructureGroup

type MPSAccelerationStructureGroup struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsaccelerationstructuregroup

func MPSAccelerationStructureGroupFromID

func MPSAccelerationStructureGroupFromID(id objc.ID) *MPSAccelerationStructureGroup

func (*MPSAccelerationStructureGroup) Device

@brief The Metal device this acceleration structure group was created with

func (*MPSAccelerationStructureGroup) InitWithDevice

type MPSAccelerationStructureStatus

type MPSAccelerationStructureStatus uint64

@brief Possible values of the acceleration structure status property

const (
	// @brief The acceleration structure has not been built yet
	MPSAccelerationStructureStatusUnbuilt MPSAccelerationStructureStatus = 0
	// @brief The acceleration structure has finished building
	MPSAccelerationStructureStatusBuilt MPSAccelerationStructureStatus = 1
)

func (MPSAccelerationStructureStatus) String

type MPSAccelerationStructureUsage

type MPSAccelerationStructureUsage uint64

@brief Options describing how an acceleration structure will be used

const (
	// @brief No usage options specified
	MPSAccelerationStructureUsageNone MPSAccelerationStructureUsage = 0
	// @brief Enable support for refitting the acceleration structure after it has been built. This option may reduce raytracing performance so do not use it unless the acceleration structure will be refit.
	MPSAccelerationStructureUsageRefit MPSAccelerationStructureUsage = 1
	// @brief Option indicating that the acceleration structure will be rebuilt frequently. In this case, the acceleration structure may choose a higher performance but lower quality acceleration structure construction algorithm. This option may reduce raytracing performance performance so do not use it unless reduced acceleration structure build time is worth reduced raytracing performance. This option may be useful if, for example, the user is interactively editing a live view of the scene.
	MPSAccelerationStructureUsageFrequentRebuild MPSAccelerationStructureUsage = 2
	// @brief Prefer building the acceleration structure on the GPU. By default, the acceleration structure will be built on the GPU when possible. However, in some cases such as very small triangle counts, the acceleration structure may be built on the CPU. This option will force the acceleration structure to be always be built on the GPU whenever possible.
	MPSAccelerationStructureUsagePreferGPUBuild MPSAccelerationStructureUsage = 4
	// @brief Prefer building the acceleration structure on the CPU. By default, the acceleration structure will be built on the GPU when possible, which is typically much faster than building on the CPU. However, in some cases it may be preferable to build on the CPU such as to avoid framerate hitches when the GPU is rendering the user interface.
	MPSAccelerationStructureUsagePreferCPUBuild MPSAccelerationStructureUsage = 8
)

func (MPSAccelerationStructureUsage) String

type MPSAxisAlignedBoundingBox

type MPSAxisAlignedBoundingBox struct {
	Min unsafe.Pointer
	Max unsafe.Pointer
}

@brief An axis aligned bounding box with a min and max point C struct: _MPSAxisAlignedBoundingBox

type MPSBoundingBoxIntersectionTestType

type MPSBoundingBoxIntersectionTestType uint64

@brief Options for the MPSRayIntersector bounding box intersection test type property

const (
	// @brief Use the default MPSBoundingBoxIntersectionTestTypeAxisAligned ray/bounding box intersection test. Note: this option was equivalent to MPSBoundingBoxIntersectionTestTypeFast in macOS 10.14/iOS 12.0. This option was changed in macOS 10.15/iOS 13.0 to handle axis-aligned rays correctly by default. The old behavior can be restored by explicitly setting the intersection test type to MPSBoundingBoxIntersectionTestTypeFast on macOS 10.15/iOS 13.0 and above.
	MPSBoundingBoxIntersectionTestTypeDefault MPSBoundingBoxIntersectionTestType = 0
	// @brief This intersection test is potentially slower than MPSBoundingBoxIntersectionTestTypeFast but does not generate false negatives for axis aligned rays (i.e. rays which have one or more components of their direction set to zero). These rays often do not come up in practice due to perspective projections and randomized ray distributions. However, synthetic ray distributions or orthographic projections can generate these rays. It may be faster to slightly perturb the ray direction and use the fast intersection test type.
	MPSBoundingBoxIntersectionTestTypeAxisAligned MPSBoundingBoxIntersectionTestType = 1
	// @brief This intersection test is potentially faster than MPSBoundingBoxIntersectionTestTypeAxisAligned but can generate false negatives for axis aligned rays (i.e. rays which have one or more components of their direction set to zero). These rays often do not come up in practice due to perspective projections and randomized ray distributions. However, synthetic ray distributions or orthographic projections can generate these rays.
	MPSBoundingBoxIntersectionTestTypeFast MPSBoundingBoxIntersectionTestType = 2
)

func (MPSBoundingBoxIntersectionTestType) String

type MPSInstanceAccelerationStructure

type MPSInstanceAccelerationStructure struct {
	MPSAccelerationStructure
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsinstanceaccelerationstructure

func MPSInstanceAccelerationStructureFromID

func MPSInstanceAccelerationStructureFromID(id objc.ID) *MPSInstanceAccelerationStructure

func (*MPSInstanceAccelerationStructure) AccelerationStructures

@brief Acceleration structures available for use in this instance acceleration structure. Each instance must provide an index into this array in the instance buffer as well as a transformation matrix in the transform buffer. All acceleration structures must share a single vertex buffer, optional index buffer, and optional mask buffer, though they may have different offsets within each buffer, and all acceleration structures must share the same acceleration structure group. If a polygon acceleration structure is rebuilt or refit, the instance acceleration structure must subsequently be rebuilt or refit.

func (*MPSInstanceAccelerationStructure) InstanceBuffer

func (o *MPSInstanceAccelerationStructure) InstanceBuffer() metal.MTLBuffer

@brief Buffer containing the 32 bit unsigned integer index into the acceleration structure array for each instance

func (*MPSInstanceAccelerationStructure) InstanceBufferOffset

func (o *MPSInstanceAccelerationStructure) InstanceBufferOffset() uint

@brief Offset, in bytes, into the instance buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.

func (*MPSInstanceAccelerationStructure) InstanceCount

func (o *MPSInstanceAccelerationStructure) InstanceCount() uint

@brief Number of instances. Changes to this property require rebuilding the acceleration structure.

func (*MPSInstanceAccelerationStructure) MaskBuffer

@brief Mask buffer containing one uint32_t mask per instance. May be nil.

func (*MPSInstanceAccelerationStructure) MaskBufferOffset

func (o *MPSInstanceAccelerationStructure) MaskBufferOffset() uint

@brief Offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.

func (*MPSInstanceAccelerationStructure) SetAccelerationStructures

func (o *MPSInstanceAccelerationStructure) SetAccelerationStructures(accelerationStructures *foundation.NSArray[*MPSPolygonAccelerationStructure])

func (*MPSInstanceAccelerationStructure) SetInstanceBuffer

func (o *MPSInstanceAccelerationStructure) SetInstanceBuffer(instanceBuffer metal.MTLBuffer)

func (*MPSInstanceAccelerationStructure) SetInstanceBufferOffset

func (o *MPSInstanceAccelerationStructure) SetInstanceBufferOffset(instanceBufferOffset uint)

func (*MPSInstanceAccelerationStructure) SetInstanceCount

func (o *MPSInstanceAccelerationStructure) SetInstanceCount(instanceCount uint)

func (*MPSInstanceAccelerationStructure) SetMaskBuffer

func (o *MPSInstanceAccelerationStructure) SetMaskBuffer(maskBuffer metal.MTLBuffer)

func (*MPSInstanceAccelerationStructure) SetMaskBufferOffset

func (o *MPSInstanceAccelerationStructure) SetMaskBufferOffset(maskBufferOffset uint)

func (*MPSInstanceAccelerationStructure) SetTransformBuffer

func (o *MPSInstanceAccelerationStructure) SetTransformBuffer(transformBuffer metal.MTLBuffer)

func (*MPSInstanceAccelerationStructure) SetTransformBufferOffset

func (o *MPSInstanceAccelerationStructure) SetTransformBufferOffset(transformBufferOffset uint)

func (*MPSInstanceAccelerationStructure) SetTransformType

func (o *MPSInstanceAccelerationStructure) SetTransformType(transformType MPSTransformType)

func (*MPSInstanceAccelerationStructure) TransformBuffer

func (o *MPSInstanceAccelerationStructure) TransformBuffer() metal.MTLBuffer

@brief Buffer containing one column major matrix_float4x4 transformation matrix per instance

func (*MPSInstanceAccelerationStructure) TransformBufferOffset

func (o *MPSInstanceAccelerationStructure) TransformBufferOffset() uint

@brief Offset, in bytes, into the transform buffer. Defaults to 0 bytes. Must be aligned to the stride of the transform type.

func (*MPSInstanceAccelerationStructure) TransformType

@brief Instance transform type. Defaults to MPSTransformTypeFloat4x4. Changes to this property require rebuilding the acceleration structure.

type MPSIntersectionDataType

type MPSIntersectionDataType uint64

@brief Intersection data type options

const (
	// @brief Use the MPSIntersectionDistance struct type
	MPSIntersectionDataTypeDistance MPSIntersectionDataType = 0
	// @brief Use the MPSIntersectionDistancePrimitiveIndex struct type
	MPSIntersectionDataTypeDistancePrimitiveIndex MPSIntersectionDataType = 1
	// @brief Use the MPSIntersectionDistancePrimitiveIndexCoordinates struct type
	MPSIntersectionDataTypeDistancePrimitiveIndexCoordinates MPSIntersectionDataType = 2
	// @brief Use the DistancePrimitiveIndexInstanceIndex struct type
	MPSIntersectionDataTypeDistancePrimitiveIndexInstanceIndex MPSIntersectionDataType = 3
	// @brief Use the DistancePrimitiveIndexInstanceIndexCoordinates struct type
	MPSIntersectionDataTypeDistancePrimitiveIndexInstanceIndexCoordinates MPSIntersectionDataType = 4
	// @brief Use the MPSIntersectionDistancePrimitiveIndexBufferIndex struct type
	MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndex MPSIntersectionDataType = 5
	// @brief Use the MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates struct type
	MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndexCoordinates MPSIntersectionDataType = 6
	// @brief Use the DistancePrimitiveIndexBufferIndexInstanceIndex struct type
	MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndex MPSIntersectionDataType = 7
	// @brief Use the DistancePrimitiveIndexBufferIndexInstanceIndexCoordinates struct type
	MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates MPSIntersectionDataType = 8
)

func (MPSIntersectionDataType) String

func (e MPSIntersectionDataType) String() string

type MPSIntersectionDistance

type MPSIntersectionDistance struct {
	Distance float32
}

@brief Returned intersection result which contains the distance from the ray origin to the intersection point @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndex

type MPSIntersectionDistancePrimitiveIndex struct {
	Distance       float32
	PrimitiveIndex uint
}

@brief Intersection result which contains the distance from the ray origin to the intersection point and the index of the intersected primitive @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndexBufferIndex

type MPSIntersectionDistancePrimitiveIndexBufferIndex struct {
	Distance       float32
	PrimitiveIndex uint
	BufferIndex    uint
}

@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, and the polygon buffer index of the intersected primitive. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates

type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates struct {
	Distance       float32
	PrimitiveIndex uint
	BufferIndex    uint
	Coordinates    unsafe.Pointer
}

@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the polygon buffer index of the intersected primitive, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex

type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex struct {
	Distance       float32
	PrimitiveIndex uint
	BufferIndex    uint
	InstanceIndex  uint
}

@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the polygon buffer index of the intersected primitive, and the index of the intersected instance. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates

type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates struct {
	Distance       float32
	PrimitiveIndex uint
	BufferIndex    uint
	InstanceIndex  uint
	Coordinates    unsafe.Pointer
}

@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the polygon buffer index of the intersected primitive, the index of the intersected instance, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndexCoordinates

type MPSIntersectionDistancePrimitiveIndexCoordinates struct {
	Distance       float32
	PrimitiveIndex uint
	Coordinates    unsafe.Pointer
}

@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndexInstanceIndex

type MPSIntersectionDistancePrimitiveIndexInstanceIndex struct {
	Distance       float32
	PrimitiveIndex uint
	InstanceIndex  uint
}

@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, and the index of the intersected instance. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates

type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates struct {
	Distance       float32
	PrimitiveIndex uint
	InstanceIndex  uint
	Coordinates    unsafe.Pointer
}

@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the index of the intersected instance, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSIntersectionType

type MPSIntersectionType uint64

@brief Options for the MPSRayIntersector intersection type property

const (
	// @brief Find the closest intersection to the ray's origin along the ray direction. This is potentially slower than MPSIntersectionTypeAny but is well suited to primary visibility rays.
	MPSIntersectionTypeNearest MPSIntersectionType = 0
	// @brief Find any intersection along the ray direction. This is potentially faster than MPSIntersectionTypeNearest and is well suited to shadow and occlusion rays.
	MPSIntersectionTypeAny MPSIntersectionType = 1
)

func (MPSIntersectionType) String

func (e MPSIntersectionType) String() string

type MPSPackedFloat3

type MPSPackedFloat3 struct {
	Field0 unsafe.Pointer
}

C struct: _MPSPackedFloat3

type MPSPolygonAccelerationStructure

type MPSPolygonAccelerationStructure struct {
	MPSAccelerationStructure
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpspolygonaccelerationstructure

func MPSPolygonAccelerationStructureFromID

func MPSPolygonAccelerationStructureFromID(id objc.ID) *MPSPolygonAccelerationStructure

func (*MPSPolygonAccelerationStructure) IndexBuffer

@brief Index buffer containing index data. Each index references a vertex in the vertex buffer. May be nil. This is an alias for polygonBuffers[0].indexBuffer. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.

func (*MPSPolygonAccelerationStructure) IndexBufferOffset

func (o *MPSPolygonAccelerationStructure) IndexBufferOffset() uint

@brief Offset, in bytes, into the index buffer. Defaults to 0 bytes. Must be aligned to a multiple of the index type. Changes to this property require rebuilding the acceleration structure. This is an alias for polygonBuffers[0].indexBufferOffset. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.

func (*MPSPolygonAccelerationStructure) IndexType

@brief Index type. Defaults to MPSDataTypeUInt32. Only MPSDataTypeUInt16 and MPSDataTypeUInt32 are supported.

func (*MPSPolygonAccelerationStructure) MaskBuffer

@brief Mask buffer containing one uint32_t mask per polygon. May be nil. Otherwise, the mask type must be specified on the MPSRayIntersector with which it is used. This is an alias for polygonBuffers[0].maskBuffer. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.

func (*MPSPolygonAccelerationStructure) MaskBufferOffset

func (o *MPSPolygonAccelerationStructure) MaskBufferOffset() uint

@brief Offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes. This is an alias for polygonBuffers[0].maskBufferOffset. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.

func (*MPSPolygonAccelerationStructure) PolygonBuffers

@brief Array of polygon buffers. Each buffer contains a vertex buffer and optional index and mask buffer for an array of polygons. Changing the length of this array requires rebuilding the acceleration structure. Using more than one MPSPolygonBuffer will reduce performance. It is better to concatenate these buffers into a single vertex buffer, index buffer, and mask buffer and use a single MPSPolygonBuffer if possible. This also applies when using an MPSInstanceAccelerationStructure: each instance or subclass of MPSPolygonAccelerationStructure in an instance hierarchy should use the same vertex buffer, index buffer, and mask buffer, although each acceleration structure may use different offsets into these buffers. This allows for the vertex, index, and mask buffers to be bound directly instead of indirectly through an argument buffer. There must be at least one MPSPolygonBuffer. On argument buffer tier 1 devices, there must be be exactly one MPSPolygonBuffer. Use the argumentBuffersSupport property of the MTLDevice to check for support.

func (*MPSPolygonAccelerationStructure) PolygonCount

func (o *MPSPolygonAccelerationStructure) PolygonCount() uint

@brief Number of polygons. Changes to this property require rebuilding the acceleration structure. This is an alias for polygonBuffers[0].polygonCount. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.

func (*MPSPolygonAccelerationStructure) PolygonType

@brief The type of polygon. Defaults to MPSPolygonTypeTriangle. Changes to this property require rebuilding the acceleration structure.

func (*MPSPolygonAccelerationStructure) SetIndexBuffer

func (o *MPSPolygonAccelerationStructure) SetIndexBuffer(indexBuffer metal.MTLBuffer)

func (*MPSPolygonAccelerationStructure) SetIndexBufferOffset

func (o *MPSPolygonAccelerationStructure) SetIndexBufferOffset(indexBufferOffset uint)

func (*MPSPolygonAccelerationStructure) SetIndexType

func (o *MPSPolygonAccelerationStructure) SetIndexType(indexType mpscore.MPSDataType)

func (*MPSPolygonAccelerationStructure) SetMaskBuffer

func (o *MPSPolygonAccelerationStructure) SetMaskBuffer(maskBuffer metal.MTLBuffer)

func (*MPSPolygonAccelerationStructure) SetMaskBufferOffset

func (o *MPSPolygonAccelerationStructure) SetMaskBufferOffset(maskBufferOffset uint)

func (*MPSPolygonAccelerationStructure) SetPolygonBuffers

func (o *MPSPolygonAccelerationStructure) SetPolygonBuffers(polygonBuffers *foundation.NSArray[*MPSPolygonBuffer])

func (*MPSPolygonAccelerationStructure) SetPolygonCount

func (o *MPSPolygonAccelerationStructure) SetPolygonCount(polygonCount uint)

func (*MPSPolygonAccelerationStructure) SetPolygonType

func (o *MPSPolygonAccelerationStructure) SetPolygonType(polygonType MPSPolygonType)

func (*MPSPolygonAccelerationStructure) SetVertexBuffer

func (o *MPSPolygonAccelerationStructure) SetVertexBuffer(vertexBuffer metal.MTLBuffer)

func (*MPSPolygonAccelerationStructure) SetVertexBufferOffset

func (o *MPSPolygonAccelerationStructure) SetVertexBufferOffset(vertexBufferOffset uint)

func (*MPSPolygonAccelerationStructure) SetVertexStride

func (o *MPSPolygonAccelerationStructure) SetVertexStride(vertexStride uint)

func (*MPSPolygonAccelerationStructure) VertexBuffer

@brief Vertex buffer containing vertex data encoded as three 32 bit floats per vertex. Note that by default each vertex is aligned to the alignment of the vector_float3 type: 16 bytes. This can be changed using the vertexStride property. A vertex buffer must be provided before the acceleration structure is built. When using triangle polygons, degenerate (zero or negative area) triangles are ignored during acceleration structure construction. This can be used to pad triangle indices if needed. Quadrilateral polygons are internally treated as two triangles. If the quadrilateral has vertices v0, v1, v2, and v3, the two triangles will have vertices v0, v1, v2 and v0, v2, v3. A quadrilateral may be used to represent a triangle by repeating the last vertex. If the first triangle is degenerate (zero or negative area), the entire quadrilateral will be ignored. This can be used to pad quadrilateral indices if needed. All four vertices of a quadrilateral must be coplanar and the quadrilateral must be convex. This is an alias for polygonBuffers[0].vertexBuffer. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.

func (*MPSPolygonAccelerationStructure) VertexBufferOffset

func (o *MPSPolygonAccelerationStructure) VertexBufferOffset() uint

@brief Offset, in bytes, into the vertex buffer. Defaults to 0 bytes. Must be aligned to 4 bytes. This is an alias for polygonBuffers[0].vertexBufferOffset. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.

func (*MPSPolygonAccelerationStructure) VertexStride

func (o *MPSPolygonAccelerationStructure) VertexStride() uint

@brief Offset, in bytes, between consecutive vertices in the vertex buffer. Defaults to 0 bytes, indicating that the vertices are packed according to the natural alignment of the vector_float3 type: 16 bytes. @discussion This can be used to skip past any additional per-vertex data which may be stored alongside the position such as the vertex normal and texture coordinates. Must be a multiple of 4 bytes, and must be at least 12 bytes. Changes to this property require rebuilding the acceleration structure.

type MPSPolygonBuffer

type MPSPolygonBuffer struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpspolygonbuffer

func MPSPolygonBufferFromID

func MPSPolygonBufferFromID(id objc.ID) *MPSPolygonBuffer

func MPSPolygonBufferPolygonBuffer

func MPSPolygonBufferPolygonBuffer() *MPSPolygonBuffer

func (*MPSPolygonBuffer) IndexBuffer

func (o *MPSPolygonBuffer) IndexBuffer() metal.MTLBuffer

@brief Index buffer containing index data. Each index references a vertex in the vertex buffer. May be nil.

func (*MPSPolygonBuffer) IndexBufferOffset

func (o *MPSPolygonBuffer) IndexBufferOffset() uint

@brief Offset, in bytes, into the index buffer. Defaults to 0 bytes. Must be aligned to a multiple of the index type. Changes to this property require rebuilding the acceleration structure.

func (*MPSPolygonBuffer) Init

@brief Initialize the polygon buffer

func (*MPSPolygonBuffer) InitWithCoder

func (o *MPSPolygonBuffer) InitWithCoder(aDecoder *foundation.NSCoder) *MPSPolygonBuffer

@brief Initialize the polygon buffer with an NSCoder. Buffer properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with the polygon buffer instead.

func (*MPSPolygonBuffer) MaskBuffer

func (o *MPSPolygonBuffer) MaskBuffer() metal.MTLBuffer

@brief Mask buffer containing one uint32_t mask per polygon. May be nil. Otherwise, the mask type must be specified on the MPSRayIntersector with which it is used.

func (*MPSPolygonBuffer) MaskBufferOffset

func (o *MPSPolygonBuffer) MaskBufferOffset() uint

@brief Offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.

func (*MPSPolygonBuffer) PolygonCount

func (o *MPSPolygonBuffer) PolygonCount() uint

@brief Number of polygons. Changes to this property require rebuilding the acceleration structure.

func (*MPSPolygonBuffer) SetIndexBuffer

func (o *MPSPolygonBuffer) SetIndexBuffer(indexBuffer metal.MTLBuffer)

func (*MPSPolygonBuffer) SetIndexBufferOffset

func (o *MPSPolygonBuffer) SetIndexBufferOffset(indexBufferOffset uint)

func (*MPSPolygonBuffer) SetMaskBuffer

func (o *MPSPolygonBuffer) SetMaskBuffer(maskBuffer metal.MTLBuffer)

func (*MPSPolygonBuffer) SetMaskBufferOffset

func (o *MPSPolygonBuffer) SetMaskBufferOffset(maskBufferOffset uint)

func (*MPSPolygonBuffer) SetPolygonCount

func (o *MPSPolygonBuffer) SetPolygonCount(polygonCount uint)

func (*MPSPolygonBuffer) SetVertexBuffer

func (o *MPSPolygonBuffer) SetVertexBuffer(vertexBuffer metal.MTLBuffer)

func (*MPSPolygonBuffer) SetVertexBufferOffset

func (o *MPSPolygonBuffer) SetVertexBufferOffset(vertexBufferOffset uint)

func (*MPSPolygonBuffer) VertexBuffer

func (o *MPSPolygonBuffer) VertexBuffer() metal.MTLBuffer

@brief Vertex buffer containing vertex data encoded as three 32 bit floats per vertex. Note that by default each vertex is aligned to the alignment of the vector_float3 type: 16 bytes. This can be changed using the vertexStride property. A vertex buffer must be provided before the acceleration structure is built. When using triangle polygons, degenerate (zero or negative area) triangles are ignored during acceleration structure construction. This can be used to pad triangle indices if needed. Quadrilateral polygons are internally treated as two triangles. If the quadrilateral has vertices v0, v1, v2, and v3, the two triangles will have vertices v0, v1, v2 and v0, v2, v3. A quadrilateral may be used to represent a triangle by repeating the last vertex. If the first triangle is degenerate (zero or negative area), the entire quadrilateral will be ignored. This can be used to pad quadrilateral indices if needed. All four vertices of a quadrilateral must be coplanar and the quadrilateral must be convex.

func (*MPSPolygonBuffer) VertexBufferOffset

func (o *MPSPolygonBuffer) VertexBufferOffset() uint

@brief Offset, in bytes, into the vertex buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.

type MPSPolygonType

type MPSPolygonType uint64
const (
	// @brief Triangles with three vertices
	MPSPolygonTypeTriangle MPSPolygonType = 0
	// @brief Quadrilaterals with four vertices
	MPSPolygonTypeQuadrilateral MPSPolygonType = 1
)

func (MPSPolygonType) String

func (e MPSPolygonType) String() string

type MPSQuadrilateralAccelerationStructure

type MPSQuadrilateralAccelerationStructure struct {
	MPSPolygonAccelerationStructure
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsquadrilateralaccelerationstructure

func MPSQuadrilateralAccelerationStructureFromID

func MPSQuadrilateralAccelerationStructureFromID(id objc.ID) *MPSQuadrilateralAccelerationStructure

func (*MPSQuadrilateralAccelerationStructure) QuadrilateralCount

func (o *MPSQuadrilateralAccelerationStructure) QuadrilateralCount() uint

@brief Number of quads. Changes to this property require rebuilding the acceleration structure. This is an alias for the polygonCount property.

func (*MPSQuadrilateralAccelerationStructure) SetQuadrilateralCount

func (o *MPSQuadrilateralAccelerationStructure) SetQuadrilateralCount(quadrilateralCount uint)

type MPSRayDataType

type MPSRayDataType uint64

@brief Options for the MPSRayIntersector ray data type property

const (
	// @brief Use the MPSRayOriginDirection struct type
	MPSRayDataTypeOriginDirection MPSRayDataType = 0
	// @brief Use the MPSRayOriginMinDistanceDirectionMaxDistance struct type
	MPSRayDataTypeOriginMinDistanceDirectionMaxDistance MPSRayDataType = 1
	// @brief Use the MPSRayOriginMaxDistanceDirectionMask struct type
	MPSRayDataTypeOriginMaskDirectionMaxDistance MPSRayDataType = 2
	// @brief Use the MPSPackedRayOriginDirection struct type
	MPSRayDataTypePackedOriginDirection MPSRayDataType = 3
)

func (MPSRayDataType) String

func (e MPSRayDataType) String() string

type MPSRayIntersector

type MPSRayIntersector struct {
	mpscore.MPSKernel
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsrayintersector

func MPSRayIntersectorFromID

func MPSRayIntersectorFromID(id objc.ID) *MPSRayIntersector

func (*MPSRayIntersector) BoundingBoxIntersectionTestType

func (o *MPSRayIntersector) BoundingBoxIntersectionTestType() MPSBoundingBoxIntersectionTestType

@brief Ray/bounding box intersection test type. Defaults to MPSBoundingBoxIntersectionTestTypeDefault.

func (*MPSRayIntersector) CullMode

func (o *MPSRayIntersector) CullMode() metal.MTLCullMode

@brief Whether to ignore intersections between rays and back-facing or front-facing triangles or quadrilaterals. Defaults to MTLCullModeNone. @discussion A triangle or quadrilateral is back-facing if its normal points in the same direction as a ray and front-facing if its normal points in the opposite direction as a ray. If the cull mode is set to MTLCullModeBack, then back-facing triangles and quadrilaterals will be ignored. If the cull mode is set to MTLCullModeFront, then front-facing triangles and quadrilaterals will be ignored. Otherwise, if the cull mode is set to MTLCullModeNone, no triangles or quadrilaterals will be ignored. The front and back faces can be swapped using the frontFacingWinding property. Backface culling is necessary for some scenes but can reduce raytracing performance.

func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountAccelerationStructure

func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayCount uint, accelerationStructure *MPSAccelerationStructure)

@brief Schedule intersection tests between rays and an acceleration structure @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayCount Number of rays @param accelerationStructure Acceleration structure to test against

func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountBufferRayCountBufferOffsetAccelerationStructure

func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountBufferRayCountBufferOffsetAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayCountBuffer metal.MTLBuffer, rayCountBufferOffset uint, accelerationStructure *MPSAccelerationStructure)

@brief Schedule intersection tests between rays and an acceleration structure with a ray count provided in a buffer @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayCountBuffer Buffer containing number of rays as a 32 bit unsigned integer @param rayCountBufferOffset Offset, in bytes, into the ray count buffer. Must be a multiple of 4 bytes. @param accelerationStructure Acceleration structure to test against

func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountAccelerationStructure

func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, rayIndexBuffer metal.MTLBuffer, rayIndexBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayIndexCount uint, accelerationStructure *MPSAccelerationStructure)

@brief Schedule intersection tests between rays and an acceleration structure @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param rayIndexBuffer Buffer containing ray indices. Each index references a ray in the ray buffer. The ray index data type is controlled by the rayIndexDataType property. @param rayIndexBufferOffset Offset, in bytes, into the ray index buffer. Must be a multiple of the stride of the ray index type. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayIndexCount Number of ray indices @param accelerationStructure Acceleration structure to test against

func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountBufferRayIndexCountBufferOffsetAccelerationStructure

func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountBufferRayIndexCountBufferOffsetAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, rayIndexBuffer metal.MTLBuffer, rayIndexBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayIndexCountBuffer metal.MTLBuffer, rayIndexCountBufferOffset uint, accelerationStructure *MPSAccelerationStructure)

@brief Schedule intersection tests between rays and an acceleration structure with a ray count provided in a buffer @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param rayIndexBuffer Buffer containing ray indices. Each index references a ray in the ray buffer. The ray index data type is controlled by the rayIndexDataType property. @param rayIndexBufferOffset Offset, in bytes, into the ray index buffer. Must be a multiple of the stride of the ray index type. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayIndexCountBuffer Buffer containing number of rays as a 32 bit unsigned integer @param rayIndexCountBufferOffset Offset, in bytes, into the ray count buffer. Must be a multiple of 4 bytes. @param accelerationStructure Acceleration structure to test against

func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayTextureIntersectionTextureAccelerationStructure

func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayTextureIntersectionTextureAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayTexture metal.MTLTexture, intersectionTexture metal.MTLTexture, accelerationStructure *MPSAccelerationStructure)

@brief Schedule intersection tests between rays and an acceleration structure, where rays and loaded from a texture and intersections are stored into a texture. This is convenient for hybrid rendering applications which produce ray data from a fragment shader. The ray and intersection texture must be 2D array textures. Ray data must be packed into consecutive channels and slices of the ray texture. Intersection data will be packed the same way. The ray and intersection data types are defined by the rayDataType and intersectionDataType properties. The rayStride and intersectionStride properties are ignored. Channels and slices beyond the required number are ignored when reading from the ray texture. Channels and slices beyond the required number are undefined when writing to the intersection texture. For example, if the ray data type is MPSRayDataTypeOriginMaskDirectionMaxDistance, the ray texture must have pixel format MTLPixelFormatRGBA32Float and at least two array slices, packed as follows: @code tex.write(float4(ray.position, as_type<float>(ray.mask)), pixel, 0); // slice 0 tex.write(float4(ray.direction, ray.maxDistance), pixel, 1); // slice 1 @end If the intersection data type is MPSIntersectionDataTypeDistance, the intersection texture may have pixel format MTLPixelFormatR32Float with just a single channel and one array slice, and should be unpacked as follows: @code float distance = tex.read(pixel, 0).x; @end On the other hand, if the intersection data type is MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates, the intersection texture must have pixel format MTLPixelFormatRGBA32Float and at least two slices: @code float3 f0 = tex.read(pixel, 0); float distance = f0.x; unsigned int primitiveIndex = as_type<unsigned int>(f0.y); unsigned int instanceIndex = as_type<unsigned int>(f0.z); // w component is padding for this intersection data type float2 coordinates = tex.read(pixel, 1).xy; @end @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayTexture A 2D array texture containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType property. @param intersectionTexture Texture to store intersection in. Intersections are stored in the same position as the ray texture, one intersection per ray. The intersection data type is defined by the intersectionDataType property. @param accelerationStructure Acceleration structure to test against

func (*MPSRayIntersector) EncodeWithCoder

func (o *MPSRayIntersector) EncodeWithCoder(coder *foundation.NSCoder)

func (*MPSRayIntersector) FrontFacingWinding

func (o *MPSRayIntersector) FrontFacingWinding() metal.MTLWinding

@brief Winding order used to determine which direction a triangle or quadrilateral's normal points when back face or front face culling is enabled. Defaults to MTLWindingClockwise. @discussion If the front face winding is set to MTLWindingClockwise, the triangle or quadrilateral normal is considered to point towards the direction where the vertices are in clockwise order when viewed from that direction. Otherwise, if the front facing winding is set to MTLWindingCounterClockwise, the triangle or quadrilateral normal is considered to point in the opposite direction.

func (*MPSRayIntersector) InitWithCoderDevice

func (o *MPSRayIntersector) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSRayIntersector

@brief Initialize the raytracer with an NSCoder and a Metal device

func (*MPSRayIntersector) InitWithDevice

func (o *MPSRayIntersector) InitWithDevice(device metal.MTLDevice) *MPSRayIntersector

@brief Initialize the raytracer with a Metal device

func (*MPSRayIntersector) IntersectionDataType

func (o *MPSRayIntersector) IntersectionDataType() MPSIntersectionDataType

@brief Intersection data type. Defaults to MPSIntersectionDataTypeDistancePrimitiveIndexCoordinates.

func (*MPSRayIntersector) IntersectionStride

func (o *MPSRayIntersector) IntersectionStride() uint

@brief Offset, in bytes, between consecutive intersections in the intersection buffer. Defaults to 0, indicating that the intersections are packed according to their natural aligned size. @discussion This can be used to skip past any additional per-intersection that which may be stored alongside the MPSRayIntersection struct such as the surface normal at the point of intersection. Must be aligned to the alignment of the intersection data type.

func (*MPSRayIntersector) RayDataType

func (o *MPSRayIntersector) RayDataType() MPSRayDataType

@brief Ray data type. Defaults to MPSRayDataTypeOriginDirection.

func (*MPSRayIntersector) RayIndexDataType

func (o *MPSRayIntersector) RayIndexDataType() mpscore.MPSDataType

@brief Ray index data type. Defaults to MPSDataTypeUInt32. Only MPSDataTypeUInt16 and MPSDataTypeUInt32 are supported.

func (*MPSRayIntersector) RayMask

func (o *MPSRayIntersector) RayMask() uint

@brief Global ray mask. Defaults to 0xFFFFFFFF. This value will be logically AND-ed with the per-ray mask if the ray data type contains a mask.

func (*MPSRayIntersector) RayMaskOperator

func (o *MPSRayIntersector) RayMaskOperator() MPSRayMaskOperator

@brief The operator to apply to determine whether to accept an intersection between a ray and a primitive or instance. Defaults to MPSRayMaskOperatorAnd.

func (*MPSRayIntersector) RayMaskOptions

func (o *MPSRayIntersector) RayMaskOptions() MPSRayMaskOptions

@brief Whether to enable primitive and instance masks. Defaults to MPSRayMaskOptionNone. @discussion If MPSRayMaskOptionPrimitive or MPSRayMaskOptionInstance is enabled, each ray and primitive and/or instance is associated with a 32 bit unsigned integer mask. Before checking for intersection between a ray and a primitive or instance, the corresponding masks are compared using the ray mask operator defined by the rayMaskOperator property. If the result is zero, the intersection is skipped. This can be used to make certain primitives or instances invisible to certain rays. For example, objects can be grouped into layers and their visibility can be toggled by modifying the ray masks rather than removing the objects from the scene and rebuilding the acceleration structure. Alternatively, certain objects can be prevented from casting shadows by making them invisible to shadow rays. Enabling this option may reduce raytracing performance.

func (*MPSRayIntersector) RayStride

func (o *MPSRayIntersector) RayStride() uint

@brief Offset, in bytes, between consecutive rays in the ray buffer. Defaults to 0, indicating that the rays are packed according to their natural aligned size. @discussion This can be used to skip past any additional per-ray data that may be stored alongside the MPSRay struct such as the current radiance along the ray or the source pixel coordinates. Must be aligned to the alignment of the ray data type.

func (*MPSRayIntersector) RecommendedMinimumRayBatchSizeForRayCount

func (o *MPSRayIntersector) RecommendedMinimumRayBatchSizeForRayCount(rayCount uint) uint

@brief Get the recommended minimum number of rays to submit for intersection in one batch @discussion In order to keep the system responsive, and to limit the amount of memory allocated to ray and intersection buffers, it may be desirable to divide the rays to be intersected against an acceleration structure into smaller batches. However, submitting too few rays in a batch reduces GPU utilization and performance. This method provides a recommended minimum number of rays to submit in any given batch. For example, for a 1920x1080 image, this method may recommend that the image be divided into 512x512 tiles. The actual recommendation varies per device and total ray count. @param rayCount The total number of rays to be submitted @return The recommended minimum ray batch size

func (*MPSRayIntersector) SetBoundingBoxIntersectionTestType

func (o *MPSRayIntersector) SetBoundingBoxIntersectionTestType(boundingBoxIntersectionTestType MPSBoundingBoxIntersectionTestType)

func (*MPSRayIntersector) SetCullMode

func (o *MPSRayIntersector) SetCullMode(cullMode metal.MTLCullMode)

func (*MPSRayIntersector) SetFrontFacingWinding

func (o *MPSRayIntersector) SetFrontFacingWinding(frontFacingWinding metal.MTLWinding)

func (*MPSRayIntersector) SetIntersectionDataType

func (o *MPSRayIntersector) SetIntersectionDataType(intersectionDataType MPSIntersectionDataType)

func (*MPSRayIntersector) SetIntersectionStride

func (o *MPSRayIntersector) SetIntersectionStride(intersectionStride uint)

func (*MPSRayIntersector) SetRayDataType

func (o *MPSRayIntersector) SetRayDataType(rayDataType MPSRayDataType)

func (*MPSRayIntersector) SetRayIndexDataType

func (o *MPSRayIntersector) SetRayIndexDataType(rayIndexDataType mpscore.MPSDataType)

func (*MPSRayIntersector) SetRayMask

func (o *MPSRayIntersector) SetRayMask(rayMask uint)

func (*MPSRayIntersector) SetRayMaskOperator

func (o *MPSRayIntersector) SetRayMaskOperator(rayMaskOperator MPSRayMaskOperator)

func (*MPSRayIntersector) SetRayMaskOptions

func (o *MPSRayIntersector) SetRayMaskOptions(rayMaskOptions MPSRayMaskOptions)

func (*MPSRayIntersector) SetRayStride

func (o *MPSRayIntersector) SetRayStride(rayStride uint)

func (*MPSRayIntersector) SetTriangleIntersectionTestType

func (o *MPSRayIntersector) SetTriangleIntersectionTestType(triangleIntersectionTestType MPSTriangleIntersectionTestType)

func (*MPSRayIntersector) TriangleIntersectionTestType

func (o *MPSRayIntersector) TriangleIntersectionTestType() MPSTriangleIntersectionTestType

@brief Ray/triangle intersection test type. Defaults to MPSTriangleIntersectionTestTypeDefault. Quads are broken into two triangles for intersection testing, so this property also applies to quadrilateral intersections.

type MPSRayMaskOperator

type MPSRayMaskOperator uint64

@brief Options for the MPSRayIntersector ray mask operator property

const (
	// @brief Accept the intersection if (primitive mask & ray mask) != 0.
	MPSRayMaskOperatorAnd MPSRayMaskOperator = 0
	// @brief Accept the intersection if ~(primitive mask & ray mask) != 0.
	MPSRayMaskOperatorNotAnd MPSRayMaskOperator = 1
	// @brief Accept the intersection if (primitive mask | ray mask) != 0.
	MPSRayMaskOperatorOr MPSRayMaskOperator = 2
	// @brief Accept the intersection if ~(primitive mask | ray mask) != 0.
	MPSRayMaskOperatorNotOr MPSRayMaskOperator = 3
	// @brief Accept the intersection if (primitive mask ^ ray mask) != 0.
	MPSRayMaskOperatorXor MPSRayMaskOperator = 4
	// @brief Accept the intersection if ~(primitive mask ^ ray mask) != 0.
	MPSRayMaskOperatorNotXor MPSRayMaskOperator = 5
	// @brief Accept the intersection if primitive mask < ray mask.
	MPSRayMaskOperatorLessThan MPSRayMaskOperator = 6
	// @brief Accept the intersection if primitive mask <= ray mask.
	MPSRayMaskOperatorLessThanOrEqualTo MPSRayMaskOperator = 7
	// @brief Accept the intersection if primitive mask > ray mask.
	MPSRayMaskOperatorGreaterThan MPSRayMaskOperator = 8
	// @brief Accept the intersection if primitive mask >= ray mask.
	MPSRayMaskOperatorGreaterThanOrEqualTo MPSRayMaskOperator = 9
	// @brief Accept the intersection if primitive mask == ray mask.
	MPSRayMaskOperatorEqual MPSRayMaskOperator = 10
	// @brief Accept the intersection if primitive mask != ray mask.
	MPSRayMaskOperatorNotEqual MPSRayMaskOperator = 11
)

func (MPSRayMaskOperator) String

func (e MPSRayMaskOperator) String() string

type MPSRayMaskOptions

type MPSRayMaskOptions uint64

@brief Options for the MPSRayIntersector ray mask options property

const (
	// @brief Disable primitive and instance masks
	MPSRayMaskOptionNone MPSRayMaskOptions = 0
	// @brief Enable primitive masks
	MPSRayMaskOptionPrimitive MPSRayMaskOptions = 1
	// @brief Enable instance masks
	MPSRayMaskOptionInstance MPSRayMaskOptions = 2
)

func (MPSRayMaskOptions) String

func (e MPSRayMaskOptions) String() string

type MPSRayOriginDirection

type MPSRayOriginDirection struct {
	Origin    unsafe.Pointer
	Direction unsafe.Pointer
}

@brief Represents a 3D ray with an origin and a direction @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSRayOriginMaskDirectionMaxDistance

type MPSRayOriginMaskDirectionMaxDistance struct {
	Origin      MPSPackedFloat3
	Mask        uint
	Direction   MPSPackedFloat3
	MaxDistance float32
}

@brief Represents a 3D ray with an origin, a direction, and a mask to filter out intersections @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSRayOriginMinDistanceDirectionMaxDistance

type MPSRayOriginMinDistanceDirectionMaxDistance struct {
	Origin      MPSPackedFloat3
	MinDistance float32
	Direction   MPSPackedFloat3
	MaxDistance float32
}

@brief Represents a 3D ray with an origin, a direction, and an intersection distance range from the origin @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSRayPackedOriginDirection

type MPSRayPackedOriginDirection struct {
	Origin    MPSPackedFloat3
	Direction MPSPackedFloat3
}

@brief Represents a 3D ray with an origin and a direction @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.

type MPSSVGF

type MPSSVGF struct {
	mpscore.MPSKernel
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpssvgf

func MPSSVGFFromID

func MPSSVGFFromID(id objc.ID) *MPSSVGF

func (*MPSSVGF) BilateralFilterRadius

func (o *MPSSVGF) BilateralFilterRadius() uint

@brief The radius of the bilateral filter. Defaults to 2 resulting in a 5x5 filter.

func (*MPSSVGF) BilateralFilterSigma

func (o *MPSSVGF) BilateralFilterSigma() float32

@brief The sigma value of the Gaussian function used by the bilateral filter. Must be greater than zero. Defaults to 1.2.

func (*MPSSVGF) ChannelCount

func (o *MPSSVGF) ChannelCount() uint

@brief The number of channels to filter in the source image. Must be at least one and at most three. Defaults to 3.

func (*MPSSVGF) ChannelCount2

func (o *MPSSVGF) ChannelCount2() uint

@brief The number of channels to filter in the second source image. Must be at least one and at most three. Defaults to 3.

func (*MPSSVGF) DepthWeight

func (o *MPSSVGF) DepthWeight() float32

@brief Controls how samples' depths are compared during reprojection, variance estimation, and bilateral filtering. The final weight is given by exp(-abs(Z1 - Z2) / depthWeight). Must be greater than zero. Defaults to 1.0.

func (*MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureDepthNormalTexture

func (o *MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, stepDistance uint, sourceTexture metal.MTLTexture, destinationTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture)

@brief Encode bilateral filter into a command buffer @discussion Performs an edge avoiding blur with radius given by the bilateraFilterRadius property with sampling weighted by a Gaussian filter with sigma given by the bilteralFilterSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the blur. These values are weighted by the depthWeight, normalWeight, and luminanceWeight properties. Before the variance values are used for luminance weighting, the variance is prefiltered with a small Gaussian blur with radius given by the variancePrefilterRadius property and sigma given by the variancePrefilterSigma property. This kernel should be run multiple times with a step distance of pow(2, i), starting with i = 0. It is recommended that the output of the first iteration be used as the image to be reprojected in the next frame. Then several more iterations should be run to compute the denoised image for the current frame. 5 total iterations is reasonable. The bilateral filter can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same normal and depth values. The number of channels to filter in the source image(s) are given by the channelCount and channelCount2 properties. Furthermore, the luminance variance is packed into the final channel of the source image(s) to reduce the number of texture sample instructions required. The filtered color and variance values are packed the same way in the destination image(s). Therefore, the source and destination images must have at least channelCount + 1 and channelCount2 + 1 channels. Channels beyond the required number are ignored when reading from source images and set to zero when writing to destination images. The source image should be produced by either the variance estimation kernel or a previous iteration of the bilateral filter. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. @param commandBuffer Command buffer to encode into @param stepDistance Number of pixels to skip between samples @param sourceTexture Source packed color and variance texture @param destinationTexture Destination packed color and variance texture @param depthNormalTexture The depth and normal values for the current frame

func (*MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureSourceTexture2DestinationTexture2DepthNormalTexture

func (o *MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureSourceTexture2DestinationTexture2DepthNormalTexture(commandBuffer metal.MTLCommandBuffer, stepDistance uint, sourceTexture metal.MTLTexture, destinationTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, depthNormalTexture metal.MTLTexture)

@brief Encode bilateral filter into a command buffer @discussion Performs an edge avoiding blur with radius given by the bilateraFilterRadius property with sampling weighted by a Gaussian filter with sigma given by the bilteralFilterSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the blur. These values are weighted by the depthWeight, normalWeight, and luminanceWeight properties. Before the variance values are used for luminance weighting, the variance is prefiltered with a small Gaussian blur with radius given by the variancePrefilterRadius property and sigma given by the variancePrefilterSigma property. This kernel should be run multiple times with a step distance of pow(2, i), starting with i = 0. It is recommended that the output of the first iteration be used as the image to be reprojected in the next frame. Then several more iterations should be run to compute the denoised image for the current frame. 5 total iterations is reasonable. The bilateral filter can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same normal and depth values. The number of channels to filter in the source image(s) are given by the channelCount and channelCount2 properties. Furthermore, the luminance variance is packed into the final channel of the source image(s) to reduce the number of texture sample instructions required. The filtered color and variance values are packed the same way in the destination image(s). Therefore, the source and destination images must have at least channelCount + 1 and channelCount2 + 1 channels. Channels beyond the required number are ignored when reading from source images and set to zero when writing to destination images. The source image should be produced by either the variance estimation kernel or a previous iteration of the bilateral filter. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. @param commandBuffer Command buffer to encode into @param stepDistance Number of pixels to skip between samples @param sourceTexture Source packed color and variance texture @param destinationTexture Destination packed color and variance texture @param sourceTexture2 Second source image @param destinationTexture2 Second destination image @param depthNormalTexture The depth and normal values for the current frame

func (*MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTexturePreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture

func (o *MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTexturePreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, previousTexture metal.MTLTexture, destinationTexture metal.MTLTexture, previousLuminanceMomentsTexture metal.MTLTexture, destinationLuminanceMomentsTexture metal.MTLTexture, previousFrameCountTexture metal.MTLTexture, destinationFrameCountTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture)

@brief Encode reprojection into a command buffer @discussion Normal and depth values from the previous frame will be compared with normal and depth values from the current frame to determine if they are similar enough to reproject into the current frame. These values are weighted by the depthWeight and normalWeight properties. If the combined weight exceeds the reprojectionThreshold property's value, the previous frame will be blended with the current frame according to the temporalWeighting and temporalReprojectionBlendFactor properties. The reprojection kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The number of channels in the source image(s), previous frame's image(s), and destination image(s) are given by the channelCount and channelCount2 properties. These images must have at least as many channels as given by these properties. Channels beyond the required number are ignored when reading from source images and set to zero when writing to the destination images, except the alpha channel which will be set to one if present. The previous frame's image will be ignored on the first frame. The source and destination luminance moments textures must be at least two-channel textures, which will be set to the accumulated first and second moments of luminance. Channels beyond the first two will be ignored when reading from the previous frame's texture and set to zero when writing to the destination texture. The previous frame's luminance moments will be ignored on the first frame. The frame count textures track the number of accumulated frames and must be at least R32Uint textures. The remaining channels will be ignored when reading from the source texture and set to zero when writing to the destination texture, if present. The previous frame count texture must be cleared to zero on the first frame or to reset the accumulated images to the current frame's image. The motion vector texture must be at least a two channel texture representing how many texels each texel in the source image(s) have moved since the previous frame. The remaining channels will be ignored if present. This texture may be nil, in which case the motion vector is assumed to be zero, which is suitable for static images. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. The depth and normal values are not required if the motion vector texture is nil. The destination texture, destination luminance moments texture, and destination frame count texture are used by subsequent stages of the denoising filter. The destination frame count texture is also used as the source frame count texture the reprojection kernel in the next frame. @param commandBuffer Command buffer to encode into @param sourceTexture Current frame to denoise @param previousTexture Previous denoised frame to reproject into current frame @param destinationTexture Output blended image @param previousLuminanceMomentsTexture Previous accumulated luminance moments image @param destinationLuminanceMomentsTexture Output accumulated luminance moments image @param previousFrameCountTexture The number of frames accumulated in the previous source image @param destinationFrameCountTexture The number of frames accumulated in the destination texture(s) including the current frame @param motionVectorTexture Motion vector texture @param depthNormalTexture The depth and normal values for the current frame @param previousDepthNormalTexture The depth and normal values for the previous frame

func (*MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTextureSourceTexture2PreviousTexture2DestinationTexture2PreviousLuminanceMomentsTexture2DestinationLuminanceMomentsTexture2PreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture

func (o *MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTextureSourceTexture2PreviousTexture2DestinationTexture2PreviousLuminanceMomentsTexture2DestinationLuminanceMomentsTexture2PreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, previousTexture metal.MTLTexture, destinationTexture metal.MTLTexture, previousLuminanceMomentsTexture metal.MTLTexture, destinationLuminanceMomentsTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, previousTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, previousLuminanceMomentsTexture2 metal.MTLTexture, destinationLuminanceMomentsTexture2 metal.MTLTexture, previousFrameCountTexture metal.MTLTexture, destinationFrameCountTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture)

@brief Encode reprojection into a command buffer @discussion Normal and depth values from the previous frame will be compared with normal and depth values from the current frame to determine if they are similar enough to reproject into the current frame. These values are weighted by the depthWeight and normalWeight properties. If the combined weight exceeds the reprojectionThreshold property's value, the previous frame will be blended with the current frame according to the temporalWeighting and temporalReprojectionBlendFactor properties. The reprojection kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The number of channels in the source image(s), previous frame's image(s), and destination image(s) are given by the channelCount and channelCount2 properties. These images must have at least as many channels as given by these properties. Channels beyond the required number are ignored when reading from source images and set to zero when writing to the destination images, except the alpha channel which will be set to one if present. The previous frame's image will be ignored on the first frame. The source and destination luminance moments textures must be at least two-channel textures, which will be set to the accumulated first and second moments of luminance. Channels beyond the first two will be ignored when reading from the previous frame's texture and set to zero when writing to the destination texture. The previous frame's luminance moments will be ignored on the first frame. The frame count textures track the number of accumulated frames and must be at least R32Uint textures. The remaining channels will be ignored when reading from the source texture and set to zero when writing to the destination texture, if present. The previous frame count texture must be cleared to zero on the first frame or to reset the accumulated images to the current frame's image. The motion vector texture must be at least a two channel texture representing how many texels each texel in the source image(s) have moved since the previous frame. The remaining channels will be ignored if present. This texture may be nil, in which case the motion vector is assumed to be zero, which is suitable for static images. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. The depth and normal values are not required if the motion vector texture is nil. The destination texture, destination luminance moments texture, and destination frame count texture are used by subsequent stages of the denoising filter. The destination frame count texture is also used as the source frame count texture the reprojection kernel in the next frame. @param commandBuffer Command buffer to encode into @param sourceTexture Current frame to denoise @param previousTexture Previous denoised frame to reproject into current frame @param destinationTexture Output blended image @param previousLuminanceMomentsTexture Previous accumulated luminance moments image @param destinationLuminanceMomentsTexture Output accumulated luminance moments image @param sourceTexture2 Second source image @param previousTexture2 Second previous image @param destinationTexture2 Second destination image @param previousLuminanceMomentsTexture2 Second previous luminance moments texture @param destinationLuminanceMomentsTexture2 Second destination luminance moments texture @param previousFrameCountTexture The number of frames accumulated in the previous source image @param destinationFrameCountTexture The number of frames accumulated in the destination texture(s) including the current frame @param motionVectorTexture Motion vector texture @param depthNormalTexture The depth and normal values for the current frame @param previousDepthNormalTexture The depth and normal values for the previous frame

func (*MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureFrameCountTextureDepthNormalTexture

func (o *MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureFrameCountTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, luminanceMomentsTexture metal.MTLTexture, destinationTexture metal.MTLTexture, frameCountTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture)

@brief Encode variance estimation into a command buffer @discussion Variance is computed from the accumulated first and second luminance moments. If the number of accumulated frames is below the minimumFramesForVarianceEstimation property, the luminance variance will be computed using a spatial estimate instead. The spatial estimate is computed using a bilateral filter with radius given by the varianceEstimationRadius property. Neighboring samples will be weighted according to a gaussian function with sigma given by the varianceEstimationSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the spatial blur. These values are weighted by the depthWeight and normalWeight properties. The variance kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The reprojected source texture, luminance moments texture and frame count texture are computed by the reprojection kernel. The computed variance will be stored in the last channel of the destination image, while the source image will be copied into the previous channels, to reduce the number of texture sample instructured required by the bilateral filter in the final stage of the denoising kernel. The number of channels in the source image(s) are given by the channelCount and channelCount2 properties. Therefore, the destination image(s) must have at least channelCount + 1 and channelCount2 + 1 channels and the source image(s) must have at least channelCount and channelCount2 channels. Channels beyond the required number are ignored when reading from source textures and set to zero when writing to destination textures. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. If the minimumFramesForVarianceEstimation property is less than or equal to one, variance will be estimated directly from the accumulated luminance moments so the depth/normal texture may be nil. @param commandBuffer Command buffer to encode into @param sourceTexture Current reprojected frame to denoise @param luminanceMomentsTexture Luminance moments texture @param destinationTexture Output packed color and variance image @param frameCountTexture Number of frames accumulated into the source image @param depthNormalTexture The depth and normal values for the current frame

func (*MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureSourceTexture2LuminanceMomentsTexture2DestinationTexture2FrameCountTextureDepthNormalTexture

func (o *MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureSourceTexture2LuminanceMomentsTexture2DestinationTexture2FrameCountTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, luminanceMomentsTexture metal.MTLTexture, destinationTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, luminanceMomentsTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, frameCountTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture)

@brief Encode variance estimation into a command buffer @discussion Variance is computed from the accumulated first and second luminance moments. If the number of accumulated frames is below the minimumFramesForVarianceEstimation property, the luminance variance will be computed using a spatial estimate instead. The spatial estimate is computed using a bilateral filter with radius given by the varianceEstimationRadius property. Neighboring samples will be weighted according to a gaussian function with sigma given by the varianceEstimationSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the spatial blur. These values are weighted by the depthWeight and normalWeight properties. The variance kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The reprojected source texture, luminance moments texture and frame count texture are computed by the reprojection kernel. The computed variance will be stored in the last channel of the destination image, while the source image will be copied into the previous channels, to reduce the number of texture sample instructured required by the bilateral filter in the final stage of the denoising kernel. The number of channels in the source image(s) are given by the channelCount and channelCount2 properties. Therefore, the destination image(s) must have at least channelCount + 1 and channelCount2 + 1 channels and the source image(s) must have at least channelCount and channelCount2 channels. Channels beyond the required number are ignored when reading from source textures and set to zero when writing to destination textures. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. If the minimumFramesForVarianceEstimation property is less than or equal to one, variance will be estimated directly from the accumulated luminance moments so the depth/normal texture may be nil. @param commandBuffer Command buffer to encode into @param sourceTexture Current reprojected frame to denoise @param luminanceMomentsTexture Luminance moments texture @param destinationTexture Output packed color and variance image @param sourceTexture2 Second source image @param luminanceMomentsTexture2 Second luminance moments image @param destinationTexture2 Second destination image @param frameCountTexture Number of frames accumulated into the source image @param depthNormalTexture The depth and normal values for the current frame

func (*MPSSVGF) EncodeWithCoder

func (o *MPSSVGF) EncodeWithCoder(coder *foundation.NSCoder)

func (*MPSSVGF) InitWithCoderDevice

func (o *MPSSVGF) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSSVGF

func (*MPSSVGF) InitWithDevice

func (o *MPSSVGF) InitWithDevice(device metal.MTLDevice) *MPSSVGF

func (*MPSSVGF) LuminanceWeight

func (o *MPSSVGF) LuminanceWeight() float32

@brief Controls how samples' luminance values are compared during bilateral filtering. The final weight is given by exp(-abs(L1 - L2) / (luminanceWeight * luminanceVariance + EPSILON)). Must be greater than or equal to zero. Defaults to 4.

func (*MPSSVGF) MinimumFramesForVarianceEstimation

func (o *MPSSVGF) MinimumFramesForVarianceEstimation() uint

@brief The minimum number of frames which must be accumulated before variance can be computed directly from the accumulated luminance moments. If enough frames have not been accumulated, variance will be estimated with a spatial filter instead. Defaults to 4.

func (*MPSSVGF) NormalWeight

func (o *MPSSVGF) NormalWeight() float32

@brief Controls how samples' normals are compared during reprojection, variance estimation, and bilateral filtering. The final weight is given by pow(max(dot(N1, N2)), normalWeight). Must be greater than or equal to zero. Defaults to 128.

func (*MPSSVGF) ReprojectionThreshold

func (o *MPSSVGF) ReprojectionThreshold() float32

@brief During reprojection, minimum combined depth and normal weight needed to consider a pixel from the previous frame consistent with a pixel from the current frame. Must be greater than or equal to zero. Defaults to 0.01.

func (*MPSSVGF) SetBilateralFilterRadius

func (o *MPSSVGF) SetBilateralFilterRadius(bilateralFilterRadius uint)

func (*MPSSVGF) SetBilateralFilterSigma

func (o *MPSSVGF) SetBilateralFilterSigma(bilateralFilterSigma float32)

func (*MPSSVGF) SetChannelCount

func (o *MPSSVGF) SetChannelCount(channelCount uint)

func (*MPSSVGF) SetChannelCount2

func (o *MPSSVGF) SetChannelCount2(channelCount2 uint)

func (*MPSSVGF) SetDepthWeight

func (o *MPSSVGF) SetDepthWeight(depthWeight float32)

func (*MPSSVGF) SetLuminanceWeight

func (o *MPSSVGF) SetLuminanceWeight(luminanceWeight float32)

func (*MPSSVGF) SetMinimumFramesForVarianceEstimation

func (o *MPSSVGF) SetMinimumFramesForVarianceEstimation(minimumFramesForVarianceEstimation uint)

func (*MPSSVGF) SetNormalWeight

func (o *MPSSVGF) SetNormalWeight(normalWeight float32)

func (*MPSSVGF) SetReprojectionThreshold

func (o *MPSSVGF) SetReprojectionThreshold(reprojectionThreshold float32)

func (*MPSSVGF) SetTemporalReprojectionBlendFactor

func (o *MPSSVGF) SetTemporalReprojectionBlendFactor(temporalReprojectionBlendFactor float32)

func (*MPSSVGF) SetTemporalWeighting

func (o *MPSSVGF) SetTemporalWeighting(temporalWeighting MPSTemporalWeighting)

func (*MPSSVGF) SetVarianceEstimationRadius

func (o *MPSSVGF) SetVarianceEstimationRadius(varianceEstimationRadius uint)

func (*MPSSVGF) SetVarianceEstimationSigma

func (o *MPSSVGF) SetVarianceEstimationSigma(varianceEstimationSigma float32)

func (*MPSSVGF) SetVariancePrefilterRadius

func (o *MPSSVGF) SetVariancePrefilterRadius(variancePrefilterRadius uint)

func (*MPSSVGF) SetVariancePrefilterSigma

func (o *MPSSVGF) SetVariancePrefilterSigma(variancePrefilterSigma float32)

func (*MPSSVGF) TemporalReprojectionBlendFactor

func (o *MPSSVGF) TemporalReprojectionBlendFactor() float32

@brief When using MPSTemporalWeightingExponentialMovingAverage, how much to blend the current frame with the previous frame during reprojection. The final value is given by current * temporalReprojectionBlendFactor + previous * (1 - temporalReprojectionBlendFactor). Must be between zero and one, inclusive. Defaults to 0.2.

func (*MPSSVGF) TemporalWeighting

func (o *MPSSVGF) TemporalWeighting() MPSTemporalWeighting

@brief How to weight samples during temporal reprojection. Defaults to MPSTemporalWeightingAverage.

func (*MPSSVGF) VarianceEstimationRadius

func (o *MPSSVGF) VarianceEstimationRadius() uint

@brief The radius of the spatial filter used when not enough frames have been accumulated to compute variance from accumulated luminance moments. Defaults to 3 resulting in a 7x7 filter.

func (*MPSSVGF) VarianceEstimationSigma

func (o *MPSSVGF) VarianceEstimationSigma() float32

@brief The sigma value of the Gaussian function used by the spatial filter used when not enough frames have been accumulated to compute variance from accumulated luminance moments. Must be greater than zero. Defaults to 2.0.

func (*MPSSVGF) VariancePrefilterRadius

func (o *MPSSVGF) VariancePrefilterRadius() uint

@brief The radius of the variance pre-filter of the bilateral filter. Defaults to 1 resulting in a 3x3 filter.

func (*MPSSVGF) VariancePrefilterSigma

func (o *MPSSVGF) VariancePrefilterSigma() float32

@brief The sigma value of the Gaussian function used by the variance pre-filter of the bilateral filter. Must be greater than zero. Defaults to 1.33.

type MPSSVGFDefaultTextureAllocator

type MPSSVGFDefaultTextureAllocator struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpssvgfdefaulttextureallocator

func MPSSVGFDefaultTextureAllocatorFromID

func MPSSVGFDefaultTextureAllocatorFromID(id objc.ID) *MPSSVGFDefaultTextureAllocator

func (*MPSSVGFDefaultTextureAllocator) AllocatedTextureCount

func (o *MPSSVGFDefaultTextureAllocator) AllocatedTextureCount() uint

@brief The number of textures which have been allocated from this allocator

func (*MPSSVGFDefaultTextureAllocator) Device

@brief Metal device this object was allocated from

func (*MPSSVGFDefaultTextureAllocator) InitWithDevice

@brief Initialize the MPSSVGFDefaultTextureAllocator with a Metal device

func (*MPSSVGFDefaultTextureAllocator) Reset

func (o *MPSSVGFDefaultTextureAllocator) Reset()

@brief Remove all textures from the cache

func (*MPSSVGFDefaultTextureAllocator) ReturnTexture

func (o *MPSSVGFDefaultTextureAllocator) ReturnTexture(texture metal.MTLTexture)

func (*MPSSVGFDefaultTextureAllocator) TextureWithPixelFormatWidthHeight

func (o *MPSSVGFDefaultTextureAllocator) TextureWithPixelFormatWidthHeight(pixelFormat metal.MTLPixelFormat, width uint, height uint) metal.MTLTexture

type MPSSVGFDenoiser

type MPSSVGFDenoiser struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpssvgfdenoiser

func MPSSVGFDenoiserFromID

func MPSSVGFDenoiserFromID(id objc.ID) *MPSSVGFDenoiser

func (*MPSSVGFDenoiser) BilateralFilterIterations

func (o *MPSSVGFDenoiser) BilateralFilterIterations() uint

@brief The number of bilateral filter iterations to run. More iterations will improve quality at the cost of performance. Defaults to 5. Must be at least 1.

func (*MPSSVGFDenoiser) ClearTemporalHistory

func (o *MPSSVGFDenoiser) ClearTemporalHistory()

@brief Clear the temporal history. Reprojection and temporal accumulation will restart on the next call to encodeToCommandBuffer:

func (*MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureDestinationTextureSourceTexture2DestinationTexture2MotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture

func (o *MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureDestinationTextureSourceTexture2DestinationTexture2MotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, destinationTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture)

@brief Encode denoising kernels to a command buffer @discussion Simultaneously removes noise from the source texture and optional second source texture, using the additional data in the motion vector, depth/normal, and previous depth/normal textures. Returns the result through the destination texture pointers. The depth/normal texture should be provided as the previous depth/normal texture for the next call to this method. This method will also update an internally managed temporal history to aid the denoising process. To reset this history, call the clearTemporalHistory method. This method will allocate and return several textures from and to the texture allocator the MPSSVGFDenoiser was initialized with. The number of iterations of the bilateral filter is controlled by the bilateralFilterIterations property. Larger numbers of iterations will improve the quality but reduce performance. To configure other parameters of the denoising process, modify the properties of the MPSSVGF object the MPSSVGFDenoiser was initialized with. @parameter commandBuffer Command buffer to encode into @parameter sourceTexture Source image to denoiser @parameter destinationTexture Denoised output image @parameter sourceTexture2 Optional second source image to denoise @parameter destinationTexture2 Denoised second output image, if there is a second source image @parameter motionVectorTexture Motion vector texture describing how much each texel has moved, in texels, since the previous frame. See the MPSSVGF object for more details. @parameter depthNormalTexture Texture containing linear depth in the X component and signed normals in the YZW components. See the MPSSVGF object for more details. @parameter previousDepthNormalTexture Depth/normal texture from the previous frame. See the MPSSVGF object for more details.

func (*MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture

func (o *MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture) metal.MTLTexture

@brief Encode denoising kernels to a command buffer @discussion Removes noise from the source texture, using the additional data in the motion vector, depth/normal, and previous depth/normal textures. Returns the resulting texture. The depth/normal texture should be provided as the previous depth/normal texture for the next call to this method. This method will also update an internally managed temporal history to aid the denoising process. To reset this history, call the clearTemporalHistory method. This method will allocate and return several textures from and to the texture allocator the MPSSVGFDenoiser was initialized with. The number of iterations of the bilateral filter is controlled by the bilateralFilterIterations property. Larger numbers of iterations will improve the quality but reduce performance. To configure other parameters of the denoising process, modify the properties of the MPSSVGF object the MPSSVGFDenoiser was initialized with. @parameter commandBuffer Command buffer to encode into @parameter sourceTexture Source image to denoiser @parameter motionVectorTexture Motion vector texture describing how much each texel has moved, in texels, since the previous frame. See the MPSSVGF object for more details. @parameter depthNormalTexture Texture containing linear depth in the X component and signed normals in the YZW components. See the MPSSVGF object for more details. @parameter previousDepthNormalTexture Depth/normal texture from the previous frame. See the MPSSVGF object for more details.

func (*MPSSVGFDenoiser) InitWithDevice

func (o *MPSSVGFDenoiser) InitWithDevice(device metal.MTLDevice) *MPSSVGFDenoiser

@brief Initialize the MPSSVGFDenoiser object @parameter device The Metal device to use for denoising

func (*MPSSVGFDenoiser) InitWithSVGFTextureAllocator

func (o *MPSSVGFDenoiser) InitWithSVGFTextureAllocator(svgf *MPSSVGF, textureAllocator MPSSVGFTextureAllocator) *MPSSVGFDenoiser

@brief Initialize the MPSSVGFDenoiser object @parameter svgf MPSSVGF kernels to use for denoising. This object can be used to configure temporal reprojection, bilateral blur settings, etc. @parameter textureAllocator An object conforming to the MPSSVGFTextureAllocator protocol. This object will be used to allocate temporary intermediate and output textures. This can be a custom object or an instance of the MPSSVGFDefaultTextureAllocator class.

func (*MPSSVGFDenoiser) ReleaseTemporaryTextures

func (o *MPSSVGFDenoiser) ReleaseTemporaryTextures()

@brief Return any temporary textures to the texture allocator. Also clears the temporal history. This should be called before resizing the source texture(s).

func (*MPSSVGFDenoiser) SetBilateralFilterIterations

func (o *MPSSVGFDenoiser) SetBilateralFilterIterations(bilateralFilterIterations uint)

func (*MPSSVGFDenoiser) Svgf

func (o *MPSSVGFDenoiser) Svgf() *MPSSVGF

@brief The underlying MPSSVGF kernels object which will be used for denoising. Use this object to customize the denoising process.

func (*MPSSVGFDenoiser) TextureAllocator

func (o *MPSSVGFDenoiser) TextureAllocator() MPSSVGFTextureAllocator

@brief The object which will be used to allocate intermediate and output textures.

type MPSSVGFTextureAllocator

type MPSSVGFTextureAllocator interface {
	TextureWithPixelFormatWidthHeight(pixelFormat metal.MTLPixelFormat, width uint, height uint) metal.MTLTexture
	ReturnTexture(texture metal.MTLTexture)
}

MPSSVGFTextureAllocator wraps the ObjC protocol MPSSVGFTextureAllocator.

type MPSTemporalAA

type MPSTemporalAA struct {
	mpscore.MPSKernel
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpstemporalaa

func MPSTemporalAAFromID

func MPSTemporalAAFromID(id objc.ID) *MPSTemporalAA

func (*MPSTemporalAA) BlendFactor

func (o *MPSTemporalAA) BlendFactor() float32

@brief How much to blend the current frame with the previous frame during temporal antialiasing. The final value is given by current * blendFactor + previous * (1 - blendFactor). Must be between zero and one, inclusive. Defaults to 0.1.

func (*MPSTemporalAA) EncodeToCommandBufferSourceTexturePreviousTextureDestinationTextureMotionVectorTextureDepthTexture

func (o *MPSTemporalAA) EncodeToCommandBufferSourceTexturePreviousTextureDestinationTextureMotionVectorTextureDepthTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, previousTexture metal.MTLTexture, destinationTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthTexture metal.MTLTexture)

@brief Encode temporal antialiasing a command buffer @discussion The motion vector texture must be at least a two channel texture representing how many texels each texel in the source image(s) have moved since the previous frame. The remaining channels will be ignored if present. This texture may be nil, in which case the motion vector is assumed to be zero, which is suitable for static images. The depth texture must contain the depth values for directly visible geometry for the current frame for each pixel. The first channel must store the depth value from zero to infinity. The depth texture may be nil, but this will prevent motion vectors from being dilated and may introduce aliasing along silhouette edges. The destination texture should be used as the previous texture in the next frame. @param commandBuffer Command buffer to encode into @param sourceTexture Current frame to denoise @param previousTexture Previous denoised frame to reproject into current frame @param destinationTexture Output blended image @param motionVectorTexture Motion vector texture @param depthTexture The depth values for the current frame

func (*MPSTemporalAA) EncodeWithCoder

func (o *MPSTemporalAA) EncodeWithCoder(coder *foundation.NSCoder)

func (*MPSTemporalAA) InitWithCoderDevice

func (o *MPSTemporalAA) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSTemporalAA

func (*MPSTemporalAA) InitWithDevice

func (o *MPSTemporalAA) InitWithDevice(device metal.MTLDevice) *MPSTemporalAA

func (*MPSTemporalAA) SetBlendFactor

func (o *MPSTemporalAA) SetBlendFactor(blendFactor float32)

type MPSTemporalWeighting

type MPSTemporalWeighting uint64

@brief Controls how samples are weighted over time

const (
	// @brief Compute an average of all samples. This will fully utilize all samples but may lead to excessive ghosting artifacts under motion. Therefore, this is best for static images.
	MPSTemporalWeightingAverage MPSTemporalWeighting = 0
	// @brief Compute an exponential moving average by blending linearly between the previous accumulated samples and the current sample according to the temporalReprojectionBlendFactor property. This will cause older samples to lose their contribution over time, which will prevent ghosting artifacts but will also never converge to a stable value. Therefore, this is best for images with motion.
	MPSTemporalWeightingExponentialMovingAverage MPSTemporalWeighting = 1
)

func (MPSTemporalWeighting) String

func (e MPSTemporalWeighting) String() string

type MPSTransformType

type MPSTransformType uint64

@brief Instance transformation type options

const (
	// @brief Instance transformations are represented by a 4x4 column major matrix of 32 bit floats
	MPSTransformTypeFloat4x4 MPSTransformType = 0
	// @brief All instances have the identity transformation (no transformation). This can be used to compose multiple polygon acceleration structures in an instance acceleration structure without the cost of transforming instances. For example, geometry can be divided into static and dynamic polygon acceleration structures which can be rebuilt and refit independently.
	MPSTransformTypeIdentity MPSTransformType = 1
)

func (MPSTransformType) String

func (e MPSTransformType) String() string

type MPSTriangleAccelerationStructure

type MPSTriangleAccelerationStructure struct {
	MPSPolygonAccelerationStructure
}

Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpstriangleaccelerationstructure

func MPSTriangleAccelerationStructureFromID

func MPSTriangleAccelerationStructureFromID(id objc.ID) *MPSTriangleAccelerationStructure

func (*MPSTriangleAccelerationStructure) SetTriangleCount

func (o *MPSTriangleAccelerationStructure) SetTriangleCount(triangleCount uint)

func (*MPSTriangleAccelerationStructure) TriangleCount

func (o *MPSTriangleAccelerationStructure) TriangleCount() uint

@brief Number of triangles. Changes to this property require rebuilding the acceleration structure. Note that this property is an alias for the polygonCount property.

type MPSTriangleIntersectionTestType

type MPSTriangleIntersectionTestType uint64

@brief Options for the MPSRayIntersector triangle intersection test type property

const (
	// @brief Use the default ray/triangle intersection test
	MPSTriangleIntersectionTestTypeDefault MPSTriangleIntersectionTestType = 0
	// @brief Use a watertight ray/triangle intersection test which avoids gaps along shared triangle edges. Shared vertices may still have gaps. This intersection test may be slower than MPSTriangleIntersectionTestTypeDefault.
	MPSTriangleIntersectionTestTypeWatertight MPSTriangleIntersectionTestType = 1
)

func (MPSTriangleIntersectionTestType) String

type Mach_vm_range_flags_t

type Mach_vm_range_flags_t int64
const (
	MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)

func (Mach_vm_range_flags_t) String

func (e Mach_vm_range_flags_t) String() string

type Mach_vm_range_flavor_t

type Mach_vm_range_flavor_t int64
const (
	MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0
	MACH_VM_RANGE_FLAVOR_V1      Mach_vm_range_flavor_t = 1
)

func (Mach_vm_range_flavor_t) String

func (e Mach_vm_range_flavor_t) String() string

type Mach_vm_range_tag_t

type Mach_vm_range_tag_t int64
const (
	MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0
	MACH_VM_RANGE_DATA    Mach_vm_range_tag_t = 1
	MACH_VM_RANGE_FIXED   Mach_vm_range_tag_t = 2
)

func (Mach_vm_range_tag_t) String

func (e Mach_vm_range_tag_t) String() string

type Mpo_flags_t

type Mpo_flags_t int64
const (
	MPO_PORT                            Mpo_flags_t = 0
	MPO_SERVICE_PORT                    Mpo_flags_t = 1024
	MPO_CONNECTION_PORT                 Mpo_flags_t = 2048
	MPO_REPLY_PORT                      Mpo_flags_t = 4096
	MPO_WEAK_REPLY_PORT                 Mpo_flags_t = 16384
	MPO_NOTIFICATION_PORT               Mpo_flags_t = 17408
	MPO_EXCEPTION_PORT                  Mpo_flags_t = 32768
	MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536
)

func (Mpo_flags_t) String

func (e Mpo_flags_t) String() string

type Os_clockid_t

type Os_clockid_t int64
const (
	OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)

func (Os_clockid_t) String

func (e Os_clockid_t) String() string

type Ptrauth_key

type Ptrauth_key int64
const (
	Ptrauth_key_none                     Ptrauth_key = -1
	Ptrauth_key_asia                     Ptrauth_key = 0
	Ptrauth_key_asib                     Ptrauth_key = 1
	Ptrauth_key_asda                     Ptrauth_key = 2
	Ptrauth_key_asdb                     Ptrauth_key = 3
	Ptrauth_key_process_independent_code Ptrauth_key = 0
	Ptrauth_key_process_dependent_code   Ptrauth_key = 1
	Ptrauth_key_process_independent_data Ptrauth_key = 2
	Ptrauth_key_process_dependent_data   Ptrauth_key = 3
	Ptrauth_key_return_address           Ptrauth_key = 1
	Ptrauth_key_frame_pointer            Ptrauth_key = 3
	Ptrauth_key_function_pointer         Ptrauth_key = 0
	Ptrauth_key_block_function           Ptrauth_key = 0
	Ptrauth_key_cxx_vtable_pointer       Ptrauth_key = 2
	Ptrauth_key_method_list_pointer      Ptrauth_key = 2
	Ptrauth_key_objc_isa_pointer         Ptrauth_key = 2
	Ptrauth_key_objc_super_pointer       Ptrauth_key = 2
	Ptrauth_key_objc_sel_pointer         Ptrauth_key = 3
	Ptrauth_key_objc_class_ro_pointer    Ptrauth_key = 2
	Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2
	Ptrauth_key_init_fini_pointer        Ptrauth_key = 0
)

func (Ptrauth_key) String

func (e Ptrauth_key) String() string

type Qos_class_t

type Qos_class_t uint32
const (
	QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33
	QOS_CLASS_USER_INITIATED   Qos_class_t = 25
	QOS_CLASS_DEFAULT          Qos_class_t = 21
	QOS_CLASS_UTILITY          Qos_class_t = 17
	QOS_CLASS_BACKGROUND       Qos_class_t = 9
	QOS_CLASS_UNSPECIFIED      Qos_class_t = 0
)

func (Qos_class_t) String

func (e Qos_class_t) String() string

type Virtual_memory_guard_exception_code_t

type Virtual_memory_guard_exception_code_t int64
const (
	KGUARD_EXC_DEALLOC_GAP                   Virtual_memory_guard_exception_code_t = 1
	KGUARD_EXC_RECLAIM_COPYIO_FAILURE        Virtual_memory_guard_exception_code_t = 2
	KGUARD_EXC_RECLAIM_INDEX_FAILURE         Virtual_memory_guard_exception_code_t = 4
	KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE    Virtual_memory_guard_exception_code_t = 8
	KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE    Virtual_memory_guard_exception_code_t = 9
	KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE         Virtual_memory_guard_exception_code_t = 10
	KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE         Virtual_memory_guard_exception_code_t = 11
	KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION  Virtual_memory_guard_exception_code_t = 12
	KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY    Virtual_memory_guard_exception_code_t = 13
	KGUARD_EXC_SEC_ACCESS_FAULT              Virtual_memory_guard_exception_code_t = 98
	KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT        Virtual_memory_guard_exception_code_t = 99
	KGUARD_EXC_SEC_COPY_DENIED               Virtual_memory_guard_exception_code_t = 100
	KGUARD_EXC_SEC_SHARING_DENIED            Virtual_memory_guard_exception_code_t = 101
	KGUARD_EXC_MTE_SYNC_FAULT                Virtual_memory_guard_exception_code_t = 200
	KGUARD_EXC_MTE_ASYNC_USER_FAULT          Virtual_memory_guard_exception_code_t = 201
	KGUARD_EXC_MTE_ASYNC_KERN_FAULT          Virtual_memory_guard_exception_code_t = 202
	KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203
	KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204
)

func (Virtual_memory_guard_exception_code_t) String

type Xpc_listener_create_flags_t

type Xpc_listener_create_flags_t int64
const (
	XPC_LISTENER_CREATE_NONE             Xpc_listener_create_flags_t = 0
	XPC_LISTENER_CREATE_INACTIVE         Xpc_listener_create_flags_t = 1
	XPC_LISTENER_CREATE_FORCE_MACH       Xpc_listener_create_flags_t = 2
	XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4
)

func (Xpc_listener_create_flags_t) String

type Xpc_session_create_flags_t

type Xpc_session_create_flags_t int64
const (
	XPC_SESSION_CREATE_NONE            Xpc_session_create_flags_t = 0
	XPC_SESSION_CREATE_INACTIVE        Xpc_session_create_flags_t = 1
	XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2
)

func (Xpc_session_create_flags_t) String

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL