Documentation
¶
Overview ¶
Package mpsrayintersector provides a fluent Go API over the macOS MPSRayIntersector framework.
Construction ¶
New… functions create objects; each With… method sets one property and returns its receiver, so configuration calls chain. A <Type>FromID constructor adopts an Objective-C object obtained elsewhere.
Lifecycle ¶
A wrapper releases its Objective-C object automatically once the garbage collector finds it unreachable. Call Release to relinquish the reference deterministically (for objects holding scarce resources); Release is idempotent, and afterwards the wrapper's methods are no-ops returning zero values.
Types ¶
Each base type below lists the concrete types you construct and pass where the base is accepted:
- AccelerationStructure: InstanceAccelerationStructure, PolygonAccelerationStructure
- PolygonAccelerationStructure: QuadrilateralAccelerationStructure, TriangleAccelerationStructure
Index ¶
- type AccelerationStructure
- func (as *AccelerationStructure) CopyWithZoneGroup(zone unsafe.Pointer, group *AccelerationStructureGroup) *AccelerationStructure
- func (as *AccelerationStructure) Description() string
- func (as *AccelerationStructure) EncodeWithCoder(coder obj.Object)
- func (as *AccelerationStructure) Group() *AccelerationStructureGroup
- func (as *AccelerationStructure) IsEqual(other obj.Object) bool
- func (as *AccelerationStructure) IsKind(className string) bool
- func (as *AccelerationStructure) Rebuild()
- func (as *AccelerationStructure) RebuildWithCompletionHandler(completionHandler func(obj.Object))
- func (as *AccelerationStructure) Status() AccelerationStructureStatus
- func (as *AccelerationStructure) String() string
- func (as *AccelerationStructure) Usage() AccelerationStructureUsage
- func (as *AccelerationStructure) WithUsage(usage AccelerationStructureUsage) *AccelerationStructure
- type AccelerationStructureGroup
- type AccelerationStructureProvider
- type AccelerationStructureStatus
- type AccelerationStructureUsage
- type BoundingBoxIntersectionTestType
- type Clockid
- type DispatchAutoreleaseFrequency
- type DispatchBlockFlags
- type EntryID
- type FilesecProperty
- type Flag
- type Idtype
- type InstanceAccelerationStructure
- func (ias *InstanceAccelerationStructure) AccelerationStructures() []*PolygonAccelerationStructure
- func (ias *InstanceAccelerationStructure) InstanceBufferOffset() int
- func (ias *InstanceAccelerationStructure) InstanceCount() int
- func (ias *InstanceAccelerationStructure) MaskBufferOffset() int
- func (ias *InstanceAccelerationStructure) TransformBufferOffset() int
- func (ias *InstanceAccelerationStructure) TransformType() TransformType
- func (ias *InstanceAccelerationStructure) WithAccelerationStructures(items ...PolygonAccelerationStructureProvider) *InstanceAccelerationStructure
- func (ias *InstanceAccelerationStructure) WithInstanceBufferOffset(instanceBufferOffset int) *InstanceAccelerationStructure
- func (ias *InstanceAccelerationStructure) WithInstanceCount(instanceCount int) *InstanceAccelerationStructure
- func (ias *InstanceAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *InstanceAccelerationStructure
- func (ias *InstanceAccelerationStructure) WithTransformBufferOffset(transformBufferOffset int) *InstanceAccelerationStructure
- func (ias *InstanceAccelerationStructure) WithTransformType(transformType TransformType) *InstanceAccelerationStructure
- func (ias *InstanceAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *InstanceAccelerationStructure
- type IntersectionDataType
- type IntersectionType
- type IpcInfoObjectType
- type LaunchDataType
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type MPSAxisAlignedBoundingBox
- type MPSIntersectionDistance
- type MPSIntersectionDistancePrimitiveIndex
- type MPSIntersectionDistancePrimitiveIndexBufferIndex
- type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates
- type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex
- type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates
- type MPSIntersectionDistancePrimitiveIndexCoordinates
- type MPSIntersectionDistancePrimitiveIndexInstanceIndex
- type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates
- type MPSPackedFloat3
- type MPSRayOriginDirection
- type MPSRayOriginMaskDirectionMaxDistance
- type MPSRayOriginMinDistanceDirectionMaxDistance
- type MPSRayPackedOriginDirection
- type MachVMRangeFlags
- type MachVMRangeFlavor
- type MachVMRangeTag
- type MpoFlags
- type OSClockid
- type Perm
- type PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) IndexBufferOffset() int
- func (pas *PolygonAccelerationStructure) MaskBufferOffset() int
- func (pas *PolygonAccelerationStructure) PolygonBuffers() []*PolygonBuffer
- func (pas *PolygonAccelerationStructure) PolygonCount() int
- func (pas *PolygonAccelerationStructure) PolygonType() PolygonType
- func (pas *PolygonAccelerationStructure) VertexBufferOffset() int
- func (pas *PolygonAccelerationStructure) VertexStride() int
- func (pas *PolygonAccelerationStructure) WithIndexBufferOffset(indexBufferOffset int) *PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) WithPolygonBuffers(items ...*PolygonBuffer) *PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) WithPolygonCount(polygonCount int) *PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) WithPolygonType(polygonType PolygonType) *PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) WithVertexBufferOffset(vertexBufferOffset int) *PolygonAccelerationStructure
- func (pas *PolygonAccelerationStructure) WithVertexStride(vertexStride int) *PolygonAccelerationStructure
- type PolygonAccelerationStructureProvider
- type PolygonBuffer
- func (pb *PolygonBuffer) Description() string
- func (pb *PolygonBuffer) IndexBufferOffset() int
- func (pb *PolygonBuffer) IsEqual(other obj.Object) bool
- func (pb *PolygonBuffer) IsKind(className string) bool
- func (pb *PolygonBuffer) MaskBufferOffset() int
- func (pb *PolygonBuffer) PolygonCount() int
- func (pb *PolygonBuffer) String() string
- func (pb *PolygonBuffer) VertexBufferOffset() int
- func (pb *PolygonBuffer) WithIndexBufferOffset(indexBufferOffset int) *PolygonBuffer
- func (pb *PolygonBuffer) WithMaskBufferOffset(maskBufferOffset int) *PolygonBuffer
- func (pb *PolygonBuffer) WithPolygonCount(polygonCount int) *PolygonBuffer
- func (pb *PolygonBuffer) WithVertexBufferOffset(vertexBufferOffset int) *PolygonBuffer
- type PolygonType
- type PtrauthKey
- type QosClass
- type QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) QuadrilateralCount() int
- func (qas *QuadrilateralAccelerationStructure) WithIndexBufferOffset(indexBufferOffset int) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithPolygonBuffers(items ...*PolygonBuffer) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithPolygonCount(polygonCount int) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithPolygonType(polygonType PolygonType) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithQuadrilateralCount(quadrilateralCount int) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithVertexBufferOffset(vertexBufferOffset int) *QuadrilateralAccelerationStructure
- func (qas *QuadrilateralAccelerationStructure) WithVertexStride(vertexStride int) *QuadrilateralAccelerationStructure
- type RayDataType
- type RayIntersector
- func (ri *RayIntersector) BoundingBoxIntersectionTestType() BoundingBoxIntersectionTestType
- func (ri *RayIntersector) Description() string
- func (ri *RayIntersector) EncodeWithCoder(coder obj.Object)
- func (ri *RayIntersector) IntersectionDataType() IntersectionDataType
- func (ri *RayIntersector) IntersectionStride() int
- func (ri *RayIntersector) IsEqual(other obj.Object) bool
- func (ri *RayIntersector) IsKind(className string) bool
- func (ri *RayIntersector) RayDataType() RayDataType
- func (ri *RayIntersector) RayMask() int
- func (ri *RayIntersector) RayMaskOperator() RayMaskOperator
- func (ri *RayIntersector) RayMaskOptions() RayMaskOptions
- func (ri *RayIntersector) RayStride() int
- func (ri *RayIntersector) RecommendedMinimumRayBatchSizeForRayCount(rayCount int) int
- func (ri *RayIntersector) String() string
- func (ri *RayIntersector) TriangleIntersectionTestType() TriangleIntersectionTestType
- func (ri *RayIntersector) WithBoundingBoxIntersectionTestType(boundingBoxIntersectionTestType BoundingBoxIntersectionTestType) *RayIntersector
- func (ri *RayIntersector) WithIntersectionDataType(intersectionDataType IntersectionDataType) *RayIntersector
- func (ri *RayIntersector) WithIntersectionStride(intersectionStride int) *RayIntersector
- func (ri *RayIntersector) WithRayDataType(rayDataType RayDataType) *RayIntersector
- func (ri *RayIntersector) WithRayMask(rayMask int) *RayIntersector
- func (ri *RayIntersector) WithRayMaskOperator(rayMaskOperator RayMaskOperator) *RayIntersector
- func (ri *RayIntersector) WithRayMaskOptions(rayMaskOptions RayMaskOptions) *RayIntersector
- func (ri *RayIntersector) WithRayStride(rayStride int) *RayIntersector
- func (ri *RayIntersector) WithTriangleIntersectionTestType(triangleIntersectionTestType TriangleIntersectionTestType) *RayIntersector
- type RayMaskOperator
- type RayMaskOptions
- type SVGF
- func (s *SVGF) BilateralFilterRadius() int
- func (s *SVGF) BilateralFilterSigma() float32
- func (s *SVGF) ChannelCount() int
- func (s *SVGF) ChannelCount2() int
- func (s *SVGF) DepthWeight() float32
- func (s *SVGF) Description() string
- func (s *SVGF) EncodeWithCoder(coder obj.Object)
- func (s *SVGF) IsEqual(other obj.Object) bool
- func (s *SVGF) IsKind(className string) bool
- func (s *SVGF) LuminanceWeight() float32
- func (s *SVGF) MinimumFramesForVarianceEstimation() int
- func (s *SVGF) NormalWeight() float32
- func (s *SVGF) ReprojectionThreshold() float32
- func (s *SVGF) String() string
- func (s *SVGF) TemporalReprojectionBlendFactor() float32
- func (s *SVGF) TemporalWeighting() TemporalWeighting
- func (s *SVGF) VarianceEstimationRadius() int
- func (s *SVGF) VarianceEstimationSigma() float32
- func (s *SVGF) VariancePrefilterRadius() int
- func (s *SVGF) VariancePrefilterSigma() float32
- func (s *SVGF) WithBilateralFilterRadius(bilateralFilterRadius int) *SVGF
- func (s *SVGF) WithBilateralFilterSigma(bilateralFilterSigma float32) *SVGF
- func (s *SVGF) WithChannelCount(channelCount int) *SVGF
- func (s *SVGF) WithChannelCount2(channelCount2 int) *SVGF
- func (s *SVGF) WithDepthWeight(depthWeight float32) *SVGF
- func (s *SVGF) WithLuminanceWeight(luminanceWeight float32) *SVGF
- func (s *SVGF) WithMinimumFramesForVarianceEstimation(minimumFramesForVarianceEstimation int) *SVGF
- func (s *SVGF) WithNormalWeight(normalWeight float32) *SVGF
- func (s *SVGF) WithReprojectionThreshold(reprojectionThreshold float32) *SVGF
- func (s *SVGF) WithTemporalReprojectionBlendFactor(temporalReprojectionBlendFactor float32) *SVGF
- func (s *SVGF) WithTemporalWeighting(temporalWeighting TemporalWeighting) *SVGF
- func (s *SVGF) WithVarianceEstimationRadius(varianceEstimationRadius int) *SVGF
- func (s *SVGF) WithVarianceEstimationSigma(varianceEstimationSigma float32) *SVGF
- func (s *SVGF) WithVariancePrefilterRadius(variancePrefilterRadius int) *SVGF
- func (s *SVGF) WithVariancePrefilterSigma(variancePrefilterSigma float32) *SVGF
- type SVGFDefaultTextureAllocator
- func (sdta *SVGFDefaultTextureAllocator) AllocatedTextureCount() int
- func (sdta *SVGFDefaultTextureAllocator) Description() string
- func (sdta *SVGFDefaultTextureAllocator) IsEqual(other obj.Object) bool
- func (sdta *SVGFDefaultTextureAllocator) IsKind(className string) bool
- func (sdta *SVGFDefaultTextureAllocator) Reset()
- func (sdta *SVGFDefaultTextureAllocator) String() string
- type SVGFDenoiser
- func (sd *SVGFDenoiser) BilateralFilterIterations() int
- func (sd *SVGFDenoiser) ClearTemporalHistory()
- func (sd *SVGFDenoiser) Description() string
- func (sd *SVGFDenoiser) IsEqual(other obj.Object) bool
- func (sd *SVGFDenoiser) IsKind(className string) bool
- func (sd *SVGFDenoiser) ReleaseTemporaryTextures()
- func (sd *SVGFDenoiser) String() string
- func (sd *SVGFDenoiser) Svgf() *SVGF
- func (sd *SVGFDenoiser) WithBilateralFilterIterations(bilateralFilterIterations int) *SVGFDenoiser
- type SVGFTextureAllocator
- type Tag
- type TemporalAA
- func (ta *TemporalAA) BlendFactor() float32
- func (ta *TemporalAA) Description() string
- func (ta *TemporalAA) EncodeWithCoder(coder obj.Object)
- func (ta *TemporalAA) IsEqual(other obj.Object) bool
- func (ta *TemporalAA) IsKind(className string) bool
- func (ta *TemporalAA) String() string
- func (ta *TemporalAA) WithBlendFactor(blendFactor float32) *TemporalAA
- type TemporalWeighting
- type TransformType
- type TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) TriangleCount() int
- func (tas *TriangleAccelerationStructure) WithIndexBufferOffset(indexBufferOffset int) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithPolygonBuffers(items ...*PolygonBuffer) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithPolygonCount(polygonCount int) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithPolygonType(polygonType PolygonType) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithTriangleCount(triangleCount int) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithVertexBufferOffset(vertexBufferOffset int) *TriangleAccelerationStructure
- func (tas *TriangleAccelerationStructure) WithVertexStride(vertexStride int) *TriangleAccelerationStructure
- type TriangleIntersectionTestType
- type Type
- type VirtualMemoryGuardExceptionCode
- type XpcListenerCreateFlags
- type XpcSessionCreateFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccelerationStructure ¶ added in v0.17.0
AccelerationStructure is an idiomatic wrapper over the Objective-C class MPSAccelerationStructure.
AccelerationStructure is an abstract base — you do not construct it directly. Construct one of InstanceAccelerationStructure, PolygonAccelerationStructure and pass it where a AccelerationStructure is accepted.
func AccelerationStructureFromID ¶ added in v0.17.0
func AccelerationStructureFromID(id objc.ID) *AccelerationStructure
AccelerationStructureFromID adopts an existing Objective-C object as a AccelerationStructure (nil for 0), retaining it and registering a release finalizer.
func NewAccelerationStructureWithCoderGroup ¶ added in v0.17.0
func NewAccelerationStructureWithCoderGroup(aDecoder obj.Object, group *AccelerationStructureGroup) *AccelerationStructure
NewAccelerationStructureWithCoderGroup 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 NewAccelerationStructureWithGroup ¶ added in v0.17.0
func NewAccelerationStructureWithGroup(group *AccelerationStructureGroup) *AccelerationStructure
NewAccelerationStructureWithGroup initialize the acceleration structure with an acceleration structure group, if the acceleration structure will be used in an instance hierarchy. The Metal device is determined from the acceleration structure group. All acceleration structures in the instance hierarchy must share the same group.
func (*AccelerationStructure) CopyWithZoneGroup ¶ added in v0.17.0
func (as *AccelerationStructure) CopyWithZoneGroup(zone unsafe.Pointer, group *AccelerationStructureGroup) *AccelerationStructure
CopyWithZoneGroup create a a copy of this acceleration structure 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.
func (*AccelerationStructure) Description ¶ added in v0.17.0
func (as *AccelerationStructure) Description() string
Description returns the object's -description text.
func (*AccelerationStructure) EncodeWithCoder ¶ added in v0.17.0
func (as *AccelerationStructure) EncodeWithCoder(coder obj.Object)
EncodeWithCoder encode the acceleration structure with an NSCoder 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.
func (*AccelerationStructure) Group ¶ added in v0.17.0
func (as *AccelerationStructure) Group() *AccelerationStructureGroup
Group returns the group this acceleration structure was created with
func (*AccelerationStructure) IsEqual ¶ added in v0.17.0
func (as *AccelerationStructure) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*AccelerationStructure) IsKind ¶ added in v0.17.0
func (as *AccelerationStructure) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*AccelerationStructure) Rebuild ¶ added in v0.17.0
func (as *AccelerationStructure) Rebuild()
Rebuild rebuild the acceleration structure 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 (*AccelerationStructure) RebuildWithCompletionHandler ¶ added in v0.18.0
func (as *AccelerationStructure) RebuildWithCompletionHandler(completionHandler func(obj.Object))
RebuildWithCompletionHandler rebuild the acceleration structure asynchronously 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 (*AccelerationStructure) Status ¶ added in v0.17.0
func (as *AccelerationStructure) Status() AccelerationStructureStatus
Status returns status indicating whether the acceleration structure has finished building
func (*AccelerationStructure) String ¶ added in v0.17.0
func (as *AccelerationStructure) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*AccelerationStructure) Usage ¶ added in v0.17.0
func (as *AccelerationStructure) Usage() AccelerationStructureUsage
Usage returns acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.
func (*AccelerationStructure) WithUsage ¶ added in v0.17.0
func (as *AccelerationStructure) WithUsage(usage AccelerationStructureUsage) *AccelerationStructure
WithUsage sets acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.
type AccelerationStructureGroup ¶ added in v0.17.0
AccelerationStructureGroup is an idiomatic wrapper over the Objective-C class MPSAccelerationStructureGroup.
func AccelerationStructureGroupFromID ¶ added in v0.17.0
func AccelerationStructureGroupFromID(id objc.ID) *AccelerationStructureGroup
AccelerationStructureGroupFromID adopts an existing Objective-C object as a AccelerationStructureGroup (nil for 0), retaining it and registering a release finalizer.
func NewAccelerationStructureGroup ¶ added in v0.17.0
func NewAccelerationStructureGroup() *AccelerationStructureGroup
NewAccelerationStructureGroup creates a new AccelerationStructureGroup.
func (*AccelerationStructureGroup) Description ¶ added in v0.17.0
func (asg *AccelerationStructureGroup) Description() string
Description returns the object's -description text.
func (*AccelerationStructureGroup) IsEqual ¶ added in v0.17.0
func (asg *AccelerationStructureGroup) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*AccelerationStructureGroup) IsKind ¶ added in v0.17.0
func (asg *AccelerationStructureGroup) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*AccelerationStructureGroup) String ¶ added in v0.17.0
func (asg *AccelerationStructureGroup) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type AccelerationStructureProvider ¶ added in v0.17.0
type AccelerationStructureProvider interface {
objref.Object
// contains filtered or unexported methods
}
AccelerationStructureProvider is accepted wherever a MPSAccelerationStructure (or one of its subclasses) is expected.
type AccelerationStructureStatus ¶ added in v0.17.0
type AccelerationStructureStatus uint64
Possible values of the acceleration structure status property
const ( // The acceleration structure has not been built yet AccelerationStructureStatusUnbuilt AccelerationStructureStatus = 0 // The acceleration structure has finished building AccelerationStructureStatusBuilt AccelerationStructureStatus = 1 )
func (AccelerationStructureStatus) String ¶ added in v0.17.0
func (e AccelerationStructureStatus) String() string
String returns the AccelerationStructureStatus constant's name, or its numeric form when the value is not a known constant.
type AccelerationStructureUsage ¶ added in v0.17.0
type AccelerationStructureUsage uint64
Options describing how an acceleration structure will be used Bitmask — values may be combined with |.
const ( // No usage options specified AccelerationStructureUsageNone AccelerationStructureUsage = 0 // 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. AccelerationStructureUsageRefit AccelerationStructureUsage = 1 // 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. AccelerationStructureUsageFrequentRebuild AccelerationStructureUsage = 2 // 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. AccelerationStructureUsagePreferGPUBuild AccelerationStructureUsage = 4 // 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. AccelerationStructureUsagePreferCPUBuild AccelerationStructureUsage = 8 )
func (AccelerationStructureUsage) String ¶ added in v0.17.0
func (e AccelerationStructureUsage) String() string
String returns the AccelerationStructureUsage constant's name, or its numeric form when the value is not a known constant.
type BoundingBoxIntersectionTestType ¶ added in v0.17.0
type BoundingBoxIntersectionTestType uint64
Options for the MPSRayIntersector bounding box intersection test type property
const ( // 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. BoundingBoxIntersectionTestTypeDefault BoundingBoxIntersectionTestType = 0 // 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. BoundingBoxIntersectionTestTypeAxisAligned BoundingBoxIntersectionTestType = 1 // 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. BoundingBoxIntersectionTestTypeFast BoundingBoxIntersectionTestType = 2 )
func (BoundingBoxIntersectionTestType) String ¶ added in v0.17.0
func (e BoundingBoxIntersectionTestType) String() string
String returns the BoundingBoxIntersectionTestType constant's name, or its numeric form when the value is not a known constant.
type DispatchAutoreleaseFrequency ¶ added in v0.17.0
type DispatchAutoreleaseFrequency uint64
const ( DispatchAutoreleaseFrequencyInherit DispatchAutoreleaseFrequency = 0 DispatchAutoreleaseFrequencyWorkItem DispatchAutoreleaseFrequency = 1 DispatchAutoreleaseFrequencyNever DispatchAutoreleaseFrequency = 2 )
func (DispatchAutoreleaseFrequency) String ¶ added in v0.17.0
func (e DispatchAutoreleaseFrequency) String() string
String returns the DispatchAutoreleaseFrequency constant's name, or its numeric form when the value is not a known constant.
type DispatchBlockFlags ¶ added in v0.17.0
type DispatchBlockFlags uint64
Bitmask — values may be combined with |.
const ( DispatchBlockFlagsBarrier DispatchBlockFlags = 1 DispatchBlockFlagsDetached DispatchBlockFlags = 2 DispatchBlockFlagsAssignCurrent DispatchBlockFlags = 4 DispatchBlockFlagsNoQosClass DispatchBlockFlags = 8 DispatchBlockFlagsInheritQosClass DispatchBlockFlags = 16 DispatchBlockFlagsEnforceQosClass DispatchBlockFlags = 32 )
func (DispatchBlockFlags) String ¶ added in v0.17.0
func (e DispatchBlockFlags) String() string
String returns the DispatchBlockFlags constant's name, or its numeric form when the value is not a known constant.
type FilesecProperty ¶ added in v0.17.0
type FilesecProperty int32
const ( FilesecPropertyOwner FilesecProperty = 1 FilesecPropertyGroup FilesecProperty = 2 FilesecPropertyUUID FilesecProperty = 3 FilesecPropertyMode FilesecProperty = 4 FilesecPropertyACL FilesecProperty = 5 FilesecPropertyGrpuuid FilesecProperty = 6 FilesecPropertyACLRaw FilesecProperty = 100 FilesecPropertyACLAllocsize FilesecProperty = 101 )
func (FilesecProperty) String ¶ added in v0.17.0
func (e FilesecProperty) String() string
String returns the FilesecProperty constant's name, or its numeric form when the value is not a known constant.
type InstanceAccelerationStructure ¶ added in v0.17.0
type InstanceAccelerationStructure struct {
AccelerationStructure
}
InstanceAccelerationStructure is an idiomatic wrapper over the Objective-C class MPSInstanceAccelerationStructure.
It embeds AccelerationStructure, promoting that type's methods.
func InstanceAccelerationStructureFromID ¶ added in v0.17.0
func InstanceAccelerationStructureFromID(id objc.ID) *InstanceAccelerationStructure
InstanceAccelerationStructureFromID adopts an existing Objective-C object as a InstanceAccelerationStructure (nil for 0), retaining it and registering a release finalizer.
func NewInstanceAccelerationStructure ¶ added in v0.17.0
func NewInstanceAccelerationStructure() *InstanceAccelerationStructure
NewInstanceAccelerationStructure creates a new InstanceAccelerationStructure.
func (*InstanceAccelerationStructure) AccelerationStructures ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) AccelerationStructures() []*PolygonAccelerationStructure
AccelerationStructures returns 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.
AccelerationStructures returns the collection as a Go slice.
func (*InstanceAccelerationStructure) InstanceBufferOffset ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) InstanceBufferOffset() int
InstanceBufferOffset returns offset, in bytes, into the instance buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*InstanceAccelerationStructure) InstanceCount ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) InstanceCount() int
InstanceCount returns number of instances. Changes to this property require rebuilding the acceleration structure.
func (*InstanceAccelerationStructure) MaskBufferOffset ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) MaskBufferOffset() int
MaskBufferOffset returns offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*InstanceAccelerationStructure) TransformBufferOffset ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) TransformBufferOffset() int
TransformBufferOffset returns offset, in bytes, into the transform buffer. Defaults to 0 bytes. Must be aligned to the stride of the transform type.
func (*InstanceAccelerationStructure) TransformType ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) TransformType() TransformType
TransformType returns instance transform type. Defaults to MPSTransformTypeFloat4x4. Changes to this property require rebuilding the acceleration structure.
func (*InstanceAccelerationStructure) WithAccelerationStructures ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) WithAccelerationStructures(items ...PolygonAccelerationStructureProvider) *InstanceAccelerationStructure
WithAccelerationStructures sets 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 (*InstanceAccelerationStructure) WithInstanceBufferOffset ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) WithInstanceBufferOffset(instanceBufferOffset int) *InstanceAccelerationStructure
WithInstanceBufferOffset sets offset, in bytes, into the instance buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*InstanceAccelerationStructure) WithInstanceCount ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) WithInstanceCount(instanceCount int) *InstanceAccelerationStructure
WithInstanceCount sets number of instances. Changes to this property require rebuilding the acceleration structure.
func (*InstanceAccelerationStructure) WithMaskBufferOffset ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *InstanceAccelerationStructure
WithMaskBufferOffset sets offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*InstanceAccelerationStructure) WithTransformBufferOffset ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) WithTransformBufferOffset(transformBufferOffset int) *InstanceAccelerationStructure
WithTransformBufferOffset sets offset, in bytes, into the transform buffer. Defaults to 0 bytes. Must be aligned to the stride of the transform type.
func (*InstanceAccelerationStructure) WithTransformType ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) WithTransformType(transformType TransformType) *InstanceAccelerationStructure
WithTransformType sets instance transform type. Defaults to MPSTransformTypeFloat4x4. Changes to this property require rebuilding the acceleration structure.
func (*InstanceAccelerationStructure) WithUsage ¶ added in v0.17.0
func (ias *InstanceAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *InstanceAccelerationStructure
WithUsage sets acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.
type IntersectionDataType ¶ added in v0.17.0
type IntersectionDataType uint64
Intersection data type options
const ( // Use the MPSIntersectionDistance struct type IntersectionDataTypeDistance IntersectionDataType = 0 // Use the MPSIntersectionDistancePrimitiveIndex struct type IntersectionDataTypeDistancePrimitiveIndex IntersectionDataType = 1 // Use the MPSIntersectionDistancePrimitiveIndexCoordinates struct type IntersectionDataTypeDistancePrimitiveIndexCoordinates IntersectionDataType = 2 // Use the DistancePrimitiveIndexInstanceIndex struct type IntersectionDataTypeDistancePrimitiveIndexInstanceIndex IntersectionDataType = 3 // Use the DistancePrimitiveIndexInstanceIndexCoordinates struct type IntersectionDataTypeDistancePrimitiveIndexInstanceIndexCoordinates IntersectionDataType = 4 // Use the MPSIntersectionDistancePrimitiveIndexBufferIndex struct type IntersectionDataTypeDistancePrimitiveIndexBufferIndex IntersectionDataType = 5 // Use the MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates struct type IntersectionDataTypeDistancePrimitiveIndexBufferIndexCoordinates IntersectionDataType = 6 // Use the DistancePrimitiveIndexBufferIndexInstanceIndex struct type IntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndex IntersectionDataType = 7 // Use the DistancePrimitiveIndexBufferIndexInstanceIndexCoordinates struct type IntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates IntersectionDataType = 8 )
func (IntersectionDataType) String ¶ added in v0.17.0
func (e IntersectionDataType) String() string
String returns the IntersectionDataType constant's name, or its numeric form when the value is not a known constant.
type IntersectionType ¶ added in v0.17.0
type IntersectionType uint64
Options for the MPSRayIntersector intersection type property
const ( // 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. IntersectionTypeNearest IntersectionType = 0 // Find any intersection along the ray direction. This is potentially faster than MPSIntersectionTypeNearest and is well suited to shadow and occlusion rays. IntersectionTypeAny IntersectionType = 1 )
func (IntersectionType) String ¶ added in v0.17.0
func (e IntersectionType) String() string
String returns the IntersectionType constant's name, or its numeric form when the value is not a known constant.
type IpcInfoObjectType ¶ added in v0.17.0
type IpcInfoObjectType uint32
const ( IpcInfoObjectTypeNone IpcInfoObjectType = 0 IpcInfoObjectTypeThreadControl IpcInfoObjectType = 1 IpcInfoObjectTypeTaskControl IpcInfoObjectType = 2 IpcInfoObjectTypeHost IpcInfoObjectType = 3 IpcInfoObjectTypeHostPriv IpcInfoObjectType = 4 IpcInfoObjectTypeProcessor IpcInfoObjectType = 5 IpcInfoObjectTypeProcessorSet IpcInfoObjectType = 6 IpcInfoObjectTypeProcessorSetName IpcInfoObjectType = 7 IpcInfoObjectTypeTimer IpcInfoObjectType = 8 IpcInfoObjectTypePortSubstOnce IpcInfoObjectType = 9 IpcInfoObjectTypeMig IpcInfoObjectType = 10 IpcInfoObjectTypeMemoryObject IpcInfoObjectType = 11 IpcInfoObjectTypeXmmPager IpcInfoObjectType = 12 IpcInfoObjectTypeXmmKernel IpcInfoObjectType = 13 IpcInfoObjectTypeXmmReply IpcInfoObjectType = 14 IpcInfoObjectTypeUndReply IpcInfoObjectType = 15 IpcInfoObjectTypeHostNotify IpcInfoObjectType = 16 IpcInfoObjectTypeHostSecurity IpcInfoObjectType = 17 IpcInfoObjectTypeLedger IpcInfoObjectType = 18 IpcInfoObjectTypeMainDevice IpcInfoObjectType = 19 IpcInfoObjectTypeTaskName IpcInfoObjectType = 20 IpcInfoObjectTypeSubsystem IpcInfoObjectType = 21 IpcInfoObjectTypeIODoneQueue IpcInfoObjectType = 22 IpcInfoObjectTypeSemaphore IpcInfoObjectType = 23 IpcInfoObjectTypeLockSet IpcInfoObjectType = 24 IpcInfoObjectTypeClock IpcInfoObjectType = 25 IpcInfoObjectTypeClockCtrl IpcInfoObjectType = 26 IpcInfoObjectTypeIokitIdent IpcInfoObjectType = 27 IpcInfoObjectTypeNamedEntry IpcInfoObjectType = 28 IpcInfoObjectTypeIokitConnect IpcInfoObjectType = 29 IpcInfoObjectTypeIokitObject IpcInfoObjectType = 30 IpcInfoObjectTypeUpl IpcInfoObjectType = 31 IpcInfoObjectTypeMemObjControl IpcInfoObjectType = 32 IpcInfoObjectTypeAuSessionport IpcInfoObjectType = 33 IpcInfoObjectTypeFileport IpcInfoObjectType = 34 IpcInfoObjectTypeLabelh IpcInfoObjectType = 35 IpcInfoObjectTypeTaskResume IpcInfoObjectType = 36 IpcInfoObjectTypeVoucher IpcInfoObjectType = 37 IpcInfoObjectTypeVoucherAttrControl IpcInfoObjectType = 38 IpcInfoObjectTypeWorkInterval IpcInfoObjectType = 39 IpcInfoObjectTypeUxHandler IpcInfoObjectType = 40 IpcInfoObjectTypeUextObject IpcInfoObjectType = 41 IpcInfoObjectTypeArcadeReg IpcInfoObjectType = 42 IpcInfoObjectTypeEventlink IpcInfoObjectType = 43 IpcInfoObjectTypeTaskInspect IpcInfoObjectType = 44 IpcInfoObjectTypeTaskRead IpcInfoObjectType = 45 IpcInfoObjectTypeThreadInspect IpcInfoObjectType = 46 IpcInfoObjectTypeThreadRead IpcInfoObjectType = 47 IpcInfoObjectTypeSuidCred IpcInfoObjectType = 48 IpcInfoObjectTypeHypervisor IpcInfoObjectType = 49 IpcInfoObjectTypeTaskIDToken IpcInfoObjectType = 50 IpcInfoObjectTypeTaskFatal IpcInfoObjectType = 51 IpcInfoObjectTypeKcdata IpcInfoObjectType = 52 IpcInfoObjectTypeExclavesResource IpcInfoObjectType = 53 IpcInfoObjectTypeThreadResume IpcInfoObjectType = 54 IpcInfoObjectTypeUnknown IpcInfoObjectType = 4294967295 )
func (IpcInfoObjectType) String ¶ added in v0.17.0
func (e IpcInfoObjectType) String() string
String returns the IpcInfoObjectType constant's name, or its numeric form when the value is not a known constant.
type LaunchDataType ¶ added in v0.17.0
type LaunchDataType int32
const ( LaunchDataTypeDictionary LaunchDataType = 1 LaunchDataTypeArray LaunchDataType = 2 LaunchDataTypeFd LaunchDataType = 3 LaunchDataTypeInteger LaunchDataType = 4 LaunchDataTypeReal LaunchDataType = 5 LaunchDataTypeBool LaunchDataType = 6 LaunchDataTypeString LaunchDataType = 7 LaunchDataTypeOpaque LaunchDataType = 8 LaunchDataTypeErrno LaunchDataType = 9 LaunchDataTypeMachport LaunchDataType = 10 )
func (LaunchDataType) String ¶ added in v0.17.0
func (e LaunchDataType) String() string
String returns the LaunchDataType constant's name, or its numeric form when the value is not a known constant.
type MDLabelDomain ¶
type MDLabelDomain int32
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
String returns the MDLabelDomain constant's name, or its numeric form when the value is not a known constant.
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int32
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
String returns the MDQueryOptionFlags constant's name, or its numeric form when the value is not a known constant.
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int32
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
String returns the MDQuerySortOptionFlags constant's name, or its numeric form when the value is not a known constant.
type MPSAxisAlignedBoundingBox ¶
An axis aligned bounding box with a min and max point
type MPSIntersectionDistance ¶
type MPSIntersectionDistance struct {
Distance float32
}
Returned intersection result which contains the distance from the ray origin to the intersection point This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndex ¶
Intersection result which contains the distance from the ray origin to the intersection point and the index of the intersected primitive This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndex ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndex struct {
Distance float32
PrimitiveIndex uint32
BufferIndex uint32
}
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. This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates struct {
Distance float32
PrimitiveIndex uint32
BufferIndex uint32
Coordinates unsafe.Pointer
}
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. This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex struct {
Distance float32
PrimitiveIndex uint32
BufferIndex uint32
InstanceIndex uint32
}
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. This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates struct {
Distance float32
PrimitiveIndex uint32
BufferIndex uint32
InstanceIndex uint32
Coordinates unsafe.Pointer
}
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. This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexCoordinates struct {
Distance float32
PrimitiveIndex uint32
Coordinates unsafe.Pointer
}
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. This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexInstanceIndex ¶
type MPSIntersectionDistancePrimitiveIndexInstanceIndex struct {
Distance float32
PrimitiveIndex uint32
InstanceIndex uint32
}
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. This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates struct {
Distance float32
PrimitiveIndex uint32
InstanceIndex uint32
Coordinates unsafe.Pointer
}
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. This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSPackedFloat3 ¶
type MPSPackedFloat3 struct {
// contains filtered or unexported fields
}
The C layout cannot be reproduced as a plain Go value struct, so it is held as its exact-size bytes and read through the typed As* accessors below. It is pointer-only: never pass it by value.
type MPSRayOriginDirection ¶
Represents a 3D ray with an origin and a direction This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSRayOriginMaskDirectionMaxDistance ¶
type MPSRayOriginMaskDirectionMaxDistance struct {
Origin MPSPackedFloat3
Mask uint32
Direction MPSPackedFloat3
MaxDistance float32
}
Represents a 3D ray with an origin, a direction, and a mask to filter out intersections 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
}
Represents a 3D ray with an origin, a direction, and an intersection distance range from the origin 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
}
Represents a 3D ray with an origin and a direction This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MachVMRangeFlags ¶ added in v0.17.0
type MachVMRangeFlags uint64
Bitmask — values may be combined with |.
const (
MachVMRangeFlagsNone MachVMRangeFlags = 0
)
func (MachVMRangeFlags) String ¶ added in v0.17.0
func (e MachVMRangeFlags) String() string
String returns the MachVMRangeFlags constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeFlavor ¶ added in v0.17.0
type MachVMRangeFlavor uint32
const ( MachVMRangeFlavorInvalid MachVMRangeFlavor = 0 MachVMRangeFlavorV1 MachVMRangeFlavor = 1 )
func (MachVMRangeFlavor) String ¶ added in v0.17.0
func (e MachVMRangeFlavor) String() string
String returns the MachVMRangeFlavor constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeTag ¶ added in v0.17.0
type MachVMRangeTag uint16
const ( MachVMRangeTagDefault MachVMRangeTag = 0 MachVMRangeTagData MachVMRangeTag = 1 MachVMRangeTagFixed MachVMRangeTag = 2 )
func (MachVMRangeTag) String ¶ added in v0.17.0
func (e MachVMRangeTag) String() string
String returns the MachVMRangeTag constant's name, or its numeric form when the value is not a known constant.
type MpoFlags ¶ added in v0.17.0
type MpoFlags uint32
Bitmask — values may be combined with |.
const ( MpoFlagsPort MpoFlags = 0 MpoFlagsServicePort MpoFlags = 1024 MpoFlagsConnectionPort MpoFlags = 2048 MpoFlagsReplyPort MpoFlags = 4096 MpoFlagsWeakReplyPort MpoFlags = 16384 MpoFlagsNotificationPort MpoFlags = 17408 MpoFlagsExceptionPort MpoFlags = 32768 MpoFlagsConnectionPortWithPortArray MpoFlags = 65536 )
type Perm ¶ added in v0.17.0
type Perm int32
const ( PermReadData Perm = 2 PermListDirectory Perm = 2 PermWriteData Perm = 4 PermAddFile Perm = 4 PermExecute Perm = 8 PermSearch Perm = 8 PermDelete Perm = 16 PermAppendData Perm = 32 PermAddSubdirectory Perm = 32 PermDeleteChild Perm = 64 PermReadAttributes Perm = 128 PermWriteAttributes Perm = 256 PermReadExtattributes Perm = 512 PermWriteExtattributes Perm = 1024 PermReadSecurity Perm = 2048 PermWriteSecurity Perm = 4096 PermChangeOwner Perm = 8192 PermSynchronize Perm = 1048576 )
type PolygonAccelerationStructure ¶ added in v0.17.0
type PolygonAccelerationStructure struct {
AccelerationStructure
}
PolygonAccelerationStructure is an idiomatic wrapper over the Objective-C class MPSPolygonAccelerationStructure.
PolygonAccelerationStructure is an abstract base — you do not construct it directly. Construct one of QuadrilateralAccelerationStructure, TriangleAccelerationStructure and pass it where a PolygonAccelerationStructure is accepted.
func PolygonAccelerationStructureFromID ¶ added in v0.17.0
func PolygonAccelerationStructureFromID(id objc.ID) *PolygonAccelerationStructure
PolygonAccelerationStructureFromID adopts an existing Objective-C object as a PolygonAccelerationStructure (nil for 0), retaining it and registering a release finalizer.
func (*PolygonAccelerationStructure) IndexBufferOffset ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) IndexBufferOffset() int
IndexBufferOffset returns 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 (*PolygonAccelerationStructure) MaskBufferOffset ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) MaskBufferOffset() int
MaskBufferOffset returns 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 (*PolygonAccelerationStructure) PolygonBuffers ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) PolygonBuffers() []*PolygonBuffer
PolygonBuffers returns 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.
PolygonBuffers returns the collection as a Go slice.
func (*PolygonAccelerationStructure) PolygonCount ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) PolygonCount() int
PolygonCount returns 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 (*PolygonAccelerationStructure) PolygonType ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) PolygonType() PolygonType
PolygonType returns the type of polygon. Defaults to MPSPolygonTypeTriangle. Changes to this property require rebuilding the acceleration structure.
func (*PolygonAccelerationStructure) VertexBufferOffset ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) VertexBufferOffset() int
VertexBufferOffset returns 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 (*PolygonAccelerationStructure) VertexStride ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) VertexStride() int
VertexStride returns 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. 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.
func (*PolygonAccelerationStructure) WithIndexBufferOffset ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithIndexBufferOffset(indexBufferOffset int) *PolygonAccelerationStructure
WithIndexBufferOffset sets 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 (*PolygonAccelerationStructure) WithMaskBufferOffset ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *PolygonAccelerationStructure
WithMaskBufferOffset sets 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 (*PolygonAccelerationStructure) WithPolygonBuffers ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithPolygonBuffers(items ...*PolygonBuffer) *PolygonAccelerationStructure
WithPolygonBuffers sets 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 (*PolygonAccelerationStructure) WithPolygonCount ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithPolygonCount(polygonCount int) *PolygonAccelerationStructure
WithPolygonCount sets 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 (*PolygonAccelerationStructure) WithPolygonType ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithPolygonType(polygonType PolygonType) *PolygonAccelerationStructure
WithPolygonType sets the type of polygon. Defaults to MPSPolygonTypeTriangle. Changes to this property require rebuilding the acceleration structure.
func (*PolygonAccelerationStructure) WithUsage ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *PolygonAccelerationStructure
WithUsage sets acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.
func (*PolygonAccelerationStructure) WithVertexBufferOffset ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithVertexBufferOffset(vertexBufferOffset int) *PolygonAccelerationStructure
WithVertexBufferOffset sets 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 (*PolygonAccelerationStructure) WithVertexStride ¶ added in v0.17.0
func (pas *PolygonAccelerationStructure) WithVertexStride(vertexStride int) *PolygonAccelerationStructure
WithVertexStride sets 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. 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 PolygonAccelerationStructureProvider ¶ added in v0.17.0
type PolygonAccelerationStructureProvider interface {
objref.Object
// contains filtered or unexported methods
}
PolygonAccelerationStructureProvider is accepted wherever a MPSPolygonAccelerationStructure (or one of its subclasses) is expected.
type PolygonBuffer ¶ added in v0.17.0
PolygonBuffer is an idiomatic wrapper over the Objective-C class MPSPolygonBuffer.
func MPSPolygonBufferPolygonBuffer ¶
func MPSPolygonBufferPolygonBuffer() *PolygonBuffer
MPSPolygonBufferPolygonBuffer returns the mps polygon buffer polygon buffer.
func NewPolygonBuffer ¶ added in v0.17.0
func NewPolygonBuffer() *PolygonBuffer
NewPolygonBuffer creates a new PolygonBuffer.
func NewPolygonBufferWithCoder ¶ added in v0.17.0
func NewPolygonBufferWithCoder(aDecoder obj.Object) *PolygonBuffer
NewPolygonBufferWithCoder 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 PolygonBufferFromID ¶ added in v0.17.0
func PolygonBufferFromID(id objc.ID) *PolygonBuffer
PolygonBufferFromID adopts an existing Objective-C object as a PolygonBuffer (nil for 0), retaining it and registering a release finalizer.
func (*PolygonBuffer) Description ¶ added in v0.17.0
func (pb *PolygonBuffer) Description() string
Description returns the object's -description text.
func (*PolygonBuffer) IndexBufferOffset ¶ added in v0.17.0
func (pb *PolygonBuffer) IndexBufferOffset() int
IndexBufferOffset returns 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 (*PolygonBuffer) IsEqual ¶ added in v0.17.0
func (pb *PolygonBuffer) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*PolygonBuffer) IsKind ¶ added in v0.17.0
func (pb *PolygonBuffer) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*PolygonBuffer) MaskBufferOffset ¶ added in v0.17.0
func (pb *PolygonBuffer) MaskBufferOffset() int
MaskBufferOffset returns offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*PolygonBuffer) PolygonCount ¶ added in v0.17.0
func (pb *PolygonBuffer) PolygonCount() int
PolygonCount returns number of polygons. Changes to this property require rebuilding the acceleration structure.
func (*PolygonBuffer) String ¶ added in v0.17.0
func (pb *PolygonBuffer) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*PolygonBuffer) VertexBufferOffset ¶ added in v0.17.0
func (pb *PolygonBuffer) VertexBufferOffset() int
VertexBufferOffset returns offset, in bytes, into the vertex buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*PolygonBuffer) WithIndexBufferOffset ¶ added in v0.17.0
func (pb *PolygonBuffer) WithIndexBufferOffset(indexBufferOffset int) *PolygonBuffer
WithIndexBufferOffset sets 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 (*PolygonBuffer) WithMaskBufferOffset ¶ added in v0.17.0
func (pb *PolygonBuffer) WithMaskBufferOffset(maskBufferOffset int) *PolygonBuffer
WithMaskBufferOffset sets offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*PolygonBuffer) WithPolygonCount ¶ added in v0.17.0
func (pb *PolygonBuffer) WithPolygonCount(polygonCount int) *PolygonBuffer
WithPolygonCount sets number of polygons. Changes to this property require rebuilding the acceleration structure.
func (*PolygonBuffer) WithVertexBufferOffset ¶ added in v0.17.0
func (pb *PolygonBuffer) WithVertexBufferOffset(vertexBufferOffset int) *PolygonBuffer
WithVertexBufferOffset sets offset, in bytes, into the vertex buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
type PolygonType ¶ added in v0.17.0
type PolygonType uint64
const ( // Triangles with three vertices PolygonTypeTriangle PolygonType = 0 // Quadrilaterals with four vertices PolygonTypeQuadrilateral PolygonType = 1 )
func (PolygonType) String ¶ added in v0.17.0
func (e PolygonType) String() string
String returns the PolygonType constant's name, or its numeric form when the value is not a known constant.
type PtrauthKey ¶ added in v0.17.0
type PtrauthKey int32
const ( Ptrauth_key_none PtrauthKey = -1 Ptrauth_key_asia PtrauthKey = 0 Ptrauth_key_asib PtrauthKey = 1 Ptrauth_key_asda PtrauthKey = 2 Ptrauth_key_asdb PtrauthKey = 3 Ptrauth_key_process_independent_code PtrauthKey = 0 Ptrauth_key_process_dependent_code PtrauthKey = 1 Ptrauth_key_process_independent_data PtrauthKey = 2 Ptrauth_key_process_dependent_data PtrauthKey = 3 Ptrauth_key_return_address PtrauthKey = 1 Ptrauth_key_frame_pointer PtrauthKey = 3 Ptrauth_key_function_pointer PtrauthKey = 0 Ptrauth_key_block_function PtrauthKey = 0 Ptrauth_key_cxx_vtable_pointer PtrauthKey = 2 Ptrauth_key_method_list_pointer PtrauthKey = 2 Ptrauth_key_objc_isa_pointer PtrauthKey = 2 Ptrauth_key_objc_super_pointer PtrauthKey = 2 Ptrauth_key_objc_sel_pointer PtrauthKey = 3 Ptrauth_key_objc_class_ro_pointer PtrauthKey = 2 Ptrauth_key_block_descriptor_pointer PtrauthKey = 2 Ptrauth_key_init_fini_pointer PtrauthKey = 0 )
func (PtrauthKey) String ¶ added in v0.17.0
func (e PtrauthKey) String() string
String returns the PtrauthKey constant's name, or its numeric form when the value is not a known constant.
type QuadrilateralAccelerationStructure ¶ added in v0.17.0
type QuadrilateralAccelerationStructure struct {
PolygonAccelerationStructure
}
QuadrilateralAccelerationStructure is an idiomatic wrapper over the Objective-C class MPSQuadrilateralAccelerationStructure.
It embeds PolygonAccelerationStructure, promoting that type's methods.
func NewQuadrilateralAccelerationStructure ¶ added in v0.17.0
func NewQuadrilateralAccelerationStructure() *QuadrilateralAccelerationStructure
NewQuadrilateralAccelerationStructure creates a new QuadrilateralAccelerationStructure.
func QuadrilateralAccelerationStructureFromID ¶ added in v0.17.0
func QuadrilateralAccelerationStructureFromID(id objc.ID) *QuadrilateralAccelerationStructure
QuadrilateralAccelerationStructureFromID adopts an existing Objective-C object as a QuadrilateralAccelerationStructure (nil for 0), retaining it and registering a release finalizer.
func (*QuadrilateralAccelerationStructure) QuadrilateralCount ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) QuadrilateralCount() int
QuadrilateralCount returns number of quads. Changes to this property require rebuilding the acceleration structure. This is an alias for the polygonCount property.
func (*QuadrilateralAccelerationStructure) WithIndexBufferOffset ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithIndexBufferOffset(indexBufferOffset int) *QuadrilateralAccelerationStructure
WithIndexBufferOffset sets 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 (*QuadrilateralAccelerationStructure) WithMaskBufferOffset ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *QuadrilateralAccelerationStructure
WithMaskBufferOffset sets 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 (*QuadrilateralAccelerationStructure) WithPolygonBuffers ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithPolygonBuffers(items ...*PolygonBuffer) *QuadrilateralAccelerationStructure
WithPolygonBuffers sets 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 (*QuadrilateralAccelerationStructure) WithPolygonCount ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithPolygonCount(polygonCount int) *QuadrilateralAccelerationStructure
WithPolygonCount sets 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 (*QuadrilateralAccelerationStructure) WithPolygonType ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithPolygonType(polygonType PolygonType) *QuadrilateralAccelerationStructure
WithPolygonType sets the type of polygon. Defaults to MPSPolygonTypeTriangle. Changes to this property require rebuilding the acceleration structure.
func (*QuadrilateralAccelerationStructure) WithQuadrilateralCount ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithQuadrilateralCount(quadrilateralCount int) *QuadrilateralAccelerationStructure
WithQuadrilateralCount sets number of quads. Changes to this property require rebuilding the acceleration structure. This is an alias for the polygonCount property.
func (*QuadrilateralAccelerationStructure) WithUsage ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *QuadrilateralAccelerationStructure
WithUsage sets acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.
func (*QuadrilateralAccelerationStructure) WithVertexBufferOffset ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithVertexBufferOffset(vertexBufferOffset int) *QuadrilateralAccelerationStructure
WithVertexBufferOffset sets 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 (*QuadrilateralAccelerationStructure) WithVertexStride ¶ added in v0.17.0
func (qas *QuadrilateralAccelerationStructure) WithVertexStride(vertexStride int) *QuadrilateralAccelerationStructure
WithVertexStride sets 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. 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 RayDataType ¶ added in v0.17.0
type RayDataType uint64
Options for the MPSRayIntersector ray data type property
const ( // Use the MPSRayOriginDirection struct type RayDataTypeOriginDirection RayDataType = 0 // Use the MPSRayOriginMinDistanceDirectionMaxDistance struct type RayDataTypeOriginMinDistanceDirectionMaxDistance RayDataType = 1 // Use the MPSRayOriginMaxDistanceDirectionMask struct type RayDataTypeOriginMaskDirectionMaxDistance RayDataType = 2 // Use the MPSPackedRayOriginDirection struct type RayDataTypePackedOriginDirection RayDataType = 3 )
func (RayDataType) String ¶ added in v0.17.0
func (e RayDataType) String() string
String returns the RayDataType constant's name, or its numeric form when the value is not a known constant.
type RayIntersector ¶ added in v0.17.0
RayIntersector is an idiomatic wrapper over the Objective-C class MPSRayIntersector.
func NewRayIntersector ¶ added in v0.17.0
func NewRayIntersector() *RayIntersector
NewRayIntersector creates a new RayIntersector.
func RayIntersectorFromID ¶ added in v0.17.0
func RayIntersectorFromID(id objc.ID) *RayIntersector
RayIntersectorFromID adopts an existing Objective-C object as a RayIntersector (nil for 0), retaining it and registering a release finalizer.
func (*RayIntersector) BoundingBoxIntersectionTestType ¶ added in v0.17.0
func (ri *RayIntersector) BoundingBoxIntersectionTestType() BoundingBoxIntersectionTestType
BoundingBoxIntersectionTestType returns ray/bounding box intersection test type. Defaults to MPSBoundingBoxIntersectionTestTypeDefault.
func (*RayIntersector) Description ¶ added in v0.17.0
func (ri *RayIntersector) Description() string
Description returns the object's -description text.
func (*RayIntersector) EncodeWithCoder ¶ added in v0.17.0
func (ri *RayIntersector) EncodeWithCoder(coder obj.Object)
EncodeWithCoder encodes with coder.
func (*RayIntersector) IntersectionDataType ¶ added in v0.17.0
func (ri *RayIntersector) IntersectionDataType() IntersectionDataType
IntersectionDataType returns intersection data type. Defaults to MPSIntersectionDataTypeDistancePrimitiveIndexCoordinates.
func (*RayIntersector) IntersectionStride ¶ added in v0.17.0
func (ri *RayIntersector) IntersectionStride() int
IntersectionStride returns 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. 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 (*RayIntersector) IsEqual ¶ added in v0.17.0
func (ri *RayIntersector) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*RayIntersector) IsKind ¶ added in v0.17.0
func (ri *RayIntersector) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*RayIntersector) RayDataType ¶ added in v0.17.0
func (ri *RayIntersector) RayDataType() RayDataType
RayDataType returns ray data type. Defaults to MPSRayDataTypeOriginDirection.
func (*RayIntersector) RayMask ¶ added in v0.17.0
func (ri *RayIntersector) RayMask() int
RayMask returns 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 (*RayIntersector) RayMaskOperator ¶ added in v0.17.0
func (ri *RayIntersector) RayMaskOperator() RayMaskOperator
RayMaskOperator returns the operator to apply to determine whether to accept an intersection between a ray and a primitive or instance. Defaults to MPSRayMaskOperatorAnd.
func (*RayIntersector) RayMaskOptions ¶ added in v0.17.0
func (ri *RayIntersector) RayMaskOptions() RayMaskOptions
RayMaskOptions returns whether to enable primitive and instance masks. Defaults to MPSRayMaskOptionNone. 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 (*RayIntersector) RayStride ¶ added in v0.17.0
func (ri *RayIntersector) RayStride() int
RayStride returns 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. 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 (*RayIntersector) RecommendedMinimumRayBatchSizeForRayCount ¶ added in v0.17.0
func (ri *RayIntersector) RecommendedMinimumRayBatchSizeForRayCount(rayCount int) int
RecommendedMinimumRayBatchSizeForRayCount get the recommended minimum number of rays to submit for intersection in one batch 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.
func (*RayIntersector) String ¶ added in v0.17.0
func (ri *RayIntersector) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*RayIntersector) TriangleIntersectionTestType ¶ added in v0.17.0
func (ri *RayIntersector) TriangleIntersectionTestType() TriangleIntersectionTestType
TriangleIntersectionTestType returns 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.
func (*RayIntersector) WithBoundingBoxIntersectionTestType ¶ added in v0.17.0
func (ri *RayIntersector) WithBoundingBoxIntersectionTestType(boundingBoxIntersectionTestType BoundingBoxIntersectionTestType) *RayIntersector
WithBoundingBoxIntersectionTestType sets ray/bounding box intersection test type. Defaults to MPSBoundingBoxIntersectionTestTypeDefault.
func (*RayIntersector) WithIntersectionDataType ¶ added in v0.17.0
func (ri *RayIntersector) WithIntersectionDataType(intersectionDataType IntersectionDataType) *RayIntersector
WithIntersectionDataType sets intersection data type. Defaults to MPSIntersectionDataTypeDistancePrimitiveIndexCoordinates.
func (*RayIntersector) WithIntersectionStride ¶ added in v0.17.0
func (ri *RayIntersector) WithIntersectionStride(intersectionStride int) *RayIntersector
WithIntersectionStride sets 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. 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 (*RayIntersector) WithRayDataType ¶ added in v0.17.0
func (ri *RayIntersector) WithRayDataType(rayDataType RayDataType) *RayIntersector
WithRayDataType sets ray data type. Defaults to MPSRayDataTypeOriginDirection.
func (*RayIntersector) WithRayMask ¶ added in v0.17.0
func (ri *RayIntersector) WithRayMask(rayMask int) *RayIntersector
WithRayMask sets 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 (*RayIntersector) WithRayMaskOperator ¶ added in v0.17.0
func (ri *RayIntersector) WithRayMaskOperator(rayMaskOperator RayMaskOperator) *RayIntersector
WithRayMaskOperator sets the operator to apply to determine whether to accept an intersection between a ray and a primitive or instance. Defaults to MPSRayMaskOperatorAnd.
func (*RayIntersector) WithRayMaskOptions ¶ added in v0.17.0
func (ri *RayIntersector) WithRayMaskOptions(rayMaskOptions RayMaskOptions) *RayIntersector
WithRayMaskOptions sets whether to enable primitive and instance masks. Defaults to MPSRayMaskOptionNone. 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 (*RayIntersector) WithRayStride ¶ added in v0.17.0
func (ri *RayIntersector) WithRayStride(rayStride int) *RayIntersector
WithRayStride sets 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. 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 (*RayIntersector) WithTriangleIntersectionTestType ¶ added in v0.17.0
func (ri *RayIntersector) WithTriangleIntersectionTestType(triangleIntersectionTestType TriangleIntersectionTestType) *RayIntersector
WithTriangleIntersectionTestType sets 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 RayMaskOperator ¶ added in v0.17.0
type RayMaskOperator uint64
Options for the MPSRayIntersector ray mask operator property
const ( // Accept the intersection if (primitive mask & ray mask) != 0. RayMaskOperatorAnd RayMaskOperator = 0 // Accept the intersection if ~(primitive mask & ray mask) != 0. RayMaskOperatorNotAnd RayMaskOperator = 1 // Accept the intersection if (primitive mask | ray mask) != 0. RayMaskOperatorOr RayMaskOperator = 2 // Accept the intersection if ~(primitive mask | ray mask) != 0. RayMaskOperatorNotOr RayMaskOperator = 3 // Accept the intersection if (primitive mask ^ ray mask) != 0. RayMaskOperatorXor RayMaskOperator = 4 // Accept the intersection if ~(primitive mask ^ ray mask) != 0. RayMaskOperatorNotXor RayMaskOperator = 5 // Accept the intersection if primitive mask < ray mask. RayMaskOperatorLessThan RayMaskOperator = 6 // Accept the intersection if primitive mask <= ray mask. RayMaskOperatorLessThanOrEqualTo RayMaskOperator = 7 // Accept the intersection if primitive mask > ray mask. RayMaskOperatorGreaterThan RayMaskOperator = 8 // Accept the intersection if primitive mask >= ray mask. RayMaskOperatorGreaterThanOrEqualTo RayMaskOperator = 9 // Accept the intersection if primitive mask == ray mask. RayMaskOperatorEqual RayMaskOperator = 10 // Accept the intersection if primitive mask != ray mask. RayMaskOperatorNotEqual RayMaskOperator = 11 )
func (RayMaskOperator) String ¶ added in v0.17.0
func (e RayMaskOperator) String() string
String returns the RayMaskOperator constant's name, or its numeric form when the value is not a known constant.
type RayMaskOptions ¶ added in v0.17.0
type RayMaskOptions uint64
Options for the MPSRayIntersector ray mask options property Bitmask — values may be combined with |.
const ( // Disable primitive and instance masks RayMaskOptionNone RayMaskOptions = 0 // Enable primitive masks RayMaskOptionPrimitive RayMaskOptions = 1 // Enable instance masks RayMaskOptionInstance RayMaskOptions = 2 )
func (RayMaskOptions) String ¶ added in v0.17.0
func (e RayMaskOptions) String() string
String returns the RayMaskOptions constant's name, or its numeric form when the value is not a known constant.
type SVGF ¶ added in v0.17.0
SVGF is an idiomatic wrapper over the Objective-C class MPSSVGF.
func SVGFFromID ¶ added in v0.17.0
SVGFFromID adopts an existing Objective-C object as a SVGF (nil for 0), retaining it and registering a release finalizer.
func (*SVGF) BilateralFilterRadius ¶ added in v0.17.0
BilateralFilterRadius returns the radius of the bilateral filter. Defaults to 2 resulting in a 5x5 filter.
func (*SVGF) BilateralFilterSigma ¶ added in v0.17.0
BilateralFilterSigma returns the sigma value of the Gaussian function used by the bilateral filter. Must be greater than zero. Defaults to 1.2.
func (*SVGF) ChannelCount ¶ added in v0.17.0
ChannelCount returns the number of channels to filter in the source image. Must be at least one and at most three. Defaults to 3.
func (*SVGF) ChannelCount2 ¶ added in v0.17.0
ChannelCount2 returns the number of channels to filter in the second source image. Must be at least one and at most three. Defaults to 3.
func (*SVGF) DepthWeight ¶ added in v0.17.0
DepthWeight returns 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 (*SVGF) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*SVGF) EncodeWithCoder ¶ added in v0.17.0
EncodeWithCoder encodes with coder.
func (*SVGF) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*SVGF) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*SVGF) LuminanceWeight ¶ added in v0.17.0
LuminanceWeight returns 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 (*SVGF) MinimumFramesForVarianceEstimation ¶ added in v0.17.0
MinimumFramesForVarianceEstimation returns 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 (*SVGF) NormalWeight ¶ added in v0.17.0
NormalWeight returns 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 (*SVGF) ReprojectionThreshold ¶ added in v0.17.0
ReprojectionThreshold returns 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 (*SVGF) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*SVGF) TemporalReprojectionBlendFactor ¶ added in v0.17.0
TemporalReprojectionBlendFactor returns 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 (*SVGF) TemporalWeighting ¶ added in v0.17.0
func (s *SVGF) TemporalWeighting() TemporalWeighting
TemporalWeighting returns how to weight samples during temporal reprojection. Defaults to MPSTemporalWeightingAverage.
func (*SVGF) VarianceEstimationRadius ¶ added in v0.17.0
VarianceEstimationRadius returns 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 (*SVGF) VarianceEstimationSigma ¶ added in v0.17.0
VarianceEstimationSigma returns 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 (*SVGF) VariancePrefilterRadius ¶ added in v0.17.0
VariancePrefilterRadius returns the radius of the variance pre-filter of the bilateral filter. Defaults to 1 resulting in a 3x3 filter.
func (*SVGF) VariancePrefilterSigma ¶ added in v0.17.0
VariancePrefilterSigma returns 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.
func (*SVGF) WithBilateralFilterRadius ¶ added in v0.17.0
WithBilateralFilterRadius sets the radius of the bilateral filter. Defaults to 2 resulting in a 5x5 filter.
func (*SVGF) WithBilateralFilterSigma ¶ added in v0.17.0
WithBilateralFilterSigma sets the sigma value of the Gaussian function used by the bilateral filter. Must be greater than zero. Defaults to 1.2.
func (*SVGF) WithChannelCount ¶ added in v0.17.0
WithChannelCount sets the number of channels to filter in the source image. Must be at least one and at most three. Defaults to 3.
func (*SVGF) WithChannelCount2 ¶ added in v0.17.0
WithChannelCount2 sets the number of channels to filter in the second source image. Must be at least one and at most three. Defaults to 3.
func (*SVGF) WithDepthWeight ¶ added in v0.17.0
WithDepthWeight sets 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 (*SVGF) WithLuminanceWeight ¶ added in v0.17.0
WithLuminanceWeight sets 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 (*SVGF) WithMinimumFramesForVarianceEstimation ¶ added in v0.17.0
WithMinimumFramesForVarianceEstimation sets 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 (*SVGF) WithNormalWeight ¶ added in v0.17.0
WithNormalWeight sets 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 (*SVGF) WithReprojectionThreshold ¶ added in v0.17.0
WithReprojectionThreshold sets 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 (*SVGF) WithTemporalReprojectionBlendFactor ¶ added in v0.17.0
WithTemporalReprojectionBlendFactor sets 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 (*SVGF) WithTemporalWeighting ¶ added in v0.17.0
func (s *SVGF) WithTemporalWeighting(temporalWeighting TemporalWeighting) *SVGF
WithTemporalWeighting sets how to weight samples during temporal reprojection. Defaults to MPSTemporalWeightingAverage.
func (*SVGF) WithVarianceEstimationRadius ¶ added in v0.17.0
WithVarianceEstimationRadius sets 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 (*SVGF) WithVarianceEstimationSigma ¶ added in v0.17.0
WithVarianceEstimationSigma sets 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 (*SVGF) WithVariancePrefilterRadius ¶ added in v0.17.0
WithVariancePrefilterRadius sets the radius of the variance pre-filter of the bilateral filter. Defaults to 1 resulting in a 3x3 filter.
func (*SVGF) WithVariancePrefilterSigma ¶ added in v0.17.0
WithVariancePrefilterSigma sets 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 SVGFDefaultTextureAllocator ¶ added in v0.17.0
SVGFDefaultTextureAllocator is an idiomatic wrapper over the Objective-C class MPSSVGFDefaultTextureAllocator.
func NewSVGFDefaultTextureAllocator ¶ added in v0.17.0
func NewSVGFDefaultTextureAllocator() *SVGFDefaultTextureAllocator
NewSVGFDefaultTextureAllocator creates a new SVGFDefaultTextureAllocator.
func SVGFDefaultTextureAllocatorFromID ¶ added in v0.17.0
func SVGFDefaultTextureAllocatorFromID(id objc.ID) *SVGFDefaultTextureAllocator
SVGFDefaultTextureAllocatorFromID adopts an existing Objective-C object as a SVGFDefaultTextureAllocator (nil for 0), retaining it and registering a release finalizer.
func (*SVGFDefaultTextureAllocator) AllocatedTextureCount ¶ added in v0.17.0
func (sdta *SVGFDefaultTextureAllocator) AllocatedTextureCount() int
AllocatedTextureCount returns the number of textures which have been allocated from this allocator
func (*SVGFDefaultTextureAllocator) Description ¶ added in v0.17.0
func (sdta *SVGFDefaultTextureAllocator) Description() string
Description returns the object's -description text.
func (*SVGFDefaultTextureAllocator) IsEqual ¶ added in v0.17.0
func (sdta *SVGFDefaultTextureAllocator) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*SVGFDefaultTextureAllocator) IsKind ¶ added in v0.17.0
func (sdta *SVGFDefaultTextureAllocator) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*SVGFDefaultTextureAllocator) Reset ¶ added in v0.17.0
func (sdta *SVGFDefaultTextureAllocator) Reset()
Reset remove all textures from the cache
func (*SVGFDefaultTextureAllocator) String ¶ added in v0.17.0
func (sdta *SVGFDefaultTextureAllocator) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type SVGFDenoiser ¶ added in v0.17.0
SVGFDenoiser is an idiomatic wrapper over the Objective-C class MPSSVGFDenoiser.
func NewSVGFDenoiser ¶ added in v0.17.0
func NewSVGFDenoiser() *SVGFDenoiser
NewSVGFDenoiser creates a new SVGFDenoiser.
func SVGFDenoiserFromID ¶ added in v0.17.0
func SVGFDenoiserFromID(id objc.ID) *SVGFDenoiser
SVGFDenoiserFromID adopts an existing Objective-C object as a SVGFDenoiser (nil for 0), retaining it and registering a release finalizer.
func (*SVGFDenoiser) BilateralFilterIterations ¶ added in v0.17.0
func (sd *SVGFDenoiser) BilateralFilterIterations() int
BilateralFilterIterations returns 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 (*SVGFDenoiser) ClearTemporalHistory ¶ added in v0.17.0
func (sd *SVGFDenoiser) ClearTemporalHistory()
ClearTemporalHistory clear the temporal history. Reprojection and temporal accumulation will restart on the next call to encodeToCommandBuffer:
func (*SVGFDenoiser) Description ¶ added in v0.17.0
func (sd *SVGFDenoiser) Description() string
Description returns the object's -description text.
func (*SVGFDenoiser) IsEqual ¶ added in v0.17.0
func (sd *SVGFDenoiser) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*SVGFDenoiser) IsKind ¶ added in v0.17.0
func (sd *SVGFDenoiser) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*SVGFDenoiser) ReleaseTemporaryTextures ¶ added in v0.17.0
func (sd *SVGFDenoiser) ReleaseTemporaryTextures()
ReleaseTemporaryTextures return any temporary textures to the texture allocator. Also clears the temporal history. This should be called before resizing the source texture(s).
func (*SVGFDenoiser) String ¶ added in v0.17.0
func (sd *SVGFDenoiser) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*SVGFDenoiser) Svgf ¶ added in v0.17.0
func (sd *SVGFDenoiser) Svgf() *SVGF
Svgf returns the underlying MPSSVGF kernels object which will be used for denoising. Use this object to customize the denoising process.
func (*SVGFDenoiser) WithBilateralFilterIterations ¶ added in v0.17.0
func (sd *SVGFDenoiser) WithBilateralFilterIterations(bilateralFilterIterations int) *SVGFDenoiser
WithBilateralFilterIterations sets 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.
type SVGFTextureAllocator ¶ added in v0.17.0
type SVGFTextureAllocator interface {
TextureWithPixelFormatWidthHeight(pixelFormat obj.Object, width int, height int) obj.Object
ReturnTexture(texture obj.Object)
}
SVGFTextureAllocator is the Go form of the Objective-C protocol MPSSVGFTextureAllocator.
type TemporalAA ¶ added in v0.17.0
TemporalAA is an idiomatic wrapper over the Objective-C class MPSTemporalAA.
func NewTemporalAA ¶ added in v0.17.0
func NewTemporalAA() *TemporalAA
NewTemporalAA creates a new TemporalAA.
func TemporalAAFromID ¶ added in v0.17.0
func TemporalAAFromID(id objc.ID) *TemporalAA
TemporalAAFromID adopts an existing Objective-C object as a TemporalAA (nil for 0), retaining it and registering a release finalizer.
func (*TemporalAA) BlendFactor ¶ added in v0.17.0
func (ta *TemporalAA) BlendFactor() float32
BlendFactor returns 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 (*TemporalAA) Description ¶ added in v0.17.0
func (ta *TemporalAA) Description() string
Description returns the object's -description text.
func (*TemporalAA) EncodeWithCoder ¶ added in v0.17.0
func (ta *TemporalAA) EncodeWithCoder(coder obj.Object)
EncodeWithCoder encodes with coder.
func (*TemporalAA) IsEqual ¶ added in v0.17.0
func (ta *TemporalAA) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*TemporalAA) IsKind ¶ added in v0.17.0
func (ta *TemporalAA) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*TemporalAA) String ¶ added in v0.17.0
func (ta *TemporalAA) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*TemporalAA) WithBlendFactor ¶ added in v0.17.0
func (ta *TemporalAA) WithBlendFactor(blendFactor float32) *TemporalAA
WithBlendFactor sets 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.
type TemporalWeighting ¶ added in v0.17.0
type TemporalWeighting uint64
Controls how samples are weighted over time
const ( // 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. TemporalWeightingAverage TemporalWeighting = 0 // 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. TemporalWeightingExponentialMovingAverage TemporalWeighting = 1 )
func (TemporalWeighting) String ¶ added in v0.17.0
func (e TemporalWeighting) String() string
String returns the TemporalWeighting constant's name, or its numeric form when the value is not a known constant.
type TransformType ¶ added in v0.17.0
type TransformType uint64
Instance transformation type options
const ( // Instance transformations are represented by a 4x4 column major matrix of 32 bit floats TransformTypeFloat4x4 TransformType = 0 // 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. TransformTypeIdentity TransformType = 1 )
func (TransformType) String ¶ added in v0.17.0
func (e TransformType) String() string
String returns the TransformType constant's name, or its numeric form when the value is not a known constant.
type TriangleAccelerationStructure ¶ added in v0.17.0
type TriangleAccelerationStructure struct {
PolygonAccelerationStructure
}
TriangleAccelerationStructure is an idiomatic wrapper over the Objective-C class MPSTriangleAccelerationStructure.
It embeds PolygonAccelerationStructure, promoting that type's methods.
func NewTriangleAccelerationStructure ¶ added in v0.17.0
func NewTriangleAccelerationStructure() *TriangleAccelerationStructure
NewTriangleAccelerationStructure creates a new TriangleAccelerationStructure.
func TriangleAccelerationStructureFromID ¶ added in v0.17.0
func TriangleAccelerationStructureFromID(id objc.ID) *TriangleAccelerationStructure
TriangleAccelerationStructureFromID adopts an existing Objective-C object as a TriangleAccelerationStructure (nil for 0), retaining it and registering a release finalizer.
func (*TriangleAccelerationStructure) TriangleCount ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) TriangleCount() int
TriangleCount returns number of triangles. Changes to this property require rebuilding the acceleration structure. Note that this property is an alias for the polygonCount property.
func (*TriangleAccelerationStructure) WithIndexBufferOffset ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithIndexBufferOffset(indexBufferOffset int) *TriangleAccelerationStructure
WithIndexBufferOffset sets 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 (*TriangleAccelerationStructure) WithMaskBufferOffset ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithMaskBufferOffset(maskBufferOffset int) *TriangleAccelerationStructure
WithMaskBufferOffset sets 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 (*TriangleAccelerationStructure) WithPolygonBuffers ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithPolygonBuffers(items ...*PolygonBuffer) *TriangleAccelerationStructure
WithPolygonBuffers sets 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 (*TriangleAccelerationStructure) WithPolygonCount ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithPolygonCount(polygonCount int) *TriangleAccelerationStructure
WithPolygonCount sets 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 (*TriangleAccelerationStructure) WithPolygonType ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithPolygonType(polygonType PolygonType) *TriangleAccelerationStructure
WithPolygonType sets the type of polygon. Defaults to MPSPolygonTypeTriangle. Changes to this property require rebuilding the acceleration structure.
func (*TriangleAccelerationStructure) WithTriangleCount ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithTriangleCount(triangleCount int) *TriangleAccelerationStructure
WithTriangleCount sets number of triangles. Changes to this property require rebuilding the acceleration structure. Note that this property is an alias for the polygonCount property.
func (*TriangleAccelerationStructure) WithUsage ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithUsage(usage AccelerationStructureUsage) *TriangleAccelerationStructure
WithUsage sets acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.
func (*TriangleAccelerationStructure) WithVertexBufferOffset ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithVertexBufferOffset(vertexBufferOffset int) *TriangleAccelerationStructure
WithVertexBufferOffset sets 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 (*TriangleAccelerationStructure) WithVertexStride ¶ added in v0.17.0
func (tas *TriangleAccelerationStructure) WithVertexStride(vertexStride int) *TriangleAccelerationStructure
WithVertexStride sets 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. 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 TriangleIntersectionTestType ¶ added in v0.17.0
type TriangleIntersectionTestType uint64
Options for the MPSRayIntersector triangle intersection test type property
const ( // Use the default ray/triangle intersection test TriangleIntersectionTestTypeDefault TriangleIntersectionTestType = 0 // 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. TriangleIntersectionTestTypeWatertight TriangleIntersectionTestType = 1 )
func (TriangleIntersectionTestType) String ¶ added in v0.17.0
func (e TriangleIntersectionTestType) String() string
String returns the TriangleIntersectionTestType constant's name, or its numeric form when the value is not a known constant.
type VirtualMemoryGuardExceptionCode ¶ added in v0.17.0
type VirtualMemoryGuardExceptionCode uint32
const ( KGUARD_EXC_DEALLOC_GAP VirtualMemoryGuardExceptionCode = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE VirtualMemoryGuardExceptionCode = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE VirtualMemoryGuardExceptionCode = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE VirtualMemoryGuardExceptionCode = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE VirtualMemoryGuardExceptionCode = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE VirtualMemoryGuardExceptionCode = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE VirtualMemoryGuardExceptionCode = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION VirtualMemoryGuardExceptionCode = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY VirtualMemoryGuardExceptionCode = 13 KGUARD_EXC_SEC_ACCESS_FAULT VirtualMemoryGuardExceptionCode = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT VirtualMemoryGuardExceptionCode = 99 KGUARD_EXC_SEC_COPY_DENIED VirtualMemoryGuardExceptionCode = 100 KGUARD_EXC_SEC_SHARING_DENIED VirtualMemoryGuardExceptionCode = 101 KGUARD_EXC_MTE_SYNC_FAULT VirtualMemoryGuardExceptionCode = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT VirtualMemoryGuardExceptionCode = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT VirtualMemoryGuardExceptionCode = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT VirtualMemoryGuardExceptionCode = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT VirtualMemoryGuardExceptionCode = 204 )
func (VirtualMemoryGuardExceptionCode) String ¶ added in v0.17.0
func (e VirtualMemoryGuardExceptionCode) String() string
String returns the VirtualMemoryGuardExceptionCode constant's name, or its numeric form when the value is not a known constant.
type XpcListenerCreateFlags ¶ added in v0.17.0
type XpcListenerCreateFlags uint64
Bitmask — values may be combined with |.
const ( XpcListenerCreateFlagsNone XpcListenerCreateFlags = 0 XpcListenerCreateFlagsInactive XpcListenerCreateFlags = 1 XpcListenerCreateFlagsForceMach XpcListenerCreateFlags = 2 XpcListenerCreateFlagsForceXpcservice XpcListenerCreateFlags = 4 )
func (XpcListenerCreateFlags) String ¶ added in v0.17.0
func (e XpcListenerCreateFlags) String() string
String returns the XpcListenerCreateFlags constant's name, or its numeric form when the value is not a known constant.
type XpcSessionCreateFlags ¶ added in v0.17.0
type XpcSessionCreateFlags uint64
Bitmask — values may be combined with |.
const ( XpcSessionCreateFlagsNone XpcSessionCreateFlags = 0 XpcSessionCreateFlagsInactive XpcSessionCreateFlags = 1 XpcSessionCreateFlagsMachPrivileged XpcSessionCreateFlags = 2 )
func (XpcSessionCreateFlags) String ¶ added in v0.17.0
func (e XpcSessionCreateFlags) String() string
String returns the XpcSessionCreateFlags constant's name, or its numeric form when the value is not a known constant.
Source Files
¶
- MPSAccelerationStructureGroup_generated.go
- MPSAccelerationStructure_generated.go
- MPSInstanceAccelerationStructure_generated.go
- MPSPolygonAccelerationStructure_generated.go
- MPSPolygonBuffer_generated.go
- MPSQuadrilateralAccelerationStructure_generated.go
- MPSRayIntersector_generated.go
- MPSSVGFDefaultTextureAllocator_generated.go
- MPSSVGFDenoiser_generated.go
- MPSSVGF_generated.go
- MPSTemporalAA_generated.go
- MPSTriangleAccelerationStructure_generated.go
- doc.go
- mpsrayintersector_classmethods_generated.go
- mpsrayintersector_enums_generated.go
- mpsrayintersector_protocols_generated.go
- mpsrayintersector_providers_generated.go
- mpsrayintersector_runtime_generated.go
- mpsrayintersector_structs_generated.go