Documentation
¶
Overview ¶
Package metal provides Go bindings for the Metal framework.
Render advanced 3D graphics and compute data in parallel with graphics processors.
The Metal framework gives your app direct access to a device’s graphics processing unit (GPU). With Metal, apps can leverage a GPU to quickly render complex scenes and run computational tasks in parallel. For example, apps in these categories use Metal to maximize their performance:
Essentials ¶
- Understanding the Metal 4 core API: Discover the features and functionality in the Metal 4 foundational APIs.
- Drawing a triangle with Metal 4: Render a colorful, rotating 2D triangle by running draw commands with a render pipeline on a GPU.
- Performing calculations on a GPU: Use Metal to find GPUs and perform calculations on them.
- Using Metal to draw a view’s contents: Create a MetalKit view and a render pass to draw the view’s contents.
Samples ¶
- Metal sample code library: Explore the complete set of Metal samples.
GPU devices ¶
- GPU devices and work submission: Find any available GPU, submit work to it with command buffers, suspend work, and coordinate between multiple GPUs. (MTLDevice, MTL4CommandQueue, MTL4CommandQueueDescriptor, MTL4CommandQueueError, MTL4CommandBuffer)
Command encoders ¶
- Render passes: Encode a render pass to draw graphics into an image. (MTL4RenderCommandEncoder, MTLRenderCommandEncoder, MTL4RenderEncoderOptions, MTLTriangleFillMode, MTLWinding)
- Compute passes: Encode a compute pass that runs computations in parallel on a thread grid, processing and manipulating Metal resource data on multiple cores of a GPU. (MTL4ComputeCommandEncoder, MTLComputeCommandEncoder, MTL4ComputePipelineDescriptor, MTLComputePipelineDescriptor, MTLComputePipelineState)
- Machine-learning passes: Add machine-learning model inference to your Metal app’s GPU workflow. (MTL4MachineLearningCommandEncoder, MTL4MachineLearningPipelineState, MTL4MachineLearningPipelineDescriptor, MTL4MachineLearningPipelineReflection)
- Blit passes: Encode a block information transfer pass to adjust and copy data to and from GPU resources, such as buffers and textures. (MTLBlitCommandEncoder, MTLBlitOption, MTLBlitPassDescriptor, MTLBlitPassSampleBufferAttachmentDescriptor, MTLBlitPassSampleBufferAttachmentDescriptorArray)
- Indirect command encoding: Store draw commands in Metal buffers and run them at a later time on the GPU, either once or repeatedly. (MTLIndirectCommandBuffer, MTLIndirectCommandBufferDescriptor, MTLIndirectCommandType, MTLIndirectCommandBufferExecutionRange, MTLIndirectComputeCommand)
- Ray tracing with acceleration structures: Build a representation of your scene’s geometry using triangles and bounding volumes to quickly trace rays through the scene. (MTLAccelerationStructure, MTL4AccelerationStructureDescriptor, MTLAccelerationStructureDescriptor, MTL4PrimitiveAccelerationStructureDescriptor, MTLPrimitiveAccelerationStructureDescriptor)
Resources ¶
- Resource fundamentals: Control the common attributes of all Metal memory resources, including buffers and textures, and how to configure their underlying memory. (MTLResidencySet, MTLResidencySetDescriptor, MTLResourceViewPool, MTLResourceViewPoolDescriptor, MTLTextureViewPool)
- Buffers: Create and manage untyped data your app uses to exchange information with its shader functions. (MTLBuffer, MTLArgumentDescriptor, MTLArgumentEncoder)
- Textures: Create and manage typed data your app uses to exchange information with its shader functions. (MTLTexture, MTLTextureCompressionType, MTLTextureDescriptor, MTLSharedTextureHandle, MTLPixelFormat)
- Memory heaps: Take control of your app’s GPU memory management by creating a large memory allocation for various buffers, textures, and other resources. (MTLHeap, MTLHeapDescriptor, MTLHeapType, MTLSizeAndAlign)
- Resource loading: Load assets in your games and apps quickly by running a dedicated input/output queue alongside your GPU tasks. (MTLIOCommandQueue, MTLIOCommandQueueDescriptor, MTLIOPriority, MTLIOCommandQueueType, MTLIOScratchBufferAllocator)
- Resource synchronization: Prevent multiple commands that can access the same resources simultaneously by coordinating those reads and writes with barriers, fences, or events. (MTLStages, MTLFence, MTLRenderStages, MTLBarrierScope, MTL4VisibilityOptions)
Shader compilation and libraries ¶
- Using the Metal 4 compilation API: Control when and how you compile an app’s shaders.
- Shader libraries: Manage and load your app’s Metal shaders. (MTL4Compiler, MTL4CompilerDescriptor, MTL4CompilerTaskOptions, MTL4CompilerTaskStatus, MTL4Archive)
- Using function specialization to build pipeline variants: Create pipelines for different levels of detail from a common shader source.
Presentation ¶
- Managing your game window for Metal in macOS: Set up a window and view for optimally displaying your Metal content.
- Managing your Metal app window in iPadOS: Set up a window that handles dynamically resizing your Metal content.
- Adapting your game interface for smaller screens: Make text legible on all devices the player chooses to run your game on.
- Onscreen presentation: Show the output from a GPU’s rendering pass to the user in your app.
- HDR content: Take advantage of high dynamic range to present more vibrant colors in your apps and games.
Developer tools ¶
- Supporting Simulator in a Metal app: Configure alternative render paths in your Metal app to enable running your app in Simulator.
- Capturing Metal commands programmatically: Invoke a Metal frame capture from your app, then save the resulting GPU trace to a file or view it in Xcode.
- Logging shader debug messages: Print debugging messages that a shader generates using shader logging.
- Developing Metal apps that run in Simulator: Prototype and test your Metal apps in Simulator.
- Improving your game’s graphics performance and settings: Fix performance glitches and develop default settings for smooth experiences on Apple platforms using the powerful suite of Metal development tools.
- Metal debugger: Debug and profile your Metal workload with a GPU trace.
- Metal developer workflows: Locate and fix issues related to your app’s use of the Metal API and GPU functions.
- GPU counters and counter sample buffers: Retrieve runtime data from a GPU device by sampling one or more of its counters. (MTLCounterSet, MTLCommonCounterSet, MTLCounter, MTLCommonCounter, MTLCounterSampleBufferDescriptor)
- Metal debugging types: Create capture managers and capture scopes, and review a GPU device’s log after it runs a command buffer. (MTLCaptureDescriptor, MTLCaptureManager, MTLCaptureDestination, MTLCaptureScope, MTLCaptureError)
Apple silicon ¶
- Porting your Metal code to Apple silicon: Create a version of your Metal app that runs on both Apple silicon and Intel-based Mac computers.
- Tailor your apps for Apple GPUs and tile-based deferred rendering: Learn about characteristic Apple GPU features, including imageblocks, tile shaders, and raster order groups.
Key Types ¶
- MTLRenderPipelineDescriptor - An argument of options you pass to a GPU device to get a render pipeline state.
- MTLMeshRenderPipelineDescriptor - An object that configures new render pipeline state objects for mesh shading.
- MTL4MeshRenderPipelineDescriptor - Groups together properties you use to create a mesh render pipeline state object.
- MTLRenderPassDescriptor - A group of render targets that hold the results of a render pass.
- MTLTextureDescriptor - An instance that you use to configure new Metal texture instances.
- MTLIndirectCommandBufferDescriptor - A configuration you create to customize an indirect command buffer.
- MTL4RenderPassDescriptor - Describes a render pass.
- MTLAccelerationStructureCurveGeometryDescriptor - A descriptor you configure with curve geometry for building acceleration structures.
- MTL4RenderPipelineDescriptor - Groups together properties to create a render pipeline state object.
- MTLSamplerDescriptor - An object that you use to configure a texture sampler.
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func MTLIOCompressionContextAppendData(context MTLIOCompressionContext, data unsafe.Pointer, size uintptr)
- func MTLIOCompressionContextDefaultChunkSize() uintptr
- func MTLRemoveDeviceObserver(observer objectivec.Object)
- func NewErrorBlock(handler ErrorHandler) (objc.ID, func())
- func NewMTLFunctionErrorBlock(handler MTLFunctionErrorHandler) (objc.ID, func())
- func NewVoidBlock(handler VoidHandler) (objc.ID, func())
- type ErrorHandler
- type IMTL4AccelerationStructureBoundingBoxGeometryDescriptor
- type IMTL4AccelerationStructureCurveGeometryDescriptor
- type IMTL4AccelerationStructureDescriptor
- type IMTL4AccelerationStructureGeometryDescriptor
- type IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
- type IMTL4AccelerationStructureMotionCurveGeometryDescriptor
- type IMTL4AccelerationStructureMotionTriangleGeometryDescriptor
- type IMTL4AccelerationStructureTriangleGeometryDescriptor
- type IMTL4ArgumentTableDescriptor
- type IMTL4BinaryFunctionDescriptor
- type IMTL4CommandAllocatorDescriptor
- type IMTL4CommandBufferOptions
- type IMTL4CommandQueueDescriptor
- type IMTL4CommitOptions
- type IMTL4CompilerDescriptor
- type IMTL4CompilerTaskOptions
- type IMTL4ComputePipelineDescriptor
- type IMTL4CounterHeapDescriptor
- type IMTL4FunctionDescriptor
- type IMTL4IndirectInstanceAccelerationStructureDescriptor
- type IMTL4InstanceAccelerationStructureDescriptor
- type IMTL4LibraryDescriptor
- type IMTL4LibraryFunctionDescriptor
- type IMTL4MachineLearningPipelineDescriptor
- type IMTL4MachineLearningPipelineReflection
- type IMTL4MeshRenderPipelineDescriptor
- type IMTL4PipelineDataSetSerializerDescriptor
- type IMTL4PipelineDescriptor
- type IMTL4PipelineOptions
- type IMTL4PipelineStageDynamicLinkingDescriptor
- type IMTL4PrimitiveAccelerationStructureDescriptor
- type IMTL4RenderPassDescriptor
- type IMTL4RenderPipelineBinaryFunctionsDescriptor
- type IMTL4RenderPipelineColorAttachmentDescriptor
- type IMTL4RenderPipelineColorAttachmentDescriptorArray
- type IMTL4RenderPipelineDescriptor
- type IMTL4RenderPipelineDynamicLinkingDescriptor
- type IMTL4SpecializedFunctionDescriptor
- type IMTL4StaticLinkingDescriptor
- type IMTL4StitchedFunctionDescriptor
- type IMTL4TileRenderPipelineDescriptor
- type IMTLAccelerationStructureBoundingBoxGeometryDescriptor
- type IMTLAccelerationStructureCurveGeometryDescriptor
- type IMTLAccelerationStructureDescriptor
- type IMTLAccelerationStructureGeometryDescriptor
- type IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
- type IMTLAccelerationStructureMotionCurveGeometryDescriptor
- type IMTLAccelerationStructureMotionTriangleGeometryDescriptor
- type IMTLAccelerationStructurePassDescriptor
- type IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor
- type IMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
- type IMTLAccelerationStructureTriangleGeometryDescriptor
- type IMTLArchitecture
- type IMTLArgumentDescriptor
- type IMTLArrayType
- type IMTLAttribute
- type IMTLAttributeDescriptor
- type IMTLAttributeDescriptorArray
- type IMTLBinaryArchiveDescriptor
- type IMTLBlitPassDescriptor
- type IMTLBlitPassSampleBufferAttachmentDescriptor
- type IMTLBlitPassSampleBufferAttachmentDescriptorArray
- type IMTLBufferLayoutDescriptor
- type IMTLBufferLayoutDescriptorArray
- type IMTLCaptureDescriptor
- type IMTLCaptureManager
- type IMTLCommandBufferDescriptor
- type IMTLCommandQueueDescriptor
- type IMTLCompileOptions
- type IMTLComputePassDescriptor
- type IMTLComputePassSampleBufferAttachmentDescriptor
- type IMTLComputePassSampleBufferAttachmentDescriptorArray
- type IMTLComputePipelineDescriptor
- type IMTLComputePipelineReflection
- type IMTLCounterSampleBufferDescriptor
- type IMTLDepthStencilDescriptor
- type IMTLFunctionConstant
- type IMTLFunctionConstantValues
- type IMTLFunctionDescriptor
- type IMTLFunctionReflection
- type IMTLFunctionStitchingAttributeAlwaysInline
- type IMTLFunctionStitchingFunctionNode
- type IMTLFunctionStitchingGraph
- type IMTLFunctionStitchingInputNode
- type IMTLHeapDescriptor
- type IMTLIOCommandQueueDescriptor
- type IMTLIndirectCommandBufferDescriptor
- type IMTLIndirectInstanceAccelerationStructureDescriptor
- type IMTLInstanceAccelerationStructureDescriptor
- type IMTLIntersectionFunctionDescriptor
- type IMTLIntersectionFunctionTableDescriptor
- type IMTLLinkedFunctions
- type IMTLLogStateDescriptor
- type IMTLLogicalToPhysicalColorAttachmentMap
- type IMTLMeshRenderPipelineDescriptor
- type IMTLMotionKeyframeData
- type IMTLPipelineBufferDescriptor
- type IMTLPipelineBufferDescriptorArray
- type IMTLPointerType
- type IMTLPrimitiveAccelerationStructureDescriptor
- type IMTLRasterizationRateLayerArray
- type IMTLRasterizationRateLayerDescriptor
- type IMTLRasterizationRateMapDescriptor
- type IMTLRasterizationRateSampleArray
- type IMTLRenderPassAttachmentDescriptor
- type IMTLRenderPassColorAttachmentDescriptor
- type IMTLRenderPassColorAttachmentDescriptorArray
- type IMTLRenderPassDepthAttachmentDescriptor
- type IMTLRenderPassDescriptor
- type IMTLRenderPassSampleBufferAttachmentDescriptor
- type IMTLRenderPassSampleBufferAttachmentDescriptorArray
- type IMTLRenderPassStencilAttachmentDescriptor
- type IMTLRenderPipelineColorAttachmentDescriptor
- type IMTLRenderPipelineColorAttachmentDescriptorArray
- type IMTLRenderPipelineDescriptor
- type IMTLRenderPipelineFunctionsDescriptor
- type IMTLRenderPipelineReflection
- type IMTLResidencySetDescriptor
- type IMTLResourceStatePassDescriptor
- type IMTLResourceStatePassSampleBufferAttachmentDescriptor
- type IMTLResourceStatePassSampleBufferAttachmentDescriptorArray
- type IMTLResourceViewPoolDescriptor
- type IMTLSamplerDescriptor
- type IMTLSharedEventHandle
- type IMTLSharedEventListener
- type IMTLSharedTextureHandle
- type IMTLStageInputOutputDescriptor
- type IMTLStencilDescriptor
- type IMTLStitchedLibraryDescriptor
- type IMTLStructMember
- type IMTLStructType
- type IMTLTensorDescriptor
- type IMTLTensorExtents
- type IMTLTensorReferenceType
- type IMTLTextureDescriptor
- type IMTLTextureReferenceType
- type IMTLTextureViewDescriptor
- type IMTLTileRenderPipelineColorAttachmentDescriptor
- type IMTLTileRenderPipelineColorAttachmentDescriptorArray
- type IMTLTileRenderPipelineDescriptor
- type IMTLType
- type IMTLVertexAttribute
- type IMTLVertexAttributeDescriptor
- type IMTLVertexAttributeDescriptorArray
- type IMTLVertexBufferLayoutDescriptor
- type IMTLVertexBufferLayoutDescriptorArray
- type IMTLVertexDescriptor
- type IMTLVisibleFunctionTableDescriptor
- type MTL4AccelerationStructureBoundingBoxGeometryDescriptor
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) Autorelease() MTL4AccelerationStructureBoundingBoxGeometryDescriptor
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) Init() MTL4AccelerationStructureBoundingBoxGeometryDescriptor
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
- func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
- type MTL4AccelerationStructureBoundingBoxGeometryDescriptorClass
- type MTL4AccelerationStructureCurveGeometryDescriptor
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) Autorelease() MTL4AccelerationStructureCurveGeometryDescriptor
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointCount() uint
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointStride() uint
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) CurveType() MTLCurveType
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) IndexBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) IndexType() MTLIndexType
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) Init() MTL4AccelerationStructureCurveGeometryDescriptor
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) RadiusBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) RadiusStride() uint
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SegmentControlPointCount() uint
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SegmentCount() uint
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointCount(value uint)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointStride(value uint)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusStride(value uint)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
- func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetSegmentCount(value uint)
- type MTL4AccelerationStructureCurveGeometryDescriptorClass
- type MTL4AccelerationStructureDescriptor
- type MTL4AccelerationStructureDescriptorClass
- type MTL4AccelerationStructureGeometryDescriptor
- func (m MTL4AccelerationStructureGeometryDescriptor) AllowDuplicateIntersectionFunctionInvocation() bool
- func (m MTL4AccelerationStructureGeometryDescriptor) Autorelease() MTL4AccelerationStructureGeometryDescriptor
- func (m MTL4AccelerationStructureGeometryDescriptor) Init() MTL4AccelerationStructureGeometryDescriptor
- func (m MTL4AccelerationStructureGeometryDescriptor) IntersectionFunctionTableOffset() uint
- func (m MTL4AccelerationStructureGeometryDescriptor) Label() string
- func (m MTL4AccelerationStructureGeometryDescriptor) Opaque() bool
- func (m MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataElementSize() uint
- func (m MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataStride() uint
- func (m MTL4AccelerationStructureGeometryDescriptor) SetAllowDuplicateIntersectionFunctionInvocation(value bool)
- func (m MTL4AccelerationStructureGeometryDescriptor) SetIntersectionFunctionTableOffset(value uint)
- func (m MTL4AccelerationStructureGeometryDescriptor) SetLabel(value string)
- func (m MTL4AccelerationStructureGeometryDescriptor) SetOpaque(value bool)
- func (m MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataElementSize(value uint)
- func (m MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataStride(value uint)
- type MTL4AccelerationStructureGeometryDescriptorClass
- type MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) Autorelease() MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxBuffers() MTL4BufferRange
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) Init() MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxBuffers(value MTL4BufferRange)
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
- func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
- type MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass
- type MTL4AccelerationStructureMotionCurveGeometryDescriptor
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) Autorelease() MTL4AccelerationStructureMotionCurveGeometryDescriptor
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointBuffers() MTL4BufferRange
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointCount() uint
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointStride() uint
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveType() MTLCurveType
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) IndexBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) IndexType() MTLIndexType
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) Init() MTL4AccelerationStructureMotionCurveGeometryDescriptor
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusBuffers() MTL4BufferRange
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusStride() uint
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SegmentControlPointCount() uint
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SegmentCount() uint
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointBuffers(value MTL4BufferRange)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointCount(value uint)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointStride(value uint)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusBuffers(value MTL4BufferRange)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusStride(value uint)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
- func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetSegmentCount(value uint)
- type MTL4AccelerationStructureMotionCurveGeometryDescriptorClass
- type MTL4AccelerationStructureMotionTriangleGeometryDescriptor
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) Autorelease() MTL4AccelerationStructureMotionTriangleGeometryDescriptor
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) IndexBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) IndexType() MTLIndexType
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) Init() MTL4AccelerationStructureMotionTriangleGeometryDescriptor
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTriangleCount(value uint)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexBuffers(value MTL4BufferRange)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexStride(value uint)
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TriangleCount() uint
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexBuffers() MTL4BufferRange
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
- func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexStride() uint
- type MTL4AccelerationStructureMotionTriangleGeometryDescriptorClass
- type MTL4AccelerationStructureTriangleGeometryDescriptor
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) Autorelease() MTL4AccelerationStructureTriangleGeometryDescriptor
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) IndexBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) IndexType() MTLIndexType
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) Init() MTL4AccelerationStructureTriangleGeometryDescriptor
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetTriangleCount(value uint)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexBuffer(value MTL4BufferRange)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexStride(value uint)
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) TriangleCount() uint
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) VertexBuffer() MTL4BufferRange
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
- func (m MTL4AccelerationStructureTriangleGeometryDescriptor) VertexStride() uint
- type MTL4AccelerationStructureTriangleGeometryDescriptorClass
- type MTL4AlphaToCoverageState
- type MTL4AlphaToOneState
- type MTL4Archive
- type MTL4ArchiveObject
- func (o MTL4ArchiveObject) BaseObject() objectivec.Object
- func (o MTL4ArchiveObject) Label() string
- func (o MTL4ArchiveObject) NewBinaryFunctionWithDescriptorError(descriptor IMTL4BinaryFunctionDescriptor) (MTL4BinaryFunction, error)
- func (o MTL4ArchiveObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorError(descriptor IMTL4ComputePipelineDescriptor, ...) (MTLComputePipelineState, error)
- func (o MTL4ArchiveObject) NewComputePipelineStateWithDescriptorError(descriptor IMTL4ComputePipelineDescriptor) (MTLComputePipelineState, error)
- func (o MTL4ArchiveObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorError(descriptor IMTL4PipelineDescriptor, ...) (MTLRenderPipelineState, error)
- func (o MTL4ArchiveObject) NewRenderPipelineStateWithDescriptorError(descriptor IMTL4PipelineDescriptor) (MTLRenderPipelineState, error)
- func (o MTL4ArchiveObject) SetLabel(value string)
- type MTL4ArgumentTable
- type MTL4ArgumentTableDescriptor
- func (m MTL4ArgumentTableDescriptor) Autorelease() MTL4ArgumentTableDescriptor
- func (m MTL4ArgumentTableDescriptor) Init() MTL4ArgumentTableDescriptor
- func (m MTL4ArgumentTableDescriptor) InitializeBindings() bool
- func (m MTL4ArgumentTableDescriptor) Label() string
- func (m MTL4ArgumentTableDescriptor) MTL4CommandQueueErrorDomain() string
- func (m MTL4ArgumentTableDescriptor) MaxBufferBindCount() uint
- func (m MTL4ArgumentTableDescriptor) MaxSamplerStateBindCount() uint
- func (m MTL4ArgumentTableDescriptor) MaxTextureBindCount() uint
- func (m MTL4ArgumentTableDescriptor) SetInitializeBindings(value bool)
- func (m MTL4ArgumentTableDescriptor) SetLabel(value string)
- func (m MTL4ArgumentTableDescriptor) SetMaxBufferBindCount(value uint)
- func (m MTL4ArgumentTableDescriptor) SetMaxSamplerStateBindCount(value uint)
- func (m MTL4ArgumentTableDescriptor) SetMaxTextureBindCount(value uint)
- func (m MTL4ArgumentTableDescriptor) SetSupportAttributeStrides(value bool)
- func (m MTL4ArgumentTableDescriptor) SupportAttributeStrides() bool
- type MTL4ArgumentTableDescriptorClass
- type MTL4ArgumentTableObject
- func (o MTL4ArgumentTableObject) BaseObject() objectivec.Object
- func (o MTL4ArgumentTableObject) Device() MTLDevice
- func (o MTL4ArgumentTableObject) Label() string
- func (o MTL4ArgumentTableObject) SetAddressAtIndex(gpuAddress MTLGPUAddress, bindingIndex uint)
- func (o MTL4ArgumentTableObject) SetAddressAttributeStrideAtIndex(gpuAddress MTLGPUAddress, stride uint, bindingIndex uint)
- func (o MTL4ArgumentTableObject) SetResourceAtBufferIndex(resourceID MTLResourceID, bindingIndex uint)
- func (o MTL4ArgumentTableObject) SetSamplerStateAtIndex(resourceID MTLResourceID, bindingIndex uint)
- func (o MTL4ArgumentTableObject) SetTextureAtIndex(resourceID MTLResourceID, bindingIndex uint)
- type MTL4BinaryFunction
- type MTL4BinaryFunctionDescriptor
- func (m MTL4BinaryFunctionDescriptor) Autorelease() MTL4BinaryFunctionDescriptor
- func (m MTL4BinaryFunctionDescriptor) FunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4BinaryFunctionDescriptor) Init() MTL4BinaryFunctionDescriptor
- func (m MTL4BinaryFunctionDescriptor) Name() string
- func (m MTL4BinaryFunctionDescriptor) Options() MTL4BinaryFunctionOptions
- func (m MTL4BinaryFunctionDescriptor) SetFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4BinaryFunctionDescriptor) SetName(value string)
- func (m MTL4BinaryFunctionDescriptor) SetOptions(value MTL4BinaryFunctionOptions)
- type MTL4BinaryFunctionDescriptorClass
- type MTL4BinaryFunctionObject
- type MTL4BinaryFunctionOptions
- type MTL4BlendState
- type MTL4BufferRange
- type MTL4CommandAllocator
- type MTL4CommandAllocatorDescriptor
- func (m MTL4CommandAllocatorDescriptor) Autorelease() MTL4CommandAllocatorDescriptor
- func (m MTL4CommandAllocatorDescriptor) Init() MTL4CommandAllocatorDescriptor
- func (m MTL4CommandAllocatorDescriptor) Label() string
- func (m MTL4CommandAllocatorDescriptor) MTL4CommandQueueErrorDomain() string
- func (m MTL4CommandAllocatorDescriptor) SetLabel(value string)
- type MTL4CommandAllocatorDescriptorClass
- type MTL4CommandAllocatorObject
- type MTL4CommandBuffer
- type MTL4CommandBufferObject
- func (o MTL4CommandBufferObject) BaseObject() objectivec.Object
- func (o MTL4CommandBufferObject) BeginCommandBufferWithAllocator(allocator MTL4CommandAllocator)
- func (o MTL4CommandBufferObject) BeginCommandBufferWithAllocatorOptions(allocator MTL4CommandAllocator, options IMTL4CommandBufferOptions)
- func (o MTL4CommandBufferObject) ComputeCommandEncoder() MTL4ComputeCommandEncoder
- func (o MTL4CommandBufferObject) Device() MTLDevice
- func (o MTL4CommandBufferObject) EndCommandBuffer()
- func (o MTL4CommandBufferObject) Label() string
- func (o MTL4CommandBufferObject) MachineLearningCommandEncoder() MTL4MachineLearningCommandEncoder
- func (o MTL4CommandBufferObject) PopDebugGroup()
- func (o MTL4CommandBufferObject) PushDebugGroup(string_ string)
- func (o MTL4CommandBufferObject) RenderCommandEncoderWithDescriptor(descriptor IMTL4RenderPassDescriptor) MTL4RenderCommandEncoder
- func (o MTL4CommandBufferObject) RenderCommandEncoderWithDescriptorOptions(descriptor IMTL4RenderPassDescriptor, options MTL4RenderEncoderOptions) MTL4RenderCommandEncoder
- func (o MTL4CommandBufferObject) ResolveCounterHeapWithRangeIntoBufferWaitFenceUpdateFence(counterHeap MTL4CounterHeap, range_ foundation.NSRange, ...)
- func (o MTL4CommandBufferObject) SetLabel(value string)
- func (o MTL4CommandBufferObject) UseResidencySet(residencySet MTLResidencySet)
- func (o MTL4CommandBufferObject) UseResidencySetsCount(residencySets []MTLResidencySet, count uint)
- func (o MTL4CommandBufferObject) WriteTimestampIntoHeapAtIndex(counterHeap MTL4CounterHeap, index uint)
- type MTL4CommandBufferOptions
- func (m MTL4CommandBufferOptions) Autorelease() MTL4CommandBufferOptions
- func (m MTL4CommandBufferOptions) Init() MTL4CommandBufferOptions
- func (m MTL4CommandBufferOptions) LogState() MTLLogState
- func (m MTL4CommandBufferOptions) MTL4CommandQueueErrorDomain() string
- func (m MTL4CommandBufferOptions) SetLogState(value MTLLogState)
- type MTL4CommandBufferOptionsClass
- type MTL4CommandEncoder
- type MTL4CommandEncoderObject
- func (o MTL4CommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, ...)
- func (o MTL4CommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, ...)
- func (o MTL4CommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, ...)
- func (o MTL4CommandEncoderObject) BaseObject() objectivec.Object
- func (o MTL4CommandEncoderObject) CommandBuffer() MTL4CommandBuffer
- func (o MTL4CommandEncoderObject) EndEncoding()
- func (o MTL4CommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTL4CommandEncoderObject) Label() string
- func (o MTL4CommandEncoderObject) PopDebugGroup()
- func (o MTL4CommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTL4CommandEncoderObject) SetLabel(value string)
- func (o MTL4CommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
- func (o MTL4CommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
- type MTL4CommandQueue
- type MTL4CommandQueueDescriptor
- func (m MTL4CommandQueueDescriptor) Autorelease() MTL4CommandQueueDescriptor
- func (m MTL4CommandQueueDescriptor) FeedbackQueue() dispatch.Queue
- func (m MTL4CommandQueueDescriptor) Init() MTL4CommandQueueDescriptor
- func (m MTL4CommandQueueDescriptor) Label() string
- func (m MTL4CommandQueueDescriptor) MTL4CommandQueueErrorDomain() string
- func (m MTL4CommandQueueDescriptor) SetFeedbackQueue(value dispatch.Queue)
- func (m MTL4CommandQueueDescriptor) SetLabel(value string)
- type MTL4CommandQueueDescriptorClass
- type MTL4CommandQueueError
- type MTL4CommandQueueObject
- func (o MTL4CommandQueueObject) AddResidencySet(residencySet MTLResidencySet)
- func (o MTL4CommandQueueObject) AddResidencySetsCount(residencySets []MTLResidencySet, count uint)
- func (o MTL4CommandQueueObject) BaseObject() objectivec.Object
- func (o MTL4CommandQueueObject) CommitCount(commandBuffers []MTL4CommandBuffer, count uint)
- func (o MTL4CommandQueueObject) CommitCountOptions(commandBuffers []MTL4CommandBuffer, count uint, options IMTL4CommitOptions)
- func (o MTL4CommandQueueObject) CopyBufferMappingsFromBufferToBufferOperationsCount(sourceBuffer MTLBuffer, destinationBuffer MTLBuffer, ...)
- func (o MTL4CommandQueueObject) CopyTextureMappingsFromTextureToTextureOperationsCount(sourceTexture MTLTexture, destinationTexture MTLTexture, ...)
- func (o MTL4CommandQueueObject) Device() MTLDevice
- func (o MTL4CommandQueueObject) Label() string
- func (o MTL4CommandQueueObject) RemoveResidencySet(residencySet MTLResidencySet)
- func (o MTL4CommandQueueObject) RemoveResidencySetsCount(residencySets []MTLResidencySet, count uint)
- func (o MTL4CommandQueueObject) SignalDrawable(drawable MTLDrawable)
- func (o MTL4CommandQueueObject) SignalEventValue(event MTLEvent, value uint64)
- func (o MTL4CommandQueueObject) UpdateBufferMappingsHeapOperationsCount(buffer MTLBuffer, heap MTLHeap, ...)
- func (o MTL4CommandQueueObject) UpdateTextureMappingsHeapOperationsCount(texture MTLTexture, heap MTLHeap, ...)
- func (o MTL4CommandQueueObject) WaitForDrawable(drawable MTLDrawable)
- func (o MTL4CommandQueueObject) WaitForEventValue(event MTLEvent, value uint64)
- type MTL4CommitFeedback
- type MTL4CommitFeedbackHandler
- type MTL4CommitFeedbackObject
- type MTL4CommitOptions
- type MTL4CommitOptionsClass
- type MTL4Compiler
- type MTL4CompilerDescriptor
- func (m MTL4CompilerDescriptor) Autorelease() MTL4CompilerDescriptor
- func (m MTL4CompilerDescriptor) Init() MTL4CompilerDescriptor
- func (m MTL4CompilerDescriptor) Label() string
- func (m MTL4CompilerDescriptor) PipelineDataSetSerializer() MTL4PipelineDataSetSerializer
- func (m MTL4CompilerDescriptor) SetLabel(value string)
- func (m MTL4CompilerDescriptor) SetPipelineDataSetSerializer(value MTL4PipelineDataSetSerializer)
- type MTL4CompilerDescriptorClass
- type MTL4CompilerObject
- func (o MTL4CompilerObject) BaseObject() objectivec.Object
- func (o MTL4CompilerObject) Device() MTLDevice
- func (o MTL4CompilerObject) Label() string
- func (o MTL4CompilerObject) NewBinaryFunctionWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4BinaryFunctionDescriptor, ...) MTL4CompilerTask
- func (o MTL4CompilerObject) NewBinaryFunctionWithDescriptorCompilerTaskOptionsError(descriptor IMTL4BinaryFunctionDescriptor, ...) (MTL4BinaryFunction, error)
- func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4ComputePipelineDescriptor, ...) MTL4CompilerTask
- func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorCompilerTaskOptionsError(descriptor IMTL4ComputePipelineDescriptor, ...) (MTLComputePipelineState, error)
- func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4ComputePipelineDescriptor, ...) MTL4CompilerTask
- func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError(descriptor IMTL4ComputePipelineDescriptor, ...) (MTLComputePipelineState, error)
- func (o MTL4CompilerObject) NewDynamicLibraryCompletionHandler(library MTLLibrary, completionHandler ErrorHandler) MTL4CompilerTask
- func (o MTL4CompilerObject) NewDynamicLibraryError(library MTLLibrary) (MTLDynamicLibrary, error)
- func (o MTL4CompilerObject) NewDynamicLibraryWithURLCompletionHandler(url foundation.INSURL, completionHandler ErrorHandler) MTL4CompilerTask
- func (o MTL4CompilerObject) NewDynamicLibraryWithURLError(url foundation.INSURL) (MTLDynamicLibrary, error)
- func (o MTL4CompilerObject) NewLibraryWithDescriptorCompletionHandler(descriptor IMTL4LibraryDescriptor, completionHandler ErrorHandler) MTL4CompilerTask
- func (o MTL4CompilerObject) NewLibraryWithDescriptorError(descriptor IMTL4LibraryDescriptor) (MTLLibrary, error)
- func (o MTL4CompilerObject) NewMachineLearningPipelineStateWithDescriptorCompletionHandler(descriptor IMTL4MachineLearningPipelineDescriptor, ...) MTL4CompilerTask
- func (o MTL4CompilerObject) NewMachineLearningPipelineStateWithDescriptorError(descriptor IMTL4MachineLearningPipelineDescriptor) (MTL4MachineLearningPipelineState, error)
- func (o MTL4CompilerObject) NewRenderPipelineStateBySpecializationWithDescriptorPipelineCompletionHandler(descriptor IMTL4PipelineDescriptor, pipeline MTLRenderPipelineState, ...) MTL4CompilerTask
- func (o MTL4CompilerObject) NewRenderPipelineStateBySpecializationWithDescriptorPipelineError(descriptor IMTL4PipelineDescriptor, pipeline MTLRenderPipelineState) (MTLRenderPipelineState, error)
- func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4PipelineDescriptor, ...) MTL4CompilerTask
- func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorCompilerTaskOptionsError(descriptor IMTL4PipelineDescriptor, ...) (MTLRenderPipelineState, error)
- func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4PipelineDescriptor, ...) MTL4CompilerTask
- func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError(descriptor IMTL4PipelineDescriptor, ...) (MTLRenderPipelineState, error)
- func (o MTL4CompilerObject) PipelineDataSetSerializer() MTL4PipelineDataSetSerializer
- type MTL4CompilerTask
- type MTL4CompilerTaskObject
- type MTL4CompilerTaskOptions
- type MTL4CompilerTaskOptionsClass
- type MTL4CompilerTaskStatus
- type MTL4ComputeCommandEncoder
- type MTL4ComputeCommandEncoderObject
- func (o MTL4ComputeCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, ...)
- func (o MTL4ComputeCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, ...)
- func (o MTL4ComputeCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, ...)
- func (o MTL4ComputeCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTL4ComputeCommandEncoderObject) BuildAccelerationStructureDescriptorScratchBuffer(accelerationStructure MTLAccelerationStructure, ...)
- func (o MTL4ComputeCommandEncoderObject) CommandBuffer() MTL4CommandBuffer
- func (o MTL4ComputeCommandEncoderObject) CopyAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyAndCompactAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetToBufferDestinationOffsetSize(sourceBuffer MTLBuffer, sourceOffset uint, destinationBuffer MTLBuffer, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions(sourceTensor MTLTensor, sourceOrigin IMTLTensorExtents, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTL4ComputeCommandEncoderObject) CopyFromTextureToTexture(sourceTexture MTLTexture, destinationTexture MTLTexture)
- func (o MTL4ComputeCommandEncoderObject) CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex(source MTLIndirectCommandBuffer, sourceRange foundation.NSRange, ...)
- func (o MTL4ComputeCommandEncoderObject) DispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
- func (o MTL4ComputeCommandEncoderObject) DispatchThreadgroupsWithIndirectBufferThreadsPerThreadgroup(indirectBuffer MTLGPUAddress, threadsPerThreadgroup MTLSize)
- func (o MTL4ComputeCommandEncoderObject) DispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
- func (o MTL4ComputeCommandEncoderObject) DispatchThreadsWithIndirectBuffer(indirectBuffer MTLGPUAddress)
- func (o MTL4ComputeCommandEncoderObject) EndEncoding()
- func (o MTL4ComputeCommandEncoderObject) ExecuteCommandsInBufferIndirectBuffer(indirectCommandbuffer MTLIndirectCommandBuffer, ...)
- func (o MTL4ComputeCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, ...)
- func (o MTL4ComputeCommandEncoderObject) FillBufferRangeValue(buffer MTLBuffer, range_ foundation.NSRange, value uint8)
- func (o MTL4ComputeCommandEncoderObject) GenerateMipmapsForTexture(texture MTLTexture)
- func (o MTL4ComputeCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTL4ComputeCommandEncoderObject) Label() string
- func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForCPUAccess(texture MTLTexture)
- func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForCPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
- func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForGPUAccess(texture MTLTexture)
- func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForGPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
- func (o MTL4ComputeCommandEncoderObject) OptimizeIndirectCommandBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
- func (o MTL4ComputeCommandEncoderObject) PopDebugGroup()
- func (o MTL4ComputeCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTL4ComputeCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBuffer(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTL4ComputeCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferOptions(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTL4ComputeCommandEncoderObject) ResetCommandsInBufferWithRange(buffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
- func (o MTL4ComputeCommandEncoderObject) SetArgumentTable(argumentTable MTL4ArgumentTable)
- func (o MTL4ComputeCommandEncoderObject) SetComputePipelineState(state MTLComputePipelineState)
- func (o MTL4ComputeCommandEncoderObject) SetImageblockWidthHeight(width uint, height uint)
- func (o MTL4ComputeCommandEncoderObject) SetLabel(value string)
- func (o MTL4ComputeCommandEncoderObject) SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
- func (o MTL4ComputeCommandEncoderObject) Stages() MTLStages
- func (o MTL4ComputeCommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
- func (o MTL4ComputeCommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
- func (o MTL4ComputeCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBuffer(accelerationStructure MTLAccelerationStructure, buffer MTL4BufferRange)
- func (o MTL4ComputeCommandEncoderObject) WriteTimestampWithGranularityIntoHeapAtIndex(granularity MTL4TimestampGranularity, counterHeap MTL4CounterHeap, index uint)
- type MTL4ComputePipelineDescriptor
- func (m MTL4ComputePipelineDescriptor) Autorelease() MTL4ComputePipelineDescriptor
- func (m MTL4ComputePipelineDescriptor) ComputeFunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4ComputePipelineDescriptor) Init() MTL4ComputePipelineDescriptor
- func (m MTL4ComputePipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
- func (m MTL4ComputePipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
- func (m MTL4ComputePipelineDescriptor) Reset()
- func (m MTL4ComputePipelineDescriptor) SetComputeFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4ComputePipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
- func (m MTL4ComputePipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
- func (m MTL4ComputePipelineDescriptor) SetStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
- func (m MTL4ComputePipelineDescriptor) SetSupportBinaryLinking(value bool)
- func (m MTL4ComputePipelineDescriptor) SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
- func (m MTL4ComputePipelineDescriptor) SetThreadGroupSizeIsMultipleOfThreadExecutionWidth(value bool)
- func (m MTL4ComputePipelineDescriptor) StaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
- func (m MTL4ComputePipelineDescriptor) SupportBinaryLinking() bool
- func (m MTL4ComputePipelineDescriptor) SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
- func (m MTL4ComputePipelineDescriptor) ThreadGroupSizeIsMultipleOfThreadExecutionWidth() bool
- type MTL4ComputePipelineDescriptorClass
- type MTL4CopySparseBufferMappingOperation
- type MTL4CopySparseTextureMappingOperation
- type MTL4CounterHeap
- type MTL4CounterHeapDescriptor
- func (m MTL4CounterHeapDescriptor) Autorelease() MTL4CounterHeapDescriptor
- func (m MTL4CounterHeapDescriptor) Count() uint
- func (m MTL4CounterHeapDescriptor) Init() MTL4CounterHeapDescriptor
- func (m MTL4CounterHeapDescriptor) MTL4CommandQueueErrorDomain() string
- func (m MTL4CounterHeapDescriptor) SetCount(value uint)
- func (m MTL4CounterHeapDescriptor) SetType(value MTL4CounterHeapType)
- func (m MTL4CounterHeapDescriptor) Type() MTL4CounterHeapType
- type MTL4CounterHeapDescriptorClass
- type MTL4CounterHeapObject
- func (o MTL4CounterHeapObject) BaseObject() objectivec.Object
- func (o MTL4CounterHeapObject) Count() uint
- func (o MTL4CounterHeapObject) InvalidateCounterRange(range_ foundation.NSRange)
- func (o MTL4CounterHeapObject) Label() string
- func (o MTL4CounterHeapObject) ResolveCounterRange(range_ foundation.NSRange) foundation.INSData
- func (o MTL4CounterHeapObject) SetLabel(value string)
- func (o MTL4CounterHeapObject) Type() MTL4CounterHeapType
- type MTL4CounterHeapType
- type MTL4FunctionDescriptor
- type MTL4FunctionDescriptorClass
- type MTL4IndirectCommandBufferSupportState
- type MTL4IndirectInstanceAccelerationStructureDescriptor
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) Autorelease() MTL4IndirectInstanceAccelerationStructureDescriptor
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) Init() MTL4IndirectInstanceAccelerationStructureDescriptor
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceCountBuffer() MTL4BufferRange
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTL4BufferRange
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MaxInstanceCount() uint
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MaxMotionTransformCount() uint
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTL4BufferRange
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBuffer() MTL4BufferRange
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformStride() uint
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBuffer(value MTL4BufferRange)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTL4BufferRange)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMaxInstanceCount(value uint)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMaxMotionTransformCount(value uint)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTL4BufferRange)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBuffer(value MTL4BufferRange)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
- func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
- type MTL4IndirectInstanceAccelerationStructureDescriptorClass
- type MTL4InstanceAccelerationStructureDescriptor
- func (m MTL4InstanceAccelerationStructureDescriptor) Autorelease() MTL4InstanceAccelerationStructureDescriptor
- func (m MTL4InstanceAccelerationStructureDescriptor) Init() MTL4InstanceAccelerationStructureDescriptor
- func (m MTL4InstanceAccelerationStructureDescriptor) InstanceCount() uint
- func (m MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTL4BufferRange
- func (m MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
- func (m MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
- func (m MTL4InstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
- func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTL4BufferRange
- func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformCount() uint
- func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformStride() uint
- func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
- func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceCount(value uint)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTL4BufferRange)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTL4BufferRange)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformCount(value uint)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
- func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
- type MTL4InstanceAccelerationStructureDescriptorClass
- type MTL4LibraryDescriptor
- func (m MTL4LibraryDescriptor) Autorelease() MTL4LibraryDescriptor
- func (m MTL4LibraryDescriptor) Init() MTL4LibraryDescriptor
- func (m MTL4LibraryDescriptor) Name() string
- func (m MTL4LibraryDescriptor) Options() IMTLCompileOptions
- func (m MTL4LibraryDescriptor) SetName(value string)
- func (m MTL4LibraryDescriptor) SetOptions(value IMTLCompileOptions)
- func (m MTL4LibraryDescriptor) SetSource(value string)
- func (m MTL4LibraryDescriptor) Source() string
- type MTL4LibraryDescriptorClass
- type MTL4LibraryFunctionDescriptor
- func (m MTL4LibraryFunctionDescriptor) Autorelease() MTL4LibraryFunctionDescriptor
- func (m MTL4LibraryFunctionDescriptor) Init() MTL4LibraryFunctionDescriptor
- func (m MTL4LibraryFunctionDescriptor) Library() MTLLibrary
- func (m MTL4LibraryFunctionDescriptor) Name() string
- func (m MTL4LibraryFunctionDescriptor) SetLibrary(value MTLLibrary)
- func (m MTL4LibraryFunctionDescriptor) SetName(value string)
- type MTL4LibraryFunctionDescriptorClass
- type MTL4LogicalToPhysicalColorAttachmentMappingState
- type MTL4MachineLearningCommandEncoder
- type MTL4MachineLearningCommandEncoderObject
- func (o MTL4MachineLearningCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, ...)
- func (o MTL4MachineLearningCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, ...)
- func (o MTL4MachineLearningCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, ...)
- func (o MTL4MachineLearningCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTL4MachineLearningCommandEncoderObject) CommandBuffer() MTL4CommandBuffer
- func (o MTL4MachineLearningCommandEncoderObject) DispatchNetworkWithIntermediatesHeap(heap MTLHeap)
- func (o MTL4MachineLearningCommandEncoderObject) EndEncoding()
- func (o MTL4MachineLearningCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTL4MachineLearningCommandEncoderObject) Label() string
- func (o MTL4MachineLearningCommandEncoderObject) PopDebugGroup()
- func (o MTL4MachineLearningCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTL4MachineLearningCommandEncoderObject) SetArgumentTable(argumentTable MTL4ArgumentTable)
- func (o MTL4MachineLearningCommandEncoderObject) SetLabel(value string)
- func (o MTL4MachineLearningCommandEncoderObject) SetPipelineState(pipelineState MTL4MachineLearningPipelineState)
- func (o MTL4MachineLearningCommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
- func (o MTL4MachineLearningCommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
- type MTL4MachineLearningPipelineDescriptor
- func (m MTL4MachineLearningPipelineDescriptor) Autorelease() MTL4MachineLearningPipelineDescriptor
- func (m MTL4MachineLearningPipelineDescriptor) Init() MTL4MachineLearningPipelineDescriptor
- func (m MTL4MachineLearningPipelineDescriptor) InputDimensionsAtBufferIndex(bufferIndex int) IMTLTensorExtents
- func (m MTL4MachineLearningPipelineDescriptor) MachineLearningFunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4MachineLearningPipelineDescriptor) Reset()
- func (m MTL4MachineLearningPipelineDescriptor) SetInputDimensionsAtBufferIndex(dimensions IMTLTensorExtents, bufferIndex int)
- func (m MTL4MachineLearningPipelineDescriptor) SetInputDimensionsWithRange(dimensions []MTLTensorExtents, range_ foundation.NSRange)
- func (m MTL4MachineLearningPipelineDescriptor) SetMachineLearningFunctionDescriptor(value IMTL4FunctionDescriptor)
- type MTL4MachineLearningPipelineDescriptorClass
- type MTL4MachineLearningPipelineReflection
- type MTL4MachineLearningPipelineReflectionClass
- type MTL4MachineLearningPipelineState
- type MTL4MachineLearningPipelineStateObject
- func (o MTL4MachineLearningPipelineStateObject) AllocatedSize() uint
- func (o MTL4MachineLearningPipelineStateObject) BaseObject() objectivec.Object
- func (o MTL4MachineLearningPipelineStateObject) Device() MTLDevice
- func (o MTL4MachineLearningPipelineStateObject) IntermediatesHeapSize() uint
- func (o MTL4MachineLearningPipelineStateObject) Label() string
- func (o MTL4MachineLearningPipelineStateObject) Reflection() IMTL4MachineLearningPipelineReflection
- type MTL4MeshRenderPipelineDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) AlphaToCoverageState() MTL4AlphaToCoverageState
- func (m MTL4MeshRenderPipelineDescriptor) AlphaToOneState() MTL4AlphaToOneState
- func (m MTL4MeshRenderPipelineDescriptor) Autorelease() MTL4MeshRenderPipelineDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) ColorAttachmentMappingState() MTL4LogicalToPhysicalColorAttachmentMappingState
- func (m MTL4MeshRenderPipelineDescriptor) ColorAttachments() IMTL4RenderPipelineColorAttachmentDescriptorArray
- func (m MTL4MeshRenderPipelineDescriptor) FragmentFunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) FragmentStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) Init() MTL4MeshRenderPipelineDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) MaxTotalThreadgroupsPerMeshGrid() uint
- func (m MTL4MeshRenderPipelineDescriptor) MaxTotalThreadsPerMeshThreadgroup() uint
- func (m MTL4MeshRenderPipelineDescriptor) MaxTotalThreadsPerObjectThreadgroup() uint
- func (m MTL4MeshRenderPipelineDescriptor) MaxVertexAmplificationCount() uint
- func (m MTL4MeshRenderPipelineDescriptor) MeshFunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) MeshStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
- func (m MTL4MeshRenderPipelineDescriptor) ObjectFunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) ObjectStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
- func (m MTL4MeshRenderPipelineDescriptor) ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
- func (m MTL4MeshRenderPipelineDescriptor) PayloadMemoryLength() uint
- func (m MTL4MeshRenderPipelineDescriptor) RasterSampleCount() uint
- func (m MTL4MeshRenderPipelineDescriptor) RasterizationEnabled() bool
- func (m MTL4MeshRenderPipelineDescriptor) RequiredThreadsPerMeshThreadgroup() MTLSize
- func (m MTL4MeshRenderPipelineDescriptor) RequiredThreadsPerObjectThreadgroup() MTLSize
- func (m MTL4MeshRenderPipelineDescriptor) Reset()
- func (m MTL4MeshRenderPipelineDescriptor) SetAlphaToCoverageState(value MTL4AlphaToCoverageState)
- func (m MTL4MeshRenderPipelineDescriptor) SetAlphaToOneState(value MTL4AlphaToOneState)
- func (m MTL4MeshRenderPipelineDescriptor) SetColorAttachmentMappingState(value MTL4LogicalToPhysicalColorAttachmentMappingState)
- func (m MTL4MeshRenderPipelineDescriptor) SetFragmentFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4MeshRenderPipelineDescriptor) SetFragmentStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
- func (m MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadgroupsPerMeshGrid(value uint)
- func (m MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadsPerMeshThreadgroup(value uint)
- func (m MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadsPerObjectThreadgroup(value uint)
- func (m MTL4MeshRenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
- func (m MTL4MeshRenderPipelineDescriptor) SetMeshFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4MeshRenderPipelineDescriptor) SetMeshStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
- func (m MTL4MeshRenderPipelineDescriptor) SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
- func (m MTL4MeshRenderPipelineDescriptor) SetObjectFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4MeshRenderPipelineDescriptor) SetObjectStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
- func (m MTL4MeshRenderPipelineDescriptor) SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
- func (m MTL4MeshRenderPipelineDescriptor) SetPayloadMemoryLength(value uint)
- func (m MTL4MeshRenderPipelineDescriptor) SetRasterSampleCount(value uint)
- func (m MTL4MeshRenderPipelineDescriptor) SetRasterizationEnabled(value bool)
- func (m MTL4MeshRenderPipelineDescriptor) SetRequiredThreadsPerMeshThreadgroup(value MTLSize)
- func (m MTL4MeshRenderPipelineDescriptor) SetRequiredThreadsPerObjectThreadgroup(value MTLSize)
- func (m MTL4MeshRenderPipelineDescriptor) SetSupportFragmentBinaryLinking(value bool)
- func (m MTL4MeshRenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
- func (m MTL4MeshRenderPipelineDescriptor) SetSupportMeshBinaryLinking(value bool)
- func (m MTL4MeshRenderPipelineDescriptor) SetSupportObjectBinaryLinking(value bool)
- func (m MTL4MeshRenderPipelineDescriptor) SupportFragmentBinaryLinking() bool
- func (m MTL4MeshRenderPipelineDescriptor) SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
- func (m MTL4MeshRenderPipelineDescriptor) SupportMeshBinaryLinking() bool
- func (m MTL4MeshRenderPipelineDescriptor) SupportObjectBinaryLinking() bool
- type MTL4MeshRenderPipelineDescriptorClass
- type MTL4NewBinaryFunctionCompletionHandler
- type MTL4NewMachineLearningPipelineStateCompletionHandler
- type MTL4PipelineDataSetSerializer
- type MTL4PipelineDataSetSerializerConfiguration
- type MTL4PipelineDataSetSerializerDescriptor
- func (m MTL4PipelineDataSetSerializerDescriptor) Autorelease() MTL4PipelineDataSetSerializerDescriptor
- func (m MTL4PipelineDataSetSerializerDescriptor) Configuration() MTL4PipelineDataSetSerializerConfiguration
- func (m MTL4PipelineDataSetSerializerDescriptor) Init() MTL4PipelineDataSetSerializerDescriptor
- func (m MTL4PipelineDataSetSerializerDescriptor) SetConfiguration(value MTL4PipelineDataSetSerializerConfiguration)
- type MTL4PipelineDataSetSerializerDescriptorClass
- type MTL4PipelineDataSetSerializerObject
- func (o MTL4PipelineDataSetSerializerObject) BaseObject() objectivec.Object
- func (o MTL4PipelineDataSetSerializerObject) SerializeAsArchiveAndFlushToURLError(url foundation.INSURL) (bool, error)
- func (o MTL4PipelineDataSetSerializerObject) SerializeAsPipelinesScriptWithError() (foundation.INSData, error)
- type MTL4PipelineDescriptor
- func (m MTL4PipelineDescriptor) Autorelease() MTL4PipelineDescriptor
- func (m MTL4PipelineDescriptor) Init() MTL4PipelineDescriptor
- func (m MTL4PipelineDescriptor) Label() string
- func (m MTL4PipelineDescriptor) Options() IMTL4PipelineOptions
- func (m MTL4PipelineDescriptor) SetLabel(value string)
- func (m MTL4PipelineDescriptor) SetOptions(value IMTL4PipelineOptions)
- type MTL4PipelineDescriptorClass
- type MTL4PipelineOptions
- func (m MTL4PipelineOptions) Autorelease() MTL4PipelineOptions
- func (m MTL4PipelineOptions) Init() MTL4PipelineOptions
- func (m MTL4PipelineOptions) SetShaderReflection(value MTL4ShaderReflection)
- func (m MTL4PipelineOptions) SetShaderValidation(value MTLShaderValidation)
- func (m MTL4PipelineOptions) ShaderReflection() MTL4ShaderReflection
- func (m MTL4PipelineOptions) ShaderValidation() MTLShaderValidation
- type MTL4PipelineOptionsClass
- type MTL4PipelineStageDynamicLinkingDescriptor
- func (m MTL4PipelineStageDynamicLinkingDescriptor) Autorelease() MTL4PipelineStageDynamicLinkingDescriptor
- func (m MTL4PipelineStageDynamicLinkingDescriptor) BinaryLinkedFunctions() []objectivec.IObject
- func (m MTL4PipelineStageDynamicLinkingDescriptor) Init() MTL4PipelineStageDynamicLinkingDescriptor
- func (m MTL4PipelineStageDynamicLinkingDescriptor) MaxCallStackDepth() uint
- func (m MTL4PipelineStageDynamicLinkingDescriptor) PreloadedLibraries() []objectivec.IObject
- func (m MTL4PipelineStageDynamicLinkingDescriptor) SetBinaryLinkedFunctions(value []objectivec.IObject)
- func (m MTL4PipelineStageDynamicLinkingDescriptor) SetMaxCallStackDepth(value uint)
- func (m MTL4PipelineStageDynamicLinkingDescriptor) SetPreloadedLibraries(value []objectivec.IObject)
- type MTL4PipelineStageDynamicLinkingDescriptorClass
- type MTL4PrimitiveAccelerationStructureDescriptor
- func (m MTL4PrimitiveAccelerationStructureDescriptor) Autorelease() MTL4PrimitiveAccelerationStructureDescriptor
- func (m MTL4PrimitiveAccelerationStructureDescriptor) GeometryDescriptors() []MTL4AccelerationStructureGeometryDescriptor
- func (m MTL4PrimitiveAccelerationStructureDescriptor) Init() MTL4PrimitiveAccelerationStructureDescriptor
- func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionEndBorderMode() MTLMotionBorderMode
- func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionEndTime() float32
- func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionKeyframeCount() uint
- func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionStartBorderMode() MTLMotionBorderMode
- func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionStartTime() float32
- func (m MTL4PrimitiveAccelerationStructureDescriptor) SetGeometryDescriptors(value []MTL4AccelerationStructureGeometryDescriptor)
- func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionEndBorderMode(value MTLMotionBorderMode)
- func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionEndTime(value float32)
- func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionKeyframeCount(value uint)
- func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionStartBorderMode(value MTLMotionBorderMode)
- func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionStartTime(value float32)
- type MTL4PrimitiveAccelerationStructureDescriptorClass
- type MTL4RenderCommandEncoder
- type MTL4RenderCommandEncoderObject
- func (o MTL4RenderCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, ...)
- func (o MTL4RenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, ...)
- func (o MTL4RenderCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, ...)
- func (o MTL4RenderCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTL4RenderCommandEncoderObject) CommandBuffer() MTL4CommandBuffer
- func (o MTL4RenderCommandEncoderObject) DispatchThreadsPerTile(threadsPerTile MTLSize)
- func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLength(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, ...)
- func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCount(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, ...)
- func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, ...)
- func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferLengthIndirectBuffer(primitiveType MTLPrimitiveType, indexType MTLIndexType, ...)
- func (o MTL4RenderCommandEncoderObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, ...)
- func (o MTL4RenderCommandEncoderObject) DrawMeshThreadgroupsWithIndirectBufferThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(indirectBuffer MTLGPUAddress, threadsPerObjectThreadgroup MTLSize, ...)
- func (o MTL4RenderCommandEncoderObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, ...)
- func (o MTL4RenderCommandEncoderObject) DrawPrimitivesIndirectBuffer(primitiveType MTLPrimitiveType, indirectBuffer MTLGPUAddress)
- func (o MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint)
- func (o MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, ...)
- func (o MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, ...)
- func (o MTL4RenderCommandEncoderObject) EndEncoding()
- func (o MTL4RenderCommandEncoderObject) ExecuteCommandsInBufferIndirectBuffer(indirectCommandBuffer MTLIndirectCommandBuffer, ...)
- func (o MTL4RenderCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, ...)
- func (o MTL4RenderCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTL4RenderCommandEncoderObject) Label() string
- func (o MTL4RenderCommandEncoderObject) PopDebugGroup()
- func (o MTL4RenderCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTL4RenderCommandEncoderObject) SetArgumentTableAtStages(argumentTable MTL4ArgumentTable, stages MTLRenderStages)
- func (o MTL4RenderCommandEncoderObject) SetBlendColorRedGreenBlueAlpha(red float32, green float32, blue float32, alpha float32)
- func (o MTL4RenderCommandEncoderObject) SetColorAttachmentMap(mapping IMTLLogicalToPhysicalColorAttachmentMap)
- func (o MTL4RenderCommandEncoderObject) SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
- func (o MTL4RenderCommandEncoderObject) SetCullMode(cullMode MTLCullMode)
- func (o MTL4RenderCommandEncoderObject) SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
- func (o MTL4RenderCommandEncoderObject) SetDepthClipMode(depthClipMode MTLDepthClipMode)
- func (o MTL4RenderCommandEncoderObject) SetDepthStencilState(depthStencilState MTLDepthStencilState)
- func (o MTL4RenderCommandEncoderObject) SetDepthStoreAction(storeAction MTLStoreAction)
- func (o MTL4RenderCommandEncoderObject) SetDepthTestMinBoundMaxBound(minBound float32, maxBound float32)
- func (o MTL4RenderCommandEncoderObject) SetFrontFacingWinding(frontFacingWinding MTLWinding)
- func (o MTL4RenderCommandEncoderObject) SetLabel(value string)
- func (o MTL4RenderCommandEncoderObject) SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
- func (o MTL4RenderCommandEncoderObject) SetRenderPipelineState(pipelineState MTLRenderPipelineState)
- func (o MTL4RenderCommandEncoderObject) SetScissorRect(rect MTLScissorRect)
- func (o MTL4RenderCommandEncoderObject) SetScissorRectsCount(scissorRects []MTLScissorRect, count uint)
- func (o MTL4RenderCommandEncoderObject) SetStencilFrontReferenceValueBackReferenceValue(frontReferenceValue uint32, backReferenceValue uint32)
- func (o MTL4RenderCommandEncoderObject) SetStencilReferenceValue(referenceValue uint32)
- func (o MTL4RenderCommandEncoderObject) SetStencilStoreAction(storeAction MTLStoreAction)
- func (o MTL4RenderCommandEncoderObject) SetThreadgroupMemoryLengthOffsetAtIndex(length uint, offset uint, index uint)
- func (o MTL4RenderCommandEncoderObject) SetTriangleFillMode(fillMode MTLTriangleFillMode)
- func (o MTL4RenderCommandEncoderObject) SetVertexAmplificationCountViewMappings(count uint, viewMappings *MTLVertexAmplificationViewMapping)
- func (o MTL4RenderCommandEncoderObject) SetViewport(viewport MTLViewport)
- func (o MTL4RenderCommandEncoderObject) SetViewportsCount(viewports []MTLViewport, count uint)
- func (o MTL4RenderCommandEncoderObject) SetVisibilityResultModeOffset(mode MTLVisibilityResultMode, offset uint)
- func (o MTL4RenderCommandEncoderObject) TileHeight() uint
- func (o MTL4RenderCommandEncoderObject) TileWidth() uint
- func (o MTL4RenderCommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
- func (o MTL4RenderCommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
- func (o MTL4RenderCommandEncoderObject) WriteTimestampWithGranularityAfterStageIntoHeapAtIndex(granularity MTL4TimestampGranularity, stage MTLRenderStages, ...)
- type MTL4RenderEncoderOptions
- type MTL4RenderPassDescriptor
- func (m MTL4RenderPassDescriptor) Autorelease() MTL4RenderPassDescriptor
- func (m MTL4RenderPassDescriptor) ColorAttachments() IMTLRenderPassColorAttachmentDescriptorArray
- func (m MTL4RenderPassDescriptor) DefaultRasterSampleCount() uint
- func (m MTL4RenderPassDescriptor) DepthAttachment() IMTLRenderPassDepthAttachmentDescriptor
- func (m MTL4RenderPassDescriptor) GetSamplePositionsCount(positions []MTLSamplePosition, count uint) uint
- func (m MTL4RenderPassDescriptor) ImageblockSampleLength() uint
- func (m MTL4RenderPassDescriptor) Init() MTL4RenderPassDescriptor
- func (m MTL4RenderPassDescriptor) RasterizationRateMap() MTLRasterizationRateMap
- func (m MTL4RenderPassDescriptor) RenderTargetArrayLength() uint
- func (m MTL4RenderPassDescriptor) RenderTargetHeight() uint
- func (m MTL4RenderPassDescriptor) RenderTargetWidth() uint
- func (m MTL4RenderPassDescriptor) SamplePositions() MTLSamplePosition
- func (m MTL4RenderPassDescriptor) SetDefaultRasterSampleCount(value uint)
- func (m MTL4RenderPassDescriptor) SetDepthAttachment(value IMTLRenderPassDepthAttachmentDescriptor)
- func (m MTL4RenderPassDescriptor) SetImageblockSampleLength(value uint)
- func (m MTL4RenderPassDescriptor) SetRasterizationRateMap(value MTLRasterizationRateMap)
- func (m MTL4RenderPassDescriptor) SetRenderTargetArrayLength(value uint)
- func (m MTL4RenderPassDescriptor) SetRenderTargetHeight(value uint)
- func (m MTL4RenderPassDescriptor) SetRenderTargetWidth(value uint)
- func (m MTL4RenderPassDescriptor) SetSamplePositions(value MTLSamplePosition)
- func (m MTL4RenderPassDescriptor) SetSamplePositionsCount(positions []MTLSamplePosition, count uint)
- func (m MTL4RenderPassDescriptor) SetStencilAttachment(value IMTLRenderPassStencilAttachmentDescriptor)
- func (m MTL4RenderPassDescriptor) SetSupportColorAttachmentMapping(value bool)
- func (m MTL4RenderPassDescriptor) SetThreadgroupMemoryLength(value uint)
- func (m MTL4RenderPassDescriptor) SetTileHeight(value uint)
- func (m MTL4RenderPassDescriptor) SetTileWidth(value uint)
- func (m MTL4RenderPassDescriptor) SetVisibilityResultBuffer(value MTLBuffer)
- func (m MTL4RenderPassDescriptor) SetVisibilityResultType(value MTLVisibilityResultType)
- func (m MTL4RenderPassDescriptor) StencilAttachment() IMTLRenderPassStencilAttachmentDescriptor
- func (m MTL4RenderPassDescriptor) SupportColorAttachmentMapping() bool
- func (m MTL4RenderPassDescriptor) ThreadgroupMemoryLength() uint
- func (m MTL4RenderPassDescriptor) TileHeight() uint
- func (m MTL4RenderPassDescriptor) TileWidth() uint
- func (m MTL4RenderPassDescriptor) VisibilityResultBuffer() MTLBuffer
- func (m MTL4RenderPassDescriptor) VisibilityResultType() MTLVisibilityResultType
- type MTL4RenderPassDescriptorClass
- type MTL4RenderPipelineBinaryFunctionsDescriptor
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) Autorelease() MTL4RenderPipelineBinaryFunctionsDescriptor
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) FragmentAdditionalBinaryFunctions() []objectivec.IObject
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) Init() MTL4RenderPipelineBinaryFunctionsDescriptor
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) MeshAdditionalBinaryFunctions() []objectivec.IObject
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) ObjectAdditionalBinaryFunctions() []objectivec.IObject
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) Reset()
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetFragmentAdditionalBinaryFunctions(value []objectivec.IObject)
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetMeshAdditionalBinaryFunctions(value []objectivec.IObject)
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetObjectAdditionalBinaryFunctions(value []objectivec.IObject)
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetTileAdditionalBinaryFunctions(value []objectivec.IObject)
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetVertexAdditionalBinaryFunctions(value []objectivec.IObject)
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) TileAdditionalBinaryFunctions() []objectivec.IObject
- func (m MTL4RenderPipelineBinaryFunctionsDescriptor) VertexAdditionalBinaryFunctions() []objectivec.IObject
- type MTL4RenderPipelineBinaryFunctionsDescriptorClass
- type MTL4RenderPipelineColorAttachmentDescriptor
- func (m MTL4RenderPipelineColorAttachmentDescriptor) AlphaBlendOperation() MTLBlendOperation
- func (m MTL4RenderPipelineColorAttachmentDescriptor) Autorelease() MTL4RenderPipelineColorAttachmentDescriptor
- func (m MTL4RenderPipelineColorAttachmentDescriptor) BlendingState() MTL4BlendState
- func (m MTL4RenderPipelineColorAttachmentDescriptor) DestinationAlphaBlendFactor() MTLBlendFactor
- func (m MTL4RenderPipelineColorAttachmentDescriptor) DestinationRGBBlendFactor() MTLBlendFactor
- func (m MTL4RenderPipelineColorAttachmentDescriptor) Init() MTL4RenderPipelineColorAttachmentDescriptor
- func (m MTL4RenderPipelineColorAttachmentDescriptor) PixelFormat() MTLPixelFormat
- func (m MTL4RenderPipelineColorAttachmentDescriptor) Reset()
- func (m MTL4RenderPipelineColorAttachmentDescriptor) RgbBlendOperation() MTLBlendOperation
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetAlphaBlendOperation(value MTLBlendOperation)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetBlendingState(value MTL4BlendState)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetDestinationAlphaBlendFactor(value MTLBlendFactor)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetDestinationRGBBlendFactor(value MTLBlendFactor)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetPixelFormat(value MTLPixelFormat)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetRgbBlendOperation(value MTLBlendOperation)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetSourceAlphaBlendFactor(value MTLBlendFactor)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetSourceRGBBlendFactor(value MTLBlendFactor)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SetWriteMask(value MTLColorWriteMask)
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SourceAlphaBlendFactor() MTLBlendFactor
- func (m MTL4RenderPipelineColorAttachmentDescriptor) SourceRGBBlendFactor() MTLBlendFactor
- func (m MTL4RenderPipelineColorAttachmentDescriptor) WriteMask() MTLColorWriteMask
- type MTL4RenderPipelineColorAttachmentDescriptorArray
- func (m MTL4RenderPipelineColorAttachmentDescriptorArray) Autorelease() MTL4RenderPipelineColorAttachmentDescriptorArray
- func (m MTL4RenderPipelineColorAttachmentDescriptorArray) Init() MTL4RenderPipelineColorAttachmentDescriptorArray
- func (m MTL4RenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTL4RenderPipelineColorAttachmentDescriptor
- func (m MTL4RenderPipelineColorAttachmentDescriptorArray) Reset()
- func (m MTL4RenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTL4RenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
- type MTL4RenderPipelineColorAttachmentDescriptorArrayClass
- type MTL4RenderPipelineColorAttachmentDescriptorClass
- type MTL4RenderPipelineDescriptor
- func (m MTL4RenderPipelineDescriptor) AlphaToCoverageState() MTL4AlphaToCoverageState
- func (m MTL4RenderPipelineDescriptor) AlphaToOneState() MTL4AlphaToOneState
- func (m MTL4RenderPipelineDescriptor) Autorelease() MTL4RenderPipelineDescriptor
- func (m MTL4RenderPipelineDescriptor) ColorAttachmentMappingState() MTL4LogicalToPhysicalColorAttachmentMappingState
- func (m MTL4RenderPipelineDescriptor) ColorAttachments() IMTL4RenderPipelineColorAttachmentDescriptorArray
- func (m MTL4RenderPipelineDescriptor) FragmentFunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4RenderPipelineDescriptor) FragmentStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
- func (m MTL4RenderPipelineDescriptor) Init() MTL4RenderPipelineDescriptor
- func (m MTL4RenderPipelineDescriptor) InputPrimitiveTopology() MTLPrimitiveTopologyClass
- func (m MTL4RenderPipelineDescriptor) MaxVertexAmplificationCount() uint
- func (m MTL4RenderPipelineDescriptor) RasterSampleCount() uint
- func (m MTL4RenderPipelineDescriptor) RasterizationEnabled() bool
- func (m MTL4RenderPipelineDescriptor) Reset()
- func (m MTL4RenderPipelineDescriptor) SetAlphaToCoverageState(value MTL4AlphaToCoverageState)
- func (m MTL4RenderPipelineDescriptor) SetAlphaToOneState(value MTL4AlphaToOneState)
- func (m MTL4RenderPipelineDescriptor) SetColorAttachmentMappingState(value MTL4LogicalToPhysicalColorAttachmentMappingState)
- func (m MTL4RenderPipelineDescriptor) SetFragmentFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4RenderPipelineDescriptor) SetFragmentStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
- func (m MTL4RenderPipelineDescriptor) SetInputPrimitiveTopology(value MTLPrimitiveTopologyClass)
- func (m MTL4RenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
- func (m MTL4RenderPipelineDescriptor) SetRasterSampleCount(value uint)
- func (m MTL4RenderPipelineDescriptor) SetRasterizationEnabled(value bool)
- func (m MTL4RenderPipelineDescriptor) SetSupportFragmentBinaryLinking(value bool)
- func (m MTL4RenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
- func (m MTL4RenderPipelineDescriptor) SetSupportVertexBinaryLinking(value bool)
- func (m MTL4RenderPipelineDescriptor) SetVertexDescriptor(value IMTLVertexDescriptor)
- func (m MTL4RenderPipelineDescriptor) SetVertexFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4RenderPipelineDescriptor) SetVertexStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
- func (m MTL4RenderPipelineDescriptor) SupportFragmentBinaryLinking() bool
- func (m MTL4RenderPipelineDescriptor) SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
- func (m MTL4RenderPipelineDescriptor) SupportVertexBinaryLinking() bool
- func (m MTL4RenderPipelineDescriptor) VertexDescriptor() IMTLVertexDescriptor
- func (m MTL4RenderPipelineDescriptor) VertexFunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4RenderPipelineDescriptor) VertexStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
- type MTL4RenderPipelineDescriptorClass
- type MTL4RenderPipelineDynamicLinkingDescriptor
- func (m MTL4RenderPipelineDynamicLinkingDescriptor) Autorelease() MTL4RenderPipelineDynamicLinkingDescriptor
- func (m MTL4RenderPipelineDynamicLinkingDescriptor) FragmentLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
- func (m MTL4RenderPipelineDynamicLinkingDescriptor) Init() MTL4RenderPipelineDynamicLinkingDescriptor
- func (m MTL4RenderPipelineDynamicLinkingDescriptor) MeshLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
- func (m MTL4RenderPipelineDynamicLinkingDescriptor) ObjectLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
- func (m MTL4RenderPipelineDynamicLinkingDescriptor) TileLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
- func (m MTL4RenderPipelineDynamicLinkingDescriptor) VertexLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
- type MTL4RenderPipelineDynamicLinkingDescriptorClass
- type MTL4ShaderReflection
- type MTL4SpecializedFunctionDescriptor
- func (m MTL4SpecializedFunctionDescriptor) Autorelease() MTL4SpecializedFunctionDescriptor
- func (m MTL4SpecializedFunctionDescriptor) ConstantValues() IMTLFunctionConstantValues
- func (m MTL4SpecializedFunctionDescriptor) FunctionDescriptor() IMTL4FunctionDescriptor
- func (m MTL4SpecializedFunctionDescriptor) Init() MTL4SpecializedFunctionDescriptor
- func (m MTL4SpecializedFunctionDescriptor) SetConstantValues(value IMTLFunctionConstantValues)
- func (m MTL4SpecializedFunctionDescriptor) SetFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4SpecializedFunctionDescriptor) SetSpecializedName(value string)
- func (m MTL4SpecializedFunctionDescriptor) SpecializedName() string
- type MTL4SpecializedFunctionDescriptorClass
- type MTL4StaticLinkingDescriptor
- func (m MTL4StaticLinkingDescriptor) Autorelease() MTL4StaticLinkingDescriptor
- func (m MTL4StaticLinkingDescriptor) FunctionDescriptors() []MTL4FunctionDescriptor
- func (m MTL4StaticLinkingDescriptor) Groups() foundation.INSDictionary
- func (m MTL4StaticLinkingDescriptor) Init() MTL4StaticLinkingDescriptor
- func (m MTL4StaticLinkingDescriptor) PrivateFunctionDescriptors() []MTL4FunctionDescriptor
- func (m MTL4StaticLinkingDescriptor) SetFunctionDescriptors(value []MTL4FunctionDescriptor)
- func (m MTL4StaticLinkingDescriptor) SetGroups(value foundation.INSDictionary)
- func (m MTL4StaticLinkingDescriptor) SetPrivateFunctionDescriptors(value []MTL4FunctionDescriptor)
- type MTL4StaticLinkingDescriptorClass
- type MTL4StitchedFunctionDescriptor
- func (m MTL4StitchedFunctionDescriptor) Autorelease() MTL4StitchedFunctionDescriptor
- func (m MTL4StitchedFunctionDescriptor) FunctionDescriptors() []MTL4FunctionDescriptor
- func (m MTL4StitchedFunctionDescriptor) FunctionGraph() IMTLFunctionStitchingGraph
- func (m MTL4StitchedFunctionDescriptor) Init() MTL4StitchedFunctionDescriptor
- func (m MTL4StitchedFunctionDescriptor) SetFunctionDescriptors(value []MTL4FunctionDescriptor)
- func (m MTL4StitchedFunctionDescriptor) SetFunctionGraph(value IMTLFunctionStitchingGraph)
- type MTL4StitchedFunctionDescriptorClass
- type MTL4TileRenderPipelineDescriptor
- func (m MTL4TileRenderPipelineDescriptor) Autorelease() MTL4TileRenderPipelineDescriptor
- func (m MTL4TileRenderPipelineDescriptor) ColorAttachments() IMTLTileRenderPipelineColorAttachmentDescriptorArray
- func (m MTL4TileRenderPipelineDescriptor) Init() MTL4TileRenderPipelineDescriptor
- func (m MTL4TileRenderPipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
- func (m MTL4TileRenderPipelineDescriptor) RasterSampleCount() uint
- func (m MTL4TileRenderPipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
- func (m MTL4TileRenderPipelineDescriptor) Reset()
- func (m MTL4TileRenderPipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
- func (m MTL4TileRenderPipelineDescriptor) SetRasterSampleCount(value uint)
- func (m MTL4TileRenderPipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
- func (m MTL4TileRenderPipelineDescriptor) SetStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
- func (m MTL4TileRenderPipelineDescriptor) SetSupportBinaryLinking(value bool)
- func (m MTL4TileRenderPipelineDescriptor) SetThreadgroupSizeMatchesTileSize(value bool)
- func (m MTL4TileRenderPipelineDescriptor) SetTileFunctionDescriptor(value IMTL4FunctionDescriptor)
- func (m MTL4TileRenderPipelineDescriptor) StaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
- func (m MTL4TileRenderPipelineDescriptor) SupportBinaryLinking() bool
- func (m MTL4TileRenderPipelineDescriptor) ThreadgroupSizeMatchesTileSize() bool
- func (m MTL4TileRenderPipelineDescriptor) TileFunctionDescriptor() IMTL4FunctionDescriptor
- type MTL4TileRenderPipelineDescriptorClass
- type MTL4TimestampGranularity
- type MTL4TimestampHeapEntry
- type MTL4UpdateSparseBufferMappingOperation
- type MTL4UpdateSparseTextureMappingOperation
- type MTL4VisibilityOptions
- type MTLAccelerationStructure
- type MTLAccelerationStructureBoundingBoxGeometryDescriptor
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) Autorelease() MTLAccelerationStructureBoundingBoxGeometryDescriptor
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBuffer() MTLBuffer
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBufferOffset() uint
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) Init() MTLAccelerationStructureBoundingBoxGeometryDescriptor
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBufferOffset(value uint)
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
- func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
- type MTLAccelerationStructureBoundingBoxGeometryDescriptorClass
- func (mc MTLAccelerationStructureBoundingBoxGeometryDescriptorClass) Alloc() MTLAccelerationStructureBoundingBoxGeometryDescriptor
- func (_MTLAccelerationStructureBoundingBoxGeometryDescriptorClass MTLAccelerationStructureBoundingBoxGeometryDescriptorClass) Descriptor() MTLAccelerationStructureBoundingBoxGeometryDescriptor
- type MTLAccelerationStructureCommandEncoder
- type MTLAccelerationStructureCommandEncoderObject
- func (o MTLAccelerationStructureCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
- func (o MTLAccelerationStructureCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTLAccelerationStructureCommandEncoderObject) BuildAccelerationStructureDescriptorScratchBufferScratchBufferOffset(accelerationStructure MTLAccelerationStructure, ...)
- func (o MTLAccelerationStructureCommandEncoderObject) CopyAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTLAccelerationStructureCommandEncoderObject) CopyAndCompactAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTLAccelerationStructureCommandEncoderObject) Device() MTLDevice
- func (o MTLAccelerationStructureCommandEncoderObject) EndEncoding()
- func (o MTLAccelerationStructureCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTLAccelerationStructureCommandEncoderObject) Label() string
- func (o MTLAccelerationStructureCommandEncoderObject) PopDebugGroup()
- func (o MTLAccelerationStructureCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTLAccelerationStructureCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffset(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTLAccelerationStructureCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffsetOptions(sourceAccelerationStructure MTLAccelerationStructure, ...)
- func (o MTLAccelerationStructureCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
- func (o MTLAccelerationStructureCommandEncoderObject) SetLabel(value string)
- func (o MTLAccelerationStructureCommandEncoderObject) UpdateFence(fence MTLFence)
- func (o MTLAccelerationStructureCommandEncoderObject) UseHeap(heap MTLHeap)
- func (o MTLAccelerationStructureCommandEncoderObject) UseHeapsCount(heaps []MTLHeap, count uint)
- func (o MTLAccelerationStructureCommandEncoderObject) UseResourceUsage(resource MTLResource, usage MTLResourceUsage)
- func (o MTLAccelerationStructureCommandEncoderObject) UseResourcesCountUsage(resources []MTLResource, count uint, usage MTLResourceUsage)
- func (o MTLAccelerationStructureCommandEncoderObject) WaitForFence(fence MTLFence)
- func (o MTLAccelerationStructureCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBufferOffset(accelerationStructure MTLAccelerationStructure, buffer MTLBuffer, offset uint)
- func (o MTLAccelerationStructureCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBufferOffsetSizeDataType(accelerationStructure MTLAccelerationStructure, buffer MTLBuffer, offset uint, ...)
- type MTLAccelerationStructureCurveGeometryDescriptor
- func (a MTLAccelerationStructureCurveGeometryDescriptor) Autorelease() MTLAccelerationStructureCurveGeometryDescriptor
- func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointBuffer() MTLBuffer
- func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointBufferOffset() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointCount() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
- func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointStride() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
- func (a MTLAccelerationStructureCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
- func (a MTLAccelerationStructureCurveGeometryDescriptor) CurveType() MTLCurveType
- func (a MTLAccelerationStructureCurveGeometryDescriptor) IndexBuffer() MTLBuffer
- func (a MTLAccelerationStructureCurveGeometryDescriptor) IndexBufferOffset() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) IndexType() MTLIndexType
- func (a MTLAccelerationStructureCurveGeometryDescriptor) Init() MTLAccelerationStructureCurveGeometryDescriptor
- func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusBuffer() MTLBuffer
- func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusBufferOffset() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
- func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusStride() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SegmentControlPointCount() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SegmentCount() uint
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointBufferOffset(value uint)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointCount(value uint)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointStride(value uint)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetIndexBufferOffset(value uint)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusBufferOffset(value uint)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusStride(value uint)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
- func (a MTLAccelerationStructureCurveGeometryDescriptor) SetSegmentCount(value uint)
- type MTLAccelerationStructureCurveGeometryDescriptorClass
- type MTLAccelerationStructureDescriptor
- func (a MTLAccelerationStructureDescriptor) Autorelease() MTLAccelerationStructureDescriptor
- func (a MTLAccelerationStructureDescriptor) Init() MTLAccelerationStructureDescriptor
- func (a MTLAccelerationStructureDescriptor) SetUsage(value MTLAccelerationStructureUsage)
- func (a MTLAccelerationStructureDescriptor) Usage() MTLAccelerationStructureUsage
- type MTLAccelerationStructureDescriptorClass
- type MTLAccelerationStructureGeometryDescriptor
- func (a MTLAccelerationStructureGeometryDescriptor) AllowDuplicateIntersectionFunctionInvocation() bool
- func (a MTLAccelerationStructureGeometryDescriptor) Autorelease() MTLAccelerationStructureGeometryDescriptor
- func (a MTLAccelerationStructureGeometryDescriptor) Init() MTLAccelerationStructureGeometryDescriptor
- func (a MTLAccelerationStructureGeometryDescriptor) IntersectionFunctionTableOffset() uint
- func (a MTLAccelerationStructureGeometryDescriptor) Label() string
- func (a MTLAccelerationStructureGeometryDescriptor) Opaque() bool
- func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataBuffer() MTLBuffer
- func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataBufferOffset() uint
- func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataElementSize() uint
- func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataStride() uint
- func (a MTLAccelerationStructureGeometryDescriptor) SetAllowDuplicateIntersectionFunctionInvocation(value bool)
- func (a MTLAccelerationStructureGeometryDescriptor) SetIntersectionFunctionTableOffset(value uint)
- func (a MTLAccelerationStructureGeometryDescriptor) SetLabel(value string)
- func (a MTLAccelerationStructureGeometryDescriptor) SetOpaque(value bool)
- func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataBufferOffset(value uint)
- func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataElementSize(value uint)
- func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataStride(value uint)
- type MTLAccelerationStructureGeometryDescriptorClass
- type MTLAccelerationStructureInstanceDescriptor
- type MTLAccelerationStructureInstanceDescriptorType
- type MTLAccelerationStructureInstanceOptions
- type MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) Autorelease() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxBuffers() []MTLMotionKeyframeData
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) Init() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxBuffers(value []MTLMotionKeyframeData)
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
- func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
- type MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass
- func (mc MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Alloc() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
- func (_MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Descriptor() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
- type MTLAccelerationStructureMotionCurveGeometryDescriptor
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) Autorelease() MTLAccelerationStructureMotionCurveGeometryDescriptor
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointBuffers() []MTLMotionKeyframeData
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointCount() uint
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointStride() uint
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveType() MTLCurveType
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexBuffer() MTLBuffer
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexBufferOffset() uint
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexType() MTLIndexType
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) Init() MTLAccelerationStructureMotionCurveGeometryDescriptor
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusBuffers() []MTLMotionKeyframeData
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusStride() uint
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SegmentControlPointCount() uint
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SegmentCount() uint
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointBuffers(value []MTLMotionKeyframeData)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointCount(value uint)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointStride(value uint)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexBufferOffset(value uint)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusBuffers(value []MTLMotionKeyframeData)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusStride(value uint)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
- func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetSegmentCount(value uint)
- type MTLAccelerationStructureMotionCurveGeometryDescriptorClass
- func (mc MTLAccelerationStructureMotionCurveGeometryDescriptorClass) Alloc() MTLAccelerationStructureMotionCurveGeometryDescriptor
- func (_MTLAccelerationStructureMotionCurveGeometryDescriptorClass MTLAccelerationStructureMotionCurveGeometryDescriptorClass) Descriptor() MTLAccelerationStructureMotionCurveGeometryDescriptor
- type MTLAccelerationStructureMotionInstanceDescriptor
- type MTLAccelerationStructureMotionTriangleGeometryDescriptor
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) Autorelease() MTLAccelerationStructureMotionTriangleGeometryDescriptor
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexBuffer() MTLBuffer
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexBufferOffset() uint
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexType() MTLIndexType
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) Init() MTLAccelerationStructureMotionTriangleGeometryDescriptor
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBufferOffset(value uint)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBufferOffset(value uint)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTriangleCount(value uint)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexBuffers(value []MTLMotionKeyframeData)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexStride(value uint)
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBuffer() MTLBuffer
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBufferOffset() uint
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TriangleCount() uint
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexBuffers() []MTLMotionKeyframeData
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
- func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexStride() uint
- type MTLAccelerationStructureMotionTriangleGeometryDescriptorClass
- func (mc MTLAccelerationStructureMotionTriangleGeometryDescriptorClass) Alloc() MTLAccelerationStructureMotionTriangleGeometryDescriptor
- func (_MTLAccelerationStructureMotionTriangleGeometryDescriptorClass MTLAccelerationStructureMotionTriangleGeometryDescriptorClass) Descriptor() MTLAccelerationStructureMotionTriangleGeometryDescriptor
- type MTLAccelerationStructureObject
- func (o MTLAccelerationStructureObject) AllocatedSize() uint
- func (o MTLAccelerationStructureObject) BaseObject() objectivec.Object
- func (o MTLAccelerationStructureObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLAccelerationStructureObject) Device() MTLDevice
- func (o MTLAccelerationStructureObject) GpuResourceID() MTLResourceID
- func (o MTLAccelerationStructureObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLAccelerationStructureObject) Heap() MTLHeap
- func (o MTLAccelerationStructureObject) HeapOffset() uint
- func (o MTLAccelerationStructureObject) IsAliasable() bool
- func (o MTLAccelerationStructureObject) Label() string
- func (o MTLAccelerationStructureObject) MakeAliasable()
- func (o MTLAccelerationStructureObject) ResourceOptions() MTLResourceOptions
- func (o MTLAccelerationStructureObject) SetLabel(value string)
- func (o MTLAccelerationStructureObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLAccelerationStructureObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLAccelerationStructureObject) Size() uint
- func (o MTLAccelerationStructureObject) StorageMode() MTLStorageMode
- type MTLAccelerationStructurePassDescriptor
- func (a MTLAccelerationStructurePassDescriptor) Autorelease() MTLAccelerationStructurePassDescriptor
- func (a MTLAccelerationStructurePassDescriptor) Init() MTLAccelerationStructurePassDescriptor
- func (a MTLAccelerationStructurePassDescriptor) SampleBufferAttachments() IMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
- type MTLAccelerationStructurePassDescriptorClass
- type MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) Autorelease() MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) Init() MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
- type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) Autorelease() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) Init() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor
- func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor, ...)
- type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass
- type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass
- type MTLAccelerationStructureRefitOptions
- type MTLAccelerationStructureSizes
- type MTLAccelerationStructureTriangleGeometryDescriptor
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) Autorelease() MTLAccelerationStructureTriangleGeometryDescriptor
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) IndexBuffer() MTLBuffer
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) IndexBufferOffset() uint
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) IndexType() MTLIndexType
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) Init() MTLAccelerationStructureTriangleGeometryDescriptor
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexBufferOffset(value uint)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBufferOffset(value uint)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTriangleCount(value uint)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexBuffer(value MTLBuffer)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexBufferOffset(value uint)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexStride(value uint)
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBuffer() MTLBuffer
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBufferOffset() uint
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) TriangleCount() uint
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexBuffer() MTLBuffer
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexBufferOffset() uint
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
- func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexStride() uint
- type MTLAccelerationStructureTriangleGeometryDescriptorClass
- func (mc MTLAccelerationStructureTriangleGeometryDescriptorClass) Alloc() MTLAccelerationStructureTriangleGeometryDescriptor
- func (_MTLAccelerationStructureTriangleGeometryDescriptorClass MTLAccelerationStructureTriangleGeometryDescriptorClass) Descriptor() MTLAccelerationStructureTriangleGeometryDescriptor
- type MTLAccelerationStructureUsage
- type MTLAccelerationStructureUserIDInstanceDescriptor
- type MTLAllocation
- type MTLAllocationObject
- type MTLArchitecture
- func (a MTLArchitecture) Architecture() IMTLArchitecture
- func (a MTLArchitecture) Autorelease() MTLArchitecture
- func (a MTLArchitecture) Init() MTLArchitecture
- func (a MTLArchitecture) IsHeadless() bool
- func (a MTLArchitecture) IsLowPower() bool
- func (a MTLArchitecture) IsRemovable() bool
- func (a MTLArchitecture) Location() MTLDeviceLocation
- func (a MTLArchitecture) LocationNumber() int
- func (a MTLArchitecture) Name() string
- func (a MTLArchitecture) PeerCount() uint32
- func (a MTLArchitecture) PeerGroupID() uint64
- func (a MTLArchitecture) PeerIndex() uint32
- func (a MTLArchitecture) RegistryID() uint64
- func (a MTLArchitecture) SetArchitecture(value IMTLArchitecture)
- func (a MTLArchitecture) SetIsHeadless(value bool)
- func (a MTLArchitecture) SetIsLowPower(value bool)
- func (a MTLArchitecture) SetIsRemovable(value bool)
- func (a MTLArchitecture) SetLocation(value MTLDeviceLocation)
- func (a MTLArchitecture) SetLocationNumber(value int)
- func (a MTLArchitecture) SetPeerCount(value uint32)
- func (a MTLArchitecture) SetPeerGroupID(value uint64)
- func (a MTLArchitecture) SetPeerIndex(value uint32)
- func (a MTLArchitecture) SetRegistryID(value uint64)
- type MTLArchitectureClass
- type MTLArgumentAccessdeprecated
- type MTLArgumentBuffersTier
- type MTLArgumentDescriptor
- func (a MTLArgumentDescriptor) Access() MTLBindingAccess
- func (a MTLArgumentDescriptor) ArrayLength() uint
- func (a MTLArgumentDescriptor) Autorelease() MTLArgumentDescriptor
- func (a MTLArgumentDescriptor) ConstantBlockAlignment() uint
- func (a MTLArgumentDescriptor) DataType() MTLDataType
- func (a MTLArgumentDescriptor) Index() uint
- func (a MTLArgumentDescriptor) Init() MTLArgumentDescriptor
- func (a MTLArgumentDescriptor) MTLAttributeStrideStatic() int
- func (a MTLArgumentDescriptor) SetAccess(value MTLBindingAccess)
- func (a MTLArgumentDescriptor) SetArrayLength(value uint)
- func (a MTLArgumentDescriptor) SetConstantBlockAlignment(value uint)
- func (a MTLArgumentDescriptor) SetDataType(value MTLDataType)
- func (a MTLArgumentDescriptor) SetIndex(value uint)
- func (a MTLArgumentDescriptor) SetTextureType(value MTLTextureType)
- func (a MTLArgumentDescriptor) TextureType() MTLTextureType
- type MTLArgumentDescriptorClass
- type MTLArgumentEncoder
- type MTLArgumentEncoderObject
- func (o MTLArgumentEncoderObject) Alignment() uint
- func (o MTLArgumentEncoderObject) BaseObject() objectivec.Object
- func (o MTLArgumentEncoderObject) ConstantDataAtIndex(index uint) unsafe.Pointer
- func (o MTLArgumentEncoderObject) Device() MTLDevice
- func (o MTLArgumentEncoderObject) EncodedLength() uint
- func (o MTLArgumentEncoderObject) Label() string
- func (o MTLArgumentEncoderObject) NewArgumentEncoderForBufferAtIndex(index uint) MTLArgumentEncoder
- func (o MTLArgumentEncoderObject) SetAccelerationStructureAtIndex(accelerationStructure MTLAccelerationStructure, index uint)
- func (o MTLArgumentEncoderObject) SetArgumentBufferOffset(argumentBuffer MTLBuffer, offset uint)
- func (o MTLArgumentEncoderObject) SetArgumentBufferStartOffsetArrayElement(argumentBuffer MTLBuffer, startOffset uint, arrayElement uint)
- func (o MTLArgumentEncoderObject) SetBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
- func (o MTLArgumentEncoderObject) SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLArgumentEncoderObject) SetComputePipelineStateAtIndex(pipeline MTLComputePipelineState, index uint)
- func (o MTLArgumentEncoderObject) SetComputePipelineStatesWithRange(pipelines []MTLComputePipelineState, range_ foundation.NSRange)
- func (o MTLArgumentEncoderObject) SetDepthStencilStateAtIndex(depthStencilState MTLDepthStencilState, index uint)
- func (o MTLArgumentEncoderObject) SetDepthStencilStatesWithRange(depthStencilStates []MTLDepthStencilState, range_ foundation.NSRange)
- func (o MTLArgumentEncoderObject) SetIndirectCommandBufferAtIndex(indirectCommandBuffer MTLIndirectCommandBuffer, index uint)
- func (o MTLArgumentEncoderObject) SetIndirectCommandBuffersWithRange(buffers []MTLIndirectCommandBuffer, range_ foundation.NSRange)
- func (o MTLArgumentEncoderObject) SetIntersectionFunctionTableAtIndex(intersectionFunctionTable MTLIntersectionFunctionTable, index uint)
- func (o MTLArgumentEncoderObject) SetIntersectionFunctionTablesWithRange(intersectionFunctionTables []MTLIntersectionFunctionTable, ...)
- func (o MTLArgumentEncoderObject) SetLabel(value string)
- func (o MTLArgumentEncoderObject) SetRenderPipelineStateAtIndex(pipeline MTLRenderPipelineState, index uint)
- func (o MTLArgumentEncoderObject) SetRenderPipelineStatesWithRange(pipelines []MTLRenderPipelineState, range_ foundation.NSRange)
- func (o MTLArgumentEncoderObject) SetSamplerStateAtIndex(sampler MTLSamplerState, index uint)
- func (o MTLArgumentEncoderObject) SetSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
- func (o MTLArgumentEncoderObject) SetTextureAtIndex(texture MTLTexture, index uint)
- func (o MTLArgumentEncoderObject) SetTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
- func (o MTLArgumentEncoderObject) SetVisibleFunctionTableAtIndex(visibleFunctionTable MTLVisibleFunctionTable, index uint)
- func (o MTLArgumentEncoderObject) SetVisibleFunctionTablesWithRange(visibleFunctionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
- type MTLArgumentType
- type MTLArrayType
- func (a MTLArrayType) ArgumentIndexStride() uint
- func (a MTLArrayType) ArrayLength() uint
- func (a MTLArrayType) Autorelease() MTLArrayType
- func (a MTLArrayType) ElementArrayType() IMTLArrayType
- func (a MTLArrayType) ElementPointerType() IMTLPointerType
- func (a MTLArrayType) ElementStructType() IMTLStructType
- func (a MTLArrayType) ElementTensorReferenceType() IMTLTensorReferenceType
- func (a MTLArrayType) ElementTextureReferenceType() IMTLTextureReferenceType
- func (a MTLArrayType) ElementType() MTLDataType
- func (a MTLArrayType) Init() MTLArrayType
- func (a MTLArrayType) Stride() uint
- type MTLArrayTypeClass
- type MTLAttribute
- func (a MTLAttribute) Active() bool
- func (a MTLAttribute) AttributeIndex() uint
- func (a MTLAttribute) AttributeType() MTLDataType
- func (a MTLAttribute) Autorelease() MTLAttribute
- func (a MTLAttribute) Init() MTLAttribute
- func (a MTLAttribute) Name() string
- func (a MTLAttribute) PatchControlPointData() bool
- func (a MTLAttribute) PatchData() bool
- type MTLAttributeClass
- type MTLAttributeDescriptor
- func (a MTLAttributeDescriptor) Autorelease() MTLAttributeDescriptor
- func (a MTLAttributeDescriptor) BufferIndex() uint
- func (a MTLAttributeDescriptor) Format() MTLAttributeFormat
- func (a MTLAttributeDescriptor) Init() MTLAttributeDescriptor
- func (a MTLAttributeDescriptor) Offset() uint
- func (a MTLAttributeDescriptor) SetBufferIndex(value uint)
- func (a MTLAttributeDescriptor) SetFormat(value MTLAttributeFormat)
- func (a MTLAttributeDescriptor) SetOffset(value uint)
- func (a MTLAttributeDescriptor) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
- func (a MTLAttributeDescriptor) StageInputDescriptor() IMTLStageInputOutputDescriptor
- type MTLAttributeDescriptorArray
- func (a MTLAttributeDescriptorArray) Autorelease() MTLAttributeDescriptorArray
- func (a MTLAttributeDescriptorArray) Init() MTLAttributeDescriptorArray
- func (a MTLAttributeDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLAttributeDescriptor
- func (a MTLAttributeDescriptorArray) SetObjectAtIndexedSubscript(attributeDesc IMTLAttributeDescriptor, index uint)
- func (a MTLAttributeDescriptorArray) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
- func (a MTLAttributeDescriptorArray) StageInputDescriptor() IMTLStageInputOutputDescriptor
- type MTLAttributeDescriptorArrayClass
- type MTLAttributeDescriptorClass
- type MTLAttributeFormat
- type MTLAutoreleasedComputePipelineReflection
- type MTLAutoreleasedRenderPipelineReflection
- type MTLAxisAlignedBoundingBox
- type MTLBarrierScope
- type MTLBinaryArchive
- type MTLBinaryArchiveDescriptor
- func (b MTLBinaryArchiveDescriptor) Autorelease() MTLBinaryArchiveDescriptor
- func (b MTLBinaryArchiveDescriptor) Init() MTLBinaryArchiveDescriptor
- func (b MTLBinaryArchiveDescriptor) MTLBinaryArchiveDomain() string
- func (b MTLBinaryArchiveDescriptor) SetUrl(value foundation.INSURL)
- func (b MTLBinaryArchiveDescriptor) Url() foundation.INSURL
- type MTLBinaryArchiveDescriptorClass
- type MTLBinaryArchiveError
- type MTLBinaryArchiveObject
- func (o MTLBinaryArchiveObject) AddComputePipelineFunctionsWithDescriptorError(descriptor IMTLComputePipelineDescriptor) (bool, error)
- func (o MTLBinaryArchiveObject) AddFunctionWithDescriptorLibraryError(descriptor IMTLFunctionDescriptor, library MTLLibrary) (bool, error)
- func (o MTLBinaryArchiveObject) AddLibraryWithDescriptorError(descriptor IMTLStitchedLibraryDescriptor) (bool, error)
- func (o MTLBinaryArchiveObject) AddMeshRenderPipelineFunctionsWithDescriptorError(descriptor IMTLMeshRenderPipelineDescriptor) (bool, error)
- func (o MTLBinaryArchiveObject) AddRenderPipelineFunctionsWithDescriptorError(descriptor IMTLRenderPipelineDescriptor) (bool, error)
- func (o MTLBinaryArchiveObject) AddTileRenderPipelineFunctionsWithDescriptorError(descriptor IMTLTileRenderPipelineDescriptor) (bool, error)
- func (o MTLBinaryArchiveObject) BaseObject() objectivec.Object
- func (o MTLBinaryArchiveObject) Device() MTLDevice
- func (o MTLBinaryArchiveObject) Label() string
- func (o MTLBinaryArchiveObject) SerializeToURLError(url foundation.INSURL) (bool, error)
- func (o MTLBinaryArchiveObject) SetLabel(value string)
- type MTLBinding
- type MTLBindingAccess
- type MTLBindingObject
- func (o MTLBindingObject) Access() MTLBindingAccess
- func (o MTLBindingObject) BaseObject() objectivec.Object
- func (o MTLBindingObject) Index() uint
- func (o MTLBindingObject) IsArgument() bool
- func (o MTLBindingObject) IsUsed() bool
- func (o MTLBindingObject) Name() string
- func (o MTLBindingObject) Type() MTLBindingType
- type MTLBindingType
- type MTLBlendFactor
- type MTLBlendOperation
- type MTLBlitCommandEncoder
- type MTLBlitCommandEncoderObject
- func (o MTLBlitCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
- func (o MTLBlitCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetToBufferDestinationOffsetSize(sourceBuffer MTLBuffer, sourceOffset uint, destinationBuffer MTLBuffer, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions(sourceTensor MTLTensor, sourceOrigin IMTLTensorExtents, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTLBlitCommandEncoderObject) CopyFromTextureToTexture(sourceTexture MTLTexture, destinationTexture MTLTexture)
- func (o MTLBlitCommandEncoderObject) CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex(source MTLIndirectCommandBuffer, sourceRange foundation.NSRange, ...)
- func (o MTLBlitCommandEncoderObject) Device() MTLDevice
- func (o MTLBlitCommandEncoderObject) EndEncoding()
- func (o MTLBlitCommandEncoderObject) FillBufferRangeValue(buffer MTLBuffer, range_ foundation.NSRange, value uint8)
- func (o MTLBlitCommandEncoderObject) GenerateMipmapsForTexture(texture MTLTexture)
- func (o MTLBlitCommandEncoderObject) GetTextureAccessCountersRegionMipLevelSliceResetCountersCountersBufferCountersBufferOffset(texture MTLTexture, region MTLRegion, mipLevel uint, slice uint, ...)
- func (o MTLBlitCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTLBlitCommandEncoderObject) Label() string
- func (o MTLBlitCommandEncoderObject) OptimizeContentsForCPUAccess(texture MTLTexture)
- func (o MTLBlitCommandEncoderObject) OptimizeContentsForCPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
- func (o MTLBlitCommandEncoderObject) OptimizeContentsForGPUAccess(texture MTLTexture)
- func (o MTLBlitCommandEncoderObject) OptimizeContentsForGPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
- func (o MTLBlitCommandEncoderObject) OptimizeIndirectCommandBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
- func (o MTLBlitCommandEncoderObject) PopDebugGroup()
- func (o MTLBlitCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTLBlitCommandEncoderObject) ResetCommandsInBufferWithRange(buffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
- func (o MTLBlitCommandEncoderObject) ResetTextureAccessCountersRegionMipLevelSlice(texture MTLTexture, region MTLRegion, mipLevel uint, slice uint)
- func (o MTLBlitCommandEncoderObject) ResolveCountersInRangeDestinationBufferDestinationOffset(sampleBuffer MTLCounterSampleBuffer, range_ foundation.NSRange, ...)
- func (o MTLBlitCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
- func (o MTLBlitCommandEncoderObject) SetLabel(value string)
- func (o MTLBlitCommandEncoderObject) SynchronizeResource(resource MTLResource)
- func (o MTLBlitCommandEncoderObject) SynchronizeTextureSliceLevel(texture MTLTexture, slice uint, level uint)
- func (o MTLBlitCommandEncoderObject) UpdateFence(fence MTLFence)
- func (o MTLBlitCommandEncoderObject) WaitForFence(fence MTLFence)
- type MTLBlitOption
- type MTLBlitPassDescriptor
- type MTLBlitPassDescriptorClass
- type MTLBlitPassSampleBufferAttachmentDescriptor
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) Autorelease() MTLBlitPassSampleBufferAttachmentDescriptor
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) Init() MTLBlitPassSampleBufferAttachmentDescriptor
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
- func (b MTLBlitPassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
- type MTLBlitPassSampleBufferAttachmentDescriptorArray
- func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) Autorelease() MTLBlitPassSampleBufferAttachmentDescriptorArray
- func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) CounterSets() MTLCounterSet
- func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) Init() MTLBlitPassSampleBufferAttachmentDescriptorArray
- func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLBlitPassSampleBufferAttachmentDescriptor
- func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) SetCounterSets(value MTLCounterSet)
- func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLBlitPassSampleBufferAttachmentDescriptor, attachmentIndex uint)
- type MTLBlitPassSampleBufferAttachmentDescriptorArrayClass
- type MTLBlitPassSampleBufferAttachmentDescriptorClass
- type MTLBuffer
- type MTLBufferBinding
- type MTLBufferBindingObject
- func (o MTLBufferBindingObject) Access() MTLBindingAccess
- func (o MTLBufferBindingObject) BaseObject() objectivec.Object
- func (o MTLBufferBindingObject) BufferAlignment() uint
- func (o MTLBufferBindingObject) BufferDataSize() uint
- func (o MTLBufferBindingObject) BufferDataType() MTLDataType
- func (o MTLBufferBindingObject) BufferPointerType() IMTLPointerType
- func (o MTLBufferBindingObject) BufferStructType() IMTLStructType
- func (o MTLBufferBindingObject) Index() uint
- func (o MTLBufferBindingObject) IsArgument() bool
- func (o MTLBufferBindingObject) IsUsed() bool
- func (o MTLBufferBindingObject) Name() string
- func (o MTLBufferBindingObject) Type() MTLBindingType
- type MTLBufferLayoutDescriptor
- func (b MTLBufferLayoutDescriptor) Autorelease() MTLBufferLayoutDescriptor
- func (b MTLBufferLayoutDescriptor) Init() MTLBufferLayoutDescriptor
- func (b MTLBufferLayoutDescriptor) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
- func (b MTLBufferLayoutDescriptor) SetStepFunction(value MTLStepFunction)
- func (b MTLBufferLayoutDescriptor) SetStepRate(value uint)
- func (b MTLBufferLayoutDescriptor) SetStride(value uint)
- func (b MTLBufferLayoutDescriptor) StageInputDescriptor() IMTLStageInputOutputDescriptor
- func (b MTLBufferLayoutDescriptor) StepFunction() MTLStepFunction
- func (b MTLBufferLayoutDescriptor) StepRate() uint
- func (b MTLBufferLayoutDescriptor) Stride() uint
- type MTLBufferLayoutDescriptorArray
- func (b MTLBufferLayoutDescriptorArray) Autorelease() MTLBufferLayoutDescriptorArray
- func (b MTLBufferLayoutDescriptorArray) Init() MTLBufferLayoutDescriptorArray
- func (b MTLBufferLayoutDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLBufferLayoutDescriptor
- func (b MTLBufferLayoutDescriptorArray) SetObjectAtIndexedSubscript(bufferDesc IMTLBufferLayoutDescriptor, index uint)
- func (b MTLBufferLayoutDescriptorArray) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
- func (b MTLBufferLayoutDescriptorArray) StageInputDescriptor() IMTLStageInputOutputDescriptor
- type MTLBufferLayoutDescriptorArrayClass
- type MTLBufferLayoutDescriptorClass
- type MTLBufferObject
- func (o MTLBufferObject) AddDebugMarkerRange(marker string, range_ foundation.NSRange)
- func (o MTLBufferObject) AllocatedSize() uint
- func (o MTLBufferObject) BaseObject() objectivec.Object
- func (o MTLBufferObject) Contents() unsafe.Pointer
- func (o MTLBufferObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLBufferObject) Device() MTLDevice
- func (o MTLBufferObject) DidModifyRange(range_ foundation.NSRange)
- func (o MTLBufferObject) GpuAddress() MTLGPUAddress
- func (o MTLBufferObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLBufferObject) Heap() MTLHeap
- func (o MTLBufferObject) HeapOffset() uint
- func (o MTLBufferObject) IsAliasable() bool
- func (o MTLBufferObject) Label() string
- func (o MTLBufferObject) Length() uint
- func (o MTLBufferObject) MakeAliasable()
- func (o MTLBufferObject) NewRemoteBufferViewForDevice(device MTLDevice) MTLBuffer
- func (o MTLBufferObject) NewTensorWithDescriptorOffsetError(descriptor IMTLTensorDescriptor, offset uint) (MTLTensor, error)
- func (o MTLBufferObject) NewTextureWithDescriptorOffsetBytesPerRow(descriptor IMTLTextureDescriptor, offset uint, bytesPerRow uint) MTLTexture
- func (o MTLBufferObject) RemoteStorageBuffer() MTLBuffer
- func (o MTLBufferObject) RemoveAllDebugMarkers()
- func (o MTLBufferObject) ResourceOptions() MTLResourceOptions
- func (o MTLBufferObject) SetLabel(value string)
- func (o MTLBufferObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLBufferObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLBufferObject) SparseBufferTier() MTLBufferSparseTier
- func (o MTLBufferObject) StorageMode() MTLStorageMode
- type MTLBufferSparseTier
- type MTLCPUCacheMode
- type MTLCaptureDescriptor
- func (c MTLCaptureDescriptor) Autorelease() MTLCaptureDescriptor
- func (c MTLCaptureDescriptor) CaptureObject() objectivec.IObject
- func (c MTLCaptureDescriptor) Destination() MTLCaptureDestination
- func (c MTLCaptureDescriptor) Init() MTLCaptureDescriptor
- func (c MTLCaptureDescriptor) OutputURL() foundation.INSURL
- func (c MTLCaptureDescriptor) SetCaptureObject(value objectivec.IObject)
- func (c MTLCaptureDescriptor) SetDestination(value MTLCaptureDestination)
- func (c MTLCaptureDescriptor) SetOutputURL(value foundation.INSURL)
- type MTLCaptureDescriptorClass
- type MTLCaptureDestination
- type MTLCaptureError
- type MTLCaptureManager
- func (c MTLCaptureManager) Autorelease() MTLCaptureManager
- func (c MTLCaptureManager) DefaultCaptureScope() MTLCaptureScope
- func (c MTLCaptureManager) Init() MTLCaptureManager
- func (c MTLCaptureManager) IsCapturing() bool
- func (c MTLCaptureManager) NewCaptureScopeWithCommandQueue(commandQueue MTLCommandQueue) MTLCaptureScope
- func (c MTLCaptureManager) NewCaptureScopeWithDevice(device MTLDevice) MTLCaptureScope
- func (c MTLCaptureManager) NewCaptureScopeWithMTL4CommandQueue(commandQueue MTL4CommandQueue) MTLCaptureScope
- func (c MTLCaptureManager) SetDefaultCaptureScope(value MTLCaptureScope)
- func (c MTLCaptureManager) StartCaptureWithDescriptorError(descriptor IMTLCaptureDescriptor) (bool, error)
- func (c MTLCaptureManager) StopCapture()
- func (c MTLCaptureManager) SupportsDestination(destination MTLCaptureDestination) bool
- type MTLCaptureManagerClass
- type MTLCaptureScope
- type MTLCaptureScopeObject
- func (o MTLCaptureScopeObject) BaseObject() objectivec.Object
- func (o MTLCaptureScopeObject) BeginScope()
- func (o MTLCaptureScopeObject) CommandQueue() MTLCommandQueue
- func (o MTLCaptureScopeObject) Device() MTLDevice
- func (o MTLCaptureScopeObject) EndScope()
- func (o MTLCaptureScopeObject) Label() string
- func (o MTLCaptureScopeObject) Mtl4CommandQueue() MTL4CommandQueue
- func (o MTLCaptureScopeObject) SetLabel(value string)
- type MTLClearColor
- type MTLColorWriteMask
- type MTLCommandBuffer
- type MTLCommandBufferDescriptor
- func (c MTLCommandBufferDescriptor) Autorelease() MTLCommandBufferDescriptor
- func (c MTLCommandBufferDescriptor) EncoderExecutionStatus() MTLCommandBufferErrorOption
- func (c MTLCommandBufferDescriptor) ErrorOptions() MTLCommandBufferErrorOption
- func (c MTLCommandBufferDescriptor) Init() MTLCommandBufferDescriptor
- func (c MTLCommandBufferDescriptor) LogState() MTLLogState
- func (c MTLCommandBufferDescriptor) MTLCommandBufferErrorDomain() string
- func (c MTLCommandBufferDescriptor) RetainedReferences() bool
- func (c MTLCommandBufferDescriptor) SetEncoderExecutionStatus(value MTLCommandBufferErrorOption)
- func (c MTLCommandBufferDescriptor) SetErrorOptions(value MTLCommandBufferErrorOption)
- func (c MTLCommandBufferDescriptor) SetLogState(value MTLLogState)
- func (c MTLCommandBufferDescriptor) SetRetainedReferences(value bool)
- type MTLCommandBufferDescriptorClass
- type MTLCommandBufferEncoderInfo
- type MTLCommandBufferEncoderInfoObject
- type MTLCommandBufferError
- type MTLCommandBufferErrorOption
- type MTLCommandBufferHandler
- type MTLCommandBufferObject
- func (o MTLCommandBufferObject) AccelerationStructureCommandEncoder() MTLAccelerationStructureCommandEncoder
- func (o MTLCommandBufferObject) AccelerationStructureCommandEncoderWithDescriptor(descriptor IMTLAccelerationStructurePassDescriptor) MTLAccelerationStructureCommandEncoder
- func (o MTLCommandBufferObject) AddCompletedHandler(block MTLCommandBufferHandler)
- func (o MTLCommandBufferObject) AddScheduledHandler(block MTLCommandBufferHandler)
- func (o MTLCommandBufferObject) BaseObject() objectivec.Object
- func (o MTLCommandBufferObject) BlitCommandEncoder() MTLBlitCommandEncoder
- func (o MTLCommandBufferObject) BlitCommandEncoderWithDescriptor(blitPassDescriptor IMTLBlitPassDescriptor) MTLBlitCommandEncoder
- func (o MTLCommandBufferObject) CommandQueue() MTLCommandQueue
- func (o MTLCommandBufferObject) Commit()
- func (o MTLCommandBufferObject) ComputeCommandEncoder() MTLComputeCommandEncoder
- func (o MTLCommandBufferObject) ComputeCommandEncoderWithDescriptor(computePassDescriptor IMTLComputePassDescriptor) MTLComputeCommandEncoder
- func (o MTLCommandBufferObject) ComputeCommandEncoderWithDispatchType(dispatchType MTLDispatchType) MTLComputeCommandEncoder
- func (o MTLCommandBufferObject) Device() MTLDevice
- func (o MTLCommandBufferObject) EncodeSignalEventValue(event MTLEvent, value uint64)
- func (o MTLCommandBufferObject) EncodeWaitForEventValue(event MTLEvent, value uint64)
- func (o MTLCommandBufferObject) Enqueue()
- func (o MTLCommandBufferObject) Error() foundation.INSError
- func (o MTLCommandBufferObject) ErrorOptions() MTLCommandBufferErrorOption
- func (o MTLCommandBufferObject) GPUEndTime() float64
- func (o MTLCommandBufferObject) GPUStartTime() float64
- func (o MTLCommandBufferObject) KernelEndTime() float64
- func (o MTLCommandBufferObject) KernelStartTime() float64
- func (o MTLCommandBufferObject) Label() string
- func (o MTLCommandBufferObject) Logs() MTLLogContainer
- func (o MTLCommandBufferObject) ParallelRenderCommandEncoderWithDescriptor(renderPassDescriptor IMTLRenderPassDescriptor) MTLParallelRenderCommandEncoder
- func (o MTLCommandBufferObject) PopDebugGroup()
- func (o MTLCommandBufferObject) PresentDrawable(drawable MTLDrawable)
- func (o MTLCommandBufferObject) PresentDrawableAfterMinimumDuration(drawable MTLDrawable, duration float64)
- func (o MTLCommandBufferObject) PresentDrawableAtTime(drawable MTLDrawable, presentationTime float64)
- func (o MTLCommandBufferObject) PushDebugGroup(string_ string)
- func (o MTLCommandBufferObject) RenderCommandEncoderWithDescriptor(renderPassDescriptor IMTLRenderPassDescriptor) MTLRenderCommandEncoder
- func (o MTLCommandBufferObject) ResourceStateCommandEncoder() MTLResourceStateCommandEncoder
- func (o MTLCommandBufferObject) ResourceStateCommandEncoderWithDescriptor(resourceStatePassDescriptor IMTLResourceStatePassDescriptor) MTLResourceStateCommandEncoder
- func (o MTLCommandBufferObject) RetainedReferences() bool
- func (o MTLCommandBufferObject) SetLabel(value string)
- func (o MTLCommandBufferObject) Status() MTLCommandBufferStatus
- func (o MTLCommandBufferObject) UseResidencySet(residencySet MTLResidencySet)
- func (o MTLCommandBufferObject) UseResidencySetsCount(residencySets []MTLResidencySet, count uint)
- func (o MTLCommandBufferObject) WaitUntilCompleted()
- func (o MTLCommandBufferObject) WaitUntilScheduled()
- type MTLCommandBufferStatus
- type MTLCommandEncoder
- type MTLCommandEncoderErrorState
- type MTLCommandEncoderObject
- func (o MTLCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
- func (o MTLCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTLCommandEncoderObject) Device() MTLDevice
- func (o MTLCommandEncoderObject) EndEncoding()
- func (o MTLCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTLCommandEncoderObject) Label() string
- func (o MTLCommandEncoderObject) PopDebugGroup()
- func (o MTLCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTLCommandEncoderObject) SetLabel(value string)
- type MTLCommandQueue
- type MTLCommandQueueDescriptor
- func (c MTLCommandQueueDescriptor) Autorelease() MTLCommandQueueDescriptor
- func (c MTLCommandQueueDescriptor) Init() MTLCommandQueueDescriptor
- func (c MTLCommandQueueDescriptor) LogState() MTLLogState
- func (c MTLCommandQueueDescriptor) MTLCommandBufferErrorDomain() string
- func (c MTLCommandQueueDescriptor) MaxCommandBufferCount() uint
- func (c MTLCommandQueueDescriptor) SetLogState(value MTLLogState)
- func (c MTLCommandQueueDescriptor) SetMaxCommandBufferCount(value uint)
- type MTLCommandQueueDescriptorClass
- type MTLCommandQueueObject
- func (o MTLCommandQueueObject) AddResidencySet(residencySet MTLResidencySet)
- func (o MTLCommandQueueObject) AddResidencySetsCount(residencySets []MTLResidencySet, count uint)
- func (o MTLCommandQueueObject) BaseObject() objectivec.Object
- func (o MTLCommandQueueObject) CommandBuffer() MTLCommandBuffer
- func (o MTLCommandQueueObject) CommandBufferWithDescriptor(descriptor IMTLCommandBufferDescriptor) MTLCommandBuffer
- func (o MTLCommandQueueObject) CommandBufferWithUnretainedReferences() MTLCommandBuffer
- func (o MTLCommandQueueObject) Device() MTLDevice
- func (o MTLCommandQueueObject) Label() string
- func (o MTLCommandQueueObject) RemoveResidencySet(residencySet MTLResidencySet)
- func (o MTLCommandQueueObject) RemoveResidencySetsCount(residencySets []MTLResidencySet, count uint)
- func (o MTLCommandQueueObject) SetLabel(value string)
- type MTLCommonCounter
- type MTLCommonCounterSet
- type MTLCompareFunction
- type MTLCompileOptions
- func (c MTLCompileOptions) AllowReferencingUndefinedSymbols() bool
- func (c MTLCompileOptions) Autorelease() MTLCompileOptions
- func (c MTLCompileOptions) CompileSymbolVisibility() MTLCompileSymbolVisibility
- func (c MTLCompileOptions) EnableLogging() bool
- func (c MTLCompileOptions) FastMathEnabled() bool
- func (c MTLCompileOptions) Init() MTLCompileOptions
- func (c MTLCompileOptions) InstallName() string
- func (c MTLCompileOptions) LanguageVersion() MTLLanguageVersion
- func (c MTLCompileOptions) Libraries() []objectivec.IObject
- func (c MTLCompileOptions) LibraryType() MTLLibraryType
- func (c MTLCompileOptions) MathFloatingPointFunctions() MTLMathFloatingPointFunctions
- func (c MTLCompileOptions) MathMode() MTLMathMode
- func (c MTLCompileOptions) MaxTotalThreadsPerThreadgroup() uint
- func (c MTLCompileOptions) OptimizationLevel() MTLLibraryOptimizationLevel
- func (c MTLCompileOptions) PreprocessorMacros() foundation.INSDictionary
- func (c MTLCompileOptions) PreserveInvariance() bool
- func (c MTLCompileOptions) RequiredThreadsPerThreadgroup() MTLSize
- func (c MTLCompileOptions) SetAllowReferencingUndefinedSymbols(value bool)
- func (c MTLCompileOptions) SetCompileSymbolVisibility(value MTLCompileSymbolVisibility)
- func (c MTLCompileOptions) SetEnableLogging(value bool)
- func (c MTLCompileOptions) SetFastMathEnabled(value bool)
- func (c MTLCompileOptions) SetInstallName(value string)
- func (c MTLCompileOptions) SetLanguageVersion(value MTLLanguageVersion)
- func (c MTLCompileOptions) SetLibraries(value []objectivec.IObject)
- func (c MTLCompileOptions) SetLibraryType(value MTLLibraryType)
- func (c MTLCompileOptions) SetMathFloatingPointFunctions(value MTLMathFloatingPointFunctions)
- func (c MTLCompileOptions) SetMathMode(value MTLMathMode)
- func (c MTLCompileOptions) SetMaxTotalThreadsPerThreadgroup(value uint)
- func (c MTLCompileOptions) SetOptimizationLevel(value MTLLibraryOptimizationLevel)
- func (c MTLCompileOptions) SetPreprocessorMacros(value foundation.INSDictionary)
- func (c MTLCompileOptions) SetPreserveInvariance(value bool)
- func (c MTLCompileOptions) SetRequiredThreadsPerThreadgroup(value MTLSize)
- type MTLCompileOptionsClass
- type MTLCompileSymbolVisibility
- type MTLComponentTransform
- type MTLComputeCommandEncoder
- type MTLComputeCommandEncoderObject
- func (o MTLComputeCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
- func (o MTLComputeCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTLComputeCommandEncoderObject) Device() MTLDevice
- func (o MTLComputeCommandEncoderObject) DispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
- func (o MTLComputeCommandEncoderObject) DispatchThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerThreadgroup(indirectBuffer MTLBuffer, indirectBufferOffset uint, ...)
- func (o MTLComputeCommandEncoderObject) DispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
- func (o MTLComputeCommandEncoderObject) DispatchType() MTLDispatchType
- func (o MTLComputeCommandEncoderObject) EndEncoding()
- func (o MTLComputeCommandEncoderObject) ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLBuffer, ...)
- func (o MTLComputeCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, ...)
- func (o MTLComputeCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTLComputeCommandEncoderObject) Label() string
- func (o MTLComputeCommandEncoderObject) MemoryBarrierWithResourcesCount(resources []MTLResource, count uint)
- func (o MTLComputeCommandEncoderObject) MemoryBarrierWithScope(scope MTLBarrierScope)
- func (o MTLComputeCommandEncoderObject) PopDebugGroup()
- func (o MTLComputeCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTLComputeCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
- func (o MTLComputeCommandEncoderObject) SetAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
- func (o MTLComputeCommandEncoderObject) SetBufferOffsetAtIndex(offset uint, index uint)
- func (o MTLComputeCommandEncoderObject) SetBufferOffsetAttributeStrideAtIndex(offset uint, stride uint, index uint)
- func (o MTLComputeCommandEncoderObject) SetBuffersOffsetsAttributeStridesWithRange(buffers []MTLBuffer, offsets uint, strides uint, range_ foundation.NSRange)
- func (o MTLComputeCommandEncoderObject) SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLComputeCommandEncoderObject) SetBytesLengthAtIndex(bytes []byte, index uint)
- func (o MTLComputeCommandEncoderObject) SetBytesLengthAttributeStrideAtIndex(bytes []byte, stride uint, index uint)
- func (o MTLComputeCommandEncoderObject) SetComputePipelineState(state MTLComputePipelineState)
- func (o MTLComputeCommandEncoderObject) SetImageblockWidthHeight(width uint, height uint)
- func (o MTLComputeCommandEncoderObject) SetIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
- func (o MTLComputeCommandEncoderObject) SetIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, ...)
- func (o MTLComputeCommandEncoderObject) SetLabel(value string)
- func (o MTLComputeCommandEncoderObject) SetSamplerStateAtIndex(sampler MTLSamplerState, index uint)
- func (o MTLComputeCommandEncoderObject) SetSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
- func (o MTLComputeCommandEncoderObject) SetSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, ...)
- func (o MTLComputeCommandEncoderObject) SetSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
- func (o MTLComputeCommandEncoderObject) SetStageInRegion(region MTLRegion)
- func (o MTLComputeCommandEncoderObject) SetStageInRegionWithIndirectBufferIndirectBufferOffset(indirectBuffer MTLBuffer, indirectBufferOffset uint)
- func (o MTLComputeCommandEncoderObject) SetTextureAtIndex(texture MTLTexture, index uint)
- func (o MTLComputeCommandEncoderObject) SetTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
- func (o MTLComputeCommandEncoderObject) SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
- func (o MTLComputeCommandEncoderObject) SetVisibleFunctionTableAtBufferIndex(visibleFunctionTable MTLVisibleFunctionTable, bufferIndex uint)
- func (o MTLComputeCommandEncoderObject) SetVisibleFunctionTablesWithBufferRange(visibleFunctionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
- func (o MTLComputeCommandEncoderObject) UpdateFence(fence MTLFence)
- func (o MTLComputeCommandEncoderObject) UseHeap(heap MTLHeap)
- func (o MTLComputeCommandEncoderObject) UseHeapsCount(heaps []MTLHeap, count uint)
- func (o MTLComputeCommandEncoderObject) UseResourceUsage(resource MTLResource, usage MTLResourceUsage)
- func (o MTLComputeCommandEncoderObject) UseResourcesCountUsage(resources []MTLResource, count uint, usage MTLResourceUsage)
- func (o MTLComputeCommandEncoderObject) WaitForFence(fence MTLFence)
- type MTLComputePassDescriptor
- func (c MTLComputePassDescriptor) Autorelease() MTLComputePassDescriptor
- func (c MTLComputePassDescriptor) DispatchType() MTLDispatchType
- func (c MTLComputePassDescriptor) Init() MTLComputePassDescriptor
- func (c MTLComputePassDescriptor) SampleBufferAttachments() IMTLComputePassSampleBufferAttachmentDescriptorArray
- func (c MTLComputePassDescriptor) SetDispatchType(value MTLDispatchType)
- type MTLComputePassDescriptorClass
- type MTLComputePassSampleBufferAttachmentDescriptor
- func (c MTLComputePassSampleBufferAttachmentDescriptor) Autorelease() MTLComputePassSampleBufferAttachmentDescriptor
- func (c MTLComputePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
- func (c MTLComputePassSampleBufferAttachmentDescriptor) Init() MTLComputePassSampleBufferAttachmentDescriptor
- func (c MTLComputePassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
- func (c MTLComputePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
- func (c MTLComputePassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
- func (c MTLComputePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
- func (c MTLComputePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
- type MTLComputePassSampleBufferAttachmentDescriptorArray
- func (c MTLComputePassSampleBufferAttachmentDescriptorArray) Autorelease() MTLComputePassSampleBufferAttachmentDescriptorArray
- func (c MTLComputePassSampleBufferAttachmentDescriptorArray) CounterSets() MTLCounterSet
- func (c MTLComputePassSampleBufferAttachmentDescriptorArray) Init() MTLComputePassSampleBufferAttachmentDescriptorArray
- func (c MTLComputePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLComputePassSampleBufferAttachmentDescriptor
- func (c MTLComputePassSampleBufferAttachmentDescriptorArray) SetCounterSets(value MTLCounterSet)
- func (c MTLComputePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLComputePassSampleBufferAttachmentDescriptor, ...)
- type MTLComputePassSampleBufferAttachmentDescriptorArrayClass
- type MTLComputePassSampleBufferAttachmentDescriptorClass
- type MTLComputePipelineDescriptor
- func (c MTLComputePipelineDescriptor) Autorelease() MTLComputePipelineDescriptor
- func (c MTLComputePipelineDescriptor) BinaryArchives() []objectivec.IObject
- func (c MTLComputePipelineDescriptor) Buffers() IMTLPipelineBufferDescriptorArray
- func (c MTLComputePipelineDescriptor) ComputeFunction() MTLFunction
- func (c MTLComputePipelineDescriptor) Init() MTLComputePipelineDescriptor
- func (c MTLComputePipelineDescriptor) Label() string
- func (c MTLComputePipelineDescriptor) LinkedFunctions() IMTLLinkedFunctions
- func (c MTLComputePipelineDescriptor) MaxCallStackDepth() uint
- func (c MTLComputePipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
- func (c MTLComputePipelineDescriptor) PreloadedLibraries() []objectivec.IObject
- func (c MTLComputePipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
- func (c MTLComputePipelineDescriptor) Reset()
- func (c MTLComputePipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
- func (c MTLComputePipelineDescriptor) SetComputeFunction(value MTLFunction)
- func (c MTLComputePipelineDescriptor) SetLabel(value string)
- func (c MTLComputePipelineDescriptor) SetLinkedFunctions(value IMTLLinkedFunctions)
- func (c MTLComputePipelineDescriptor) SetMaxCallStackDepth(value uint)
- func (c MTLComputePipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
- func (c MTLComputePipelineDescriptor) SetPreloadedLibraries(value []objectivec.IObject)
- func (c MTLComputePipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
- func (c MTLComputePipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
- func (c MTLComputePipelineDescriptor) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
- func (c MTLComputePipelineDescriptor) SetSupportAddingBinaryFunctions(value bool)
- func (c MTLComputePipelineDescriptor) SetSupportIndirectCommandBuffers(value bool)
- func (c MTLComputePipelineDescriptor) SetThreadGroupSizeIsMultipleOfThreadExecutionWidth(value bool)
- func (c MTLComputePipelineDescriptor) ShaderValidation() MTLShaderValidation
- func (c MTLComputePipelineDescriptor) StageInputDescriptor() IMTLStageInputOutputDescriptor
- func (c MTLComputePipelineDescriptor) SupportAddingBinaryFunctions() bool
- func (c MTLComputePipelineDescriptor) SupportIndirectCommandBuffers() bool
- func (c MTLComputePipelineDescriptor) ThreadGroupSizeIsMultipleOfThreadExecutionWidth() bool
- type MTLComputePipelineDescriptorClass
- type MTLComputePipelineReflection
- type MTLComputePipelineReflectionClass
- type MTLComputePipelineState
- type MTLComputePipelineStateObject
- func (o MTLComputePipelineStateObject) AllocatedSize() uint
- func (o MTLComputePipelineStateObject) BaseObject() objectivec.Object
- func (o MTLComputePipelineStateObject) Device() MTLDevice
- func (o MTLComputePipelineStateObject) FunctionHandleWithBinaryFunction(function MTL4BinaryFunction) MTLFunctionHandle
- func (o MTLComputePipelineStateObject) FunctionHandleWithFunction(function MTLFunction) MTLFunctionHandle
- func (o MTLComputePipelineStateObject) FunctionHandleWithName(name string) MTLFunctionHandle
- func (o MTLComputePipelineStateObject) GpuResourceID() MTLResourceID
- func (o MTLComputePipelineStateObject) ImageblockMemoryLengthForDimensions(imageblockDimensions MTLSize) uint
- func (o MTLComputePipelineStateObject) Label() string
- func (o MTLComputePipelineStateObject) MaxTotalThreadsPerThreadgroup() uint
- func (o MTLComputePipelineStateObject) NewComputePipelineStateWithAdditionalBinaryFunctionsError(functions []objectivec.IObject) (MTLComputePipelineState, error)
- func (o MTLComputePipelineStateObject) NewComputePipelineStateWithBinaryFunctionsError(additionalBinaryFunctions []objectivec.IObject) (MTLComputePipelineState, error)
- func (o MTLComputePipelineStateObject) NewIntersectionFunctionTableWithDescriptor(descriptor IMTLIntersectionFunctionTableDescriptor) MTLIntersectionFunctionTable
- func (o MTLComputePipelineStateObject) NewVisibleFunctionTableWithDescriptor(descriptor IMTLVisibleFunctionTableDescriptor) MTLVisibleFunctionTable
- func (o MTLComputePipelineStateObject) Reflection() IMTLComputePipelineReflection
- func (o MTLComputePipelineStateObject) RequiredThreadsPerThreadgroup() MTLSize
- func (o MTLComputePipelineStateObject) ShaderValidation() MTLShaderValidation
- func (o MTLComputePipelineStateObject) StaticThreadgroupMemoryLength() uint
- func (o MTLComputePipelineStateObject) SupportIndirectCommandBuffers() bool
- func (o MTLComputePipelineStateObject) ThreadExecutionWidth() uint
- type MTLCoordinate2D
- type MTLCounter
- type MTLCounterObject
- type MTLCounterResultStageUtilization
- type MTLCounterResultStatistic
- type MTLCounterResultTimestamp
- type MTLCounterSampleBuffer
- type MTLCounterSampleBufferDescriptor
- func (c MTLCounterSampleBufferDescriptor) Autorelease() MTLCounterSampleBufferDescriptor
- func (c MTLCounterSampleBufferDescriptor) CounterSet() MTLCounterSet
- func (c MTLCounterSampleBufferDescriptor) Init() MTLCounterSampleBufferDescriptor
- func (c MTLCounterSampleBufferDescriptor) Label() string
- func (c MTLCounterSampleBufferDescriptor) MTLCounterDontSample() int
- func (c MTLCounterSampleBufferDescriptor) SampleCount() uint
- func (c MTLCounterSampleBufferDescriptor) SetCounterSet(value MTLCounterSet)
- func (c MTLCounterSampleBufferDescriptor) SetLabel(value string)
- func (c MTLCounterSampleBufferDescriptor) SetMTLCounterDontSample(value int)
- func (c MTLCounterSampleBufferDescriptor) SetSampleCount(value uint)
- func (c MTLCounterSampleBufferDescriptor) SetStorageMode(value MTLStorageMode)
- func (c MTLCounterSampleBufferDescriptor) StorageMode() MTLStorageMode
- type MTLCounterSampleBufferDescriptorClass
- type MTLCounterSampleBufferError
- type MTLCounterSampleBufferObject
- func (o MTLCounterSampleBufferObject) BaseObject() objectivec.Object
- func (o MTLCounterSampleBufferObject) Device() MTLDevice
- func (o MTLCounterSampleBufferObject) Label() string
- func (o MTLCounterSampleBufferObject) ResolveCounterRange(range_ foundation.NSRange) foundation.INSData
- func (o MTLCounterSampleBufferObject) SampleCount() uint
- type MTLCounterSamplingPoint
- type MTLCounterSet
- type MTLCounterSetObject
- type MTLCullMode
- type MTLCurveBasis
- type MTLCurveEndCaps
- type MTLCurveType
- type MTLDataType
- type MTLDepthClipMode
- type MTLDepthStencilDescriptor
- func (d MTLDepthStencilDescriptor) Autorelease() MTLDepthStencilDescriptor
- func (d MTLDepthStencilDescriptor) BackFaceStencil() IMTLStencilDescriptor
- func (d MTLDepthStencilDescriptor) DepthCompareFunction() MTLCompareFunction
- func (d MTLDepthStencilDescriptor) DepthWriteEnabled() bool
- func (d MTLDepthStencilDescriptor) FrontFaceStencil() IMTLStencilDescriptor
- func (d MTLDepthStencilDescriptor) Init() MTLDepthStencilDescriptor
- func (d MTLDepthStencilDescriptor) Label() string
- func (d MTLDepthStencilDescriptor) SetBackFaceStencil(value IMTLStencilDescriptor)
- func (d MTLDepthStencilDescriptor) SetDepthCompareFunction(value MTLCompareFunction)
- func (d MTLDepthStencilDescriptor) SetDepthWriteEnabled(value bool)
- func (d MTLDepthStencilDescriptor) SetFrontFaceStencil(value IMTLStencilDescriptor)
- func (d MTLDepthStencilDescriptor) SetLabel(value string)
- type MTLDepthStencilDescriptorClass
- type MTLDepthStencilState
- type MTLDepthStencilStateObject
- type MTLDevice
- type MTLDeviceLocation
- type MTLDeviceNotificationHandler
- type MTLDeviceNotificationName
- type MTLDeviceObject
- func (o MTLDeviceObject) AccelerationStructureSizesWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructureSizes
- func (o MTLDeviceObject) Architecture() IMTLArchitecture
- func (o MTLDeviceObject) ArgumentBuffersSupport() MTLArgumentBuffersTier
- func (o MTLDeviceObject) BaseObject() objectivec.Object
- func (o MTLDeviceObject) ConvertSparsePixelRegionsToTileRegionsWithTileSizeAlignmentModeNumRegions(pixelRegions []MTLRegion, tileRegions []MTLRegion, tileSize MTLSize, ...)
- func (o MTLDeviceObject) ConvertSparseTileRegionsToPixelRegionsWithTileSizeNumRegions(tileRegions []MTLRegion, pixelRegions []MTLRegion, tileSize MTLSize, ...)
- func (o MTLDeviceObject) CounterSets() []objectivec.IObject
- func (o MTLDeviceObject) CurrentAllocatedSize() uint
- func (o MTLDeviceObject) Depth24Stencil8PixelFormatSupported() bool
- func (o MTLDeviceObject) FunctionHandleWithBinaryFunction(function MTL4BinaryFunction) MTLFunctionHandle
- func (o MTLDeviceObject) FunctionHandleWithFunction(function MTLFunction) MTLFunctionHandle
- func (o MTLDeviceObject) GetDefaultSamplePositionsCount(positions *MTLSamplePosition, count uint)
- func (o MTLDeviceObject) HasUnifiedMemory() bool
- func (o MTLDeviceObject) Headless() bool
- func (o MTLDeviceObject) HeapAccelerationStructureSizeAndAlignWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLSizeAndAlign
- func (o MTLDeviceObject) HeapAccelerationStructureSizeAndAlignWithSize(size uint) MTLSizeAndAlign
- func (o MTLDeviceObject) HeapBufferSizeAndAlignWithLengthOptions(length uint, options MTLResourceOptions) MTLSizeAndAlign
- func (o MTLDeviceObject) HeapTextureSizeAndAlignWithDescriptor(desc IMTLTextureDescriptor) MTLSizeAndAlign
- func (o MTLDeviceObject) Location() MTLDeviceLocation
- func (o MTLDeviceObject) LocationNumber() uint
- func (o MTLDeviceObject) LowPower() bool
- func (o MTLDeviceObject) MaxArgumentBufferSamplerCount() uint
- func (o MTLDeviceObject) MaxBufferLength() uint
- func (o MTLDeviceObject) MaxThreadgroupMemoryLength() uint
- func (o MTLDeviceObject) MaxThreadsPerThreadgroup() MTLSize
- func (o MTLDeviceObject) MaxTransferRate() uint64
- func (o MTLDeviceObject) MaximumConcurrentCompilationTaskCount() uint
- func (o MTLDeviceObject) MinimumLinearTextureAlignmentForPixelFormat(format MTLPixelFormat) uint
- func (o MTLDeviceObject) MinimumTextureBufferAlignmentForPixelFormat(format MTLPixelFormat) uint
- func (o MTLDeviceObject) Name() string
- func (o MTLDeviceObject) NewAccelerationStructureWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructure
- func (o MTLDeviceObject) NewAccelerationStructureWithSize(size uint) MTLAccelerationStructure
- func (o MTLDeviceObject) NewArchiveWithURLError(url foundation.INSURL) (MTL4Archive, error)
- func (o MTLDeviceObject) NewArgumentEncoderWithArguments(arguments []MTLArgumentDescriptor) MTLArgumentEncoder
- func (o MTLDeviceObject) NewArgumentEncoderWithBufferBinding(bufferBinding MTLBufferBinding) MTLArgumentEncoder
- func (o MTLDeviceObject) NewArgumentTableWithDescriptorError(descriptor IMTL4ArgumentTableDescriptor) (MTL4ArgumentTable, error)
- func (o MTLDeviceObject) NewBinaryArchiveWithDescriptorError(descriptor IMTLBinaryArchiveDescriptor) (MTLBinaryArchive, error)
- func (o MTLDeviceObject) NewBufferWithBytesLengthOptions(pointer unsafe.Pointer, length uint, options MTLResourceOptions) MTLBuffer
- func (o MTLDeviceObject) NewBufferWithBytesNoCopyLengthOptionsDeallocator(pointer unsafe.Pointer, length uint, options MTLResourceOptions, ...) MTLBuffer
- func (o MTLDeviceObject) NewBufferWithLengthOptions(length uint, options MTLResourceOptions) MTLBuffer
- func (o MTLDeviceObject) NewBufferWithLengthOptionsPlacementSparsePageSize(length uint, options MTLResourceOptions, ...) MTLBuffer
- func (o MTLDeviceObject) NewCommandAllocator() MTL4CommandAllocator
- func (o MTLDeviceObject) NewCommandAllocatorWithDescriptorError(descriptor IMTL4CommandAllocatorDescriptor) (MTL4CommandAllocator, error)
- func (o MTLDeviceObject) NewCommandBuffer() MTL4CommandBuffer
- func (o MTLDeviceObject) NewCommandQueue() MTLCommandQueue
- func (o MTLDeviceObject) NewCommandQueueWithDescriptor(descriptor IMTLCommandQueueDescriptor) MTLCommandQueue
- func (o MTLDeviceObject) NewCommandQueueWithMaxCommandBufferCount(maxCommandBufferCount uint) MTLCommandQueue
- func (o MTLDeviceObject) NewCompilerWithDescriptorError(descriptor IMTL4CompilerDescriptor) (MTL4Compiler, error)
- func (o MTLDeviceObject) NewComputePipelineStateWithDescriptorOptionsCompletionHandler(descriptor IMTLComputePipelineDescriptor, options MTLPipelineOption, ...)
- func (o MTLDeviceObject) NewComputePipelineStateWithDescriptorOptionsReflectionError(descriptor IMTLComputePipelineDescriptor, options MTLPipelineOption, ...) (MTLComputePipelineState, error)
- func (o MTLDeviceObject) NewComputePipelineStateWithFunctionCompletionHandler(computeFunction MTLFunction, completionHandler ErrorHandler)
- func (o MTLDeviceObject) NewComputePipelineStateWithFunctionError(computeFunction MTLFunction) (MTLComputePipelineState, error)
- func (o MTLDeviceObject) NewComputePipelineStateWithFunctionOptionsCompletionHandler(computeFunction MTLFunction, options MTLPipelineOption, ...)
- func (o MTLDeviceObject) NewComputePipelineStateWithFunctionOptionsReflectionError(computeFunction MTLFunction, options MTLPipelineOption, ...) (MTLComputePipelineState, error)
- func (o MTLDeviceObject) NewCounterHeapWithDescriptorError(descriptor IMTL4CounterHeapDescriptor) (MTL4CounterHeap, error)
- func (o MTLDeviceObject) NewCounterSampleBufferWithDescriptorError(descriptor IMTLCounterSampleBufferDescriptor) (MTLCounterSampleBuffer, error)
- func (o MTLDeviceObject) NewDefaultLibrary() MTLLibrary
- func (o MTLDeviceObject) NewDefaultLibraryWithBundleError(bundle foundation.NSBundle) (MTLLibrary, error)
- func (o MTLDeviceObject) NewDepthStencilStateWithDescriptor(descriptor IMTLDepthStencilDescriptor) MTLDepthStencilState
- func (o MTLDeviceObject) NewDynamicLibraryError(library MTLLibrary) (MTLDynamicLibrary, error)
- func (o MTLDeviceObject) NewDynamicLibraryWithURLError(url foundation.INSURL) (MTLDynamicLibrary, error)
- func (o MTLDeviceObject) NewEvent() MTLEvent
- func (o MTLDeviceObject) NewFence() MTLFence
- func (o MTLDeviceObject) NewHeapWithDescriptor(descriptor IMTLHeapDescriptor) MTLHeap
- func (o MTLDeviceObject) NewIOCommandQueueWithDescriptorError(descriptor IMTLIOCommandQueueDescriptor) (MTLIOCommandQueue, error)
- func (o MTLDeviceObject) NewIOFileHandleWithURLCompressionMethodError(url foundation.INSURL, compressionMethod MTLIOCompressionMethod) (MTLIOFileHandle, error)
- func (o MTLDeviceObject) NewIOFileHandleWithURLError(url foundation.INSURL) (MTLIOFileHandle, error)
- func (o MTLDeviceObject) NewIndirectCommandBufferWithDescriptorMaxCommandCountOptions(descriptor IMTLIndirectCommandBufferDescriptor, maxCount uint, ...) MTLIndirectCommandBuffer
- func (o MTLDeviceObject) NewLibraryWithDataError(data dispatch.Data) (MTLLibrary, error)
- func (o MTLDeviceObject) NewLibraryWithSourceOptionsCompletionHandler(source string, options IMTLCompileOptions, completionHandler ErrorHandler)
- func (o MTLDeviceObject) NewLibraryWithSourceOptionsError(source string, options IMTLCompileOptions) (MTLLibrary, error)
- func (o MTLDeviceObject) NewLibraryWithStitchedDescriptorCompletionHandler(descriptor IMTLStitchedLibraryDescriptor, completionHandler ErrorHandler)
- func (o MTLDeviceObject) NewLibraryWithStitchedDescriptorError(descriptor IMTLStitchedLibraryDescriptor) (MTLLibrary, error)
- func (o MTLDeviceObject) NewLibraryWithURLError(url foundation.INSURL) (MTLLibrary, error)
- func (o MTLDeviceObject) NewLogStateWithDescriptorError(descriptor IMTLLogStateDescriptor) (MTLLogState, error)
- func (o MTLDeviceObject) NewMTL4CommandQueue() MTL4CommandQueue
- func (o MTLDeviceObject) NewMTL4CommandQueueWithDescriptorError(descriptor IMTL4CommandQueueDescriptor) (MTL4CommandQueue, error)
- func (o MTLDeviceObject) NewPipelineDataSetSerializerWithDescriptor(descriptor IMTL4PipelineDataSetSerializerDescriptor) MTL4PipelineDataSetSerializer
- func (o MTLDeviceObject) NewRasterizationRateMapWithDescriptor(descriptor IMTLRasterizationRateMapDescriptor) MTLRasterizationRateMap
- func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorCompletionHandler(descriptor IMTLRenderPipelineDescriptor, completionHandler ErrorHandler)
- func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorError(descriptor IMTLRenderPipelineDescriptor) (MTLRenderPipelineState, error)
- func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorOptionsCompletionHandler(descriptor IMTLRenderPipelineDescriptor, options MTLPipelineOption, ...)
- func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorOptionsReflectionError(descriptor IMTLRenderPipelineDescriptor, options MTLPipelineOption, ...) (MTLRenderPipelineState, error)
- func (o MTLDeviceObject) NewRenderPipelineStateWithMeshDescriptorOptionsCompletionHandler(descriptor IMTLMeshRenderPipelineDescriptor, options MTLPipelineOption, ...)
- func (o MTLDeviceObject) NewRenderPipelineStateWithMeshDescriptorOptionsReflectionError(descriptor IMTLMeshRenderPipelineDescriptor, options MTLPipelineOption, ...) (MTLRenderPipelineState, error)
- func (o MTLDeviceObject) NewRenderPipelineStateWithTileDescriptorOptionsCompletionHandler(descriptor IMTLTileRenderPipelineDescriptor, options MTLPipelineOption, ...)
- func (o MTLDeviceObject) NewRenderPipelineStateWithTileDescriptorOptionsReflectionError(descriptor IMTLTileRenderPipelineDescriptor, options MTLPipelineOption, ...) (MTLRenderPipelineState, error)
- func (o MTLDeviceObject) NewResidencySetWithDescriptorError(desc IMTLResidencySetDescriptor) (MTLResidencySet, error)
- func (o MTLDeviceObject) NewSamplerStateWithDescriptor(descriptor IMTLSamplerDescriptor) MTLSamplerState
- func (o MTLDeviceObject) NewSharedEvent() MTLSharedEvent
- func (o MTLDeviceObject) NewSharedEventWithHandle(sharedEventHandle IMTLSharedEventHandle) MTLSharedEvent
- func (o MTLDeviceObject) NewSharedEventWithMachPort(port uint32) MTLSharedEvent
- func (o MTLDeviceObject) NewSharedTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
- func (o MTLDeviceObject) NewSharedTextureWithHandle(sharedHandle IMTLSharedTextureHandle) MTLTexture
- func (o MTLDeviceObject) NewTensorWithDescriptorError(descriptor IMTLTensorDescriptor) (MTLTensor, error)
- func (o MTLDeviceObject) NewTextureViewPoolWithDescriptorError(descriptor IMTLResourceViewPoolDescriptor) (MTLTextureViewPool, error)
- func (o MTLDeviceObject) NewTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
- func (o MTLDeviceObject) NewTextureWithDescriptorIosurfacePlane(descriptor IMTLTextureDescriptor, iosurface iosurface.IOSurfaceRef, plane uint) MTLTexture
- func (o MTLDeviceObject) PeerCount() uint32
- func (o MTLDeviceObject) PeerGroupID() uint64
- func (o MTLDeviceObject) PeerIndex() uint32
- func (o MTLDeviceObject) ProgrammableSamplePositionsSupported() bool
- func (o MTLDeviceObject) QueryTimestampFrequency() uint64
- func (o MTLDeviceObject) RasterOrderGroupsSupported() bool
- func (o MTLDeviceObject) ReadWriteTextureSupport() MTLReadWriteTextureTier
- func (o MTLDeviceObject) RecommendedMaxWorkingSetSize() uint64
- func (o MTLDeviceObject) RegistryID() uint64
- func (o MTLDeviceObject) Removable() bool
- func (o MTLDeviceObject) SampleTimestampsGpuTimestamp(cpuTimestamp *MTLTimestamp, gpuTimestamp *MTLTimestamp)
- func (o MTLDeviceObject) SetShouldMaximizeConcurrentCompilation(value bool)
- func (o MTLDeviceObject) ShouldMaximizeConcurrentCompilation() bool
- func (o MTLDeviceObject) SizeOfCounterHeapEntry(type_ MTL4CounterHeapType) uint
- func (o MTLDeviceObject) SparseTileSizeInBytes() uint
- func (o MTLDeviceObject) SparseTileSizeInBytesForSparsePageSize(sparsePageSize MTLSparsePageSize) uint
- func (o MTLDeviceObject) SparseTileSizeWithTextureTypePixelFormatSampleCount(textureType MTLTextureType, pixelFormat MTLPixelFormat, sampleCount uint) MTLSize
- func (o MTLDeviceObject) SparseTileSizeWithTextureTypePixelFormatSampleCountSparsePageSize(textureType MTLTextureType, pixelFormat MTLPixelFormat, sampleCount uint, ...) MTLSize
- func (o MTLDeviceObject) Supports32BitFloatFiltering() bool
- func (o MTLDeviceObject) Supports32BitMSAA() bool
- func (o MTLDeviceObject) SupportsBCTextureCompression() bool
- func (o MTLDeviceObject) SupportsCounterSampling(samplingPoint MTLCounterSamplingPoint) bool
- func (o MTLDeviceObject) SupportsDynamicLibraries() bool
- func (o MTLDeviceObject) SupportsFamily(gpuFamily MTLGPUFamily) bool
- func (o MTLDeviceObject) SupportsFunctionPointers() bool
- func (o MTLDeviceObject) SupportsFunctionPointersFromRender() bool
- func (o MTLDeviceObject) SupportsPlacementSparse() bool
- func (o MTLDeviceObject) SupportsPrimitiveMotionBlur() bool
- func (o MTLDeviceObject) SupportsPullModelInterpolation() bool
- func (o MTLDeviceObject) SupportsQueryTextureLOD() bool
- func (o MTLDeviceObject) SupportsRasterizationRateMapWithLayerCount(layerCount uint) bool
- func (o MTLDeviceObject) SupportsRaytracing() bool
- func (o MTLDeviceObject) SupportsRaytracingFromRender() bool
- func (o MTLDeviceObject) SupportsRenderDynamicLibraries() bool
- func (o MTLDeviceObject) SupportsShaderBarycentricCoordinates() bool
- func (o MTLDeviceObject) SupportsTextureSampleCount(sampleCount uint) bool
- func (o MTLDeviceObject) SupportsVertexAmplificationCount(count uint) bool
- func (o MTLDeviceObject) TensorSizeAndAlignWithDescriptor(descriptor IMTLTensorDescriptor) MTLSizeAndAlign
- type MTLDispatchThreadgroupsIndirectArguments
- type MTLDispatchThreadsIndirectArguments
- type MTLDispatchType
- type MTLDrawIndexedPrimitivesIndirectArguments
- type MTLDrawPatchIndirectArguments
- type MTLDrawPrimitivesIndirectArguments
- type MTLDrawable
- type MTLDrawableObject
- func (o MTLDrawableObject) AddPresentedHandler(block MTLDrawablePresentedHandler)
- func (o MTLDrawableObject) BaseObject() objectivec.Object
- func (o MTLDrawableObject) DrawableID() uint
- func (o MTLDrawableObject) Present()
- func (o MTLDrawableObject) PresentAfterMinimumDuration(duration float64)
- func (o MTLDrawableObject) PresentAtTime(presentationTime float64)
- func (o MTLDrawableObject) PresentedTime() float64
- type MTLDrawablePresentedHandler
- type MTLDynamicLibrary
- type MTLDynamicLibraryError
- type MTLDynamicLibraryObject
- func (o MTLDynamicLibraryObject) BaseObject() objectivec.Object
- func (o MTLDynamicLibraryObject) Device() MTLDevice
- func (o MTLDynamicLibraryObject) InstallName() string
- func (o MTLDynamicLibraryObject) Label() string
- func (o MTLDynamicLibraryObject) SerializeToURLError(url foundation.INSURL) (bool, error)
- func (o MTLDynamicLibraryObject) SetLabel(value string)
- type MTLEvent
- type MTLEventObject
- type MTLFeatureSet
- type MTLFence
- type MTLFenceObject
- type MTLFunction
- type MTLFunctionConstant
- type MTLFunctionConstantClass
- type MTLFunctionConstantValues
- func (f MTLFunctionConstantValues) Autorelease() MTLFunctionConstantValues
- func (f MTLFunctionConstantValues) Init() MTLFunctionConstantValues
- func (f MTLFunctionConstantValues) Reset()
- func (f MTLFunctionConstantValues) SetConstantValueTypeAtIndex(value unsafe.Pointer, type_ MTLDataType, index uint)
- func (f MTLFunctionConstantValues) SetConstantValueTypeWithName(value unsafe.Pointer, type_ MTLDataType, name string)
- func (f MTLFunctionConstantValues) SetConstantValuesTypeWithRange(values unsafe.Pointer, type_ MTLDataType, range_ foundation.NSRange)
- type MTLFunctionConstantValuesClass
- type MTLFunctionDescriptor
- func (f MTLFunctionDescriptor) Autorelease() MTLFunctionDescriptor
- func (f MTLFunctionDescriptor) BinaryArchives() []objectivec.IObject
- func (f MTLFunctionDescriptor) ConstantValues() IMTLFunctionConstantValues
- func (f MTLFunctionDescriptor) Init() MTLFunctionDescriptor
- func (f MTLFunctionDescriptor) Name() string
- func (f MTLFunctionDescriptor) Options() MTLFunctionOptions
- func (f MTLFunctionDescriptor) SetBinaryArchives(value []objectivec.IObject)
- func (f MTLFunctionDescriptor) SetConstantValues(value IMTLFunctionConstantValues)
- func (f MTLFunctionDescriptor) SetName(value string)
- func (f MTLFunctionDescriptor) SetOptions(value MTLFunctionOptions)
- func (f MTLFunctionDescriptor) SetSpecializedName(value string)
- func (f MTLFunctionDescriptor) SpecializedName() string
- type MTLFunctionDescriptorClass
- type MTLFunctionErrorHandler
- type MTLFunctionHandle
- type MTLFunctionHandleObject
- type MTLFunctionLog
- type MTLFunctionLogDebugLocation
- type MTLFunctionLogDebugLocationObject
- func (o MTLFunctionLogDebugLocationObject) BaseObject() objectivec.Object
- func (o MTLFunctionLogDebugLocationObject) Column() uint
- func (o MTLFunctionLogDebugLocationObject) FunctionName() string
- func (o MTLFunctionLogDebugLocationObject) Line() uint
- func (o MTLFunctionLogDebugLocationObject) URL() foundation.INSURL
- type MTLFunctionLogObject
- type MTLFunctionLogType
- type MTLFunctionObject
- func (o MTLFunctionObject) BaseObject() objectivec.Object
- func (o MTLFunctionObject) Device() MTLDevice
- func (o MTLFunctionObject) FunctionConstantsDictionary() foundation.INSDictionary
- func (o MTLFunctionObject) FunctionType() MTLFunctionType
- func (o MTLFunctionObject) Label() string
- func (o MTLFunctionObject) Name() string
- func (o MTLFunctionObject) NewArgumentEncoderWithBufferIndex(bufferIndex uint) MTLArgumentEncoder
- func (o MTLFunctionObject) Options() MTLFunctionOptions
- func (o MTLFunctionObject) PatchControlPointCount() int
- func (o MTLFunctionObject) PatchType() MTLPatchType
- func (o MTLFunctionObject) SetLabel(value string)
- func (o MTLFunctionObject) StageInputAttributes() []MTLAttribute
- func (o MTLFunctionObject) VertexAttributes() []MTLVertexAttribute
- type MTLFunctionOptions
- type MTLFunctionReflection
- type MTLFunctionReflectionClass
- type MTLFunctionStitchingAttribute
- type MTLFunctionStitchingAttributeAlwaysInline
- func (f MTLFunctionStitchingAttributeAlwaysInline) Attributes() MTLFunctionStitchingAttribute
- func (f MTLFunctionStitchingAttributeAlwaysInline) Autorelease() MTLFunctionStitchingAttributeAlwaysInline
- func (f MTLFunctionStitchingAttributeAlwaysInline) Init() MTLFunctionStitchingAttributeAlwaysInline
- func (f MTLFunctionStitchingAttributeAlwaysInline) SetAttributes(value MTLFunctionStitchingAttribute)
- type MTLFunctionStitchingAttributeAlwaysInlineClass
- type MTLFunctionStitchingAttributeObject
- type MTLFunctionStitchingFunctionNode
- func MTLFunctionStitchingFunctionNodeFromID(id objc.ID) MTLFunctionStitchingFunctionNode
- func NewFunctionStitchingFunctionNodeWithNameArgumentsControlDependencies(name string, arguments []objectivec.IObject, ...) MTLFunctionStitchingFunctionNode
- func NewMTLFunctionStitchingFunctionNode() MTLFunctionStitchingFunctionNode
- func (f MTLFunctionStitchingFunctionNode) Arguments() []objectivec.IObject
- func (f MTLFunctionStitchingFunctionNode) Autorelease() MTLFunctionStitchingFunctionNode
- func (f MTLFunctionStitchingFunctionNode) ControlDependencies() []MTLFunctionStitchingFunctionNode
- func (f MTLFunctionStitchingFunctionNode) Init() MTLFunctionStitchingFunctionNode
- func (f MTLFunctionStitchingFunctionNode) InitWithNameArgumentsControlDependencies(name string, arguments []objectivec.IObject, ...) MTLFunctionStitchingFunctionNode
- func (f MTLFunctionStitchingFunctionNode) Name() string
- func (f MTLFunctionStitchingFunctionNode) SetArguments(value []objectivec.IObject)
- func (f MTLFunctionStitchingFunctionNode) SetControlDependencies(value []MTLFunctionStitchingFunctionNode)
- func (f MTLFunctionStitchingFunctionNode) SetName(value string)
- type MTLFunctionStitchingFunctionNodeClass
- type MTLFunctionStitchingGraph
- func MTLFunctionStitchingGraphFromID(id objc.ID) MTLFunctionStitchingGraph
- func NewFunctionStitchingGraphWithFunctionNameNodesOutputNodeAttributes(functionName string, nodes []MTLFunctionStitchingFunctionNode, ...) MTLFunctionStitchingGraph
- func NewMTLFunctionStitchingGraph() MTLFunctionStitchingGraph
- func (f MTLFunctionStitchingGraph) Attributes() []objectivec.IObject
- func (f MTLFunctionStitchingGraph) Autorelease() MTLFunctionStitchingGraph
- func (f MTLFunctionStitchingGraph) FunctionName() string
- func (f MTLFunctionStitchingGraph) Init() MTLFunctionStitchingGraph
- func (f MTLFunctionStitchingGraph) InitWithFunctionNameNodesOutputNodeAttributes(functionName string, nodes []MTLFunctionStitchingFunctionNode, ...) MTLFunctionStitchingGraph
- func (f MTLFunctionStitchingGraph) Nodes() []MTLFunctionStitchingFunctionNode
- func (f MTLFunctionStitchingGraph) OutputNode() IMTLFunctionStitchingFunctionNode
- func (f MTLFunctionStitchingGraph) SetAttributes(value []objectivec.IObject)
- func (f MTLFunctionStitchingGraph) SetFunctionName(value string)
- func (f MTLFunctionStitchingGraph) SetNodes(value []MTLFunctionStitchingFunctionNode)
- func (f MTLFunctionStitchingGraph) SetOutputNode(value IMTLFunctionStitchingFunctionNode)
- type MTLFunctionStitchingGraphClass
- type MTLFunctionStitchingInputNode
- func (f MTLFunctionStitchingInputNode) ArgumentIndex() uint
- func (f MTLFunctionStitchingInputNode) Autorelease() MTLFunctionStitchingInputNode
- func (f MTLFunctionStitchingInputNode) Init() MTLFunctionStitchingInputNode
- func (f MTLFunctionStitchingInputNode) InitWithArgumentIndex(argument uint) MTLFunctionStitchingInputNode
- func (f MTLFunctionStitchingInputNode) SetArgumentIndex(value uint)
- type MTLFunctionStitchingInputNodeClass
- type MTLFunctionStitchingNode
- type MTLFunctionStitchingNodeObject
- type MTLFunctionType
- type MTLGPUAddress
- type MTLGPUFamily
- type MTLHazardTrackingMode
- type MTLHeap
- type MTLHeapDescriptor
- func (h MTLHeapDescriptor) Autorelease() MTLHeapDescriptor
- func (h MTLHeapDescriptor) CpuCacheMode() MTLCPUCacheMode
- func (h MTLHeapDescriptor) HazardTrackingMode() MTLHazardTrackingMode
- func (h MTLHeapDescriptor) Init() MTLHeapDescriptor
- func (h MTLHeapDescriptor) MaxCompatiblePlacementSparsePageSize() MTLSparsePageSize
- func (h MTLHeapDescriptor) ResourceOptions() MTLResourceOptions
- func (h MTLHeapDescriptor) SetCpuCacheMode(value MTLCPUCacheMode)
- func (h MTLHeapDescriptor) SetHazardTrackingMode(value MTLHazardTrackingMode)
- func (h MTLHeapDescriptor) SetMaxCompatiblePlacementSparsePageSize(value MTLSparsePageSize)
- func (h MTLHeapDescriptor) SetResourceOptions(value MTLResourceOptions)
- func (h MTLHeapDescriptor) SetSize(value uint)
- func (h MTLHeapDescriptor) SetSparsePageSize(value MTLSparsePageSize)
- func (h MTLHeapDescriptor) SetStorageMode(value MTLStorageMode)
- func (h MTLHeapDescriptor) SetType(value MTLHeapType)
- func (h MTLHeapDescriptor) Size() uint
- func (h MTLHeapDescriptor) SparsePageSize() MTLSparsePageSize
- func (h MTLHeapDescriptor) StorageMode() MTLStorageMode
- func (h MTLHeapDescriptor) Type() MTLHeapType
- type MTLHeapDescriptorClass
- type MTLHeapObject
- func (o MTLHeapObject) AllocatedSize() uint
- func (o MTLHeapObject) BaseObject() objectivec.Object
- func (o MTLHeapObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLHeapObject) CurrentAllocatedSize() uint
- func (o MTLHeapObject) Device() MTLDevice
- func (o MTLHeapObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLHeapObject) Label() string
- func (o MTLHeapObject) MaxAvailableSizeWithAlignment(alignment uint) uint
- func (o MTLHeapObject) NewAccelerationStructureWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructure
- func (o MTLHeapObject) NewAccelerationStructureWithDescriptorOffset(descriptor IMTLAccelerationStructureDescriptor, offset uint) MTLAccelerationStructure
- func (o MTLHeapObject) NewAccelerationStructureWithSize(size uint) MTLAccelerationStructure
- func (o MTLHeapObject) NewAccelerationStructureWithSizeOffset(size uint, offset uint) MTLAccelerationStructure
- func (o MTLHeapObject) NewBufferWithLengthOptions(length uint, options MTLResourceOptions) MTLBuffer
- func (o MTLHeapObject) NewBufferWithLengthOptionsOffset(length uint, options MTLResourceOptions, offset uint) MTLBuffer
- func (o MTLHeapObject) NewTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
- func (o MTLHeapObject) NewTextureWithDescriptorOffset(descriptor IMTLTextureDescriptor, offset uint) MTLTexture
- func (o MTLHeapObject) ResourceOptions() MTLResourceOptions
- func (o MTLHeapObject) SetLabel(value string)
- func (o MTLHeapObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLHeapObject) Size() uint
- func (o MTLHeapObject) StorageMode() MTLStorageMode
- func (o MTLHeapObject) Type() MTLHeapType
- func (o MTLHeapObject) UsedSize() uint
- type MTLHeapType
- type MTLIOCommandBuffer
- type MTLIOCommandBufferHandler
- type MTLIOCommandBufferObject
- func (o MTLIOCommandBufferObject) AddBarrier()
- func (o MTLIOCommandBufferObject) AddCompletedHandler(block MTLIOCommandBufferHandler)
- func (o MTLIOCommandBufferObject) BaseObject() objectivec.Object
- func (o MTLIOCommandBufferObject) Commit()
- func (o MTLIOCommandBufferObject) CopyStatusToBufferOffset(buffer MTLBuffer, offset uint)
- func (o MTLIOCommandBufferObject) Enqueue()
- func (o MTLIOCommandBufferObject) Error() foundation.INSError
- func (o MTLIOCommandBufferObject) Label() string
- func (o MTLIOCommandBufferObject) LoadBufferOffsetSizeSourceHandleSourceHandleOffset(buffer MTLBuffer, offset uint, size uint, sourceHandle MTLIOFileHandle, ...)
- func (o MTLIOCommandBufferObject) LoadBytesSizeSourceHandleSourceHandleOffset(pointer unsafe.Pointer, size uint, sourceHandle MTLIOFileHandle, ...)
- func (o MTLIOCommandBufferObject) LoadTextureSliceLevelSizeSourceBytesPerRowSourceBytesPerImageDestinationOriginSourceHandleSourceHandleOffset(texture MTLTexture, slice uint, level uint, size MTLSize, ...)
- func (o MTLIOCommandBufferObject) PopDebugGroup()
- func (o MTLIOCommandBufferObject) PushDebugGroup(string_ string)
- func (o MTLIOCommandBufferObject) SetLabel(value string)
- func (o MTLIOCommandBufferObject) SignalEventValue(event MTLSharedEvent, value uint64)
- func (o MTLIOCommandBufferObject) Status() MTLIOStatus
- func (o MTLIOCommandBufferObject) TryCancel()
- func (o MTLIOCommandBufferObject) WaitForEventValue(event MTLSharedEvent, value uint64)
- func (o MTLIOCommandBufferObject) WaitUntilCompleted()
- type MTLIOCommandQueue
- type MTLIOCommandQueueDescriptor
- func (i MTLIOCommandQueueDescriptor) Autorelease() MTLIOCommandQueueDescriptor
- func (i MTLIOCommandQueueDescriptor) Init() MTLIOCommandQueueDescriptor
- func (i MTLIOCommandQueueDescriptor) MaxCommandBufferCount() uint
- func (i MTLIOCommandQueueDescriptor) MaxCommandsInFlight() uint
- func (i MTLIOCommandQueueDescriptor) Priority() MTLIOPriority
- func (i MTLIOCommandQueueDescriptor) ScratchBufferAllocator() MTLIOScratchBufferAllocator
- func (i MTLIOCommandQueueDescriptor) SetMaxCommandBufferCount(value uint)
- func (i MTLIOCommandQueueDescriptor) SetMaxCommandsInFlight(value uint)
- func (i MTLIOCommandQueueDescriptor) SetPriority(value MTLIOPriority)
- func (i MTLIOCommandQueueDescriptor) SetScratchBufferAllocator(value MTLIOScratchBufferAllocator)
- func (i MTLIOCommandQueueDescriptor) SetType(value MTLIOCommandQueueType)
- func (i MTLIOCommandQueueDescriptor) Type() MTLIOCommandQueueType
- type MTLIOCommandQueueDescriptorClass
- type MTLIOCommandQueueObject
- func (o MTLIOCommandQueueObject) BaseObject() objectivec.Object
- func (o MTLIOCommandQueueObject) CommandBuffer() MTLIOCommandBuffer
- func (o MTLIOCommandQueueObject) CommandBufferWithUnretainedReferences() MTLIOCommandBuffer
- func (o MTLIOCommandQueueObject) EnqueueBarrier()
- func (o MTLIOCommandQueueObject) Label() string
- func (o MTLIOCommandQueueObject) SetLabel(value string)
- type MTLIOCommandQueueType
- type MTLIOCompressionContext
- type MTLIOCompressionMethod
- type MTLIOCompressionStatus
- type MTLIOError
- type MTLIOFileHandle
- type MTLIOFileHandleObject
- type MTLIOPriority
- type MTLIOScratchBuffer
- type MTLIOScratchBufferAllocator
- type MTLIOScratchBufferAllocatorObject
- type MTLIOScratchBufferObject
- type MTLIOStatus
- type MTLIndexType
- type MTLIndirectAccelerationStructureInstanceDescriptor
- type MTLIndirectAccelerationStructureMotionInstanceDescriptor
- type MTLIndirectCommandBuffer
- type MTLIndirectCommandBufferDescriptor
- func (i MTLIndirectCommandBufferDescriptor) Autorelease() MTLIndirectCommandBufferDescriptor
- func (i MTLIndirectCommandBufferDescriptor) CommandTypes() MTLIndirectCommandType
- func (i MTLIndirectCommandBufferDescriptor) InheritBuffers() bool
- func (i MTLIndirectCommandBufferDescriptor) InheritCullMode() bool
- func (i MTLIndirectCommandBufferDescriptor) InheritDepthBias() bool
- func (i MTLIndirectCommandBufferDescriptor) InheritDepthClipMode() bool
- func (i MTLIndirectCommandBufferDescriptor) InheritDepthStencilState() bool
- func (i MTLIndirectCommandBufferDescriptor) InheritFrontFacingWinding() bool
- func (i MTLIndirectCommandBufferDescriptor) InheritPipelineState() bool
- func (i MTLIndirectCommandBufferDescriptor) InheritTriangleFillMode() bool
- func (i MTLIndirectCommandBufferDescriptor) Init() MTLIndirectCommandBufferDescriptor
- func (i MTLIndirectCommandBufferDescriptor) MaxFragmentBufferBindCount() uint
- func (i MTLIndirectCommandBufferDescriptor) MaxKernelBufferBindCount() uint
- func (i MTLIndirectCommandBufferDescriptor) MaxKernelThreadgroupMemoryBindCount() uint
- func (i MTLIndirectCommandBufferDescriptor) MaxMeshBufferBindCount() uint
- func (i MTLIndirectCommandBufferDescriptor) MaxObjectBufferBindCount() uint
- func (i MTLIndirectCommandBufferDescriptor) MaxObjectThreadgroupMemoryBindCount() uint
- func (i MTLIndirectCommandBufferDescriptor) MaxVertexBufferBindCount() uint
- func (i MTLIndirectCommandBufferDescriptor) SetCommandTypes(value MTLIndirectCommandType)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritBuffers(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritCullMode(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritDepthBias(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritDepthClipMode(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritDepthStencilState(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritFrontFacingWinding(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritPipelineState(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetInheritTriangleFillMode(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetMaxFragmentBufferBindCount(value uint)
- func (i MTLIndirectCommandBufferDescriptor) SetMaxKernelBufferBindCount(value uint)
- func (i MTLIndirectCommandBufferDescriptor) SetMaxKernelThreadgroupMemoryBindCount(value uint)
- func (i MTLIndirectCommandBufferDescriptor) SetMaxMeshBufferBindCount(value uint)
- func (i MTLIndirectCommandBufferDescriptor) SetMaxObjectBufferBindCount(value uint)
- func (i MTLIndirectCommandBufferDescriptor) SetMaxObjectThreadgroupMemoryBindCount(value uint)
- func (i MTLIndirectCommandBufferDescriptor) SetMaxVertexBufferBindCount(value uint)
- func (i MTLIndirectCommandBufferDescriptor) SetSupportColorAttachmentMapping(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetSupportDynamicAttributeStride(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SetSupportRayTracing(value bool)
- func (i MTLIndirectCommandBufferDescriptor) SupportColorAttachmentMapping() bool
- func (i MTLIndirectCommandBufferDescriptor) SupportDynamicAttributeStride() bool
- func (i MTLIndirectCommandBufferDescriptor) SupportRayTracing() bool
- type MTLIndirectCommandBufferDescriptorClass
- type MTLIndirectCommandBufferExecutionRange
- type MTLIndirectCommandBufferObject
- func (o MTLIndirectCommandBufferObject) AllocatedSize() uint
- func (o MTLIndirectCommandBufferObject) BaseObject() objectivec.Object
- func (o MTLIndirectCommandBufferObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLIndirectCommandBufferObject) Device() MTLDevice
- func (o MTLIndirectCommandBufferObject) GpuResourceID() MTLResourceID
- func (o MTLIndirectCommandBufferObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLIndirectCommandBufferObject) Heap() MTLHeap
- func (o MTLIndirectCommandBufferObject) HeapOffset() uint
- func (o MTLIndirectCommandBufferObject) IndirectComputeCommandAtIndex(commandIndex uint) MTLIndirectComputeCommand
- func (o MTLIndirectCommandBufferObject) IndirectRenderCommandAtIndex(commandIndex uint) MTLIndirectRenderCommand
- func (o MTLIndirectCommandBufferObject) IsAliasable() bool
- func (o MTLIndirectCommandBufferObject) Label() string
- func (o MTLIndirectCommandBufferObject) MakeAliasable()
- func (o MTLIndirectCommandBufferObject) ResetWithRange(range_ foundation.NSRange)
- func (o MTLIndirectCommandBufferObject) ResourceOptions() MTLResourceOptions
- func (o MTLIndirectCommandBufferObject) SetLabel(value string)
- func (o MTLIndirectCommandBufferObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLIndirectCommandBufferObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLIndirectCommandBufferObject) Size() uint
- func (o MTLIndirectCommandBufferObject) StorageMode() MTLStorageMode
- type MTLIndirectCommandType
- type MTLIndirectComputeCommand
- type MTLIndirectComputeCommandObject
- func (o MTLIndirectComputeCommandObject) BaseObject() objectivec.Object
- func (o MTLIndirectComputeCommandObject) ClearBarrier()
- func (o MTLIndirectComputeCommandObject) ConcurrentDispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
- func (o MTLIndirectComputeCommandObject) ConcurrentDispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
- func (o MTLIndirectComputeCommandObject) Reset()
- func (o MTLIndirectComputeCommandObject) SetBarrier()
- func (o MTLIndirectComputeCommandObject) SetComputePipelineState(pipelineState MTLComputePipelineState)
- func (o MTLIndirectComputeCommandObject) SetImageblockWidthHeight(width uint, height uint)
- func (o MTLIndirectComputeCommandObject) SetKernelBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
- func (o MTLIndirectComputeCommandObject) SetKernelBufferOffsetAttributeStrideAtIndex(buffer MTLBuffer, offset uint, stride uint, index uint)
- func (o MTLIndirectComputeCommandObject) SetStageInRegion(region MTLRegion)
- func (o MTLIndirectComputeCommandObject) SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
- type MTLIndirectInstanceAccelerationStructureDescriptor
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) Autorelease() MTLIndirectInstanceAccelerationStructureDescriptor
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) Init() MTLIndirectInstanceAccelerationStructureDescriptor
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceCountBuffer() MTLBuffer
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceCountBufferOffset() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTLBuffer
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBufferOffset() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MaxInstanceCount() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MaxMotionTransformCount() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTLBuffer
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformBufferOffset() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBuffer() MTLBuffer
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBufferOffset() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformStride() uint
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBuffer(value MTLBuffer)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBufferOffset(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTLBuffer)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBufferOffset(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMaxInstanceCount(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMaxMotionTransformCount(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTLBuffer)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBufferOffset(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBuffer(value MTLBuffer)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBufferOffset(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
- func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
- type MTLIndirectInstanceAccelerationStructureDescriptorClass
- func (mc MTLIndirectInstanceAccelerationStructureDescriptorClass) Alloc() MTLIndirectInstanceAccelerationStructureDescriptor
- func (_MTLIndirectInstanceAccelerationStructureDescriptorClass MTLIndirectInstanceAccelerationStructureDescriptorClass) Descriptor() MTLIndirectInstanceAccelerationStructureDescriptor
- type MTLIndirectRenderCommand
- type MTLIndirectRenderCommandObject
- func (o MTLIndirectRenderCommandObject) BaseObject() objectivec.Object
- func (o MTLIndirectRenderCommandObject) ClearBarrier()
- func (o MTLIndirectRenderCommandObject) DrawIndexedPatches()
- func (o MTLIndirectRenderCommandObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, ...)
- func (o MTLIndirectRenderCommandObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, ...)
- func (o MTLIndirectRenderCommandObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, ...)
- func (o MTLIndirectRenderCommandObject) DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstanceTessellationFactorBufferTessellationFactorBufferOffsetTessellationFactorBufferInstanceStride(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, ...)
- func (o MTLIndirectRenderCommandObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, ...)
- func (o MTLIndirectRenderCommandObject) Reset()
- func (o MTLIndirectRenderCommandObject) SetBarrier()
- func (o MTLIndirectRenderCommandObject) SetCullMode(cullMode MTLCullMode)
- func (o MTLIndirectRenderCommandObject) SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
- func (o MTLIndirectRenderCommandObject) SetDepthClipMode(depthClipMode MTLDepthClipMode)
- func (o MTLIndirectRenderCommandObject) SetDepthStencilState(depthStencilState MTLDepthStencilState)
- func (o MTLIndirectRenderCommandObject) SetFragmentBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
- func (o MTLIndirectRenderCommandObject) SetFrontFacingWinding(frontFacingWindning MTLWinding)
- func (o MTLIndirectRenderCommandObject) SetMeshBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
- func (o MTLIndirectRenderCommandObject) SetObjectBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
- func (o MTLIndirectRenderCommandObject) SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
- func (o MTLIndirectRenderCommandObject) SetRenderPipelineState(pipelineState MTLRenderPipelineState)
- func (o MTLIndirectRenderCommandObject) SetTriangleFillMode(fillMode MTLTriangleFillMode)
- func (o MTLIndirectRenderCommandObject) SetVertexBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
- func (o MTLIndirectRenderCommandObject) SetVertexBufferOffsetAttributeStrideAtIndex(buffer MTLBuffer, offset uint, stride uint, index uint)
- type MTLInstanceAccelerationStructureDescriptor
- func (i MTLInstanceAccelerationStructureDescriptor) Autorelease() MTLInstanceAccelerationStructureDescriptor
- func (i MTLInstanceAccelerationStructureDescriptor) Init() MTLInstanceAccelerationStructureDescriptor
- func (i MTLInstanceAccelerationStructureDescriptor) InstanceCount() uint
- func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTLBuffer
- func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorBufferOffset() uint
- func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
- func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
- func (i MTLInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
- func (i MTLInstanceAccelerationStructureDescriptor) InstancedAccelerationStructures() []objectivec.IObject
- func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTLBuffer
- func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformBufferOffset() uint
- func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformCount() uint
- func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformStride() uint
- func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
- func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceCount(value uint)
- func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTLBuffer)
- func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBufferOffset(value uint)
- func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
- func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
- func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
- func (i MTLInstanceAccelerationStructureDescriptor) SetInstancedAccelerationStructures(value []objectivec.IObject)
- func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTLBuffer)
- func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformBufferOffset(value uint)
- func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformCount(value uint)
- func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
- func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
- type MTLInstanceAccelerationStructureDescriptorClass
- type MTLIntersectionFunctionBufferArguments
- type MTLIntersectionFunctionDescriptor
- type MTLIntersectionFunctionDescriptorClass
- type MTLIntersectionFunctionSignature
- type MTLIntersectionFunctionTable
- type MTLIntersectionFunctionTableDescriptor
- func (i MTLIntersectionFunctionTableDescriptor) Autorelease() MTLIntersectionFunctionTableDescriptor
- func (i MTLIntersectionFunctionTableDescriptor) FunctionCount() uint
- func (i MTLIntersectionFunctionTableDescriptor) Init() MTLIntersectionFunctionTableDescriptor
- func (i MTLIntersectionFunctionTableDescriptor) SetFunctionCount(value uint)
- type MTLIntersectionFunctionTableDescriptorClass
- type MTLIntersectionFunctionTableObject
- func (o MTLIntersectionFunctionTableObject) AllocatedSize() uint
- func (o MTLIntersectionFunctionTableObject) BaseObject() objectivec.Object
- func (o MTLIntersectionFunctionTableObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLIntersectionFunctionTableObject) Device() MTLDevice
- func (o MTLIntersectionFunctionTableObject) GpuResourceID() MTLResourceID
- func (o MTLIntersectionFunctionTableObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLIntersectionFunctionTableObject) Heap() MTLHeap
- func (o MTLIntersectionFunctionTableObject) HeapOffset() uint
- func (o MTLIntersectionFunctionTableObject) IsAliasable() bool
- func (o MTLIntersectionFunctionTableObject) Label() string
- func (o MTLIntersectionFunctionTableObject) MakeAliasable()
- func (o MTLIntersectionFunctionTableObject) ResourceOptions() MTLResourceOptions
- func (o MTLIntersectionFunctionTableObject) SetBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
- func (o MTLIntersectionFunctionTableObject) SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLIntersectionFunctionTableObject) SetFunctionAtIndex(function MTLFunctionHandle, index uint)
- func (o MTLIntersectionFunctionTableObject) SetFunctionsWithRange(functions []MTLFunctionHandle, range_ foundation.NSRange)
- func (o MTLIntersectionFunctionTableObject) SetLabel(value string)
- func (o MTLIntersectionFunctionTableObject) SetOpaqueCurveIntersectionFunctionWithSignatureAtIndex(signature MTLIntersectionFunctionSignature, index uint)
- func (o MTLIntersectionFunctionTableObject) SetOpaqueCurveIntersectionFunctionWithSignatureWithRange(signature MTLIntersectionFunctionSignature, range_ foundation.NSRange)
- func (o MTLIntersectionFunctionTableObject) SetOpaqueTriangleIntersectionFunctionWithSignatureAtIndex(signature MTLIntersectionFunctionSignature, index uint)
- func (o MTLIntersectionFunctionTableObject) SetOpaqueTriangleIntersectionFunctionWithSignatureWithRange(signature MTLIntersectionFunctionSignature, range_ foundation.NSRange)
- func (o MTLIntersectionFunctionTableObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLIntersectionFunctionTableObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLIntersectionFunctionTableObject) SetVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
- func (o MTLIntersectionFunctionTableObject) SetVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, bufferRange foundation.NSRange)
- func (o MTLIntersectionFunctionTableObject) StorageMode() MTLStorageMode
- type MTLLanguageVersion
- type MTLLibrary
- type MTLLibraryError
- type MTLLibraryObject
- func (o MTLLibraryObject) BaseObject() objectivec.Object
- func (o MTLLibraryObject) Device() MTLDevice
- func (o MTLLibraryObject) FunctionNames() []string
- func (o MTLLibraryObject) InstallName() string
- func (o MTLLibraryObject) Label() string
- func (o MTLLibraryObject) NewFunctionWithDescriptorCompletionHandler(descriptor IMTLFunctionDescriptor, completionHandler MTLFunctionErrorHandler)
- func (o MTLLibraryObject) NewFunctionWithDescriptorError(descriptor IMTLFunctionDescriptor) (MTLFunction, error)
- func (o MTLLibraryObject) NewFunctionWithName(functionName string) MTLFunction
- func (o MTLLibraryObject) NewFunctionWithNameConstantValuesCompletionHandler(name string, constantValues IMTLFunctionConstantValues, ...)
- func (o MTLLibraryObject) NewFunctionWithNameConstantValuesError(name string, constantValues IMTLFunctionConstantValues) (MTLFunction, error)
- func (o MTLLibraryObject) NewIntersectionFunctionWithDescriptorCompletionHandler(descriptor IMTLIntersectionFunctionDescriptor, ...)
- func (o MTLLibraryObject) NewIntersectionFunctionWithDescriptorError(descriptor IMTLIntersectionFunctionDescriptor) (MTLFunction, error)
- func (o MTLLibraryObject) ReflectionForFunctionWithName(functionName string) IMTLFunctionReflection
- func (o MTLLibraryObject) SetLabel(value string)
- func (o MTLLibraryObject) Type() MTLLibraryType
- type MTLLibraryOptimizationLevel
- type MTLLibraryType
- type MTLLinkedFunctions
- func (l MTLLinkedFunctions) Autorelease() MTLLinkedFunctions
- func (l MTLLinkedFunctions) BinaryArchives() MTLBinaryArchive
- func (l MTLLinkedFunctions) BinaryFunctions() []objectivec.IObject
- func (l MTLLinkedFunctions) ConstantValues() IMTLFunctionConstantValues
- func (l MTLLinkedFunctions) Functions() []objectivec.IObject
- func (l MTLLinkedFunctions) Groups() foundation.INSDictionary
- func (l MTLLinkedFunctions) Init() MTLLinkedFunctions
- func (l MTLLinkedFunctions) Name() string
- func (l MTLLinkedFunctions) Options() MTLFunctionOptions
- func (l MTLLinkedFunctions) PrivateFunctions() []objectivec.IObject
- func (l MTLLinkedFunctions) SetBinaryArchives(value MTLBinaryArchive)
- func (l MTLLinkedFunctions) SetBinaryFunctions(value []objectivec.IObject)
- func (l MTLLinkedFunctions) SetConstantValues(value IMTLFunctionConstantValues)
- func (l MTLLinkedFunctions) SetFunctions(value []objectivec.IObject)
- func (l MTLLinkedFunctions) SetGroups(value foundation.INSDictionary)
- func (l MTLLinkedFunctions) SetName(value string)
- func (l MTLLinkedFunctions) SetOptions(value MTLFunctionOptions)
- func (l MTLLinkedFunctions) SetPrivateFunctions(value []objectivec.IObject)
- func (l MTLLinkedFunctions) SetSpecializedName(value string)
- func (l MTLLinkedFunctions) SpecializedName() string
- type MTLLinkedFunctionsClass
- type MTLLoadAction
- type MTLLogContainer
- type MTLLogContainerObject
- type MTLLogLevel
- type MTLLogState
- type MTLLogStateDescriptor
- func (l MTLLogStateDescriptor) Autorelease() MTLLogStateDescriptor
- func (l MTLLogStateDescriptor) BufferSize() int
- func (l MTLLogStateDescriptor) Init() MTLLogStateDescriptor
- func (l MTLLogStateDescriptor) Level() MTLLogLevel
- func (l MTLLogStateDescriptor) SetBufferSize(value int)
- func (l MTLLogStateDescriptor) SetLevel(value MTLLogLevel)
- type MTLLogStateDescriptorClass
- type MTLLogStateError
- type MTLLogStateObject
- type MTLLogicalToPhysicalColorAttachmentMap
- func (l MTLLogicalToPhysicalColorAttachmentMap) Autorelease() MTLLogicalToPhysicalColorAttachmentMap
- func (l MTLLogicalToPhysicalColorAttachmentMap) GetPhysicalIndexForLogicalIndex(logicalIndex uint) uint
- func (l MTLLogicalToPhysicalColorAttachmentMap) Init() MTLLogicalToPhysicalColorAttachmentMap
- func (l MTLLogicalToPhysicalColorAttachmentMap) Reset()
- func (l MTLLogicalToPhysicalColorAttachmentMap) SetPhysicalIndexForLogicalIndex(physicalIndex uint, logicalIndex uint)
- type MTLLogicalToPhysicalColorAttachmentMapClass
- type MTLMapIndirectArguments
- type MTLMathFloatingPointFunctions
- type MTLMathMode
- type MTLMatrixLayout
- type MTLMeshRenderPipelineDescriptor
- func (m MTLMeshRenderPipelineDescriptor) AlphaToCoverageEnabled() bool
- func (m MTLMeshRenderPipelineDescriptor) AlphaToOneEnabled() bool
- func (m MTLMeshRenderPipelineDescriptor) Autorelease() MTLMeshRenderPipelineDescriptor
- func (m MTLMeshRenderPipelineDescriptor) BinaryArchives() []objectivec.IObject
- func (m MTLMeshRenderPipelineDescriptor) ColorAttachments() IMTLRenderPipelineColorAttachmentDescriptorArray
- func (m MTLMeshRenderPipelineDescriptor) DepthAttachmentPixelFormat() MTLPixelFormat
- func (m MTLMeshRenderPipelineDescriptor) FragmentBuffers() IMTLPipelineBufferDescriptorArray
- func (m MTLMeshRenderPipelineDescriptor) FragmentFunction() MTLFunction
- func (m MTLMeshRenderPipelineDescriptor) FragmentLinkedFunctions() IMTLLinkedFunctions
- func (m MTLMeshRenderPipelineDescriptor) Init() MTLMeshRenderPipelineDescriptor
- func (m MTLMeshRenderPipelineDescriptor) Label() string
- func (m MTLMeshRenderPipelineDescriptor) MaxTotalThreadgroupsPerMeshGrid() uint
- func (m MTLMeshRenderPipelineDescriptor) MaxTotalThreadsPerMeshThreadgroup() uint
- func (m MTLMeshRenderPipelineDescriptor) MaxTotalThreadsPerObjectThreadgroup() uint
- func (m MTLMeshRenderPipelineDescriptor) MaxVertexAmplificationCount() uint
- func (m MTLMeshRenderPipelineDescriptor) MeshBuffers() IMTLPipelineBufferDescriptorArray
- func (m MTLMeshRenderPipelineDescriptor) MeshFunction() MTLFunction
- func (m MTLMeshRenderPipelineDescriptor) MeshLinkedFunctions() IMTLLinkedFunctions
- func (m MTLMeshRenderPipelineDescriptor) MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
- func (m MTLMeshRenderPipelineDescriptor) ObjectBuffers() IMTLPipelineBufferDescriptorArray
- func (m MTLMeshRenderPipelineDescriptor) ObjectFunction() MTLFunction
- func (m MTLMeshRenderPipelineDescriptor) ObjectLinkedFunctions() IMTLLinkedFunctions
- func (m MTLMeshRenderPipelineDescriptor) ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
- func (m MTLMeshRenderPipelineDescriptor) PayloadMemoryLength() uint
- func (m MTLMeshRenderPipelineDescriptor) RasterSampleCount() uint
- func (m MTLMeshRenderPipelineDescriptor) RasterizationEnabled() bool
- func (m MTLMeshRenderPipelineDescriptor) RequiredThreadsPerMeshThreadgroup() MTLSize
- func (m MTLMeshRenderPipelineDescriptor) RequiredThreadsPerObjectThreadgroup() MTLSize
- func (m MTLMeshRenderPipelineDescriptor) Reset()
- func (m MTLMeshRenderPipelineDescriptor) SetAlphaToCoverageEnabled(value bool)
- func (m MTLMeshRenderPipelineDescriptor) SetAlphaToOneEnabled(value bool)
- func (m MTLMeshRenderPipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
- func (m MTLMeshRenderPipelineDescriptor) SetDepthAttachmentPixelFormat(value MTLPixelFormat)
- func (m MTLMeshRenderPipelineDescriptor) SetFragmentFunction(value MTLFunction)
- func (m MTLMeshRenderPipelineDescriptor) SetFragmentLinkedFunctions(value IMTLLinkedFunctions)
- func (m MTLMeshRenderPipelineDescriptor) SetLabel(value string)
- func (m MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadgroupsPerMeshGrid(value uint)
- func (m MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadsPerMeshThreadgroup(value uint)
- func (m MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadsPerObjectThreadgroup(value uint)
- func (m MTLMeshRenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
- func (m MTLMeshRenderPipelineDescriptor) SetMeshFunction(value MTLFunction)
- func (m MTLMeshRenderPipelineDescriptor) SetMeshLinkedFunctions(value IMTLLinkedFunctions)
- func (m MTLMeshRenderPipelineDescriptor) SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
- func (m MTLMeshRenderPipelineDescriptor) SetObjectFunction(value MTLFunction)
- func (m MTLMeshRenderPipelineDescriptor) SetObjectLinkedFunctions(value IMTLLinkedFunctions)
- func (m MTLMeshRenderPipelineDescriptor) SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
- func (m MTLMeshRenderPipelineDescriptor) SetPayloadMemoryLength(value uint)
- func (m MTLMeshRenderPipelineDescriptor) SetRasterSampleCount(value uint)
- func (m MTLMeshRenderPipelineDescriptor) SetRasterizationEnabled(value bool)
- func (m MTLMeshRenderPipelineDescriptor) SetRequiredThreadsPerMeshThreadgroup(value MTLSize)
- func (m MTLMeshRenderPipelineDescriptor) SetRequiredThreadsPerObjectThreadgroup(value MTLSize)
- func (m MTLMeshRenderPipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
- func (m MTLMeshRenderPipelineDescriptor) SetStencilAttachmentPixelFormat(value MTLPixelFormat)
- func (m MTLMeshRenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value bool)
- func (m MTLMeshRenderPipelineDescriptor) ShaderValidation() MTLShaderValidation
- func (m MTLMeshRenderPipelineDescriptor) StencilAttachmentPixelFormat() MTLPixelFormat
- func (m MTLMeshRenderPipelineDescriptor) SupportIndirectCommandBuffers() bool
- type MTLMeshRenderPipelineDescriptorClass
- type MTLMotionBorderMode
- type MTLMotionKeyframeData
- func (m MTLMotionKeyframeData) Autorelease() MTLMotionKeyframeData
- func (m MTLMotionKeyframeData) Buffer() MTLBuffer
- func (m MTLMotionKeyframeData) Init() MTLMotionKeyframeData
- func (m MTLMotionKeyframeData) Offset() uint
- func (m MTLMotionKeyframeData) SetBuffer(value MTLBuffer)
- func (m MTLMotionKeyframeData) SetOffset(value uint)
- type MTLMotionKeyframeDataClass
- type MTLMultisampleDepthResolveFilter
- type MTLMultisampleStencilResolveFilter
- type MTLMutability
- type MTLNewComputePipelineStateCompletionHandler
- type MTLNewComputePipelineStateWithReflectionCompletionHandler
- type MTLNewDynamicLibraryCompletionHandler
- type MTLNewLibraryCompletionHandler
- type MTLNewRenderPipelineStateCompletionHandler
- type MTLNewRenderPipelineStateWithReflectionCompletionHandler
- type MTLObjectPayloadBinding
- type MTLObjectPayloadBindingObject
- func (o MTLObjectPayloadBindingObject) Access() MTLBindingAccess
- func (o MTLObjectPayloadBindingObject) BaseObject() objectivec.Object
- func (o MTLObjectPayloadBindingObject) Index() uint
- func (o MTLObjectPayloadBindingObject) IsArgument() bool
- func (o MTLObjectPayloadBindingObject) IsUsed() bool
- func (o MTLObjectPayloadBindingObject) Name() string
- func (o MTLObjectPayloadBindingObject) ObjectPayloadAlignment() uint
- func (o MTLObjectPayloadBindingObject) ObjectPayloadDataSize() uint
- func (o MTLObjectPayloadBindingObject) Type() MTLBindingType
- type MTLOrigin
- type MTLPackedFloat3
- type MTLPackedFloat4x3
- type MTLPackedFloatQuaternion
- type MTLParallelRenderCommandEncoder
- type MTLParallelRenderCommandEncoderObject
- func (o MTLParallelRenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
- func (o MTLParallelRenderCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTLParallelRenderCommandEncoderObject) Device() MTLDevice
- func (o MTLParallelRenderCommandEncoderObject) EndEncoding()
- func (o MTLParallelRenderCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTLParallelRenderCommandEncoderObject) Label() string
- func (o MTLParallelRenderCommandEncoderObject) PopDebugGroup()
- func (o MTLParallelRenderCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTLParallelRenderCommandEncoderObject) RenderCommandEncoder() MTLRenderCommandEncoder
- func (o MTLParallelRenderCommandEncoderObject) SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
- func (o MTLParallelRenderCommandEncoderObject) SetColorStoreActionOptionsAtIndex(storeActionOptions MTLStoreActionOptions, colorAttachmentIndex uint)
- func (o MTLParallelRenderCommandEncoderObject) SetDepthStoreAction(storeAction MTLStoreAction)
- func (o MTLParallelRenderCommandEncoderObject) SetDepthStoreActionOptions(storeActionOptions MTLStoreActionOptions)
- func (o MTLParallelRenderCommandEncoderObject) SetLabel(value string)
- func (o MTLParallelRenderCommandEncoderObject) SetStencilStoreAction(storeAction MTLStoreAction)
- func (o MTLParallelRenderCommandEncoderObject) SetStencilStoreActionOptions(storeActionOptions MTLStoreActionOptions)
- type MTLPatchType
- type MTLPipelineBufferDescriptor
- type MTLPipelineBufferDescriptorArray
- func (p MTLPipelineBufferDescriptorArray) Autorelease() MTLPipelineBufferDescriptorArray
- func (p MTLPipelineBufferDescriptorArray) Init() MTLPipelineBufferDescriptorArray
- func (p MTLPipelineBufferDescriptorArray) ObjectAtIndexedSubscript(bufferIndex uint) IMTLPipelineBufferDescriptor
- func (p MTLPipelineBufferDescriptorArray) SetObjectAtIndexedSubscript(buffer IMTLPipelineBufferDescriptor, bufferIndex uint)
- type MTLPipelineBufferDescriptorArrayClass
- type MTLPipelineBufferDescriptorClass
- type MTLPipelineOption
- type MTLPixelFormat
- type MTLPointerType
- func (p MTLPointerType) Access() MTLBindingAccess
- func (p MTLPointerType) Alignment() uint
- func (p MTLPointerType) Autorelease() MTLPointerType
- func (p MTLPointerType) DataSize() uint
- func (p MTLPointerType) ElementArrayType() IMTLArrayType
- func (p MTLPointerType) ElementIsArgumentBuffer() bool
- func (p MTLPointerType) ElementStructType() IMTLStructType
- func (p MTLPointerType) ElementType() MTLDataType
- func (p MTLPointerType) Init() MTLPointerType
- type MTLPointerTypeClass
- type MTLPrimitiveAccelerationStructureDescriptor
- func (p MTLPrimitiveAccelerationStructureDescriptor) Autorelease() MTLPrimitiveAccelerationStructureDescriptor
- func (p MTLPrimitiveAccelerationStructureDescriptor) GeometryDescriptors() []MTLAccelerationStructureGeometryDescriptor
- func (p MTLPrimitiveAccelerationStructureDescriptor) Init() MTLPrimitiveAccelerationStructureDescriptor
- func (p MTLPrimitiveAccelerationStructureDescriptor) MotionEndBorderMode() MTLMotionBorderMode
- func (p MTLPrimitiveAccelerationStructureDescriptor) MotionEndTime() float32
- func (p MTLPrimitiveAccelerationStructureDescriptor) MotionKeyframeCount() uint
- func (p MTLPrimitiveAccelerationStructureDescriptor) MotionStartBorderMode() MTLMotionBorderMode
- func (p MTLPrimitiveAccelerationStructureDescriptor) MotionStartTime() float32
- func (p MTLPrimitiveAccelerationStructureDescriptor) SetGeometryDescriptors(value []MTLAccelerationStructureGeometryDescriptor)
- func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionEndBorderMode(value MTLMotionBorderMode)
- func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionEndTime(value float32)
- func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionKeyframeCount(value uint)
- func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionStartBorderMode(value MTLMotionBorderMode)
- func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionStartTime(value float32)
- type MTLPrimitiveAccelerationStructureDescriptorClass
- type MTLPrimitiveTopologyClass
- type MTLPrimitiveType
- type MTLPurgeableState
- type MTLQuadTessellationFactorsHalf
- type MTLRasterizationRateLayerArray
- func (r MTLRasterizationRateLayerArray) Autorelease() MTLRasterizationRateLayerArray
- func (r MTLRasterizationRateLayerArray) Init() MTLRasterizationRateLayerArray
- func (r MTLRasterizationRateLayerArray) LayerCount() int
- func (r MTLRasterizationRateLayerArray) Layers() IMTLRasterizationRateLayerArray
- func (r MTLRasterizationRateLayerArray) ObjectAtIndexedSubscript(layerIndex uint) IMTLRasterizationRateLayerDescriptor
- func (r MTLRasterizationRateLayerArray) SetLayerCount(value int)
- func (r MTLRasterizationRateLayerArray) SetLayers(value IMTLRasterizationRateLayerArray)
- func (r MTLRasterizationRateLayerArray) SetObjectAtIndexedSubscript(layer IMTLRasterizationRateLayerDescriptor, layerIndex uint)
- type MTLRasterizationRateLayerArrayClass
- type MTLRasterizationRateLayerDescriptor
- func MTLRasterizationRateLayerDescriptorFromID(id objc.ID) MTLRasterizationRateLayerDescriptor
- func NewMTLRasterizationRateLayerDescriptor() MTLRasterizationRateLayerDescriptor
- func NewRasterizationRateLayerDescriptorWithSampleCount(sampleCount MTLSize) MTLRasterizationRateLayerDescriptor
- func NewRasterizationRateLayerDescriptorWithSampleCountHorizontalVertical(sampleCount MTLSize, horizontal unsafe.Pointer, vertical unsafe.Pointer) MTLRasterizationRateLayerDescriptor
- func (r MTLRasterizationRateLayerDescriptor) Autorelease() MTLRasterizationRateLayerDescriptor
- func (r MTLRasterizationRateLayerDescriptor) Horizontal() IMTLRasterizationRateSampleArray
- func (r MTLRasterizationRateLayerDescriptor) HorizontalSampleStorage() unsafe.Pointer
- func (r MTLRasterizationRateLayerDescriptor) Init() MTLRasterizationRateLayerDescriptor
- func (r MTLRasterizationRateLayerDescriptor) InitWithSampleCount(sampleCount MTLSize) MTLRasterizationRateLayerDescriptor
- func (r MTLRasterizationRateLayerDescriptor) InitWithSampleCountHorizontalVertical(sampleCount MTLSize, horizontal unsafe.Pointer, vertical unsafe.Pointer) MTLRasterizationRateLayerDescriptor
- func (r MTLRasterizationRateLayerDescriptor) MaxSampleCount() MTLSize
- func (r MTLRasterizationRateLayerDescriptor) SampleCount() MTLSize
- func (r MTLRasterizationRateLayerDescriptor) Vertical() IMTLRasterizationRateSampleArray
- func (r MTLRasterizationRateLayerDescriptor) VerticalSampleStorage() unsafe.Pointer
- type MTLRasterizationRateLayerDescriptorClass
- type MTLRasterizationRateMap
- type MTLRasterizationRateMapDescriptor
- func (r MTLRasterizationRateMapDescriptor) Autorelease() MTLRasterizationRateMapDescriptor
- func (r MTLRasterizationRateMapDescriptor) Init() MTLRasterizationRateMapDescriptor
- func (r MTLRasterizationRateMapDescriptor) Label() string
- func (r MTLRasterizationRateMapDescriptor) LayerAtIndex(layerIndex uint) IMTLRasterizationRateLayerDescriptor
- func (r MTLRasterizationRateMapDescriptor) LayerCount() uint
- func (r MTLRasterizationRateMapDescriptor) Layers() IMTLRasterizationRateLayerArray
- func (r MTLRasterizationRateMapDescriptor) ScreenSize() MTLSize
- func (r MTLRasterizationRateMapDescriptor) SetLabel(value string)
- func (r MTLRasterizationRateMapDescriptor) SetLayerAtIndex(layer IMTLRasterizationRateLayerDescriptor, layerIndex uint)
- func (r MTLRasterizationRateMapDescriptor) SetScreenSize(value MTLSize)
- type MTLRasterizationRateMapDescriptorClass
- func (mc MTLRasterizationRateMapDescriptorClass) Alloc() MTLRasterizationRateMapDescriptor
- func (_MTLRasterizationRateMapDescriptorClass MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSize(screenSize MTLSize) MTLRasterizationRateMapDescriptor
- func (_MTLRasterizationRateMapDescriptorClass MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSizeLayer(screenSize MTLSize, layer IMTLRasterizationRateLayerDescriptor) MTLRasterizationRateMapDescriptor
- func (_MTLRasterizationRateMapDescriptorClass MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSizeLayerCountLayers(screenSize MTLSize, layerCount uint, ...) MTLRasterizationRateMapDescriptor
- type MTLRasterizationRateMapObject
- func (o MTLRasterizationRateMapObject) BaseObject() objectivec.Object
- func (o MTLRasterizationRateMapObject) CopyParameterDataToBufferOffset(buffer MTLBuffer, offset uint)
- func (o MTLRasterizationRateMapObject) Device() MTLDevice
- func (o MTLRasterizationRateMapObject) Label() string
- func (o MTLRasterizationRateMapObject) LayerCount() uint
- func (o MTLRasterizationRateMapObject) MapPhysicalToScreenCoordinatesForLayer(physicalCoordinates MTLCoordinate2D, layerIndex uint) MTLCoordinate2D
- func (o MTLRasterizationRateMapObject) MapScreenToPhysicalCoordinatesForLayer(screenCoordinates MTLCoordinate2D, layerIndex uint) MTLCoordinate2D
- func (o MTLRasterizationRateMapObject) ParameterBufferSizeAndAlign() MTLSizeAndAlign
- func (o MTLRasterizationRateMapObject) PhysicalGranularity() MTLSize
- func (o MTLRasterizationRateMapObject) PhysicalSizeForLayer(layerIndex uint) MTLSize
- func (o MTLRasterizationRateMapObject) ScreenSize() MTLSize
- type MTLRasterizationRateSampleArray
- func (r MTLRasterizationRateSampleArray) Autorelease() MTLRasterizationRateSampleArray
- func (r MTLRasterizationRateSampleArray) Horizontal() IMTLRasterizationRateSampleArray
- func (r MTLRasterizationRateSampleArray) Init() MTLRasterizationRateSampleArray
- func (r MTLRasterizationRateSampleArray) MaxSampleCount() MTLSize
- func (r MTLRasterizationRateSampleArray) ObjectAtIndexedSubscript(index uint) foundation.NSNumber
- func (r MTLRasterizationRateSampleArray) SampleCount() MTLSize
- func (r MTLRasterizationRateSampleArray) SetHorizontal(value IMTLRasterizationRateSampleArray)
- func (r MTLRasterizationRateSampleArray) SetMaxSampleCount(value MTLSize)
- func (r MTLRasterizationRateSampleArray) SetObjectAtIndexedSubscript(value foundation.NSNumber, index uint)
- func (r MTLRasterizationRateSampleArray) SetSampleCount(value MTLSize)
- func (r MTLRasterizationRateSampleArray) SetVertical(value IMTLRasterizationRateSampleArray)
- func (r MTLRasterizationRateSampleArray) Vertical() IMTLRasterizationRateSampleArray
- type MTLRasterizationRateSampleArrayClass
- type MTLReadWriteTextureTier
- type MTLRegion
- type MTLRenderCommandEncoder
- type MTLRenderCommandEncoderObject
- func (o MTLRenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
- func (o MTLRenderCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTLRenderCommandEncoderObject) Device() MTLDevice
- func (o MTLRenderCommandEncoderObject) DispatchThreadsPerTile(threadsPerTile MTLSize)
- func (o MTLRenderCommandEncoderObject) DrawIndexedPatchesPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetIndirectBufferIndirectBufferOffset(numberOfPatchControlPoints uint, patchIndexBuffer MTLBuffer, ...)
- func (o MTLRenderCommandEncoderObject) DrawIndexedPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetInstanceCountBaseInstance(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, ...)
- func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffset(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, ...)
- func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCount(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, ...)
- func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, ...)
- func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferOffsetIndirectBufferIndirectBufferOffset(primitiveType MTLPrimitiveType, indexType MTLIndexType, indexBuffer MTLBuffer, ...)
- func (o MTLRenderCommandEncoderObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, ...)
- func (o MTLRenderCommandEncoderObject) DrawMeshThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(indirectBuffer MTLBuffer, indirectBufferOffset uint, ...)
- func (o MTLRenderCommandEncoderObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, ...)
- func (o MTLRenderCommandEncoderObject) DrawPatchesPatchIndexBufferPatchIndexBufferOffsetIndirectBufferIndirectBufferOffset(numberOfPatchControlPoints uint, patchIndexBuffer MTLBuffer, ...)
- func (o MTLRenderCommandEncoderObject) DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstance(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, ...)
- func (o MTLRenderCommandEncoderObject) DrawPrimitivesIndirectBufferIndirectBufferOffset(primitiveType MTLPrimitiveType, indirectBuffer MTLBuffer, ...)
- func (o MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint)
- func (o MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, ...)
- func (o MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, ...)
- func (o MTLRenderCommandEncoderObject) EndEncoding()
- func (o MTLRenderCommandEncoderObject) ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLBuffer, ...)
- func (o MTLRenderCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, ...)
- func (o MTLRenderCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTLRenderCommandEncoderObject) Label() string
- func (o MTLRenderCommandEncoderObject) MemoryBarrierWithResourcesCountAfterStagesBeforeStages(resources []MTLResource, count uint, after MTLRenderStages, ...)
- func (o MTLRenderCommandEncoderObject) MemoryBarrierWithScopeAfterStagesBeforeStages(scope MTLBarrierScope, after MTLRenderStages, before MTLRenderStages)
- func (o MTLRenderCommandEncoderObject) PopDebugGroup()
- func (o MTLRenderCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTLRenderCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
- func (o MTLRenderCommandEncoderObject) SetBlendColorRedGreenBlueAlpha(red float32, green float32, blue float32, alpha float32)
- func (o MTLRenderCommandEncoderObject) SetColorAttachmentMap(mapping IMTLLogicalToPhysicalColorAttachmentMap)
- func (o MTLRenderCommandEncoderObject) SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
- func (o MTLRenderCommandEncoderObject) SetColorStoreActionOptionsAtIndex(storeActionOptions MTLStoreActionOptions, colorAttachmentIndex uint)
- func (o MTLRenderCommandEncoderObject) SetCullMode(cullMode MTLCullMode)
- func (o MTLRenderCommandEncoderObject) SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
- func (o MTLRenderCommandEncoderObject) SetDepthClipMode(depthClipMode MTLDepthClipMode)
- func (o MTLRenderCommandEncoderObject) SetDepthStencilState(depthStencilState MTLDepthStencilState)
- func (o MTLRenderCommandEncoderObject) SetDepthStoreAction(storeAction MTLStoreAction)
- func (o MTLRenderCommandEncoderObject) SetDepthStoreActionOptions(storeActionOptions MTLStoreActionOptions)
- func (o MTLRenderCommandEncoderObject) SetDepthTestMinBoundMaxBound(minBound float32, maxBound float32)
- func (o MTLRenderCommandEncoderObject) SetFragmentAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentBufferOffsetAtIndex(offset uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetFragmentBytesLengthAtIndex(bytes []byte, index uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, ...)
- func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStateAtIndex(sampler MTLSamplerState, index uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, ...)
- func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetFragmentTextureAtIndex(texture MTLTexture, index uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetFragmentVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetFragmentVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetFrontFacingWinding(frontFacingWinding MTLWinding)
- func (o MTLRenderCommandEncoderObject) SetLabel(value string)
- func (o MTLRenderCommandEncoderObject) SetMeshBufferOffsetAtIndex(offset uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetMeshBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetMeshBytesLengthAtIndex(bytes []byte, index uint)
- func (o MTLRenderCommandEncoderObject) SetMeshSamplerStateAtIndex(sampler MTLSamplerState, index uint)
- func (o MTLRenderCommandEncoderObject) SetMeshSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
- func (o MTLRenderCommandEncoderObject) SetMeshSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, ...)
- func (o MTLRenderCommandEncoderObject) SetMeshSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetMeshTextureAtIndex(texture MTLTexture, index uint)
- func (o MTLRenderCommandEncoderObject) SetMeshTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetObjectBufferOffsetAtIndex(offset uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetObjectBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetObjectBytesLengthAtIndex(bytes []byte, index uint)
- func (o MTLRenderCommandEncoderObject) SetObjectSamplerStateAtIndex(sampler MTLSamplerState, index uint)
- func (o MTLRenderCommandEncoderObject) SetObjectSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
- func (o MTLRenderCommandEncoderObject) SetObjectSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, ...)
- func (o MTLRenderCommandEncoderObject) SetObjectSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetObjectTextureAtIndex(texture MTLTexture, index uint)
- func (o MTLRenderCommandEncoderObject) SetObjectTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetRenderPipelineState(pipelineState MTLRenderPipelineState)
- func (o MTLRenderCommandEncoderObject) SetScissorRect(rect MTLScissorRect)
- func (o MTLRenderCommandEncoderObject) SetScissorRectsCount(scissorRects []MTLScissorRect, count uint)
- func (o MTLRenderCommandEncoderObject) SetStencilFrontReferenceValueBackReferenceValue(frontReferenceValue uint32, backReferenceValue uint32)
- func (o MTLRenderCommandEncoderObject) SetStencilReferenceValue(referenceValue uint32)
- func (o MTLRenderCommandEncoderObject) SetStencilStoreAction(storeAction MTLStoreAction)
- func (o MTLRenderCommandEncoderObject) SetStencilStoreActionOptions(storeActionOptions MTLStoreActionOptions)
- func (o MTLRenderCommandEncoderObject) SetTessellationFactorBufferOffsetInstanceStride(buffer MTLBuffer, offset uint, instanceStride uint)
- func (o MTLRenderCommandEncoderObject) SetTessellationFactorScale(scale float32)
- func (o MTLRenderCommandEncoderObject) SetThreadgroupMemoryLengthOffsetAtIndex(length uint, offset uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetTileAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetTileBufferOffsetAtIndex(offset uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetTileBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetTileBytesLengthAtIndex(bytes []byte, index uint)
- func (o MTLRenderCommandEncoderObject) SetTileIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetTileIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, ...)
- func (o MTLRenderCommandEncoderObject) SetTileSamplerStateAtIndex(sampler MTLSamplerState, index uint)
- func (o MTLRenderCommandEncoderObject) SetTileSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
- func (o MTLRenderCommandEncoderObject) SetTileSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, ...)
- func (o MTLRenderCommandEncoderObject) SetTileSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetTileTextureAtIndex(texture MTLTexture, index uint)
- func (o MTLRenderCommandEncoderObject) SetTileTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetTileVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetTileVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetTriangleFillMode(fillMode MTLTriangleFillMode)
- func (o MTLRenderCommandEncoderObject) SetVertexAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetVertexAmplificationCountViewMappings(count uint, viewMappings *MTLVertexAmplificationViewMapping)
- func (o MTLRenderCommandEncoderObject) SetVertexBufferOffsetAtIndex(offset uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetVertexBufferOffsetAttributeStrideAtIndex(offset uint, stride uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetVertexBuffersOffsetsAttributeStridesWithRange(buffers []MTLBuffer, offsets uint, strides uint, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetVertexBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetVertexBytesLengthAtIndex(bytes []byte, index uint)
- func (o MTLRenderCommandEncoderObject) SetVertexBytesLengthAttributeStrideAtIndex(bytes []byte, stride uint, index uint)
- func (o MTLRenderCommandEncoderObject) SetVertexIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetVertexIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, ...)
- func (o MTLRenderCommandEncoderObject) SetVertexSamplerStateAtIndex(sampler MTLSamplerState, index uint)
- func (o MTLRenderCommandEncoderObject) SetVertexSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
- func (o MTLRenderCommandEncoderObject) SetVertexSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, ...)
- func (o MTLRenderCommandEncoderObject) SetVertexSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetVertexTextureAtIndex(texture MTLTexture, index uint)
- func (o MTLRenderCommandEncoderObject) SetVertexTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetVertexVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
- func (o MTLRenderCommandEncoderObject) SetVertexVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
- func (o MTLRenderCommandEncoderObject) SetViewport(viewport MTLViewport)
- func (o MTLRenderCommandEncoderObject) SetViewportsCount(viewports []MTLViewport, count uint)
- func (o MTLRenderCommandEncoderObject) SetVisibilityResultModeOffset(mode MTLVisibilityResultMode, offset uint)
- func (o MTLRenderCommandEncoderObject) TileHeight() uint
- func (o MTLRenderCommandEncoderObject) TileWidth() uint
- func (o MTLRenderCommandEncoderObject) UpdateFenceAfterStages(fence MTLFence, stages MTLRenderStages)
- func (o MTLRenderCommandEncoderObject) UseHeapStages(heap MTLHeap, stages MTLRenderStages)
- func (o MTLRenderCommandEncoderObject) UseHeapsCountStages(heaps []MTLHeap, count uint, stages MTLRenderStages)
- func (o MTLRenderCommandEncoderObject) UseResourceUsageStages(resource MTLResource, usage MTLResourceUsage, stages MTLRenderStages)
- func (o MTLRenderCommandEncoderObject) UseResourcesCountUsageStages(resources []MTLResource, count uint, usage MTLResourceUsage, ...)
- func (o MTLRenderCommandEncoderObject) WaitForFenceBeforeStages(fence MTLFence, stages MTLRenderStages)
- type MTLRenderPassAttachmentDescriptor
- func (r MTLRenderPassAttachmentDescriptor) Autorelease() MTLRenderPassAttachmentDescriptor
- func (r MTLRenderPassAttachmentDescriptor) DepthPlane() uint
- func (r MTLRenderPassAttachmentDescriptor) Init() MTLRenderPassAttachmentDescriptor
- func (r MTLRenderPassAttachmentDescriptor) Level() uint
- func (r MTLRenderPassAttachmentDescriptor) LoadAction() MTLLoadAction
- func (r MTLRenderPassAttachmentDescriptor) ResolveDepthPlane() uint
- func (r MTLRenderPassAttachmentDescriptor) ResolveLevel() uint
- func (r MTLRenderPassAttachmentDescriptor) ResolveSlice() uint
- func (r MTLRenderPassAttachmentDescriptor) ResolveTexture() MTLTexture
- func (r MTLRenderPassAttachmentDescriptor) SetDepthPlane(value uint)
- func (r MTLRenderPassAttachmentDescriptor) SetLevel(value uint)
- func (r MTLRenderPassAttachmentDescriptor) SetLoadAction(value MTLLoadAction)
- func (r MTLRenderPassAttachmentDescriptor) SetResolveDepthPlane(value uint)
- func (r MTLRenderPassAttachmentDescriptor) SetResolveLevel(value uint)
- func (r MTLRenderPassAttachmentDescriptor) SetResolveSlice(value uint)
- func (r MTLRenderPassAttachmentDescriptor) SetResolveTexture(value MTLTexture)
- func (r MTLRenderPassAttachmentDescriptor) SetSlice(value uint)
- func (r MTLRenderPassAttachmentDescriptor) SetStoreAction(value MTLStoreAction)
- func (r MTLRenderPassAttachmentDescriptor) SetStoreActionOptions(value MTLStoreActionOptions)
- func (r MTLRenderPassAttachmentDescriptor) SetTexture(value MTLTexture)
- func (r MTLRenderPassAttachmentDescriptor) Slice() uint
- func (r MTLRenderPassAttachmentDescriptor) StoreAction() MTLStoreAction
- func (r MTLRenderPassAttachmentDescriptor) StoreActionOptions() MTLStoreActionOptions
- func (r MTLRenderPassAttachmentDescriptor) Texture() MTLTexture
- type MTLRenderPassAttachmentDescriptorClass
- type MTLRenderPassColorAttachmentDescriptor
- func (r MTLRenderPassColorAttachmentDescriptor) Autorelease() MTLRenderPassColorAttachmentDescriptor
- func (r MTLRenderPassColorAttachmentDescriptor) ClearColor() MTLClearColor
- func (r MTLRenderPassColorAttachmentDescriptor) Init() MTLRenderPassColorAttachmentDescriptor
- func (r MTLRenderPassColorAttachmentDescriptor) SetClearColor(value MTLClearColor)
- type MTLRenderPassColorAttachmentDescriptorArray
- func (r MTLRenderPassColorAttachmentDescriptorArray) Autorelease() MTLRenderPassColorAttachmentDescriptorArray
- func (r MTLRenderPassColorAttachmentDescriptorArray) Init() MTLRenderPassColorAttachmentDescriptorArray
- func (r MTLRenderPassColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPassColorAttachmentDescriptor
- func (r MTLRenderPassColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLRenderPassColorAttachmentDescriptor, attachmentIndex uint)
- type MTLRenderPassColorAttachmentDescriptorArrayClass
- type MTLRenderPassColorAttachmentDescriptorClass
- type MTLRenderPassDepthAttachmentDescriptor
- func (r MTLRenderPassDepthAttachmentDescriptor) Autorelease() MTLRenderPassDepthAttachmentDescriptor
- func (r MTLRenderPassDepthAttachmentDescriptor) ClearDepth() float64
- func (r MTLRenderPassDepthAttachmentDescriptor) DepthResolveFilter() MTLMultisampleDepthResolveFilter
- func (r MTLRenderPassDepthAttachmentDescriptor) Init() MTLRenderPassDepthAttachmentDescriptor
- func (r MTLRenderPassDepthAttachmentDescriptor) SetClearDepth(value float64)
- func (r MTLRenderPassDepthAttachmentDescriptor) SetDepthResolveFilter(value MTLMultisampleDepthResolveFilter)
- type MTLRenderPassDepthAttachmentDescriptorClass
- type MTLRenderPassDescriptor
- func (r MTLRenderPassDescriptor) Autorelease() MTLRenderPassDescriptor
- func (r MTLRenderPassDescriptor) ColorAttachments() IMTLRenderPassColorAttachmentDescriptorArray
- func (r MTLRenderPassDescriptor) DefaultRasterSampleCount() uint
- func (r MTLRenderPassDescriptor) DepthAttachment() IMTLRenderPassDepthAttachmentDescriptor
- func (r MTLRenderPassDescriptor) GetSamplePositionsCount(positions []MTLSamplePosition, count uint) uint
- func (r MTLRenderPassDescriptor) ImageblockSampleLength() uint
- func (r MTLRenderPassDescriptor) Init() MTLRenderPassDescriptor
- func (r MTLRenderPassDescriptor) RasterizationRateMap() MTLRasterizationRateMap
- func (r MTLRenderPassDescriptor) RenderTarget() MTLTextureUsage
- func (r MTLRenderPassDescriptor) RenderTargetArrayLength() uint
- func (r MTLRenderPassDescriptor) RenderTargetHeight() uint
- func (r MTLRenderPassDescriptor) RenderTargetWidth() uint
- func (r MTLRenderPassDescriptor) SampleBufferAttachments() IMTLRenderPassSampleBufferAttachmentDescriptorArray
- func (r MTLRenderPassDescriptor) SetDefaultRasterSampleCount(value uint)
- func (r MTLRenderPassDescriptor) SetDepthAttachment(value IMTLRenderPassDepthAttachmentDescriptor)
- func (r MTLRenderPassDescriptor) SetImageblockSampleLength(value uint)
- func (r MTLRenderPassDescriptor) SetRasterizationRateMap(value MTLRasterizationRateMap)
- func (r MTLRenderPassDescriptor) SetRenderTarget(value MTLTextureUsage)
- func (r MTLRenderPassDescriptor) SetRenderTargetArrayLength(value uint)
- func (r MTLRenderPassDescriptor) SetRenderTargetHeight(value uint)
- func (r MTLRenderPassDescriptor) SetRenderTargetWidth(value uint)
- func (r MTLRenderPassDescriptor) SetSamplePositionsCount(positions []MTLSamplePosition, count uint)
- func (r MTLRenderPassDescriptor) SetStencilAttachment(value IMTLRenderPassStencilAttachmentDescriptor)
- func (r MTLRenderPassDescriptor) SetSupportColorAttachmentMapping(value bool)
- func (r MTLRenderPassDescriptor) SetThreadgroupMemoryLength(value uint)
- func (r MTLRenderPassDescriptor) SetTileHeight(value uint)
- func (r MTLRenderPassDescriptor) SetTileWidth(value uint)
- func (r MTLRenderPassDescriptor) SetUsage(value MTLTextureUsage)
- func (r MTLRenderPassDescriptor) SetVisibilityResultBuffer(value MTLBuffer)
- func (r MTLRenderPassDescriptor) SetVisibilityResultType(value MTLVisibilityResultType)
- func (r MTLRenderPassDescriptor) StencilAttachment() IMTLRenderPassStencilAttachmentDescriptor
- func (r MTLRenderPassDescriptor) SupportColorAttachmentMapping() bool
- func (r MTLRenderPassDescriptor) ThreadgroupMemoryLength() uint
- func (r MTLRenderPassDescriptor) TileHeight() uint
- func (r MTLRenderPassDescriptor) TileWidth() uint
- func (r MTLRenderPassDescriptor) Usage() MTLTextureUsage
- func (r MTLRenderPassDescriptor) VisibilityResultBuffer() MTLBuffer
- func (r MTLRenderPassDescriptor) VisibilityResultType() MTLVisibilityResultType
- type MTLRenderPassDescriptorClass
- type MTLRenderPassSampleBufferAttachmentDescriptor
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) Autorelease() MTLRenderPassSampleBufferAttachmentDescriptor
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) EndOfFragmentSampleIndex() uint
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) EndOfVertexSampleIndex() uint
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) Init() MTLRenderPassSampleBufferAttachmentDescriptor
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetEndOfFragmentSampleIndex(value uint)
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetEndOfVertexSampleIndex(value uint)
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetStartOfFragmentSampleIndex(value uint)
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetStartOfVertexSampleIndex(value uint)
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) StartOfFragmentSampleIndex() uint
- func (r MTLRenderPassSampleBufferAttachmentDescriptor) StartOfVertexSampleIndex() uint
- type MTLRenderPassSampleBufferAttachmentDescriptorArray
- func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) Autorelease() MTLRenderPassSampleBufferAttachmentDescriptorArray
- func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) Init() MTLRenderPassSampleBufferAttachmentDescriptorArray
- func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPassSampleBufferAttachmentDescriptor
- func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLRenderPassSampleBufferAttachmentDescriptor, ...)
- type MTLRenderPassSampleBufferAttachmentDescriptorArrayClass
- type MTLRenderPassSampleBufferAttachmentDescriptorClass
- type MTLRenderPassStencilAttachmentDescriptor
- func (r MTLRenderPassStencilAttachmentDescriptor) Autorelease() MTLRenderPassStencilAttachmentDescriptor
- func (r MTLRenderPassStencilAttachmentDescriptor) ClearStencil() uint32
- func (r MTLRenderPassStencilAttachmentDescriptor) Init() MTLRenderPassStencilAttachmentDescriptor
- func (r MTLRenderPassStencilAttachmentDescriptor) SetClearStencil(value uint32)
- func (r MTLRenderPassStencilAttachmentDescriptor) SetStencilResolveFilter(value MTLMultisampleStencilResolveFilter)
- func (r MTLRenderPassStencilAttachmentDescriptor) StencilResolveFilter() MTLMultisampleStencilResolveFilter
- type MTLRenderPassStencilAttachmentDescriptorClass
- type MTLRenderPipelineColorAttachmentDescriptor
- func (r MTLRenderPipelineColorAttachmentDescriptor) All() MTLColorWriteMask
- func (r MTLRenderPipelineColorAttachmentDescriptor) AlphaBlendOperation() MTLBlendOperation
- func (r MTLRenderPipelineColorAttachmentDescriptor) Autorelease() MTLRenderPipelineColorAttachmentDescriptor
- func (r MTLRenderPipelineColorAttachmentDescriptor) BlendingEnabled() bool
- func (r MTLRenderPipelineColorAttachmentDescriptor) DestinationAlphaBlendFactor() MTLBlendFactor
- func (r MTLRenderPipelineColorAttachmentDescriptor) DestinationRGBBlendFactor() MTLBlendFactor
- func (r MTLRenderPipelineColorAttachmentDescriptor) Init() MTLRenderPipelineColorAttachmentDescriptor
- func (r MTLRenderPipelineColorAttachmentDescriptor) PixelFormat() MTLPixelFormat
- func (r MTLRenderPipelineColorAttachmentDescriptor) RgbBlendOperation() MTLBlendOperation
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetAll(value MTLColorWriteMask)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetAlphaBlendOperation(value MTLBlendOperation)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetBlendingEnabled(value bool)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetDestinationAlphaBlendFactor(value MTLBlendFactor)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetDestinationRGBBlendFactor(value MTLBlendFactor)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetPixelFormat(value MTLPixelFormat)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetRgbBlendOperation(value MTLBlendOperation)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetSourceAlphaBlendFactor(value MTLBlendFactor)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetSourceRGBBlendFactor(value MTLBlendFactor)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SetWriteMask(value MTLColorWriteMask)
- func (r MTLRenderPipelineColorAttachmentDescriptor) SourceAlphaBlendFactor() MTLBlendFactor
- func (r MTLRenderPipelineColorAttachmentDescriptor) SourceRGBBlendFactor() MTLBlendFactor
- func (r MTLRenderPipelineColorAttachmentDescriptor) WriteMask() MTLColorWriteMask
- type MTLRenderPipelineColorAttachmentDescriptorArray
- func (r MTLRenderPipelineColorAttachmentDescriptorArray) Autorelease() MTLRenderPipelineColorAttachmentDescriptorArray
- func (r MTLRenderPipelineColorAttachmentDescriptorArray) Init() MTLRenderPipelineColorAttachmentDescriptorArray
- func (r MTLRenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPipelineColorAttachmentDescriptor
- func (r MTLRenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLRenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
- type MTLRenderPipelineColorAttachmentDescriptorArrayClass
- type MTLRenderPipelineColorAttachmentDescriptorClass
- type MTLRenderPipelineDescriptor
- func (r MTLRenderPipelineDescriptor) AlphaToCoverageEnabled() bool
- func (r MTLRenderPipelineDescriptor) AlphaToOneEnabled() bool
- func (r MTLRenderPipelineDescriptor) Autorelease() MTLRenderPipelineDescriptor
- func (r MTLRenderPipelineDescriptor) BinaryArchives() []objectivec.IObject
- func (r MTLRenderPipelineDescriptor) ColorAttachments() IMTLRenderPipelineColorAttachmentDescriptorArray
- func (r MTLRenderPipelineDescriptor) DepthAttachmentPixelFormat() MTLPixelFormat
- func (r MTLRenderPipelineDescriptor) FragmentBuffers() IMTLPipelineBufferDescriptorArray
- func (r MTLRenderPipelineDescriptor) FragmentFunction() MTLFunction
- func (r MTLRenderPipelineDescriptor) FragmentLinkedFunctions() IMTLLinkedFunctions
- func (r MTLRenderPipelineDescriptor) FragmentPreloadedLibraries() []objectivec.IObject
- func (r MTLRenderPipelineDescriptor) Init() MTLRenderPipelineDescriptor
- func (r MTLRenderPipelineDescriptor) InputPrimitiveTopology() MTLPrimitiveTopologyClass
- func (r MTLRenderPipelineDescriptor) Label() string
- func (r MTLRenderPipelineDescriptor) MaxFragmentCallStackDepth() uint
- func (r MTLRenderPipelineDescriptor) MaxTessellationFactor() uint
- func (r MTLRenderPipelineDescriptor) MaxVertexAmplificationCount() uint
- func (r MTLRenderPipelineDescriptor) MaxVertexCallStackDepth() uint
- func (r MTLRenderPipelineDescriptor) RasterSampleCount() uint
- func (r MTLRenderPipelineDescriptor) RasterizationEnabled() bool
- func (r MTLRenderPipelineDescriptor) Reset()
- func (r MTLRenderPipelineDescriptor) SetAlphaToCoverageEnabled(value bool)
- func (r MTLRenderPipelineDescriptor) SetAlphaToOneEnabled(value bool)
- func (r MTLRenderPipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
- func (r MTLRenderPipelineDescriptor) SetDepthAttachmentPixelFormat(value MTLPixelFormat)
- func (r MTLRenderPipelineDescriptor) SetFragmentFunction(value MTLFunction)
- func (r MTLRenderPipelineDescriptor) SetFragmentLinkedFunctions(value IMTLLinkedFunctions)
- func (r MTLRenderPipelineDescriptor) SetFragmentPreloadedLibraries(value []objectivec.IObject)
- func (r MTLRenderPipelineDescriptor) SetInputPrimitiveTopology(value MTLPrimitiveTopologyClass)
- func (r MTLRenderPipelineDescriptor) SetLabel(value string)
- func (r MTLRenderPipelineDescriptor) SetMaxFragmentCallStackDepth(value uint)
- func (r MTLRenderPipelineDescriptor) SetMaxTessellationFactor(value uint)
- func (r MTLRenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
- func (r MTLRenderPipelineDescriptor) SetMaxVertexCallStackDepth(value uint)
- func (r MTLRenderPipelineDescriptor) SetRasterSampleCount(value uint)
- func (r MTLRenderPipelineDescriptor) SetRasterizationEnabled(value bool)
- func (r MTLRenderPipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
- func (r MTLRenderPipelineDescriptor) SetStencilAttachmentPixelFormat(value MTLPixelFormat)
- func (r MTLRenderPipelineDescriptor) SetSupportAddingFragmentBinaryFunctions(value bool)
- func (r MTLRenderPipelineDescriptor) SetSupportAddingVertexBinaryFunctions(value bool)
- func (r MTLRenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value bool)
- func (r MTLRenderPipelineDescriptor) SetTessellationControlPointIndexType(value MTLTessellationControlPointIndexType)
- func (r MTLRenderPipelineDescriptor) SetTessellationFactorFormat(value MTLTessellationFactorFormat)
- func (r MTLRenderPipelineDescriptor) SetTessellationFactorScaleEnabled(value bool)
- func (r MTLRenderPipelineDescriptor) SetTessellationFactorStepFunction(value MTLTessellationFactorStepFunction)
- func (r MTLRenderPipelineDescriptor) SetTessellationOutputWindingOrder(value MTLWinding)
- func (r MTLRenderPipelineDescriptor) SetTessellationPartitionMode(value MTLTessellationPartitionMode)
- func (r MTLRenderPipelineDescriptor) SetVertexDescriptor(value IMTLVertexDescriptor)
- func (r MTLRenderPipelineDescriptor) SetVertexFunction(value MTLFunction)
- func (r MTLRenderPipelineDescriptor) SetVertexLinkedFunctions(value IMTLLinkedFunctions)
- func (r MTLRenderPipelineDescriptor) SetVertexPreloadedLibraries(value []objectivec.IObject)
- func (r MTLRenderPipelineDescriptor) ShaderValidation() MTLShaderValidation
- func (r MTLRenderPipelineDescriptor) StencilAttachmentPixelFormat() MTLPixelFormat
- func (r MTLRenderPipelineDescriptor) SupportAddingFragmentBinaryFunctions() bool
- func (r MTLRenderPipelineDescriptor) SupportAddingVertexBinaryFunctions() bool
- func (r MTLRenderPipelineDescriptor) SupportIndirectCommandBuffers() bool
- func (r MTLRenderPipelineDescriptor) TessellationControlPointIndexType() MTLTessellationControlPointIndexType
- func (r MTLRenderPipelineDescriptor) TessellationFactorFormat() MTLTessellationFactorFormat
- func (r MTLRenderPipelineDescriptor) TessellationFactorScaleEnabled() bool
- func (r MTLRenderPipelineDescriptor) TessellationFactorStepFunction() MTLTessellationFactorStepFunction
- func (r MTLRenderPipelineDescriptor) TessellationOutputWindingOrder() MTLWinding
- func (r MTLRenderPipelineDescriptor) TessellationPartitionMode() MTLTessellationPartitionMode
- func (r MTLRenderPipelineDescriptor) VertexBuffers() IMTLPipelineBufferDescriptorArray
- func (r MTLRenderPipelineDescriptor) VertexDescriptor() IMTLVertexDescriptor
- func (r MTLRenderPipelineDescriptor) VertexFunction() MTLFunction
- func (r MTLRenderPipelineDescriptor) VertexLinkedFunctions() IMTLLinkedFunctions
- func (r MTLRenderPipelineDescriptor) VertexPreloadedLibraries() []objectivec.IObject
- type MTLRenderPipelineDescriptorClass
- type MTLRenderPipelineFunctionsDescriptor
- func (r MTLRenderPipelineFunctionsDescriptor) Autorelease() MTLRenderPipelineFunctionsDescriptor
- func (r MTLRenderPipelineFunctionsDescriptor) FragmentAdditionalBinaryFunctions() []objectivec.IObject
- func (r MTLRenderPipelineFunctionsDescriptor) Init() MTLRenderPipelineFunctionsDescriptor
- func (r MTLRenderPipelineFunctionsDescriptor) SetFragmentAdditionalBinaryFunctions(value []objectivec.IObject)
- func (r MTLRenderPipelineFunctionsDescriptor) SetTileAdditionalBinaryFunctions(value []objectivec.IObject)
- func (r MTLRenderPipelineFunctionsDescriptor) SetVertexAdditionalBinaryFunctions(value []objectivec.IObject)
- func (r MTLRenderPipelineFunctionsDescriptor) TileAdditionalBinaryFunctions() []objectivec.IObject
- func (r MTLRenderPipelineFunctionsDescriptor) VertexAdditionalBinaryFunctions() []objectivec.IObject
- type MTLRenderPipelineFunctionsDescriptorClass
- type MTLRenderPipelineReflection
- func (r MTLRenderPipelineReflection) Autorelease() MTLRenderPipelineReflection
- func (r MTLRenderPipelineReflection) FragmentBindings() []objectivec.IObject
- func (r MTLRenderPipelineReflection) Init() MTLRenderPipelineReflection
- func (r MTLRenderPipelineReflection) MeshBindings() []objectivec.IObject
- func (r MTLRenderPipelineReflection) ObjectBindings() []objectivec.IObject
- func (r MTLRenderPipelineReflection) TileBindings() []objectivec.IObject
- func (r MTLRenderPipelineReflection) VertexBindings() []objectivec.IObject
- type MTLRenderPipelineReflectionClass
- type MTLRenderPipelineState
- type MTLRenderPipelineStateObject
- func (o MTLRenderPipelineStateObject) AllocatedSize() uint
- func (o MTLRenderPipelineStateObject) BaseObject() objectivec.Object
- func (o MTLRenderPipelineStateObject) Device() MTLDevice
- func (o MTLRenderPipelineStateObject) FunctionHandleWithBinaryFunctionStage(function MTL4BinaryFunction, stage MTLRenderStages) MTLFunctionHandle
- func (o MTLRenderPipelineStateObject) FunctionHandleWithFunctionStage(function MTLFunction, stage MTLRenderStages) MTLFunctionHandle
- func (o MTLRenderPipelineStateObject) FunctionHandleWithNameStage(name string, stage MTLRenderStages) MTLFunctionHandle
- func (o MTLRenderPipelineStateObject) GpuResourceID() MTLResourceID
- func (o MTLRenderPipelineStateObject) ImageblockMemoryLengthForDimensions(imageblockDimensions MTLSize) uint
- func (o MTLRenderPipelineStateObject) ImageblockSampleLength() uint
- func (o MTLRenderPipelineStateObject) Label() string
- func (o MTLRenderPipelineStateObject) MaxTotalThreadgroupsPerMeshGrid() uint
- func (o MTLRenderPipelineStateObject) MaxTotalThreadsPerMeshThreadgroup() uint
- func (o MTLRenderPipelineStateObject) MaxTotalThreadsPerObjectThreadgroup() uint
- func (o MTLRenderPipelineStateObject) MaxTotalThreadsPerThreadgroup() uint
- func (o MTLRenderPipelineStateObject) MeshThreadExecutionWidth() uint
- func (o MTLRenderPipelineStateObject) NewIntersectionFunctionTableWithDescriptorStage(descriptor IMTLIntersectionFunctionTableDescriptor, stage MTLRenderStages) MTLIntersectionFunctionTable
- func (o MTLRenderPipelineStateObject) NewRenderPipelineDescriptorForSpecialization() IMTL4PipelineDescriptor
- func (o MTLRenderPipelineStateObject) NewRenderPipelineStateWithAdditionalBinaryFunctionsError(additionalBinaryFunctions IMTLRenderPipelineFunctionsDescriptor) (MTLRenderPipelineState, error)
- func (o MTLRenderPipelineStateObject) NewRenderPipelineStateWithBinaryFunctionsError(binaryFunctionsDescriptor IMTL4RenderPipelineBinaryFunctionsDescriptor) (MTLRenderPipelineState, error)
- func (o MTLRenderPipelineStateObject) NewVisibleFunctionTableWithDescriptorStage(descriptor IMTLVisibleFunctionTableDescriptor, stage MTLRenderStages) MTLVisibleFunctionTable
- func (o MTLRenderPipelineStateObject) ObjectThreadExecutionWidth() uint
- func (o MTLRenderPipelineStateObject) Reflection() IMTLRenderPipelineReflection
- func (o MTLRenderPipelineStateObject) RequiredThreadsPerMeshThreadgroup() MTLSize
- func (o MTLRenderPipelineStateObject) RequiredThreadsPerObjectThreadgroup() MTLSize
- func (o MTLRenderPipelineStateObject) RequiredThreadsPerTileThreadgroup() MTLSize
- func (o MTLRenderPipelineStateObject) ShaderValidation() MTLShaderValidation
- func (o MTLRenderPipelineStateObject) SupportIndirectCommandBuffers() bool
- func (o MTLRenderPipelineStateObject) ThreadgroupSizeMatchesTileSize() bool
- type MTLRenderStages
- type MTLResidencySet
- type MTLResidencySetDescriptor
- func (r MTLResidencySetDescriptor) Autorelease() MTLResidencySetDescriptor
- func (r MTLResidencySetDescriptor) Init() MTLResidencySetDescriptor
- func (r MTLResidencySetDescriptor) InitialCapacity() uint
- func (r MTLResidencySetDescriptor) Label() string
- func (r MTLResidencySetDescriptor) SetInitialCapacity(value uint)
- func (r MTLResidencySetDescriptor) SetLabel(value string)
- type MTLResidencySetDescriptorClass
- type MTLResidencySetObject
- func (o MTLResidencySetObject) AddAllocation(allocation MTLAllocation)
- func (o MTLResidencySetObject) AddAllocationsCount(allocations []MTLAllocation, count uint)
- func (o MTLResidencySetObject) AllAllocations() []objectivec.IObject
- func (o MTLResidencySetObject) AllocatedSize() uint64
- func (o MTLResidencySetObject) AllocationCount() uint
- func (o MTLResidencySetObject) BaseObject() objectivec.Object
- func (o MTLResidencySetObject) Commit()
- func (o MTLResidencySetObject) ContainsAllocation(anAllocation MTLAllocation) bool
- func (o MTLResidencySetObject) Device() MTLDevice
- func (o MTLResidencySetObject) EndResidency()
- func (o MTLResidencySetObject) Label() string
- func (o MTLResidencySetObject) RemoveAllAllocations()
- func (o MTLResidencySetObject) RemoveAllocation(allocation MTLAllocation)
- func (o MTLResidencySetObject) RemoveAllocationsCount(allocations []MTLAllocation, count uint)
- func (o MTLResidencySetObject) RequestResidency()
- type MTLResource
- type MTLResourceID
- type MTLResourceObject
- func (o MTLResourceObject) AllocatedSize() uint
- func (o MTLResourceObject) BaseObject() objectivec.Object
- func (o MTLResourceObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLResourceObject) Device() MTLDevice
- func (o MTLResourceObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLResourceObject) Heap() MTLHeap
- func (o MTLResourceObject) HeapOffset() uint
- func (o MTLResourceObject) IsAliasable() bool
- func (o MTLResourceObject) Label() string
- func (o MTLResourceObject) MakeAliasable()
- func (o MTLResourceObject) ResourceOptions() MTLResourceOptions
- func (o MTLResourceObject) SetLabel(value string)
- func (o MTLResourceObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLResourceObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLResourceObject) StorageMode() MTLStorageMode
- type MTLResourceOptions
- type MTLResourceStateCommandEncoder
- type MTLResourceStateCommandEncoderObject
- func (o MTLResourceStateCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
- func (o MTLResourceStateCommandEncoderObject) BaseObject() objectivec.Object
- func (o MTLResourceStateCommandEncoderObject) Device() MTLDevice
- func (o MTLResourceStateCommandEncoderObject) EndEncoding()
- func (o MTLResourceStateCommandEncoderObject) InsertDebugSignpost(string_ string)
- func (o MTLResourceStateCommandEncoderObject) Label() string
- func (o MTLResourceStateCommandEncoderObject) MoveTextureMappingsFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, ...)
- func (o MTLResourceStateCommandEncoderObject) PopDebugGroup()
- func (o MTLResourceStateCommandEncoderObject) PushDebugGroup(string_ string)
- func (o MTLResourceStateCommandEncoderObject) SetLabel(value string)
- func (o MTLResourceStateCommandEncoderObject) UpdateFence(fence MTLFence)
- func (o MTLResourceStateCommandEncoderObject) UpdateTextureMappingModeIndirectBufferIndirectBufferOffset(texture MTLTexture, mode MTLSparseTextureMappingMode, indirectBuffer MTLBuffer, ...)
- func (o MTLResourceStateCommandEncoderObject) UpdateTextureMappingModeRegionMipLevelSlice(texture MTLTexture, mode MTLSparseTextureMappingMode, region MTLRegion, ...)
- func (o MTLResourceStateCommandEncoderObject) UpdateTextureMappingsModeRegionsMipLevelsSlicesNumRegions(texture MTLTexture, mode MTLSparseTextureMappingMode, regions []MTLRegion, ...)
- func (o MTLResourceStateCommandEncoderObject) WaitForFence(fence MTLFence)
- type MTLResourceStatePassDescriptor
- type MTLResourceStatePassDescriptorClass
- type MTLResourceStatePassSampleBufferAttachmentDescriptor
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) Autorelease() MTLResourceStatePassSampleBufferAttachmentDescriptor
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) Init() MTLResourceStatePassSampleBufferAttachmentDescriptor
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
- type MTLResourceStatePassSampleBufferAttachmentDescriptorArray
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) Autorelease() MTLResourceStatePassSampleBufferAttachmentDescriptorArray
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) Init() MTLResourceStatePassSampleBufferAttachmentDescriptorArray
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLResourceStatePassSampleBufferAttachmentDescriptor
- func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLResourceStatePassSampleBufferAttachmentDescriptor, ...)
- type MTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass
- type MTLResourceStatePassSampleBufferAttachmentDescriptorClass
- type MTLResourceUsage
- type MTLResourceViewPool
- type MTLResourceViewPoolDescriptor
- func (r MTLResourceViewPoolDescriptor) Autorelease() MTLResourceViewPoolDescriptor
- func (r MTLResourceViewPoolDescriptor) Init() MTLResourceViewPoolDescriptor
- func (r MTLResourceViewPoolDescriptor) Label() string
- func (r MTLResourceViewPoolDescriptor) ResourceViewCount() uint
- func (r MTLResourceViewPoolDescriptor) SetLabel(value string)
- func (r MTLResourceViewPoolDescriptor) SetResourceViewCount(value uint)
- type MTLResourceViewPoolDescriptorClass
- type MTLResourceViewPoolObject
- func (o MTLResourceViewPoolObject) BaseObject() objectivec.Object
- func (o MTLResourceViewPoolObject) BaseResourceID() MTLResourceID
- func (o MTLResourceViewPoolObject) CopyResourceViewsFromPoolSourceRangeDestinationIndex(sourcePool MTLResourceViewPool, sourceRange foundation.NSRange, ...) MTLResourceID
- func (o MTLResourceViewPoolObject) Device() MTLDevice
- func (o MTLResourceViewPoolObject) Label() string
- func (o MTLResourceViewPoolObject) ResourceViewCount() uint
- type MTLSamplePosition
- type MTLSamplerAddressMode
- type MTLSamplerBorderColor
- type MTLSamplerDescriptor
- func (s MTLSamplerDescriptor) Autorelease() MTLSamplerDescriptor
- func (s MTLSamplerDescriptor) BorderColor() MTLSamplerBorderColor
- func (s MTLSamplerDescriptor) CompareFunction() MTLCompareFunction
- func (s MTLSamplerDescriptor) Init() MTLSamplerDescriptor
- func (s MTLSamplerDescriptor) Label() string
- func (s MTLSamplerDescriptor) LodAverage() bool
- func (s MTLSamplerDescriptor) LodBias() float32
- func (s MTLSamplerDescriptor) LodMaxClamp() float32
- func (s MTLSamplerDescriptor) LodMinClamp() float32
- func (s MTLSamplerDescriptor) MagFilter() MTLSamplerMinMagFilter
- func (s MTLSamplerDescriptor) MaxAnisotropy() uint
- func (s MTLSamplerDescriptor) MinFilter() MTLSamplerMinMagFilter
- func (s MTLSamplerDescriptor) MipFilter() MTLSamplerMipFilter
- func (s MTLSamplerDescriptor) NormalizedCoordinates() bool
- func (s MTLSamplerDescriptor) RAddressMode() MTLSamplerAddressMode
- func (s MTLSamplerDescriptor) ReductionMode() MTLSamplerReductionMode
- func (s MTLSamplerDescriptor) SAddressMode() MTLSamplerAddressMode
- func (s MTLSamplerDescriptor) SetBorderColor(value MTLSamplerBorderColor)
- func (s MTLSamplerDescriptor) SetCompareFunction(value MTLCompareFunction)
- func (s MTLSamplerDescriptor) SetLabel(value string)
- func (s MTLSamplerDescriptor) SetLodAverage(value bool)
- func (s MTLSamplerDescriptor) SetLodBias(value float32)
- func (s MTLSamplerDescriptor) SetLodMaxClamp(value float32)
- func (s MTLSamplerDescriptor) SetLodMinClamp(value float32)
- func (s MTLSamplerDescriptor) SetMagFilter(value MTLSamplerMinMagFilter)
- func (s MTLSamplerDescriptor) SetMaxAnisotropy(value uint)
- func (s MTLSamplerDescriptor) SetMinFilter(value MTLSamplerMinMagFilter)
- func (s MTLSamplerDescriptor) SetMipFilter(value MTLSamplerMipFilter)
- func (s MTLSamplerDescriptor) SetNormalizedCoordinates(value bool)
- func (s MTLSamplerDescriptor) SetRAddressMode(value MTLSamplerAddressMode)
- func (s MTLSamplerDescriptor) SetReductionMode(value MTLSamplerReductionMode)
- func (s MTLSamplerDescriptor) SetSAddressMode(value MTLSamplerAddressMode)
- func (s MTLSamplerDescriptor) SetSupportArgumentBuffers(value bool)
- func (s MTLSamplerDescriptor) SetTAddressMode(value MTLSamplerAddressMode)
- func (s MTLSamplerDescriptor) SupportArgumentBuffers() bool
- func (s MTLSamplerDescriptor) TAddressMode() MTLSamplerAddressMode
- type MTLSamplerDescriptorClass
- type MTLSamplerMinMagFilter
- type MTLSamplerMipFilter
- type MTLSamplerReductionMode
- type MTLSamplerState
- type MTLSamplerStateObject
- type MTLScissorRect
- type MTLShaderValidation
- type MTLSharedEvent
- type MTLSharedEventHandle
- type MTLSharedEventHandleClass
- type MTLSharedEventListener
- func (s MTLSharedEventListener) Autorelease() MTLSharedEventListener
- func (s MTLSharedEventListener) DispatchQueue() dispatch.Queue
- func (s MTLSharedEventListener) Init() MTLSharedEventListener
- func (s MTLSharedEventListener) InitWithDispatchQueue(dispatchQueue dispatch.Queue) MTLSharedEventListener
- type MTLSharedEventListenerClass
- type MTLSharedEventNotificationBlock
- type MTLSharedEventObject
- func (o MTLSharedEventObject) BaseObject() objectivec.Object
- func (o MTLSharedEventObject) Device() MTLDevice
- func (o MTLSharedEventObject) Label() string
- func (o MTLSharedEventObject) NewSharedEventHandle() IMTLSharedEventHandle
- func (o MTLSharedEventObject) NotifyListenerAtValueBlock(listener IMTLSharedEventListener, value uint64, ...)
- func (o MTLSharedEventObject) NotifyListenerAtValueRetained(listener IMTLSharedEventListener, value uint64, ...) *SharedEventNotificationBinding
- func (o MTLSharedEventObject) SetLabel(value string)
- func (o MTLSharedEventObject) SetSignaledValue(value uint64)
- func (o MTLSharedEventObject) SignaledValue() uint64
- func (o MTLSharedEventObject) WaitUntilSignaledValueTimeoutMS(value uint64, milliseconds uint64) bool
- type MTLSharedTextureHandle
- func (s MTLSharedTextureHandle) Autorelease() MTLSharedTextureHandle
- func (s MTLSharedTextureHandle) Device() MTLDevice
- func (s MTLSharedTextureHandle) EncodeWithCoder(coder foundation.INSCoder)
- func (s MTLSharedTextureHandle) Init() MTLSharedTextureHandle
- func (s MTLSharedTextureHandle) Label() string
- type MTLSharedTextureHandleClass
- type MTLSize
- type MTLSizeAndAlign
- type MTLSparsePageSize
- type MTLSparseTextureMappingMode
- type MTLSparseTextureRegionAlignmentMode
- type MTLStageInRegionIndirectArguments
- type MTLStageInputOutputDescriptor
- func (s MTLStageInputOutputDescriptor) Attributes() IMTLAttributeDescriptorArray
- func (s MTLStageInputOutputDescriptor) Autorelease() MTLStageInputOutputDescriptor
- func (s MTLStageInputOutputDescriptor) IndexBufferIndex() uint
- func (s MTLStageInputOutputDescriptor) IndexType() MTLIndexType
- func (s MTLStageInputOutputDescriptor) Init() MTLStageInputOutputDescriptor
- func (s MTLStageInputOutputDescriptor) Layouts() IMTLBufferLayoutDescriptorArray
- func (s MTLStageInputOutputDescriptor) Reset()
- func (s MTLStageInputOutputDescriptor) SetIndexBufferIndex(value uint)
- func (s MTLStageInputOutputDescriptor) SetIndexType(value MTLIndexType)
- type MTLStageInputOutputDescriptorClass
- type MTLStages
- type MTLStencilDescriptor
- func (s MTLStencilDescriptor) Autorelease() MTLStencilDescriptor
- func (s MTLStencilDescriptor) DepthFailureOperation() MTLStencilOperation
- func (s MTLStencilDescriptor) DepthStencilPassOperation() MTLStencilOperation
- func (s MTLStencilDescriptor) Init() MTLStencilDescriptor
- func (s MTLStencilDescriptor) ReadMask() uint32
- func (s MTLStencilDescriptor) SetDepthFailureOperation(value MTLStencilOperation)
- func (s MTLStencilDescriptor) SetDepthStencilPassOperation(value MTLStencilOperation)
- func (s MTLStencilDescriptor) SetReadMask(value uint32)
- func (s MTLStencilDescriptor) SetStencilCompareFunction(value MTLCompareFunction)
- func (s MTLStencilDescriptor) SetStencilFailureOperation(value MTLStencilOperation)
- func (s MTLStencilDescriptor) SetWriteMask(value uint32)
- func (s MTLStencilDescriptor) StencilCompareFunction() MTLCompareFunction
- func (s MTLStencilDescriptor) StencilFailureOperation() MTLStencilOperation
- func (s MTLStencilDescriptor) WriteMask() uint32
- type MTLStencilDescriptorClass
- type MTLStencilOperation
- type MTLStepFunction
- type MTLStitchedLibraryDescriptor
- func (s MTLStitchedLibraryDescriptor) Autorelease() MTLStitchedLibraryDescriptor
- func (s MTLStitchedLibraryDescriptor) BinaryArchives() []objectivec.IObject
- func (s MTLStitchedLibraryDescriptor) FunctionGraphs() []MTLFunctionStitchingGraph
- func (s MTLStitchedLibraryDescriptor) Functions() []objectivec.IObject
- func (s MTLStitchedLibraryDescriptor) Init() MTLStitchedLibraryDescriptor
- func (s MTLStitchedLibraryDescriptor) Options() MTLStitchedLibraryOptions
- func (s MTLStitchedLibraryDescriptor) SetBinaryArchives(value []objectivec.IObject)
- func (s MTLStitchedLibraryDescriptor) SetFunctionGraphs(value []MTLFunctionStitchingGraph)
- func (s MTLStitchedLibraryDescriptor) SetFunctions(value []objectivec.IObject)
- func (s MTLStitchedLibraryDescriptor) SetOptions(value MTLStitchedLibraryOptions)
- type MTLStitchedLibraryDescriptorClass
- type MTLStitchedLibraryOptions
- type MTLStorageMode
- type MTLStoreAction
- type MTLStoreActionOptions
- type MTLStructMember
- func (s MTLStructMember) ArgumentIndex() uint
- func (s MTLStructMember) ArrayType() IMTLArrayType
- func (s MTLStructMember) Autorelease() MTLStructMember
- func (s MTLStructMember) DataType() MTLDataType
- func (s MTLStructMember) Init() MTLStructMember
- func (s MTLStructMember) Members() IMTLStructMember
- func (s MTLStructMember) Name() string
- func (s MTLStructMember) Offset() uint
- func (s MTLStructMember) PointerType() IMTLPointerType
- func (s MTLStructMember) SetMembers(value IMTLStructMember)
- func (s MTLStructMember) StructType() IMTLStructType
- func (s MTLStructMember) TensorReferenceType() IMTLTensorReferenceType
- func (s MTLStructMember) TextureReferenceType() IMTLTextureReferenceType
- type MTLStructMemberClass
- type MTLStructType
- func (s MTLStructType) Autorelease() MTLStructType
- func (s MTLStructType) BufferStructType() IMTLStructType
- func (s MTLStructType) Init() MTLStructType
- func (s MTLStructType) MemberByName(name string) IMTLStructMember
- func (s MTLStructType) Members() []MTLStructMember
- func (s MTLStructType) SetBufferStructType(value IMTLStructType)
- type MTLStructTypeClass
- type MTLTensor
- type MTLTensorBinding
- type MTLTensorBindingObject
- func (o MTLTensorBindingObject) Access() MTLBindingAccess
- func (o MTLTensorBindingObject) BaseObject() objectivec.Object
- func (o MTLTensorBindingObject) Dimensions() IMTLTensorExtents
- func (o MTLTensorBindingObject) Index() uint
- func (o MTLTensorBindingObject) IndexType() MTLDataType
- func (o MTLTensorBindingObject) IsArgument() bool
- func (o MTLTensorBindingObject) IsUsed() bool
- func (o MTLTensorBindingObject) Name() string
- func (o MTLTensorBindingObject) TensorDataType() MTLTensorDataType
- func (o MTLTensorBindingObject) Type() MTLBindingType
- type MTLTensorDataType
- type MTLTensorDescriptor
- func (t MTLTensorDescriptor) Autorelease() MTLTensorDescriptor
- func (t MTLTensorDescriptor) CpuCacheMode() MTLCPUCacheMode
- func (t MTLTensorDescriptor) DataType() MTLTensorDataType
- func (t MTLTensorDescriptor) Dimensions() IMTLTensorExtents
- func (t MTLTensorDescriptor) HazardTrackingMode() MTLHazardTrackingMode
- func (t MTLTensorDescriptor) Init() MTLTensorDescriptor
- func (t MTLTensorDescriptor) MTLTensorDomain() string
- func (t MTLTensorDescriptor) MTL_TENSOR_MAX_RANK() objectivec.IObject
- func (t MTLTensorDescriptor) ResourceOptions() MTLResourceOptions
- func (t MTLTensorDescriptor) SetCpuCacheMode(value MTLCPUCacheMode)
- func (t MTLTensorDescriptor) SetDataType(value MTLTensorDataType)
- func (t MTLTensorDescriptor) SetDimensions(value IMTLTensorExtents)
- func (t MTLTensorDescriptor) SetHazardTrackingMode(value MTLHazardTrackingMode)
- func (t MTLTensorDescriptor) SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
- func (t MTLTensorDescriptor) SetResourceOptions(value MTLResourceOptions)
- func (t MTLTensorDescriptor) SetStorageMode(value MTLStorageMode)
- func (t MTLTensorDescriptor) SetStrides(value IMTLTensorExtents)
- func (t MTLTensorDescriptor) SetUsage(value MTLTensorUsage)
- func (t MTLTensorDescriptor) StorageMode() MTLStorageMode
- func (t MTLTensorDescriptor) Strides() IMTLTensorExtents
- func (t MTLTensorDescriptor) Usage() MTLTensorUsage
- type MTLTensorDescriptorClass
- type MTLTensorError
- type MTLTensorExtents
- func (t MTLTensorExtents) Autorelease() MTLTensorExtents
- func (t MTLTensorExtents) ExtentAtDimensionIndex(dimensionIndex uint) int
- func (t MTLTensorExtents) Extents() int
- func (t MTLTensorExtents) Init() MTLTensorExtents
- func (t MTLTensorExtents) InitWithRankValues(rank uint, values unsafe.Pointer) MTLTensorExtents
- func (t MTLTensorExtents) MTLTensorDomain() string
- func (t MTLTensorExtents) MTL_TENSOR_MAX_RANK() objectivec.IObject
- func (t MTLTensorExtents) Rank() uint
- func (t MTLTensorExtents) SetExtents(value int)
- func (t MTLTensorExtents) SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
- type MTLTensorExtentsClass
- type MTLTensorObject
- func (o MTLTensorObject) AllocatedSize() uint
- func (o MTLTensorObject) BaseObject() objectivec.Object
- func (o MTLTensorObject) Buffer() MTLBuffer
- func (o MTLTensorObject) BufferOffset() uint
- func (o MTLTensorObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLTensorObject) DataType() MTLTensorDataType
- func (o MTLTensorObject) Device() MTLDevice
- func (o MTLTensorObject) Dimensions() IMTLTensorExtents
- func (o MTLTensorObject) GetBytesStridesFromSliceOriginSliceDimensions(bytes unsafe.Pointer, strides IMTLTensorExtents, sliceOrigin IMTLTensorExtents, ...)
- func (o MTLTensorObject) GpuResourceID() MTLResourceID
- func (o MTLTensorObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLTensorObject) Heap() MTLHeap
- func (o MTLTensorObject) HeapOffset() uint
- func (o MTLTensorObject) IsAliasable() bool
- func (o MTLTensorObject) Label() string
- func (o MTLTensorObject) MakeAliasable()
- func (o MTLTensorObject) ReplaceSliceOriginSliceDimensionsWithBytesStrides(sliceOrigin IMTLTensorExtents, sliceDimensions IMTLTensorExtents, ...)
- func (o MTLTensorObject) ResourceOptions() MTLResourceOptions
- func (o MTLTensorObject) SetLabel(value string)
- func (o MTLTensorObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLTensorObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLTensorObject) StorageMode() MTLStorageMode
- func (o MTLTensorObject) Strides() IMTLTensorExtents
- func (o MTLTensorObject) Usage() MTLTensorUsage
- type MTLTensorReferenceType
- func (t MTLTensorReferenceType) Access() MTLBindingAccess
- func (t MTLTensorReferenceType) Autorelease() MTLTensorReferenceType
- func (t MTLTensorReferenceType) Dimensions() IMTLTensorExtents
- func (t MTLTensorReferenceType) IndexType() MTLDataType
- func (t MTLTensorReferenceType) Init() MTLTensorReferenceType
- func (t MTLTensorReferenceType) MTLTensorDomain() string
- func (t MTLTensorReferenceType) MTL_TENSOR_MAX_RANK() objectivec.IObject
- func (t MTLTensorReferenceType) SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
- func (t MTLTensorReferenceType) TensorDataType() MTLTensorDataType
- type MTLTensorReferenceTypeClass
- type MTLTensorUsage
- type MTLTessellationControlPointIndexType
- type MTLTessellationFactorFormat
- type MTLTessellationFactorStepFunction
- type MTLTessellationPartitionMode
- type MTLTexture
- type MTLTextureBinding
- type MTLTextureBindingObject
- func (o MTLTextureBindingObject) Access() MTLBindingAccess
- func (o MTLTextureBindingObject) ArrayLength() uint
- func (o MTLTextureBindingObject) BaseObject() objectivec.Object
- func (o MTLTextureBindingObject) Index() uint
- func (o MTLTextureBindingObject) IsArgument() bool
- func (o MTLTextureBindingObject) IsDepthTexture() bool
- func (o MTLTextureBindingObject) IsUsed() bool
- func (o MTLTextureBindingObject) Name() string
- func (o MTLTextureBindingObject) TextureDataType() MTLDataType
- func (o MTLTextureBindingObject) TextureType() MTLTextureType
- func (o MTLTextureBindingObject) Type() MTLBindingType
- type MTLTextureCompressionType
- type MTLTextureDescriptor
- func (t MTLTextureDescriptor) AllowGPUOptimizedContents() bool
- func (t MTLTextureDescriptor) ArrayLength() uint
- func (t MTLTextureDescriptor) Autorelease() MTLTextureDescriptor
- func (t MTLTextureDescriptor) CompressionType() MTLTextureCompressionType
- func (t MTLTextureDescriptor) CpuCacheMode() MTLCPUCacheMode
- func (t MTLTextureDescriptor) Depth() uint
- func (t MTLTextureDescriptor) HazardTrackingMode() MTLHazardTrackingMode
- func (t MTLTextureDescriptor) Height() uint
- func (t MTLTextureDescriptor) Init() MTLTextureDescriptor
- func (t MTLTextureDescriptor) MipmapLevelCount() uint
- func (t MTLTextureDescriptor) PixelFormat() MTLPixelFormat
- func (t MTLTextureDescriptor) PlacementSparsePageSize() MTLSparsePageSize
- func (t MTLTextureDescriptor) ResourceOptions() MTLResourceOptions
- func (t MTLTextureDescriptor) SampleCount() uint
- func (t MTLTextureDescriptor) SetAllowGPUOptimizedContents(value bool)
- func (t MTLTextureDescriptor) SetArrayLength(value uint)
- func (t MTLTextureDescriptor) SetCompressionType(value MTLTextureCompressionType)
- func (t MTLTextureDescriptor) SetCpuCacheMode(value MTLCPUCacheMode)
- func (t MTLTextureDescriptor) SetDepth(value uint)
- func (t MTLTextureDescriptor) SetHazardTrackingMode(value MTLHazardTrackingMode)
- func (t MTLTextureDescriptor) SetHeight(value uint)
- func (t MTLTextureDescriptor) SetMipmapLevelCount(value uint)
- func (t MTLTextureDescriptor) SetPixelFormat(value MTLPixelFormat)
- func (t MTLTextureDescriptor) SetPlacementSparsePageSize(value MTLSparsePageSize)
- func (t MTLTextureDescriptor) SetResourceOptions(value MTLResourceOptions)
- func (t MTLTextureDescriptor) SetSampleCount(value uint)
- func (t MTLTextureDescriptor) SetStorageMode(value MTLStorageMode)
- func (t MTLTextureDescriptor) SetSwizzle(value MTLTextureSwizzleChannels)
- func (t MTLTextureDescriptor) SetTextureType(value MTLTextureType)
- func (t MTLTextureDescriptor) SetUsage(value MTLTextureUsage)
- func (t MTLTextureDescriptor) SetWidth(value uint)
- func (t MTLTextureDescriptor) StorageMode() MTLStorageMode
- func (t MTLTextureDescriptor) Swizzle() MTLTextureSwizzleChannels
- func (t MTLTextureDescriptor) TextureType() MTLTextureType
- func (t MTLTextureDescriptor) Usage() MTLTextureUsage
- func (t MTLTextureDescriptor) Width() uint
- type MTLTextureDescriptorClass
- func (mc MTLTextureDescriptorClass) Alloc() MTLTextureDescriptor
- func (_MTLTextureDescriptorClass MTLTextureDescriptorClass) Texture2DDescriptorWithPixelFormatWidthHeightMipmapped(pixelFormat MTLPixelFormat, width uint, height uint, mipmapped bool) MTLTextureDescriptor
- func (_MTLTextureDescriptorClass MTLTextureDescriptorClass) TextureBufferDescriptorWithPixelFormatWidthResourceOptionsUsage(pixelFormat MTLPixelFormat, width uint, resourceOptions MTLResourceOptions, ...) MTLTextureDescriptor
- func (_MTLTextureDescriptorClass MTLTextureDescriptorClass) TextureCubeDescriptorWithPixelFormatSizeMipmapped(pixelFormat MTLPixelFormat, size uint, mipmapped bool) MTLTextureDescriptor
- type MTLTextureObject
- func (o MTLTextureObject) AllocatedSize() uint
- func (o MTLTextureObject) AllowGPUOptimizedContents() bool
- func (o MTLTextureObject) ArrayLength() uint
- func (o MTLTextureObject) BaseObject() objectivec.Object
- func (o MTLTextureObject) Buffer() MTLBuffer
- func (o MTLTextureObject) BufferBytesPerRow() uint
- func (o MTLTextureObject) BufferOffset() uint
- func (o MTLTextureObject) CompressionType() MTLTextureCompressionType
- func (o MTLTextureObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLTextureObject) Depth() uint
- func (o MTLTextureObject) Device() MTLDevice
- func (o MTLTextureObject) FirstMipmapInTail() uint
- func (o MTLTextureObject) GetBytesBytesPerRowBytesPerImageFromRegionMipmapLevelSlice(pixelBytes unsafe.Pointer, bytesPerRow uint, bytesPerImage uint, ...)
- func (o MTLTextureObject) GetBytesBytesPerRowFromRegionMipmapLevel(pixelBytes unsafe.Pointer, bytesPerRow uint, region MTLRegion, level uint)
- func (o MTLTextureObject) GpuResourceID() MTLResourceID
- func (o MTLTextureObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLTextureObject) Heap() MTLHeap
- func (o MTLTextureObject) HeapOffset() uint
- func (o MTLTextureObject) Height() uint
- func (o MTLTextureObject) Iosurface() iosurface.IOSurfaceRef
- func (o MTLTextureObject) IosurfacePlane() uint
- func (o MTLTextureObject) IsAliasable() bool
- func (o MTLTextureObject) IsFramebufferOnly() bool
- func (o MTLTextureObject) IsShareable() bool
- func (o MTLTextureObject) IsSparse() bool
- func (o MTLTextureObject) Label() string
- func (o MTLTextureObject) MakeAliasable()
- func (o MTLTextureObject) MipmapLevelCount() uint
- func (o MTLTextureObject) NewRemoteTextureViewForDevice(device MTLDevice) MTLTexture
- func (o MTLTextureObject) NewSharedTextureHandle() IMTLSharedTextureHandle
- func (o MTLTextureObject) NewTextureViewWithDescriptor(descriptor IMTLTextureViewDescriptor) MTLTexture
- func (o MTLTextureObject) NewTextureViewWithPixelFormat(pixelFormat MTLPixelFormat) MTLTexture
- func (o MTLTextureObject) NewTextureViewWithPixelFormatTextureTypeLevelsSlices(pixelFormat MTLPixelFormat, textureType MTLTextureType, ...) MTLTexture
- func (o MTLTextureObject) NewTextureViewWithPixelFormatTextureTypeLevelsSlicesSwizzle(pixelFormat MTLPixelFormat, textureType MTLTextureType, ...) MTLTexture
- func (o MTLTextureObject) ParentRelativeLevel() uint
- func (o MTLTextureObject) ParentRelativeSlice() uint
- func (o MTLTextureObject) ParentTexture() MTLTexture
- func (o MTLTextureObject) PixelFormat() MTLPixelFormat
- func (o MTLTextureObject) RemoteStorageTexture() MTLTexture
- func (o MTLTextureObject) ReplaceRegionMipmapLevelSliceWithBytesBytesPerRowBytesPerImage(region MTLRegion, level uint, slice uint, pixelBytes unsafe.Pointer, ...)
- func (o MTLTextureObject) ReplaceRegionMipmapLevelWithBytesBytesPerRow(region MTLRegion, level uint, pixelBytes unsafe.Pointer, bytesPerRow uint)
- func (o MTLTextureObject) ResourceOptions() MTLResourceOptions
- func (o MTLTextureObject) RootResource() MTLResource
- func (o MTLTextureObject) SampleCount() uint
- func (o MTLTextureObject) SetLabel(value string)
- func (o MTLTextureObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLTextureObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLTextureObject) SparseTextureTier() MTLTextureSparseTier
- func (o MTLTextureObject) StorageMode() MTLStorageMode
- func (o MTLTextureObject) Swizzle() MTLTextureSwizzleChannels
- func (o MTLTextureObject) TailSizeInBytes() uint
- func (o MTLTextureObject) TextureType() MTLTextureType
- func (o MTLTextureObject) Usage() MTLTextureUsage
- func (o MTLTextureObject) Width() uint
- type MTLTextureReferenceType
- func (t MTLTextureReferenceType) Access() MTLBindingAccess
- func (t MTLTextureReferenceType) Autorelease() MTLTextureReferenceType
- func (t MTLTextureReferenceType) Init() MTLTextureReferenceType
- func (t MTLTextureReferenceType) IsDepthTexture() bool
- func (t MTLTextureReferenceType) TextureDataType() MTLDataType
- func (t MTLTextureReferenceType) TextureType() MTLTextureType
- type MTLTextureReferenceTypeClass
- type MTLTextureSparseTier
- type MTLTextureSwizzle
- type MTLTextureSwizzleChannels
- type MTLTextureType
- type MTLTextureUsage
- type MTLTextureViewDescriptor
- func (t MTLTextureViewDescriptor) Autorelease() MTLTextureViewDescriptor
- func (t MTLTextureViewDescriptor) Init() MTLTextureViewDescriptor
- func (t MTLTextureViewDescriptor) LevelRange() foundation.NSRange
- func (t MTLTextureViewDescriptor) PixelFormat() MTLPixelFormat
- func (t MTLTextureViewDescriptor) SetLevelRange(value foundation.NSRange)
- func (t MTLTextureViewDescriptor) SetPixelFormat(value MTLPixelFormat)
- func (t MTLTextureViewDescriptor) SetSliceRange(value foundation.NSRange)
- func (t MTLTextureViewDescriptor) SetSwizzle(value MTLTextureSwizzleChannels)
- func (t MTLTextureViewDescriptor) SetTextureType(value MTLTextureType)
- func (t MTLTextureViewDescriptor) SliceRange() foundation.NSRange
- func (t MTLTextureViewDescriptor) Swizzle() MTLTextureSwizzleChannels
- func (t MTLTextureViewDescriptor) TextureType() MTLTextureType
- type MTLTextureViewDescriptorClass
- type MTLTextureViewPool
- type MTLTextureViewPoolObject
- func (o MTLTextureViewPoolObject) BaseObject() objectivec.Object
- func (o MTLTextureViewPoolObject) BaseResourceID() MTLResourceID
- func (o MTLTextureViewPoolObject) CopyResourceViewsFromPoolSourceRangeDestinationIndex(sourcePool MTLResourceViewPool, sourceRange foundation.NSRange, ...) MTLResourceID
- func (o MTLTextureViewPoolObject) Device() MTLDevice
- func (o MTLTextureViewPoolObject) Label() string
- func (o MTLTextureViewPoolObject) ResourceViewCount() uint
- func (o MTLTextureViewPoolObject) SetTextureViewAtIndex(texture MTLTexture, index uint) MTLResourceID
- func (o MTLTextureViewPoolObject) SetTextureViewDescriptorAtIndex(texture MTLTexture, descriptor IMTLTextureViewDescriptor, index uint) MTLResourceID
- func (o MTLTextureViewPoolObject) SetTextureViewFromBufferDescriptorOffsetBytesPerRowAtIndex(buffer MTLBuffer, descriptor IMTLTextureDescriptor, offset uint, ...) MTLResourceID
- type MTLThreadgroupBinding
- type MTLThreadgroupBindingObject
- func (o MTLThreadgroupBindingObject) Access() MTLBindingAccess
- func (o MTLThreadgroupBindingObject) BaseObject() objectivec.Object
- func (o MTLThreadgroupBindingObject) Index() uint
- func (o MTLThreadgroupBindingObject) IsArgument() bool
- func (o MTLThreadgroupBindingObject) IsUsed() bool
- func (o MTLThreadgroupBindingObject) Name() string
- func (o MTLThreadgroupBindingObject) ThreadgroupMemoryAlignment() uint
- func (o MTLThreadgroupBindingObject) ThreadgroupMemoryDataSize() uint
- func (o MTLThreadgroupBindingObject) Type() MTLBindingType
- type MTLTileRenderPipelineColorAttachmentDescriptor
- func (t MTLTileRenderPipelineColorAttachmentDescriptor) Autorelease() MTLTileRenderPipelineColorAttachmentDescriptor
- func (t MTLTileRenderPipelineColorAttachmentDescriptor) Init() MTLTileRenderPipelineColorAttachmentDescriptor
- func (t MTLTileRenderPipelineColorAttachmentDescriptor) PixelFormat() MTLPixelFormat
- func (t MTLTileRenderPipelineColorAttachmentDescriptor) SetPixelFormat(value MTLPixelFormat)
- type MTLTileRenderPipelineColorAttachmentDescriptorArray
- func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) Autorelease() MTLTileRenderPipelineColorAttachmentDescriptorArray
- func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) Init() MTLTileRenderPipelineColorAttachmentDescriptorArray
- func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLTileRenderPipelineColorAttachmentDescriptor
- func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLTileRenderPipelineColorAttachmentDescriptor, ...)
- type MTLTileRenderPipelineColorAttachmentDescriptorArrayClass
- type MTLTileRenderPipelineColorAttachmentDescriptorClass
- type MTLTileRenderPipelineDescriptor
- func (t MTLTileRenderPipelineDescriptor) Autorelease() MTLTileRenderPipelineDescriptor
- func (t MTLTileRenderPipelineDescriptor) BinaryArchives() []objectivec.IObject
- func (t MTLTileRenderPipelineDescriptor) ColorAttachments() IMTLTileRenderPipelineColorAttachmentDescriptorArray
- func (t MTLTileRenderPipelineDescriptor) Init() MTLTileRenderPipelineDescriptor
- func (t MTLTileRenderPipelineDescriptor) Label() string
- func (t MTLTileRenderPipelineDescriptor) LinkedFunctions() IMTLLinkedFunctions
- func (t MTLTileRenderPipelineDescriptor) MaxCallStackDepth() uint
- func (t MTLTileRenderPipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
- func (t MTLTileRenderPipelineDescriptor) PreloadedLibraries() []objectivec.IObject
- func (t MTLTileRenderPipelineDescriptor) RasterSampleCount() uint
- func (t MTLTileRenderPipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
- func (t MTLTileRenderPipelineDescriptor) Reset()
- func (t MTLTileRenderPipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
- func (t MTLTileRenderPipelineDescriptor) SetLabel(value string)
- func (t MTLTileRenderPipelineDescriptor) SetLinkedFunctions(value IMTLLinkedFunctions)
- func (t MTLTileRenderPipelineDescriptor) SetMaxCallStackDepth(value uint)
- func (t MTLTileRenderPipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
- func (t MTLTileRenderPipelineDescriptor) SetPreloadedLibraries(value []objectivec.IObject)
- func (t MTLTileRenderPipelineDescriptor) SetRasterSampleCount(value uint)
- func (t MTLTileRenderPipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
- func (t MTLTileRenderPipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
- func (t MTLTileRenderPipelineDescriptor) SetSupportAddingBinaryFunctions(value bool)
- func (t MTLTileRenderPipelineDescriptor) SetThreadgroupSizeMatchesTileSize(value bool)
- func (t MTLTileRenderPipelineDescriptor) SetTileFunction(value MTLFunction)
- func (t MTLTileRenderPipelineDescriptor) ShaderValidation() MTLShaderValidation
- func (t MTLTileRenderPipelineDescriptor) SupportAddingBinaryFunctions() bool
- func (t MTLTileRenderPipelineDescriptor) ThreadgroupSizeMatchesTileSize() bool
- func (t MTLTileRenderPipelineDescriptor) TileBuffers() IMTLPipelineBufferDescriptorArray
- func (t MTLTileRenderPipelineDescriptor) TileFunction() MTLFunction
- type MTLTileRenderPipelineDescriptorClass
- type MTLTimestamp
- type MTLTransformType
- type MTLTriangleFillMode
- type MTLTriangleTessellationFactorsHalf
- type MTLType
- type MTLTypeClass
- type MTLVertexAmplificationViewMapping
- type MTLVertexAttribute
- func (v MTLVertexAttribute) Active() bool
- func (v MTLVertexAttribute) AttributeIndex() uint
- func (v MTLVertexAttribute) AttributeType() MTLDataType
- func (v MTLVertexAttribute) Autorelease() MTLVertexAttribute
- func (v MTLVertexAttribute) Init() MTLVertexAttribute
- func (v MTLVertexAttribute) Name() string
- func (v MTLVertexAttribute) PatchControlPointData() bool
- func (v MTLVertexAttribute) PatchData() bool
- func (v MTLVertexAttribute) SetVertexAttributes(value IMTLVertexAttribute)
- func (v MTLVertexAttribute) VertexAttributes() IMTLVertexAttribute
- type MTLVertexAttributeClass
- type MTLVertexAttributeDescriptor
- func (v MTLVertexAttributeDescriptor) Autorelease() MTLVertexAttributeDescriptor
- func (v MTLVertexAttributeDescriptor) BufferIndex() uint
- func (v MTLVertexAttributeDescriptor) Format() MTLVertexFormat
- func (v MTLVertexAttributeDescriptor) Init() MTLVertexAttributeDescriptor
- func (v MTLVertexAttributeDescriptor) MTLBufferLayoutStrideDynamic() int
- func (v MTLVertexAttributeDescriptor) Offset() uint
- func (v MTLVertexAttributeDescriptor) SetBufferIndex(value uint)
- func (v MTLVertexAttributeDescriptor) SetFormat(value MTLVertexFormat)
- func (v MTLVertexAttributeDescriptor) SetOffset(value uint)
- type MTLVertexAttributeDescriptorArray
- func (v MTLVertexAttributeDescriptorArray) Autorelease() MTLVertexAttributeDescriptorArray
- func (v MTLVertexAttributeDescriptorArray) Init() MTLVertexAttributeDescriptorArray
- func (v MTLVertexAttributeDescriptorArray) MTLBufferLayoutStrideDynamic() int
- func (v MTLVertexAttributeDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLVertexAttributeDescriptor
- func (v MTLVertexAttributeDescriptorArray) SetObjectAtIndexedSubscript(attributeDesc IMTLVertexAttributeDescriptor, index uint)
- type MTLVertexAttributeDescriptorArrayClass
- type MTLVertexAttributeDescriptorClass
- type MTLVertexBufferLayoutDescriptor
- func (v MTLVertexBufferLayoutDescriptor) Autorelease() MTLVertexBufferLayoutDescriptor
- func (v MTLVertexBufferLayoutDescriptor) Init() MTLVertexBufferLayoutDescriptor
- func (v MTLVertexBufferLayoutDescriptor) MTLBufferLayoutStrideDynamic() int
- func (v MTLVertexBufferLayoutDescriptor) SetStepFunction(value MTLVertexStepFunction)
- func (v MTLVertexBufferLayoutDescriptor) SetStepRate(value uint)
- func (v MTLVertexBufferLayoutDescriptor) SetStride(value uint)
- func (v MTLVertexBufferLayoutDescriptor) StepFunction() MTLVertexStepFunction
- func (v MTLVertexBufferLayoutDescriptor) StepRate() uint
- func (v MTLVertexBufferLayoutDescriptor) Stride() uint
- type MTLVertexBufferLayoutDescriptorArray
- func (v MTLVertexBufferLayoutDescriptorArray) Autorelease() MTLVertexBufferLayoutDescriptorArray
- func (v MTLVertexBufferLayoutDescriptorArray) Init() MTLVertexBufferLayoutDescriptorArray
- func (v MTLVertexBufferLayoutDescriptorArray) MTLBufferLayoutStrideDynamic() int
- func (v MTLVertexBufferLayoutDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLVertexBufferLayoutDescriptor
- func (v MTLVertexBufferLayoutDescriptorArray) SetObjectAtIndexedSubscript(bufferDesc IMTLVertexBufferLayoutDescriptor, index uint)
- type MTLVertexBufferLayoutDescriptorArrayClass
- type MTLVertexBufferLayoutDescriptorClass
- type MTLVertexDescriptor
- func (v MTLVertexDescriptor) Attributes() IMTLVertexAttributeDescriptorArray
- func (v MTLVertexDescriptor) Autorelease() MTLVertexDescriptor
- func (v MTLVertexDescriptor) Init() MTLVertexDescriptor
- func (v MTLVertexDescriptor) Layouts() IMTLVertexBufferLayoutDescriptorArray
- func (v MTLVertexDescriptor) MTLBufferLayoutStrideDynamic() int
- func (v MTLVertexDescriptor) Reset()
- func (v MTLVertexDescriptor) SetVertexDescriptor(value IMTLVertexDescriptor)
- func (v MTLVertexDescriptor) VertexDescriptor() IMTLVertexDescriptor
- type MTLVertexDescriptorClass
- type MTLVertexFormat
- type MTLVertexStepFunction
- type MTLViewport
- type MTLVisibilityResultMode
- type MTLVisibilityResultType
- type MTLVisibleFunctionTable
- type MTLVisibleFunctionTableDescriptor
- func (v MTLVisibleFunctionTableDescriptor) Autorelease() MTLVisibleFunctionTableDescriptor
- func (v MTLVisibleFunctionTableDescriptor) FunctionCount() uint
- func (v MTLVisibleFunctionTableDescriptor) Init() MTLVisibleFunctionTableDescriptor
- func (v MTLVisibleFunctionTableDescriptor) SetFunctionCount(value uint)
- type MTLVisibleFunctionTableDescriptorClass
- type MTLVisibleFunctionTableObject
- func (o MTLVisibleFunctionTableObject) AllocatedSize() uint
- func (o MTLVisibleFunctionTableObject) BaseObject() objectivec.Object
- func (o MTLVisibleFunctionTableObject) CpuCacheMode() MTLCPUCacheMode
- func (o MTLVisibleFunctionTableObject) Device() MTLDevice
- func (o MTLVisibleFunctionTableObject) GpuResourceID() MTLResourceID
- func (o MTLVisibleFunctionTableObject) HazardTrackingMode() MTLHazardTrackingMode
- func (o MTLVisibleFunctionTableObject) Heap() MTLHeap
- func (o MTLVisibleFunctionTableObject) HeapOffset() uint
- func (o MTLVisibleFunctionTableObject) IsAliasable() bool
- func (o MTLVisibleFunctionTableObject) Label() string
- func (o MTLVisibleFunctionTableObject) MakeAliasable()
- func (o MTLVisibleFunctionTableObject) ResourceOptions() MTLResourceOptions
- func (o MTLVisibleFunctionTableObject) SetFunctionAtIndex(function MTLFunctionHandle, index uint)
- func (o MTLVisibleFunctionTableObject) SetFunctionsWithRange(functions []MTLFunctionHandle, range_ foundation.NSRange)
- func (o MTLVisibleFunctionTableObject) SetLabel(value string)
- func (o MTLVisibleFunctionTableObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
- func (o MTLVisibleFunctionTableObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
- func (o MTLVisibleFunctionTableObject) StorageMode() MTLStorageMode
- type MTLWinding
- type NSDeviceCertification
- type NSProcessPerformanceProfile
- type SharedEventNotificationBinding
- type VoidHandler
Constants ¶
const ( // // See: https://developer.apple.com/documentation/Metal/MTLAttributeStrideStatic MTLAttributeStrideStatic uint = 9223372036854775807 // // See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutStrideDynamic MTLBufferLayoutStrideDynamic uint = 9223372036854775807 )
uint values.
Variables ¶
var ( // See: https://developer.apple.com/documentation/Metal/MTL4CommandQueueErrorDomain MTL4CommandQueueErrorDomain foundation.NSErrorDomain // MTLBinaryArchiveDomain is the domain for Metal binary archive errors. // // See: https://developer.apple.com/documentation/Metal/MTLBinaryArchiveDomain MTLBinaryArchiveDomain foundation.NSErrorDomain // MTLCaptureErrorDomain is the error domain for capture errors. // // See: https://developer.apple.com/documentation/Metal/MTLCaptureErrorDomain MTLCaptureErrorDomain foundation.NSErrorDomain // MTLCommandBufferEncoderInfoErrorKey is a key to a command buffer error’s user information dictionary that retrieves additional information about a GPU’s runtime error. // // See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfoErrorKey MTLCommandBufferEncoderInfoErrorKey foundation.NSErrorUserInfoKey // MTLCommandBufferErrorDomain is the domain for Metal command buffer errors. // // See: https://developer.apple.com/documentation/Metal/MTLCommandBufferErrorDomain MTLCommandBufferErrorDomain foundation.NSErrorDomain // MTLCounterErrorDomain is the domain for Metal counter sample buffer errors. // // See: https://developer.apple.com/documentation/Metal/MTLCounterErrorDomain MTLCounterErrorDomain foundation.NSErrorDomain // MTLDynamicLibraryDomain is the domain for Metal dynamic library errors. // // See: https://developer.apple.com/documentation/Metal/MTLDynamicLibraryDomain MTLDynamicLibraryDomain foundation.NSErrorDomain // MTLIOErrorDomain is the domain for input/output command queue errors. // // See: https://developer.apple.com/documentation/Metal/MTLIOErrorDomain MTLIOErrorDomain foundation.NSErrorDomain // MTLLibraryErrorDomain is the error domain for Metal libraries. // // See: https://developer.apple.com/documentation/Metal/MTLLibraryErrorDomain MTLLibraryErrorDomain foundation.NSErrorDomain // See: https://developer.apple.com/documentation/Metal/MTLLogStateErrorDomain MTLLogStateErrorDomain foundation.NSErrorDomain // MTLTensorDomain is an error domain for errors that pertain to creating a tensor. // // See: https://developer.apple.com/documentation/Metal/MTLTensorDomain MTLTensorDomain foundation.NSErrorDomain // See: https://developer.apple.com/documentation/Metal/NSProcessInfoPerformanceProfileDidChangeNotification ProcessInfoPerformanceProfileDidChangeNotification foundation.NSNotificationName )
var MTLCommonCounterSets struct { // StageUtilization: The common name for the counter set that contains hardware utilization measurements from various render stages. StageUtilization MTLCommonCounterSet // Statistic: The common name for the counter set that contains GPU workload statistics. Statistic MTLCommonCounterSet // Timestamp: The common name for the counter set that contains the timestamp counter. Timestamp MTLCommonCounterSet }
MTLCommonCounterSets provides typed accessors for MTLCommonCounterSet constants.
var MTLCommonCounters struct { // ClipperInvocations: The common name for the counter that tracks the number of primitives a render pass sends to the clip stage. ClipperInvocations MTLCommonCounter // ClipperPrimitivesOut: The common name for the counter that tracks the number of primitives the clip stage produces during a render pass. ClipperPrimitivesOut MTLCommonCounter // ComputeKernelInvocations: The common name for the counter that tracks the number of times a pass invokes any compute kernel. ComputeKernelInvocations MTLCommonCounter // FragmentCycles: The common name for the counter that tracks the number of cycles the GPU uses to run fragment shaders during a pass. FragmentCycles MTLCommonCounter // FragmentInvocations: The common name for the counter that tracks the number of times a render pass calls fragment shaders. FragmentInvocations MTLCommonCounter // FragmentsPassed: The common name for the counter that tracks the number of fragments a render pass sends to the visibility and blend stages. FragmentsPassed MTLCommonCounter // PostTessellationVertexCycles: The common name for the counter that tracks the number of cycles the GPU uses to run post-tessellation vertex shaders during a pass. PostTessellationVertexCycles MTLCommonCounter // PostTessellationVertexInvocations: The common name for the counter that tracks the number of vertices a render pass sends to a post-tessellation vertex shader. PostTessellationVertexInvocations MTLCommonCounter // RenderTargetWriteCycles: The common name for the counter that tracks the number of cycles the GPU uses to write data to render targets during a render pass. RenderTargetWriteCycles MTLCommonCounter // TessellationCycles: The common name for the counter that tracks the number of cycles the GPU uses to run the tessellation stage during a pass. TessellationCycles MTLCommonCounter // TessellationInputPatches: The common name for the counter that tracks the number of tessellation patches a render pass sends to the tessellation stage. TessellationInputPatches MTLCommonCounter // Timestamp: The common name for the counter that tracks the current time. Timestamp MTLCommonCounter // TotalCycles: The common name for the counter that tracks the total number of cycles the GPU uses to run a pass. TotalCycles MTLCommonCounter // VertexCycles: The common name for the counter that tracks the number of cycles the GPU uses to run vertex shaders during a pass. VertexCycles MTLCommonCounter // VertexInvocations: The common name for the counter that tracks the number of times a render pass calls any vertex shader. VertexInvocations MTLCommonCounter }
MTLCommonCounters provides typed accessors for MTLCommonCounter constants.
var NSProcessPerformanceProfiles struct { // Default: The default performance profile for a device. Default NSProcessPerformanceProfile // Sustained: The performance profile for a device representing sustained performance. Sustained NSProcessPerformanceProfile }
NSProcessPerformanceProfiles provides typed accessors for NSProcessPerformanceProfile constants.
Functions ¶
func MTLIOCompressionContextAppendData ¶
func MTLIOCompressionContextAppendData(context MTLIOCompressionContext, data unsafe.Pointer, size uintptr)
MTLIOCompressionContextAppendData adds data to a compression context.
See: https://developer.apple.com/documentation/Metal/MTLIOCompressionContextAppendData(_:_:_:)
func MTLIOCompressionContextDefaultChunkSize ¶
func MTLIOCompressionContextDefaultChunkSize() uintptr
MTLIOCompressionContextDefaultChunkSize returns a compression chunk size you can use as a default for creating a compression context.
See: https://developer.apple.com/documentation/Metal/MTLIOCompressionContextDefaultChunkSize()
func MTLRemoveDeviceObserver ¶
func MTLRemoveDeviceObserver(observer objectivec.Object)
MTLRemoveDeviceObserver removes a registered observer of device notifications.
See: https://developer.apple.com/documentation/Metal/MTLRemoveDeviceObserver(_:)
func NewErrorBlock ¶
func NewErrorBlock(handler ErrorHandler) (objc.ID, func())
NewErrorBlock wraps a Go ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [MTL4Compiler.NewBinaryFunctionWithDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewComputePipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewDynamicLibraryCompletionHandler]
- [MTL4Compiler.NewDynamicLibraryWithURLCompletionHandler]
- [MTL4Compiler.NewLibraryWithDescriptorCompletionHandler]
- [MTL4Compiler.NewMachineLearningPipelineStateWithDescriptorCompletionHandler]
- [MTL4Compiler.NewRenderPipelineStateBySpecializationWithDescriptorPipelineCompletionHandler]
- [MTL4Compiler.NewRenderPipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler]
- [MTLDevice.NewComputePipelineStateWithDescriptorOptionsCompletionHandler]
- [MTLDevice.NewComputePipelineStateWithFunctionCompletionHandler]
- [MTLDevice.NewComputePipelineStateWithFunctionOptionsCompletionHandler]
- [MTLDevice.NewLibraryWithSourceOptionsCompletionHandler]
- [MTLDevice.NewLibraryWithStitchedDescriptorCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithDescriptorCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithDescriptorOptionsCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithMeshDescriptorOptionsCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithTileDescriptorOptionsCompletionHandler]
func NewMTLFunctionErrorBlock ¶
func NewMTLFunctionErrorBlock(handler MTLFunctionErrorHandler) (objc.ID, func())
NewMTLFunctionErrorBlock wraps a Go MTLFunctionErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [MTLLibrary.NewFunctionWithDescriptorCompletionHandler]
- [MTLLibrary.NewFunctionWithNameConstantValuesCompletionHandler]
- [MTLLibrary.NewIntersectionFunctionWithDescriptorCompletionHandler]
func NewVoidBlock ¶
func NewVoidBlock(handler VoidHandler) (objc.ID, func())
NewVoidBlock wraps a Go VoidHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [MTLLogState.AddLogHandler]
Types ¶
type ErrorHandler ¶
type ErrorHandler = func()
ErrorHandler handles A completetion handler that you provide, which the task calls when it finishes compiling the binary function.
Used by:
- [MTL4Compiler.NewBinaryFunctionWithDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewComputePipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewDynamicLibraryCompletionHandler]
- [MTL4Compiler.NewDynamicLibraryWithURLCompletionHandler]
- [MTL4Compiler.NewLibraryWithDescriptorCompletionHandler]
- [MTL4Compiler.NewMachineLearningPipelineStateWithDescriptorCompletionHandler]
- [MTL4Compiler.NewRenderPipelineStateBySpecializationWithDescriptorPipelineCompletionHandler]
- [MTL4Compiler.NewRenderPipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler]
- [MTL4Compiler.NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler]
- [MTLDevice.NewComputePipelineStateWithDescriptorOptionsCompletionHandler]
- [MTLDevice.NewComputePipelineStateWithFunctionCompletionHandler]
- [MTLDevice.NewComputePipelineStateWithFunctionOptionsCompletionHandler]
- [MTLDevice.NewLibraryWithSourceOptionsCompletionHandler]
- [MTLDevice.NewLibraryWithStitchedDescriptorCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithDescriptorCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithDescriptorOptionsCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithMeshDescriptorOptionsCompletionHandler]
- [MTLDevice.NewRenderPipelineStateWithTileDescriptorOptionsCompletionHandler]
type IMTL4AccelerationStructureBoundingBoxGeometryDescriptor ¶
type IMTL4AccelerationStructureBoundingBoxGeometryDescriptor interface {
IMTL4AccelerationStructureGeometryDescriptor
// References a buffer containing bounding box data in [MTLAxisAlignedBoundingBoxes] format.
BoundingBoxBuffer() MTL4BufferRange
SetBoundingBoxBuffer(value MTL4BufferRange)
// Describes the number of bounding boxes the `boundingBoxBuffer` contains.
BoundingBoxCount() uint
SetBoundingBoxCount(value uint)
// Assigns the stride, in bytes, between bounding boxes in the bounding box buffer `boundingBoxBuffer` references.
BoundingBoxStride() uint
SetBoundingBoxStride(value uint)
}
An interface definition for the MTL4AccelerationStructureBoundingBoxGeometryDescriptor class.
Instance Properties ¶
- [IMTL4AccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxBuffer]: References a buffer containing bounding box data in [MTLAxisAlignedBoundingBoxes] format.
- [IMTL4AccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxBuffer]
- [IMTL4AccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxCount]: Describes the number of bounding boxes the `boundingBoxBuffer` contains.
- [IMTL4AccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxCount]
- [IMTL4AccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxStride]: Assigns the stride, in bytes, between bounding boxes in the bounding box buffer `boundingBoxBuffer` references.
- [IMTL4AccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxStride]
type IMTL4AccelerationStructureCurveGeometryDescriptor ¶
type IMTL4AccelerationStructureCurveGeometryDescriptor interface {
IMTL4AccelerationStructureGeometryDescriptor
// References a buffer containing curve control points.
ControlPointBuffer() MTL4BufferRange
SetControlPointBuffer(value MTL4BufferRange)
// Declares the number of control points in the control point buffer.
ControlPointCount() uint
SetControlPointCount(value uint)
// Declares the format of the control points the control point buffer references.
ControlPointFormat() MTLAttributeFormat
SetControlPointFormat(value MTLAttributeFormat)
// Sets the stride, in bytes, between control points in the control point buffer the control point buffer references.
ControlPointStride() uint
SetControlPointStride(value uint)
// Controls the curve basis function, determining how Metal interpolates the control points.
CurveBasis() MTLCurveBasis
SetCurveBasis(value MTLCurveBasis)
// Sets the type of curve end caps.
CurveEndCaps() MTLCurveEndCaps
SetCurveEndCaps(value MTLCurveEndCaps)
// Controls the curve type.
CurveType() MTLCurveType
SetCurveType(value MTLCurveType)
// Assigns an optional index buffer containing references to control points in the control point buffer.
IndexBuffer() MTL4BufferRange
SetIndexBuffer(value MTL4BufferRange)
// Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// Assigns a reference to a buffer containing the curve radius for each control point.
RadiusBuffer() MTL4BufferRange
SetRadiusBuffer(value MTL4BufferRange)
// Declares the format of the radii in the radius buffer.
RadiusFormat() MTLAttributeFormat
SetRadiusFormat(value MTLAttributeFormat)
// Configures the stride, in bytes, between radii in the radius buffer.
RadiusStride() uint
SetRadiusStride(value uint)
// Declares the number of control points per curve segment.
SegmentControlPointCount() uint
SetSegmentControlPointCount(value uint)
// Declares the number of curve segments.
SegmentCount() uint
SetSegmentCount(value uint)
}
An interface definition for the MTL4AccelerationStructureCurveGeometryDescriptor class.
Instance Properties ¶
- [IMTL4AccelerationStructureCurveGeometryDescriptor.ControlPointBuffer]: References a buffer containing curve control points.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointBuffer]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.ControlPointCount]: Declares the number of control points in the control point buffer.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointCount]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.ControlPointFormat]: Declares the format of the control points the control point buffer references.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointFormat]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.ControlPointStride]: Sets the stride, in bytes, between control points in the control point buffer the control point buffer references.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointStride]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.CurveBasis]: Controls the curve basis function, determining how Metal interpolates the control points.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetCurveBasis]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.CurveEndCaps]: Sets the type of curve end caps.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetCurveEndCaps]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.CurveType]: Controls the curve type.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetCurveType]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.IndexBuffer]: Assigns an optional index buffer containing references to control points in the control point buffer.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetIndexBuffer]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.IndexType]: Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetIndexType]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.RadiusBuffer]: Assigns a reference to a buffer containing the curve radius for each control point.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetRadiusBuffer]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.RadiusFormat]: Declares the format of the radii in the radius buffer.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetRadiusFormat]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.RadiusStride]: Configures the stride, in bytes, between radii in the radius buffer.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetRadiusStride]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SegmentControlPointCount]: Declares the number of control points per curve segment.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetSegmentControlPointCount]
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SegmentCount]: Declares the number of curve segments.
- [IMTL4AccelerationStructureCurveGeometryDescriptor.SetSegmentCount]
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureCurveGeometryDescriptor
type IMTL4AccelerationStructureDescriptor ¶
type IMTL4AccelerationStructureDescriptor interface {
IMTLAccelerationStructureDescriptor
}
An interface definition for the MTL4AccelerationStructureDescriptor class.
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureDescriptor
type IMTL4AccelerationStructureGeometryDescriptor ¶
type IMTL4AccelerationStructureGeometryDescriptor interface {
objectivec.IObject
// A boolean value that indicates whether the ray-tracing system in Metal allows the invocation of intersection functions more than once per ray-primitive intersection.
AllowDuplicateIntersectionFunctionInvocation() bool
SetAllowDuplicateIntersectionFunctionInvocation(value bool)
// Sets the offset that this geometry contributes to determining the intersection function to invoke when a ray intersects it.
IntersectionFunctionTableOffset() uint
SetIntersectionFunctionTableOffset(value uint)
// Assigns an optional label you can assign to this geometry for debugging purposes.
Label() string
SetLabel(value string)
// Provides a hint to Metal that this geometry is opaque, potentially accelerating the ray/primitive intersection process.
Opaque() bool
SetOpaque(value bool)
// Assigns optional buffer containing data to associate with each primitive in this geometry.
PrimitiveDataBuffer() MTL4BufferRange
SetPrimitiveDataBuffer(value MTL4BufferRange)
// Sets the size, in bytes, of the data for each primitive in the primitive data buffer [primitiveDataBuffer](<doc://com.apple.metal/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/primitiveDataBuffer>) references.
PrimitiveDataElementSize() uint
SetPrimitiveDataElementSize(value uint)
// Defines the stride, in bytes, between each primitive’s data in the primitive data buffer [primitiveDataBuffer](<doc://com.apple.metal/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/primitiveDataBuffer>) references.
PrimitiveDataStride() uint
SetPrimitiveDataStride(value uint)
}
An interface definition for the MTL4AccelerationStructureGeometryDescriptor class.
Instance Properties ¶
- [IMTL4AccelerationStructureGeometryDescriptor.AllowDuplicateIntersectionFunctionInvocation]: A boolean value that indicates whether the ray-tracing system in Metal allows the invocation of intersection functions more than once per ray-primitive intersection.
- [IMTL4AccelerationStructureGeometryDescriptor.SetAllowDuplicateIntersectionFunctionInvocation]
- [IMTL4AccelerationStructureGeometryDescriptor.IntersectionFunctionTableOffset]: Sets the offset that this geometry contributes to determining the intersection function to invoke when a ray intersects it.
- [IMTL4AccelerationStructureGeometryDescriptor.SetIntersectionFunctionTableOffset]
- [IMTL4AccelerationStructureGeometryDescriptor.Label]: Assigns an optional label you can assign to this geometry for debugging purposes.
- [IMTL4AccelerationStructureGeometryDescriptor.SetLabel]
- [IMTL4AccelerationStructureGeometryDescriptor.Opaque]: Provides a hint to Metal that this geometry is opaque, potentially accelerating the ray/primitive intersection process.
- [IMTL4AccelerationStructureGeometryDescriptor.SetOpaque]
- [IMTL4AccelerationStructureGeometryDescriptor.PrimitiveDataBuffer]: Assigns optional buffer containing data to associate with each primitive in this geometry.
- [IMTL4AccelerationStructureGeometryDescriptor.SetPrimitiveDataBuffer]
- [IMTL4AccelerationStructureGeometryDescriptor.PrimitiveDataElementSize]: Sets the size, in bytes, of the data for each primitive in the primitive data buffer [primitiveDataBuffer](<doc://com.apple.metal/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/primitiveDataBuffer>) references.
- [IMTL4AccelerationStructureGeometryDescriptor.SetPrimitiveDataElementSize]
- [IMTL4AccelerationStructureGeometryDescriptor.PrimitiveDataStride]: Defines the stride, in bytes, between each primitive’s data in the primitive data buffer [primitiveDataBuffer](<doc://com.apple.metal/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/primitiveDataBuffer>) references.
- [IMTL4AccelerationStructureGeometryDescriptor.SetPrimitiveDataStride]
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor
type IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor ¶
type IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor interface {
IMTL4AccelerationStructureGeometryDescriptor
// Configures a reference to a buffer where each entry contains a reference to a buffer of bounding boxes.
BoundingBoxBuffers() MTL4BufferRange
SetBoundingBoxBuffers(value MTL4BufferRange)
// Declares the number of bounding boxes in each buffer that `boundingBoxBuffer` references.
BoundingBoxCount() uint
SetBoundingBoxCount(value uint)
// Declares the stride, in bytes, between bounding boxes in the bounding box buffers each entry in `boundingBoxBuffer` references.
BoundingBoxStride() uint
SetBoundingBoxStride(value uint)
}
An interface definition for the MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor class.
Instance Properties ¶
- [IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxBuffers]: Configures a reference to a buffer where each entry contains a reference to a buffer of bounding boxes.
- [IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxBuffers]
- [IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxCount]: Declares the number of bounding boxes in each buffer that `boundingBoxBuffer` references.
- [IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxCount]
- [IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxStride]: Declares the stride, in bytes, between bounding boxes in the bounding box buffers each entry in `boundingBoxBuffer` references.
- [IMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxStride]
type IMTL4AccelerationStructureMotionCurveGeometryDescriptor ¶
type IMTL4AccelerationStructureMotionCurveGeometryDescriptor interface {
IMTL4AccelerationStructureGeometryDescriptor
// Assigns a reference to a buffer where each entry contains a reference to a buffer of control points.
ControlPointBuffers() MTL4BufferRange
SetControlPointBuffers(value MTL4BufferRange)
// Specifies the number of control points in the buffers the control point buffers reference.
ControlPointCount() uint
SetControlPointCount(value uint)
// Declares the format of the control points in the buffers that the control point buffers reference.
ControlPointFormat() MTLAttributeFormat
SetControlPointFormat(value MTLAttributeFormat)
// Sets the stride, in bytes, between control points in the control point buffer.
ControlPointStride() uint
SetControlPointStride(value uint)
// Sets the curve basis function, determining how Metal interpolates the control points.
CurveBasis() MTLCurveBasis
SetCurveBasis(value MTLCurveBasis)
// Configures the type of curve end caps.
CurveEndCaps() MTLCurveEndCaps
SetCurveEndCaps(value MTLCurveEndCaps)
// Controls the curve type.
CurveType() MTLCurveType
SetCurveType(value MTLCurveType)
// Assigns an optional index buffer containing references to control points in the control point buffers.
IndexBuffer() MTL4BufferRange
SetIndexBuffer(value MTL4BufferRange)
// Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// Assigns a reference to a buffer containing, in turn, references to curve radii buffers.
RadiusBuffers() MTL4BufferRange
SetRadiusBuffers(value MTL4BufferRange)
// Sets the format of the radii in the radius buffer.
RadiusFormat() MTLAttributeFormat
SetRadiusFormat(value MTLAttributeFormat)
// Sets the stride, in bytes, between radii in the radius buffer.
RadiusStride() uint
SetRadiusStride(value uint)
// Controls the number of control points per curve segment.
SegmentControlPointCount() uint
SetSegmentControlPointCount(value uint)
// Declares the number of curve segments.
SegmentCount() uint
SetSegmentCount(value uint)
}
An interface definition for the MTL4AccelerationStructureMotionCurveGeometryDescriptor class.
Instance Properties ¶
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointBuffers]: Assigns a reference to a buffer where each entry contains a reference to a buffer of control points.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointBuffers]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointCount]: Specifies the number of control points in the buffers the control point buffers reference.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointCount]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointFormat]: Declares the format of the control points in the buffers that the control point buffers reference.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointFormat]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointStride]: Sets the stride, in bytes, between control points in the control point buffer.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointStride]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.CurveBasis]: Sets the curve basis function, determining how Metal interpolates the control points.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetCurveBasis]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.CurveEndCaps]: Configures the type of curve end caps.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetCurveEndCaps]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.CurveType]: Controls the curve type.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetCurveType]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.IndexBuffer]: Assigns an optional index buffer containing references to control points in the control point buffers.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetIndexBuffer]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.IndexType]: Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetIndexType]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.RadiusBuffers]: Assigns a reference to a buffer containing, in turn, references to curve radii buffers.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetRadiusBuffers]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.RadiusFormat]: Sets the format of the radii in the radius buffer.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetRadiusFormat]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.RadiusStride]: Sets the stride, in bytes, between radii in the radius buffer.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetRadiusStride]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SegmentControlPointCount]: Controls the number of control points per curve segment.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetSegmentControlPointCount]
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SegmentCount]: Declares the number of curve segments.
- [IMTL4AccelerationStructureMotionCurveGeometryDescriptor.SetSegmentCount]
type IMTL4AccelerationStructureMotionTriangleGeometryDescriptor ¶
type IMTL4AccelerationStructureMotionTriangleGeometryDescriptor interface {
IMTL4AccelerationStructureGeometryDescriptor
// Assigns an optional index buffer containing references to vertices in the vertex buffers you reference through the vertex buffers property.
IndexBuffer() MTL4BufferRange
SetIndexBuffer(value MTL4BufferRange)
// Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// Assings an optional reference to a buffer containing a `float4x3` transformation matrix.
TransformationMatrixBuffer() MTL4BufferRange
SetTransformationMatrixBuffer(value MTL4BufferRange)
// Configures the layout for the transformation matrix in the transformation matrix buffer.
TransformationMatrixLayout() MTLMatrixLayout
SetTransformationMatrixLayout(value MTLMatrixLayout)
// Declares the number of triangles in the vertex buffers that the buffer in the vertex buffers property references.
TriangleCount() uint
SetTriangleCount(value uint)
// Assigns a buffer where each entry contains a reference to a vertex buffer.
VertexBuffers() MTL4BufferRange
SetVertexBuffers(value MTL4BufferRange)
// Defines the format of the vertices in the vertex buffers.
VertexFormat() MTLAttributeFormat
SetVertexFormat(value MTLAttributeFormat)
// Sets the stride, in bytes, between vertices in all the vertex buffer.
VertexStride() uint
SetVertexStride(value uint)
}
An interface definition for the MTL4AccelerationStructureMotionTriangleGeometryDescriptor class.
Instance Properties ¶
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.IndexBuffer]: Assigns an optional index buffer containing references to vertices in the vertex buffers you reference through the vertex buffers property.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetIndexBuffer]
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.IndexType]: Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetIndexType]
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixBuffer]: Assings an optional reference to a buffer containing a `float4x3` transformation matrix.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixBuffer]
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixLayout]: Configures the layout for the transformation matrix in the transformation matrix buffer.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixLayout]
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.TriangleCount]: Declares the number of triangles in the vertex buffers that the buffer in the vertex buffers property references.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetTriangleCount]
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.VertexBuffers]: Assigns a buffer where each entry contains a reference to a vertex buffer.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetVertexBuffers]
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.VertexFormat]: Defines the format of the vertices in the vertex buffers.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetVertexFormat]
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.VertexStride]: Sets the stride, in bytes, between vertices in all the vertex buffer.
- [IMTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetVertexStride]
type IMTL4AccelerationStructureTriangleGeometryDescriptor ¶
type IMTL4AccelerationStructureTriangleGeometryDescriptor interface {
IMTL4AccelerationStructureGeometryDescriptor
// Sets an optional index buffer containing references to vertices in the `vertexBuffer`.
IndexBuffer() MTL4BufferRange
SetIndexBuffer(value MTL4BufferRange)
// Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// Assigns an optional reference to a buffer containing a `float4x3` transformation matrix.
TransformationMatrixBuffer() MTL4BufferRange
SetTransformationMatrixBuffer(value MTL4BufferRange)
// Configures the layout for the transformation matrix in the transformation matrix buffer.
TransformationMatrixLayout() MTLMatrixLayout
SetTransformationMatrixLayout(value MTLMatrixLayout)
// Declares the number of triangles in this geometry descriptor.
TriangleCount() uint
SetTriangleCount(value uint)
// Associates a vertex buffer containing triangle vertices.
VertexBuffer() MTL4BufferRange
SetVertexBuffer(value MTL4BufferRange)
// Describes the format of the vertices in the vertex buffer.
VertexFormat() MTLAttributeFormat
SetVertexFormat(value MTLAttributeFormat)
// Sets the stride, in bytes, between vertices in the vertex buffer.
VertexStride() uint
SetVertexStride(value uint)
}
An interface definition for the MTL4AccelerationStructureTriangleGeometryDescriptor class.
Instance Properties ¶
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.IndexBuffer]: Sets an optional index buffer containing references to vertices in the `vertexBuffer`.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetIndexBuffer]
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.IndexType]: Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetIndexType]
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.TransformationMatrixBuffer]: Assigns an optional reference to a buffer containing a `float4x3` transformation matrix.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixBuffer]
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.TransformationMatrixLayout]: Configures the layout for the transformation matrix in the transformation matrix buffer.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixLayout]
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.TriangleCount]: Declares the number of triangles in this geometry descriptor.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetTriangleCount]
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.VertexBuffer]: Associates a vertex buffer containing triangle vertices.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetVertexBuffer]
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.VertexFormat]: Describes the format of the vertices in the vertex buffer.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetVertexFormat]
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.VertexStride]: Sets the stride, in bytes, between vertices in the vertex buffer.
- [IMTL4AccelerationStructureTriangleGeometryDescriptor.SetVertexStride]
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureTriangleGeometryDescriptor
type IMTL4ArgumentTableDescriptor ¶
type IMTL4ArgumentTableDescriptor interface {
objectivec.IObject
// Configures whether Metal initializes the bindings to nil values upon creation of argument table.
InitializeBindings() bool
SetInitializeBindings(value bool)
// Assigns an optional label with the argument table for debug purposes.
Label() string
SetLabel(value string)
// Determines the number of buffer-binding slots for the argument table.
MaxBufferBindCount() uint
SetMaxBufferBindCount(value uint)
// Determines the number of sampler state-binding slots for the argument table.
MaxSamplerStateBindCount() uint
SetMaxSamplerStateBindCount(value uint)
// Determines the number of texture-binding slots for the argument table.
MaxTextureBindCount() uint
SetMaxTextureBindCount(value uint)
// Controls whether Metal should reserve memory for attribute strides in the argument table.
SupportAttributeStrides() bool
SetSupportAttributeStrides(value bool)
MTL4CommandQueueErrorDomain() string
}
An interface definition for the MTL4ArgumentTableDescriptor class.
Instance Properties ¶
- [IMTL4ArgumentTableDescriptor.InitializeBindings]: Configures whether Metal initializes the bindings to nil values upon creation of argument table.
- [IMTL4ArgumentTableDescriptor.SetInitializeBindings]
- [IMTL4ArgumentTableDescriptor.Label]: Assigns an optional label with the argument table for debug purposes.
- [IMTL4ArgumentTableDescriptor.SetLabel]
- [IMTL4ArgumentTableDescriptor.MaxBufferBindCount]: Determines the number of buffer-binding slots for the argument table.
- [IMTL4ArgumentTableDescriptor.SetMaxBufferBindCount]
- [IMTL4ArgumentTableDescriptor.MaxSamplerStateBindCount]: Determines the number of sampler state-binding slots for the argument table.
- [IMTL4ArgumentTableDescriptor.SetMaxSamplerStateBindCount]
- [IMTL4ArgumentTableDescriptor.MaxTextureBindCount]: Determines the number of texture-binding slots for the argument table.
- [IMTL4ArgumentTableDescriptor.SetMaxTextureBindCount]
- [IMTL4ArgumentTableDescriptor.SupportAttributeStrides]: Controls whether Metal should reserve memory for attribute strides in the argument table.
- [IMTL4ArgumentTableDescriptor.SetSupportAttributeStrides]
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor
type IMTL4BinaryFunctionDescriptor ¶
type IMTL4BinaryFunctionDescriptor interface {
objectivec.IObject
// Provides the function descriptor corresponding to the function to compile into a binary function.
FunctionDescriptor() IMTL4FunctionDescriptor
SetFunctionDescriptor(value IMTL4FunctionDescriptor)
// Associates a string that uniquely identifies a binary function.
Name() string
SetName(value string)
// Configure the options to use at binary function creation time.
Options() MTL4BinaryFunctionOptions
SetOptions(value MTL4BinaryFunctionOptions)
}
An interface definition for the MTL4BinaryFunctionDescriptor class.
Instance Properties ¶
- [IMTL4BinaryFunctionDescriptor.FunctionDescriptor]: Provides the function descriptor corresponding to the function to compile into a binary function.
- [IMTL4BinaryFunctionDescriptor.SetFunctionDescriptor]
- [IMTL4BinaryFunctionDescriptor.Name]: Associates a string that uniquely identifies a binary function.
- [IMTL4BinaryFunctionDescriptor.SetName]
- [IMTL4BinaryFunctionDescriptor.Options]: Configure the options to use at binary function creation time.
- [IMTL4BinaryFunctionDescriptor.SetOptions]
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunctionDescriptor
type IMTL4CommandAllocatorDescriptor ¶
type IMTL4CommandAllocatorDescriptor interface {
objectivec.IObject
// An optional label you can assign to the command allocator to aid debugging.
Label() string
SetLabel(value string)
MTL4CommandQueueErrorDomain() string
}
An interface definition for the MTL4CommandAllocatorDescriptor class.
Instance Properties ¶
- [IMTL4CommandAllocatorDescriptor.Label]: An optional label you can assign to the command allocator to aid debugging.
- [IMTL4CommandAllocatorDescriptor.SetLabel]
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocatorDescriptor
type IMTL4CommandBufferOptions ¶
type IMTL4CommandBufferOptions interface {
objectivec.IObject
// Contains information related to shader logging.
LogState() MTLLogState
SetLogState(value MTLLogState)
MTL4CommandQueueErrorDomain() string
}
An interface definition for the MTL4CommandBufferOptions class.
Instance Properties ¶
- [IMTL4CommandBufferOptions.LogState]: Contains information related to shader logging.
- [IMTL4CommandBufferOptions.SetLogState]
See: https://developer.apple.com/documentation/Metal/MTL4CommandBufferOptions
type IMTL4CommandQueueDescriptor ¶
type IMTL4CommandQueueDescriptor interface {
objectivec.IObject
// Assigns a dispatch queue to which Metal submits feedback notification blocks.
FeedbackQueue() dispatch.Queue
SetFeedbackQueue(value dispatch.Queue)
// Assigns an optional label to the command queue instance for debugging purposes.
Label() string
SetLabel(value string)
MTL4CommandQueueErrorDomain() string
}
An interface definition for the MTL4CommandQueueDescriptor class.
Instance Properties ¶
- [IMTL4CommandQueueDescriptor.FeedbackQueue]: Assigns a dispatch queue to which Metal submits feedback notification blocks.
- [IMTL4CommandQueueDescriptor.SetFeedbackQueue]
- [IMTL4CommandQueueDescriptor.Label]: Assigns an optional label to the command queue instance for debugging purposes.
- [IMTL4CommandQueueDescriptor.SetLabel]
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueueDescriptor
type IMTL4CommitOptions ¶
type IMTL4CommitOptions interface {
objectivec.IObject
// Registers a commit feedback handler that Metal calls with feedback data when available.
AddFeedbackHandler(block MTL4CommitFeedbackHandler)
MTL4CommandQueueErrorDomain() string
}
An interface definition for the MTL4CommitOptions class.
Instance Methods ¶
- [IMTL4CommitOptions.AddFeedbackHandler]: Registers a commit feedback handler that Metal calls with feedback data when available.
See: https://developer.apple.com/documentation/Metal/MTL4CommitOptions
type IMTL4CompilerDescriptor ¶
type IMTL4CompilerDescriptor interface {
objectivec.IObject
// Assigns an optional descriptor label to the compiler for debugging purposes.
Label() string
SetLabel(value string)
// Assigns a pipeline data set serializer into which this compiler stores data for all pipelines it creates.
PipelineDataSetSerializer() MTL4PipelineDataSetSerializer
SetPipelineDataSetSerializer(value MTL4PipelineDataSetSerializer)
}
An interface definition for the MTL4CompilerDescriptor class.
Instance Properties ¶
- [IMTL4CompilerDescriptor.Label]: Assigns an optional descriptor label to the compiler for debugging purposes.
- [IMTL4CompilerDescriptor.SetLabel]
- [IMTL4CompilerDescriptor.PipelineDataSetSerializer]: Assigns a pipeline data set serializer into which this compiler stores data for all pipelines it creates.
- [IMTL4CompilerDescriptor.SetPipelineDataSetSerializer]
See: https://developer.apple.com/documentation/Metal/MTL4CompilerDescriptor
type IMTL4CompilerTaskOptions ¶
type IMTL4CompilerTaskOptions interface {
objectivec.IObject
// An array of archive instances that can potentially accelerate a compilation task.
LookupArchives() []objectivec.IObject
SetLookupArchives(value []objectivec.IObject)
}
An interface definition for the MTL4CompilerTaskOptions class.
Instance Properties ¶
- [IMTL4CompilerTaskOptions.LookupArchives]: An array of archive instances that can potentially accelerate a compilation task.
- [IMTL4CompilerTaskOptions.SetLookupArchives]
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTaskOptions
type IMTL4ComputePipelineDescriptor ¶
type IMTL4ComputePipelineDescriptor interface {
IMTL4PipelineDescriptor
// A descriptor representing the compute pipeline’s function.
ComputeFunctionDescriptor() IMTL4FunctionDescriptor
SetComputeFunctionDescriptor(value IMTL4FunctionDescriptor)
// The maximum total number of threads that Metal can execute in a single threadgroup for the compute function.
MaxTotalThreadsPerThreadgroup() uint
SetMaxTotalThreadsPerThreadgroup(value uint)
// The required number of threads per threadgroup for compute dispatches.
RequiredThreadsPerThreadgroup() MTLSize
SetRequiredThreadsPerThreadgroup(value MTLSize)
// An object that contains information about functions to link to the compute pipeline.
StaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
SetStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
// A boolean value indicating whether the compute pipeline supports linking binary functions.
SupportBinaryLinking() bool
SetSupportBinaryLinking(value bool)
// A value indicating whether the pipeline supports Metal indirect command buffers.
SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
// A boolean value indicating whether each dimension of the threadgroup size is a multiple of its corresponding thread execution width.
ThreadGroupSizeIsMultipleOfThreadExecutionWidth() bool
SetThreadGroupSizeIsMultipleOfThreadExecutionWidth(value bool)
// Resets the descriptor to its default values.
Reset()
}
An interface definition for the MTL4ComputePipelineDescriptor class.
Instance Properties ¶
- [IMTL4ComputePipelineDescriptor.ComputeFunctionDescriptor]: A descriptor representing the compute pipeline’s function.
- [IMTL4ComputePipelineDescriptor.SetComputeFunctionDescriptor]
- [IMTL4ComputePipelineDescriptor.MaxTotalThreadsPerThreadgroup]: The maximum total number of threads that Metal can execute in a single threadgroup for the compute function.
- [IMTL4ComputePipelineDescriptor.SetMaxTotalThreadsPerThreadgroup]
- [IMTL4ComputePipelineDescriptor.RequiredThreadsPerThreadgroup]: The required number of threads per threadgroup for compute dispatches.
- [IMTL4ComputePipelineDescriptor.SetRequiredThreadsPerThreadgroup]
- [IMTL4ComputePipelineDescriptor.StaticLinkingDescriptor]: An object that contains information about functions to link to the compute pipeline.
- [IMTL4ComputePipelineDescriptor.SetStaticLinkingDescriptor]
- [IMTL4ComputePipelineDescriptor.SupportBinaryLinking]: A boolean value indicating whether the compute pipeline supports linking binary functions.
- [IMTL4ComputePipelineDescriptor.SetSupportBinaryLinking]
- [IMTL4ComputePipelineDescriptor.SupportIndirectCommandBuffers]: A value indicating whether the pipeline supports Metal indirect command buffers.
- [IMTL4ComputePipelineDescriptor.SetSupportIndirectCommandBuffers]
- [IMTL4ComputePipelineDescriptor.ThreadGroupSizeIsMultipleOfThreadExecutionWidth]: A boolean value indicating whether each dimension of the threadgroup size is a multiple of its corresponding thread execution width.
- [IMTL4ComputePipelineDescriptor.SetThreadGroupSizeIsMultipleOfThreadExecutionWidth]
Instance Methods ¶
- [IMTL4ComputePipelineDescriptor.Reset]: Resets the descriptor to its default values.
See: https://developer.apple.com/documentation/Metal/MTL4ComputePipelineDescriptor
type IMTL4CounterHeapDescriptor ¶
type IMTL4CounterHeapDescriptor interface {
objectivec.IObject
// Assigns the number of entries in the heap.
Count() uint
SetCount(value uint)
// Assigns the type of data that the heap contains.
Type() MTL4CounterHeapType
SetType(value MTL4CounterHeapType)
MTL4CommandQueueErrorDomain() string
}
An interface definition for the MTL4CounterHeapDescriptor class.
Instance Properties ¶
- [IMTL4CounterHeapDescriptor.Count]: Assigns the number of entries in the heap.
- [IMTL4CounterHeapDescriptor.SetCount]
- [IMTL4CounterHeapDescriptor.Type]: Assigns the type of data that the heap contains.
- [IMTL4CounterHeapDescriptor.SetType]
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeapDescriptor
type IMTL4FunctionDescriptor ¶
type IMTL4FunctionDescriptor interface {
objectivec.IObject
}
An interface definition for the MTL4FunctionDescriptor class.
See: https://developer.apple.com/documentation/Metal/MTL4FunctionDescriptor
type IMTL4IndirectInstanceAccelerationStructureDescriptor ¶
type IMTL4IndirectInstanceAccelerationStructureDescriptor interface {
IMTL4AccelerationStructureDescriptor
// Provides a reference to a buffer containing the number of instances in the instance descriptor buffer, formatted as a 32-bit unsigned integer.
InstanceCountBuffer() MTL4BufferRange
SetInstanceCountBuffer(value MTL4BufferRange)
// Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
InstanceDescriptorBuffer() MTL4BufferRange
SetInstanceDescriptorBuffer(value MTL4BufferRange)
// Sets the stride, in bytes, between instance descriptors in the instance descriptor buffer.
InstanceDescriptorStride() uint
SetInstanceDescriptorStride(value uint)
// Controls the type of instance descriptor that the instance descriptor buffer references.
InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
// Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
InstanceTransformationMatrixLayout() MTLMatrixLayout
SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
// Controls the maximum number of instance descriptors the instance descriptor buffer can reference.
MaxInstanceCount() uint
SetMaxInstanceCount(value uint)
// Controls the maximum number of motion transforms in the motion transform buffer.
MaxMotionTransformCount() uint
SetMaxMotionTransformCount(value uint)
// A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
MotionTransformBuffer() MTL4BufferRange
SetMotionTransformBuffer(value MTL4BufferRange)
// Associates a buffer reference containing the number of motion transforms in the motion transform buffer, formatted as a 32-bit unsigned integer.
MotionTransformCountBuffer() MTL4BufferRange
SetMotionTransformCountBuffer(value MTL4BufferRange)
// Sets the stride for motion transform.
MotionTransformStride() uint
SetMotionTransformStride(value uint)
// Sets the type of motion transforms, either as a matrix or individual components.
MotionTransformType() MTLTransformType
SetMotionTransformType(value MTLTransformType)
}
An interface definition for the MTL4IndirectInstanceAccelerationStructureDescriptor class.
Instance Properties ¶
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.InstanceCountBuffer]: Provides a reference to a buffer containing the number of instances in the instance descriptor buffer, formatted as a 32-bit unsigned integer.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceCountBuffer]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer]: Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorStride]: Sets the stride, in bytes, between instance descriptors in the instance descriptor buffer.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorType]: Controls the type of instance descriptor that the instance descriptor buffer references.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorType]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout]: Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.MaxInstanceCount]: Controls the maximum number of instance descriptors the instance descriptor buffer can reference.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetMaxInstanceCount]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.MaxMotionTransformCount]: Controls the maximum number of motion transforms in the motion transform buffer.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetMaxMotionTransformCount]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformBuffer]: A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformBuffer]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformCountBuffer]: Associates a buffer reference containing the number of motion transforms in the motion transform buffer, formatted as a 32-bit unsigned integer.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformCountBuffer]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformStride]: Sets the stride for motion transform.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformStride]
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformType]: Sets the type of motion transforms, either as a matrix or individual components.
- [IMTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformType]
See: https://developer.apple.com/documentation/Metal/MTL4IndirectInstanceAccelerationStructureDescriptor
type IMTL4InstanceAccelerationStructureDescriptor ¶
type IMTL4InstanceAccelerationStructureDescriptor interface {
IMTL4AccelerationStructureDescriptor
// Controls the number of instance descriptors in the instance descriptor buffer references.
InstanceCount() uint
SetInstanceCount(value uint)
// Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
InstanceDescriptorBuffer() MTL4BufferRange
SetInstanceDescriptorBuffer(value MTL4BufferRange)
// Sets the stride, in bytes, between instance descriptors the instance descriptor buffer references.
InstanceDescriptorStride() uint
SetInstanceDescriptorStride(value uint)
// The type of instance descriptor that the instance descriptor buffer references.
InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
// Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
InstanceTransformationMatrixLayout() MTLMatrixLayout
SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
// A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
MotionTransformBuffer() MTL4BufferRange
SetMotionTransformBuffer(value MTL4BufferRange)
// Controls the total number of motion transforms in the motion transform buffer.
MotionTransformCount() uint
SetMotionTransformCount(value uint)
// Specify the stride for motion transform.
MotionTransformStride() uint
SetMotionTransformStride(value uint)
// Controls the type of motion transforms, either as a matrix or individual components.
MotionTransformType() MTLTransformType
SetMotionTransformType(value MTLTransformType)
}
An interface definition for the MTL4InstanceAccelerationStructureDescriptor class.
Instance Properties ¶
- [IMTL4InstanceAccelerationStructureDescriptor.InstanceCount]: Controls the number of instance descriptors in the instance descriptor buffer references.
- [IMTL4InstanceAccelerationStructureDescriptor.SetInstanceCount]
- [IMTL4InstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer]: Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
- [IMTL4InstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer]
- [IMTL4InstanceAccelerationStructureDescriptor.InstanceDescriptorStride]: Sets the stride, in bytes, between instance descriptors the instance descriptor buffer references.
- [IMTL4InstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride]
- [IMTL4InstanceAccelerationStructureDescriptor.InstanceDescriptorType]: The type of instance descriptor that the instance descriptor buffer references.
- [IMTL4InstanceAccelerationStructureDescriptor.SetInstanceDescriptorType]
- [IMTL4InstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout]: Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
- [IMTL4InstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout]
- [IMTL4InstanceAccelerationStructureDescriptor.MotionTransformBuffer]: A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
- [IMTL4InstanceAccelerationStructureDescriptor.SetMotionTransformBuffer]
- [IMTL4InstanceAccelerationStructureDescriptor.MotionTransformCount]: Controls the total number of motion transforms in the motion transform buffer.
- [IMTL4InstanceAccelerationStructureDescriptor.SetMotionTransformCount]
- [IMTL4InstanceAccelerationStructureDescriptor.MotionTransformStride]: Specify the stride for motion transform.
- [IMTL4InstanceAccelerationStructureDescriptor.SetMotionTransformStride]
- [IMTL4InstanceAccelerationStructureDescriptor.MotionTransformType]: Controls the type of motion transforms, either as a matrix or individual components.
- [IMTL4InstanceAccelerationStructureDescriptor.SetMotionTransformType]
See: https://developer.apple.com/documentation/Metal/MTL4InstanceAccelerationStructureDescriptor
type IMTL4LibraryDescriptor ¶
type IMTL4LibraryDescriptor interface {
objectivec.IObject
// Assigns an optional name to the Metal library.
Name() string
SetName(value string)
// Provides compile-time options for the Metal library.
Options() IMTLCompileOptions
SetOptions(value IMTLCompileOptions)
// Assigns an optional string containing the source code of the shader language program to compile into a Metal library.
Source() string
SetSource(value string)
}
An interface definition for the MTL4LibraryDescriptor class.
Instance Properties ¶
- [IMTL4LibraryDescriptor.Name]: Assigns an optional name to the Metal library.
- [IMTL4LibraryDescriptor.SetName]
- [IMTL4LibraryDescriptor.Options]: Provides compile-time options for the Metal library.
- [IMTL4LibraryDescriptor.SetOptions]
- [IMTL4LibraryDescriptor.Source]: Assigns an optional string containing the source code of the shader language program to compile into a Metal library.
- [IMTL4LibraryDescriptor.SetSource]
See: https://developer.apple.com/documentation/Metal/MTL4LibraryDescriptor
type IMTL4LibraryFunctionDescriptor ¶
type IMTL4LibraryFunctionDescriptor interface {
IMTL4FunctionDescriptor
// Returns a reference to the library containing the function.
Library() MTLLibrary
SetLibrary(value MTLLibrary)
// Assigns a name to the function.
Name() string
SetName(value string)
}
An interface definition for the MTL4LibraryFunctionDescriptor class.
Instance Properties ¶
- [IMTL4LibraryFunctionDescriptor.Library]: Returns a reference to the library containing the function.
- [IMTL4LibraryFunctionDescriptor.SetLibrary]
- [IMTL4LibraryFunctionDescriptor.Name]: Assigns a name to the function.
- [IMTL4LibraryFunctionDescriptor.SetName]
See: https://developer.apple.com/documentation/Metal/MTL4LibraryFunctionDescriptor
type IMTL4MachineLearningPipelineDescriptor ¶
type IMTL4MachineLearningPipelineDescriptor interface {
IMTL4PipelineDescriptor
// Assigns the function that the machine learning pipeline you create from this descriptor executes.
MachineLearningFunctionDescriptor() IMTL4FunctionDescriptor
SetMachineLearningFunctionDescriptor(value IMTL4FunctionDescriptor)
// Obtains the dimensions of the input tensor at `bufferIndex` if set, `nil` otherwise.
InputDimensionsAtBufferIndex(bufferIndex int) IMTLTensorExtents
// Resets the descriptor to its default values.
Reset()
// Sets the dimension of an input tensor at a buffer index.
SetInputDimensionsAtBufferIndex(dimensions IMTLTensorExtents, bufferIndex int)
// Sets the dimensions of multiple input tensors on a range of buffer bindings.
SetInputDimensionsWithRange(dimensions []MTLTensorExtents, range_ foundation.NSRange)
}
An interface definition for the MTL4MachineLearningPipelineDescriptor class.
Instance Properties ¶
- [IMTL4MachineLearningPipelineDescriptor.MachineLearningFunctionDescriptor]: Assigns the function that the machine learning pipeline you create from this descriptor executes.
- [IMTL4MachineLearningPipelineDescriptor.SetMachineLearningFunctionDescriptor]
Instance Methods ¶
- [IMTL4MachineLearningPipelineDescriptor.InputDimensionsAtBufferIndex]: Obtains the dimensions of the input tensor at `bufferIndex` if set, `nil` otherwise.
- [IMTL4MachineLearningPipelineDescriptor.Reset]: Resets the descriptor to its default values.
- [IMTL4MachineLearningPipelineDescriptor.SetInputDimensionsAtBufferIndex]: Sets the dimension of an input tensor at a buffer index.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineDescriptor
type IMTL4MachineLearningPipelineReflection ¶
type IMTL4MachineLearningPipelineReflection interface {
objectivec.IObject
// Describes every input and output of the pipeline.
Bindings() []objectivec.IObject
}
An interface definition for the MTL4MachineLearningPipelineReflection class.
Instance Properties ¶
- [IMTL4MachineLearningPipelineReflection.Bindings]: Describes every input and output of the pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineReflection
type IMTL4MeshRenderPipelineDescriptor ¶
type IMTL4MeshRenderPipelineDescriptor interface {
IMTL4PipelineDescriptor
// Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
AlphaToCoverageState() MTL4AlphaToCoverageState
SetAlphaToCoverageState(value MTL4AlphaToCoverageState)
// Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
AlphaToOneState() MTL4AlphaToOneState
SetAlphaToOneState(value MTL4AlphaToOneState)
// Sets the logical-to-physical rendering remap state.
ColorAttachmentMappingState() MTL4LogicalToPhysicalColorAttachmentMappingState
SetColorAttachmentMappingState(value MTL4LogicalToPhysicalColorAttachmentMappingState)
// Accesses an array containing descriptions of the color attachments this pipeline writes to.
ColorAttachments() IMTL4RenderPipelineColorAttachmentDescriptorArray
// Assigns a function descriptor representing the function this pipeline executes for each fragment.
FragmentFunctionDescriptor() IMTL4FunctionDescriptor
SetFragmentFunctionDescriptor(value IMTL4FunctionDescriptor)
// Provides static linking information for the fragment stage of the render pipeline.
FragmentStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
SetFragmentStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
// Determines whether the pipeline rasterizes primitives.
RasterizationEnabled() bool
SetRasterizationEnabled(value bool)
// Controls the largest number of threads the pipeline state can execute when the object stage of a mesh render pipeline you create from this descriptor dispatches its mesh stage.
MaxTotalThreadgroupsPerMeshGrid() uint
SetMaxTotalThreadgroupsPerMeshGrid(value uint)
// Controls the largest number of threads the pipeline state can execute in a single mesh shader threadgroup dispatch.
MaxTotalThreadsPerMeshThreadgroup() uint
SetMaxTotalThreadsPerMeshThreadgroup(value uint)
// Controls the largest number of threads the pipeline state can execute in a single object shader threadgroup dispatch.
MaxTotalThreadsPerObjectThreadgroup() uint
SetMaxTotalThreadsPerObjectThreadgroup(value uint)
// Determines the maximum value that can you can pass as the pipeline’s amplification count.
MaxVertexAmplificationCount() uint
SetMaxVertexAmplificationCount(value uint)
// Assigns a function descriptor representing the function this pipeline executes for each primitive in the mesh shader stage.
MeshFunctionDescriptor() IMTL4FunctionDescriptor
SetMeshFunctionDescriptor(value IMTL4FunctionDescriptor)
// Provides static linking information for the mesh stage of the render pipeline.
MeshStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
SetMeshStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
// Provides a guarantee to Metal regarding the number of threadgroup threads for the mesh stage of a pipeline you create from this descriptor.
MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
// Assigns a function descriptor representing the function this pipeline executes for each in the object shader stage.
ObjectFunctionDescriptor() IMTL4FunctionDescriptor
SetObjectFunctionDescriptor(value IMTL4FunctionDescriptor)
// Provides static linking information for the object stage of the render pipeline.
ObjectStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
SetObjectStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
// Provides a guarantee to Metal regarding the number of threadgroup threads for the object stage of a pipeline you create from this descriptor.
ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
// Reserves storage for the object-to-mesh stage payload.
PayloadMemoryLength() uint
SetPayloadMemoryLength(value uint)
// Sets number of samples this pipeline applies for each fragment.
RasterSampleCount() uint
SetRasterSampleCount(value uint)
// Controls the required number of mesh threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
RequiredThreadsPerMeshThreadgroup() MTLSize
SetRequiredThreadsPerMeshThreadgroup(value MTLSize)
// Controls the required number of object threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
RequiredThreadsPerObjectThreadgroup() MTLSize
SetRequiredThreadsPerObjectThreadgroup(value MTLSize)
// Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
SupportFragmentBinaryLinking() bool
SetSupportFragmentBinaryLinking(value bool)
// Indicates whether the pipeline supports indirect command buffers.
SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
// Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the mesh shader function’s callable functions list.
SupportMeshBinaryLinking() bool
SetSupportMeshBinaryLinking(value bool)
// Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the object shader function’s callable functions list.
SupportObjectBinaryLinking() bool
SetSupportObjectBinaryLinking(value bool)
// Resets this descriptor to its default state.
Reset()
}
An interface definition for the MTL4MeshRenderPipelineDescriptor class.
Instance Properties ¶
- [IMTL4MeshRenderPipelineDescriptor.AlphaToCoverageState]: Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
- [IMTL4MeshRenderPipelineDescriptor.SetAlphaToCoverageState]
- [IMTL4MeshRenderPipelineDescriptor.AlphaToOneState]: Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
- [IMTL4MeshRenderPipelineDescriptor.SetAlphaToOneState]
- [IMTL4MeshRenderPipelineDescriptor.ColorAttachmentMappingState]: Sets the logical-to-physical rendering remap state.
- [IMTL4MeshRenderPipelineDescriptor.SetColorAttachmentMappingState]
- [IMTL4MeshRenderPipelineDescriptor.ColorAttachments]: Accesses an array containing descriptions of the color attachments this pipeline writes to.
- [IMTL4MeshRenderPipelineDescriptor.FragmentFunctionDescriptor]: Assigns a function descriptor representing the function this pipeline executes for each fragment.
- [IMTL4MeshRenderPipelineDescriptor.SetFragmentFunctionDescriptor]
- [IMTL4MeshRenderPipelineDescriptor.FragmentStaticLinkingDescriptor]: Provides static linking information for the fragment stage of the render pipeline.
- [IMTL4MeshRenderPipelineDescriptor.SetFragmentStaticLinkingDescriptor]
- [IMTL4MeshRenderPipelineDescriptor.RasterizationEnabled]: Determines whether the pipeline rasterizes primitives.
- [IMTL4MeshRenderPipelineDescriptor.SetRasterizationEnabled]
- [IMTL4MeshRenderPipelineDescriptor.MaxTotalThreadgroupsPerMeshGrid]: Controls the largest number of threads the pipeline state can execute when the object stage of a mesh render pipeline you create from this descriptor dispatches its mesh stage.
- [IMTL4MeshRenderPipelineDescriptor.SetMaxTotalThreadgroupsPerMeshGrid]
- [IMTL4MeshRenderPipelineDescriptor.MaxTotalThreadsPerMeshThreadgroup]: Controls the largest number of threads the pipeline state can execute in a single mesh shader threadgroup dispatch.
- [IMTL4MeshRenderPipelineDescriptor.SetMaxTotalThreadsPerMeshThreadgroup]
- [IMTL4MeshRenderPipelineDescriptor.MaxTotalThreadsPerObjectThreadgroup]: Controls the largest number of threads the pipeline state can execute in a single object shader threadgroup dispatch.
- [IMTL4MeshRenderPipelineDescriptor.SetMaxTotalThreadsPerObjectThreadgroup]
- [IMTL4MeshRenderPipelineDescriptor.MaxVertexAmplificationCount]: Determines the maximum value that can you can pass as the pipeline’s amplification count.
- [IMTL4MeshRenderPipelineDescriptor.SetMaxVertexAmplificationCount]
- [IMTL4MeshRenderPipelineDescriptor.MeshFunctionDescriptor]: Assigns a function descriptor representing the function this pipeline executes for each primitive in the mesh shader stage.
- [IMTL4MeshRenderPipelineDescriptor.SetMeshFunctionDescriptor]
- [IMTL4MeshRenderPipelineDescriptor.MeshStaticLinkingDescriptor]: Provides static linking information for the mesh stage of the render pipeline.
- [IMTL4MeshRenderPipelineDescriptor.SetMeshStaticLinkingDescriptor]
- [IMTL4MeshRenderPipelineDescriptor.MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth]: Provides a guarantee to Metal regarding the number of threadgroup threads for the mesh stage of a pipeline you create from this descriptor.
- [IMTL4MeshRenderPipelineDescriptor.SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth]
- [IMTL4MeshRenderPipelineDescriptor.ObjectFunctionDescriptor]: Assigns a function descriptor representing the function this pipeline executes for each in the object shader stage.
- [IMTL4MeshRenderPipelineDescriptor.SetObjectFunctionDescriptor]
- [IMTL4MeshRenderPipelineDescriptor.ObjectStaticLinkingDescriptor]: Provides static linking information for the object stage of the render pipeline.
- [IMTL4MeshRenderPipelineDescriptor.SetObjectStaticLinkingDescriptor]
- [IMTL4MeshRenderPipelineDescriptor.ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth]: Provides a guarantee to Metal regarding the number of threadgroup threads for the object stage of a pipeline you create from this descriptor.
- [IMTL4MeshRenderPipelineDescriptor.SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth]
- [IMTL4MeshRenderPipelineDescriptor.PayloadMemoryLength]: Reserves storage for the object-to-mesh stage payload.
- [IMTL4MeshRenderPipelineDescriptor.SetPayloadMemoryLength]
- [IMTL4MeshRenderPipelineDescriptor.RasterSampleCount]: Sets number of samples this pipeline applies for each fragment.
- [IMTL4MeshRenderPipelineDescriptor.SetRasterSampleCount]
- [IMTL4MeshRenderPipelineDescriptor.RequiredThreadsPerMeshThreadgroup]: Controls the required number of mesh threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
- [IMTL4MeshRenderPipelineDescriptor.SetRequiredThreadsPerMeshThreadgroup]
- [IMTL4MeshRenderPipelineDescriptor.RequiredThreadsPerObjectThreadgroup]: Controls the required number of object threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
- [IMTL4MeshRenderPipelineDescriptor.SetRequiredThreadsPerObjectThreadgroup]
- [IMTL4MeshRenderPipelineDescriptor.SupportFragmentBinaryLinking]: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
- [IMTL4MeshRenderPipelineDescriptor.SetSupportFragmentBinaryLinking]
- [IMTL4MeshRenderPipelineDescriptor.SupportIndirectCommandBuffers]: Indicates whether the pipeline supports indirect command buffers.
- [IMTL4MeshRenderPipelineDescriptor.SetSupportIndirectCommandBuffers]
- [IMTL4MeshRenderPipelineDescriptor.SupportMeshBinaryLinking]: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the mesh shader function’s callable functions list.
- [IMTL4MeshRenderPipelineDescriptor.SetSupportMeshBinaryLinking]
- [IMTL4MeshRenderPipelineDescriptor.SupportObjectBinaryLinking]: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the object shader function’s callable functions list.
- [IMTL4MeshRenderPipelineDescriptor.SetSupportObjectBinaryLinking]
Instance Methods ¶
- [IMTL4MeshRenderPipelineDescriptor.Reset]: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4MeshRenderPipelineDescriptor
type IMTL4PipelineDataSetSerializerDescriptor ¶
type IMTL4PipelineDataSetSerializerDescriptor interface {
objectivec.IObject
// Specifies the configuration of the serialization process.
Configuration() MTL4PipelineDataSetSerializerConfiguration
SetConfiguration(value MTL4PipelineDataSetSerializerConfiguration)
}
An interface definition for the MTL4PipelineDataSetSerializerDescriptor class.
Instance Properties ¶
- [IMTL4PipelineDataSetSerializerDescriptor.Configuration]: Specifies the configuration of the serialization process.
- [IMTL4PipelineDataSetSerializerDescriptor.SetConfiguration]
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDataSetSerializerDescriptor
type IMTL4PipelineDescriptor ¶
type IMTL4PipelineDescriptor interface {
objectivec.IObject
// Assigns an optional string that uniquely identifies a pipeline descriptor.
Label() string
SetLabel(value string)
// Provides compile-time options when you build the pipeline.
Options() IMTL4PipelineOptions
SetOptions(value IMTL4PipelineOptions)
}
An interface definition for the MTL4PipelineDescriptor class.
Instance Properties ¶
- [IMTL4PipelineDescriptor.Label]: Assigns an optional string that uniquely identifies a pipeline descriptor.
- [IMTL4PipelineDescriptor.SetLabel]
- [IMTL4PipelineDescriptor.Options]: Provides compile-time options when you build the pipeline.
- [IMTL4PipelineDescriptor.SetOptions]
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDescriptor
type IMTL4PipelineOptions ¶
type IMTL4PipelineOptions interface {
objectivec.IObject
// Controls whether to include Metal shader reflection in this pipeline.
ShaderReflection() MTL4ShaderReflection
SetShaderReflection(value MTL4ShaderReflection)
// Controls whether to enable or disable Metal Shader Validation for the pipeline.
ShaderValidation() MTLShaderValidation
SetShaderValidation(value MTLShaderValidation)
}
An interface definition for the MTL4PipelineOptions class.
Instance Properties ¶
- [IMTL4PipelineOptions.ShaderReflection]: Controls whether to include Metal shader reflection in this pipeline.
- [IMTL4PipelineOptions.SetShaderReflection]
- [IMTL4PipelineOptions.ShaderValidation]: Controls whether to enable or disable Metal Shader Validation for the pipeline.
- [IMTL4PipelineOptions.SetShaderValidation]
See: https://developer.apple.com/documentation/Metal/MTL4PipelineOptions
type IMTL4PipelineStageDynamicLinkingDescriptor ¶
type IMTL4PipelineStageDynamicLinkingDescriptor interface {
objectivec.IObject
// Provides the array of binary functions to link.
BinaryLinkedFunctions() []objectivec.IObject
SetBinaryLinkedFunctions(value []objectivec.IObject)
// Limits the maximum depth of the call stack for indirect function calls in the pipeline stage function.
MaxCallStackDepth() uint
SetMaxCallStackDepth(value uint)
// Provides an array of dynamic libraries the compiler loads when it builds the pipeline.
PreloadedLibraries() []objectivec.IObject
SetPreloadedLibraries(value []objectivec.IObject)
}
An interface definition for the MTL4PipelineStageDynamicLinkingDescriptor class.
Instance Properties ¶
- [IMTL4PipelineStageDynamicLinkingDescriptor.BinaryLinkedFunctions]: Provides the array of binary functions to link.
- [IMTL4PipelineStageDynamicLinkingDescriptor.SetBinaryLinkedFunctions]
- [IMTL4PipelineStageDynamicLinkingDescriptor.MaxCallStackDepth]: Limits the maximum depth of the call stack for indirect function calls in the pipeline stage function.
- [IMTL4PipelineStageDynamicLinkingDescriptor.SetMaxCallStackDepth]
- [IMTL4PipelineStageDynamicLinkingDescriptor.PreloadedLibraries]: Provides an array of dynamic libraries the compiler loads when it builds the pipeline.
- [IMTL4PipelineStageDynamicLinkingDescriptor.SetPreloadedLibraries]
See: https://developer.apple.com/documentation/Metal/MTL4PipelineStageDynamicLinkingDescriptor
type IMTL4PrimitiveAccelerationStructureDescriptor ¶
type IMTL4PrimitiveAccelerationStructureDescriptor interface {
IMTL4AccelerationStructureDescriptor
// Associates the array of geometry descriptors that comprise this primitive acceleration structure.
GeometryDescriptors() []MTL4AccelerationStructureGeometryDescriptor
SetGeometryDescriptors(value []MTL4AccelerationStructureGeometryDescriptor)
// Configures the motion border mode.
MotionEndBorderMode() MTLMotionBorderMode
SetMotionEndBorderMode(value MTLMotionBorderMode)
// Configures the motion end time for this geometry.
MotionEndTime() float32
SetMotionEndTime(value float32)
// Sets the motion keyframe count.
MotionKeyframeCount() uint
SetMotionKeyframeCount(value uint)
// Configures the behavior when the ray-tracing system samples the acceleration structure before the motion start time.
MotionStartBorderMode() MTLMotionBorderMode
SetMotionStartBorderMode(value MTLMotionBorderMode)
// Configures the motion start time for this geometry.
MotionStartTime() float32
SetMotionStartTime(value float32)
}
An interface definition for the MTL4PrimitiveAccelerationStructureDescriptor class.
Instance Properties ¶
- [IMTL4PrimitiveAccelerationStructureDescriptor.GeometryDescriptors]: Associates the array of geometry descriptors that comprise this primitive acceleration structure.
- [IMTL4PrimitiveAccelerationStructureDescriptor.SetGeometryDescriptors]
- [IMTL4PrimitiveAccelerationStructureDescriptor.MotionEndBorderMode]: Configures the motion border mode.
- [IMTL4PrimitiveAccelerationStructureDescriptor.SetMotionEndBorderMode]
- [IMTL4PrimitiveAccelerationStructureDescriptor.MotionEndTime]: Configures the motion end time for this geometry.
- [IMTL4PrimitiveAccelerationStructureDescriptor.SetMotionEndTime]
- [IMTL4PrimitiveAccelerationStructureDescriptor.MotionKeyframeCount]: Sets the motion keyframe count.
- [IMTL4PrimitiveAccelerationStructureDescriptor.SetMotionKeyframeCount]
- [IMTL4PrimitiveAccelerationStructureDescriptor.MotionStartBorderMode]: Configures the behavior when the ray-tracing system samples the acceleration structure before the motion start time.
- [IMTL4PrimitiveAccelerationStructureDescriptor.SetMotionStartBorderMode]
- [IMTL4PrimitiveAccelerationStructureDescriptor.MotionStartTime]: Configures the motion start time for this geometry.
- [IMTL4PrimitiveAccelerationStructureDescriptor.SetMotionStartTime]
See: https://developer.apple.com/documentation/Metal/MTL4PrimitiveAccelerationStructureDescriptor
type IMTL4RenderPassDescriptor ¶
type IMTL4RenderPassDescriptor interface {
objectivec.IObject
// Accesses the array of state information for render attachments that store color data.
ColorAttachments() IMTLRenderPassColorAttachmentDescriptorArray
// Sets the default raster sample count for the render pass when it references no attachments.
DefaultRasterSampleCount() uint
SetDefaultRasterSampleCount(value uint)
// Accesses state information for a render attachment that stores depth data.
DepthAttachment() IMTLRenderPassDepthAttachmentDescriptor
SetDepthAttachment(value IMTLRenderPassDepthAttachmentDescriptor)
// Assigns the per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
ImageblockSampleLength() uint
SetImageblockSampleLength(value uint)
// Assigns an optional variable rasterization rate map that Metal uses in the render pass.
RasterizationRateMap() MTLRasterizationRateMap
SetRasterizationRateMap(value MTLRasterizationRateMap)
// Assigns the number of layers that all attachments this descriptor references have.
RenderTargetArrayLength() uint
SetRenderTargetArrayLength(value uint)
// Sets the height, in pixels, to which Metal constrains the render target.
RenderTargetHeight() uint
SetRenderTargetHeight(value uint)
// Sets the width, in pixels, to which Metal constrains the render target.
RenderTargetWidth() uint
SetRenderTargetWidth(value uint)
// Configures the custom sample positions to use in MSAA rendering.
SamplePositions() MTLSamplePosition
SetSamplePositions(value MTLSamplePosition)
// Accesses state information for a render attachment that stores stencil data.
StencilAttachment() IMTLRenderPassStencilAttachmentDescriptor
SetStencilAttachment(value IMTLRenderPassStencilAttachmentDescriptor)
// Controls if the render pass supports color attachment mapping.
SupportColorAttachmentMapping() bool
SetSupportColorAttachmentMapping(value bool)
// Assigns the per-tile size, in bytes, of the persistent threadgroup memory allocation of this render pass.
ThreadgroupMemoryLength() uint
SetThreadgroupMemoryLength(value uint)
// The height of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
TileHeight() uint
SetTileHeight(value uint)
// The width of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
TileWidth() uint
SetTileWidth(value uint)
// Configures a buffer into which Metal writes counts of fragments (pixels) passing the depth and stencil tests.
VisibilityResultBuffer() MTLBuffer
SetVisibilityResultBuffer(value MTLBuffer)
// Determines if Metal accumulates visibility results between render encoders or resets them.
VisibilityResultType() MTLVisibilityResultType
SetVisibilityResultType(value MTLVisibilityResultType)
// Retrieves the previously-configured custom sample positions.
GetSamplePositionsCount(positions []MTLSamplePosition, count uint) uint
// Configures the custom sample positions to use in MSAA rendering.
SetSamplePositionsCount(positions []MTLSamplePosition, count uint)
}
An interface definition for the MTL4RenderPassDescriptor class.
Instance Properties ¶
- [IMTL4RenderPassDescriptor.ColorAttachments]: Accesses the array of state information for render attachments that store color data.
- [IMTL4RenderPassDescriptor.DefaultRasterSampleCount]: Sets the default raster sample count for the render pass when it references no attachments.
- [IMTL4RenderPassDescriptor.SetDefaultRasterSampleCount]
- [IMTL4RenderPassDescriptor.DepthAttachment]: Accesses state information for a render attachment that stores depth data.
- [IMTL4RenderPassDescriptor.SetDepthAttachment]
- [IMTL4RenderPassDescriptor.ImageblockSampleLength]: Assigns the per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
- [IMTL4RenderPassDescriptor.SetImageblockSampleLength]
- [IMTL4RenderPassDescriptor.RasterizationRateMap]: Assigns an optional variable rasterization rate map that Metal uses in the render pass.
- [IMTL4RenderPassDescriptor.SetRasterizationRateMap]
- [IMTL4RenderPassDescriptor.RenderTargetArrayLength]: Assigns the number of layers that all attachments this descriptor references have.
- [IMTL4RenderPassDescriptor.SetRenderTargetArrayLength]
- [IMTL4RenderPassDescriptor.RenderTargetHeight]: Sets the height, in pixels, to which Metal constrains the render target.
- [IMTL4RenderPassDescriptor.SetRenderTargetHeight]
- [IMTL4RenderPassDescriptor.RenderTargetWidth]: Sets the width, in pixels, to which Metal constrains the render target.
- [IMTL4RenderPassDescriptor.SetRenderTargetWidth]
- [IMTL4RenderPassDescriptor.SamplePositions]: Configures the custom sample positions to use in MSAA rendering.
- [IMTL4RenderPassDescriptor.SetSamplePositions]
- [IMTL4RenderPassDescriptor.StencilAttachment]: Accesses state information for a render attachment that stores stencil data.
- [IMTL4RenderPassDescriptor.SetStencilAttachment]
- [IMTL4RenderPassDescriptor.SupportColorAttachmentMapping]: Controls if the render pass supports color attachment mapping.
- [IMTL4RenderPassDescriptor.SetSupportColorAttachmentMapping]
- [IMTL4RenderPassDescriptor.ThreadgroupMemoryLength]: Assigns the per-tile size, in bytes, of the persistent threadgroup memory allocation of this render pass.
- [IMTL4RenderPassDescriptor.SetThreadgroupMemoryLength]
- [IMTL4RenderPassDescriptor.TileHeight]: The height of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
- [IMTL4RenderPassDescriptor.SetTileHeight]
- [IMTL4RenderPassDescriptor.TileWidth]: The width of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
- [IMTL4RenderPassDescriptor.SetTileWidth]
- [IMTL4RenderPassDescriptor.VisibilityResultBuffer]: Configures a buffer into which Metal writes counts of fragments (pixels) passing the depth and stencil tests.
- [IMTL4RenderPassDescriptor.SetVisibilityResultBuffer]
- [IMTL4RenderPassDescriptor.VisibilityResultType]: Determines if Metal accumulates visibility results between render encoders or resets them.
- [IMTL4RenderPassDescriptor.SetVisibilityResultType]
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor
type IMTL4RenderPipelineBinaryFunctionsDescriptor ¶
type IMTL4RenderPipelineBinaryFunctionsDescriptor interface {
objectivec.IObject
// Provides an array of binary functions representing additional binary fragment shader functions.
FragmentAdditionalBinaryFunctions() []objectivec.IObject
SetFragmentAdditionalBinaryFunctions(value []objectivec.IObject)
// Provides an array of binary functions representing additional binary mesh shader functions.
MeshAdditionalBinaryFunctions() []objectivec.IObject
SetMeshAdditionalBinaryFunctions(value []objectivec.IObject)
// Provides an array of binary functions representing additional binary object shader functions.
ObjectAdditionalBinaryFunctions() []objectivec.IObject
SetObjectAdditionalBinaryFunctions(value []objectivec.IObject)
// Provides an array of binary functions representing additional binary tile shader functions.
TileAdditionalBinaryFunctions() []objectivec.IObject
SetTileAdditionalBinaryFunctions(value []objectivec.IObject)
// Provides an array of binary functions representing additional binary vertex shader functions.
VertexAdditionalBinaryFunctions() []objectivec.IObject
SetVertexAdditionalBinaryFunctions(value []objectivec.IObject)
// Resets this descriptor to its default state.
Reset()
}
An interface definition for the MTL4RenderPipelineBinaryFunctionsDescriptor class.
Instance Properties ¶
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.FragmentAdditionalBinaryFunctions]: Provides an array of binary functions representing additional binary fragment shader functions.
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.SetFragmentAdditionalBinaryFunctions]
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.MeshAdditionalBinaryFunctions]: Provides an array of binary functions representing additional binary mesh shader functions.
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.SetMeshAdditionalBinaryFunctions]
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.ObjectAdditionalBinaryFunctions]: Provides an array of binary functions representing additional binary object shader functions.
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.SetObjectAdditionalBinaryFunctions]
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.TileAdditionalBinaryFunctions]: Provides an array of binary functions representing additional binary tile shader functions.
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.SetTileAdditionalBinaryFunctions]
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.VertexAdditionalBinaryFunctions]: Provides an array of binary functions representing additional binary vertex shader functions.
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.SetVertexAdditionalBinaryFunctions]
Instance Methods ¶
- [IMTL4RenderPipelineBinaryFunctionsDescriptor.Reset]: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineBinaryFunctionsDescriptor
type IMTL4RenderPipelineColorAttachmentDescriptor ¶
type IMTL4RenderPipelineColorAttachmentDescriptor interface {
objectivec.IObject
// Configures the alpha blending operation.
AlphaBlendOperation() MTLBlendOperation
SetAlphaBlendOperation(value MTLBlendOperation)
// Configure the blend state for color attachments the pipeline state uses.
BlendingState() MTL4BlendState
SetBlendingState(value MTL4BlendState)
// Configures the destination-alpha blend factor.
DestinationAlphaBlendFactor() MTLBlendFactor
SetDestinationAlphaBlendFactor(value MTLBlendFactor)
// Configures the destination RGB blend factor.
DestinationRGBBlendFactor() MTLBlendFactor
SetDestinationRGBBlendFactor(value MTLBlendFactor)
// Configures the pixel format.
PixelFormat() MTLPixelFormat
SetPixelFormat(value MTLPixelFormat)
// Configures the RGB blend operation.
RgbBlendOperation() MTLBlendOperation
SetRgbBlendOperation(value MTLBlendOperation)
// Configures the source-alpha blend factor.
SourceAlphaBlendFactor() MTLBlendFactor
SetSourceAlphaBlendFactor(value MTLBlendFactor)
// Configures the source RGB blend factor.
SourceRGBBlendFactor() MTLBlendFactor
SetSourceRGBBlendFactor(value MTLBlendFactor)
// Configures the color write mask.
WriteMask() MTLColorWriteMask
SetWriteMask(value MTLColorWriteMask)
// Resets this descriptor to its default state.
Reset()
}
An interface definition for the MTL4RenderPipelineColorAttachmentDescriptor class.
Instance Properties ¶
- [IMTL4RenderPipelineColorAttachmentDescriptor.AlphaBlendOperation]: Configures the alpha blending operation.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetAlphaBlendOperation]
- [IMTL4RenderPipelineColorAttachmentDescriptor.BlendingState]: Configure the blend state for color attachments the pipeline state uses.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetBlendingState]
- [IMTL4RenderPipelineColorAttachmentDescriptor.DestinationAlphaBlendFactor]: Configures the destination-alpha blend factor.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetDestinationAlphaBlendFactor]
- [IMTL4RenderPipelineColorAttachmentDescriptor.DestinationRGBBlendFactor]: Configures the destination RGB blend factor.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetDestinationRGBBlendFactor]
- [IMTL4RenderPipelineColorAttachmentDescriptor.PixelFormat]: Configures the pixel format.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetPixelFormat]
- [IMTL4RenderPipelineColorAttachmentDescriptor.RgbBlendOperation]: Configures the RGB blend operation.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetRgbBlendOperation]
- [IMTL4RenderPipelineColorAttachmentDescriptor.SourceAlphaBlendFactor]: Configures the source-alpha blend factor.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetSourceAlphaBlendFactor]
- [IMTL4RenderPipelineColorAttachmentDescriptor.SourceRGBBlendFactor]: Configures the source RGB blend factor.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetSourceRGBBlendFactor]
- [IMTL4RenderPipelineColorAttachmentDescriptor.WriteMask]: Configures the color write mask.
- [IMTL4RenderPipelineColorAttachmentDescriptor.SetWriteMask]
Instance Methods ¶
- [IMTL4RenderPipelineColorAttachmentDescriptor.Reset]: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineColorAttachmentDescriptor
type IMTL4RenderPipelineColorAttachmentDescriptorArray ¶
type IMTL4RenderPipelineColorAttachmentDescriptorArray interface {
objectivec.IObject
// Resets the elements of the descriptor array
Reset()
// Accesses a color attachment at a specific index.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTL4RenderPipelineColorAttachmentDescriptor
// Sets an attachment at an index.
SetObjectAtIndexedSubscript(attachment IMTL4RenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTL4RenderPipelineColorAttachmentDescriptorArray class.
Instance Methods ¶
- [IMTL4RenderPipelineColorAttachmentDescriptorArray.Reset]: Resets the elements of the descriptor array
Subscripts ¶
- [IMTL4RenderPipelineColorAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Accesses a color attachment at a specific index.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineColorAttachmentDescriptorArray
type IMTL4RenderPipelineDescriptor ¶
type IMTL4RenderPipelineDescriptor interface {
IMTL4PipelineDescriptor
// Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
AlphaToCoverageState() MTL4AlphaToCoverageState
SetAlphaToCoverageState(value MTL4AlphaToCoverageState)
// Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
AlphaToOneState() MTL4AlphaToOneState
SetAlphaToOneState(value MTL4AlphaToOneState)
// Configures a logical-to-physical rendering remap state.
ColorAttachmentMappingState() MTL4LogicalToPhysicalColorAttachmentMappingState
SetColorAttachmentMappingState(value MTL4LogicalToPhysicalColorAttachmentMappingState)
// Accesses an array containing descriptions of the color attachments this pipeline writes to.
ColorAttachments() IMTL4RenderPipelineColorAttachmentDescriptorArray
// Assigns the shader function that this pipeline executes for each fragment.
FragmentFunctionDescriptor() IMTL4FunctionDescriptor
SetFragmentFunctionDescriptor(value IMTL4FunctionDescriptor)
// Provides static linking information for the fragment stage of the render pipeline.
FragmentStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
SetFragmentStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
// Assigns type of primitive topology this pipeline renders.
InputPrimitiveTopology() MTLPrimitiveTopologyClass
SetInputPrimitiveTopology(value MTLPrimitiveTopologyClass)
// Determines whether the pipeline rasterizes primitives.
RasterizationEnabled() bool
SetRasterizationEnabled(value bool)
// Determines the maximum value that can you can pass as the pipeline’s amplification count.
MaxVertexAmplificationCount() uint
SetMaxVertexAmplificationCount(value uint)
// Controls the number of samples this pipeline applies for each fragment.
RasterSampleCount() uint
SetRasterSampleCount(value uint)
// Indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
SupportFragmentBinaryLinking() bool
SetSupportFragmentBinaryLinking(value bool)
// Indicates whether the pipeline supports indirect command buffers.
SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
// Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the vertex shader function’s callable functions list.
SupportVertexBinaryLinking() bool
SetSupportVertexBinaryLinking(value bool)
// Configures an optional vertex descriptor for the vertex input.
VertexDescriptor() IMTLVertexDescriptor
SetVertexDescriptor(value IMTLVertexDescriptor)
// Assigns the shader function that this pipeline executes for each vertex.
VertexFunctionDescriptor() IMTL4FunctionDescriptor
SetVertexFunctionDescriptor(value IMTL4FunctionDescriptor)
// Provides static linking information for the vertex stage of the render pipeline.
VertexStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
SetVertexStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
// Resets this descriptor to its default state.
Reset()
}
An interface definition for the MTL4RenderPipelineDescriptor class.
Instance Properties ¶
- [IMTL4RenderPipelineDescriptor.AlphaToCoverageState]: Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
- [IMTL4RenderPipelineDescriptor.SetAlphaToCoverageState]
- [IMTL4RenderPipelineDescriptor.AlphaToOneState]: Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
- [IMTL4RenderPipelineDescriptor.SetAlphaToOneState]
- [IMTL4RenderPipelineDescriptor.ColorAttachmentMappingState]: Configures a logical-to-physical rendering remap state.
- [IMTL4RenderPipelineDescriptor.SetColorAttachmentMappingState]
- [IMTL4RenderPipelineDescriptor.ColorAttachments]: Accesses an array containing descriptions of the color attachments this pipeline writes to.
- [IMTL4RenderPipelineDescriptor.FragmentFunctionDescriptor]: Assigns the shader function that this pipeline executes for each fragment.
- [IMTL4RenderPipelineDescriptor.SetFragmentFunctionDescriptor]
- [IMTL4RenderPipelineDescriptor.FragmentStaticLinkingDescriptor]: Provides static linking information for the fragment stage of the render pipeline.
- [IMTL4RenderPipelineDescriptor.SetFragmentStaticLinkingDescriptor]
- [IMTL4RenderPipelineDescriptor.InputPrimitiveTopology]: Assigns type of primitive topology this pipeline renders.
- [IMTL4RenderPipelineDescriptor.SetInputPrimitiveTopology]
- [IMTL4RenderPipelineDescriptor.RasterizationEnabled]: Determines whether the pipeline rasterizes primitives.
- [IMTL4RenderPipelineDescriptor.SetRasterizationEnabled]
- [IMTL4RenderPipelineDescriptor.MaxVertexAmplificationCount]: Determines the maximum value that can you can pass as the pipeline’s amplification count.
- [IMTL4RenderPipelineDescriptor.SetMaxVertexAmplificationCount]
- [IMTL4RenderPipelineDescriptor.RasterSampleCount]: Controls the number of samples this pipeline applies for each fragment.
- [IMTL4RenderPipelineDescriptor.SetRasterSampleCount]
- [IMTL4RenderPipelineDescriptor.SupportFragmentBinaryLinking]: Indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
- [IMTL4RenderPipelineDescriptor.SetSupportFragmentBinaryLinking]
- [IMTL4RenderPipelineDescriptor.SupportIndirectCommandBuffers]: Indicates whether the pipeline supports indirect command buffers.
- [IMTL4RenderPipelineDescriptor.SetSupportIndirectCommandBuffers]
- [IMTL4RenderPipelineDescriptor.SupportVertexBinaryLinking]: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the vertex shader function’s callable functions list.
- [IMTL4RenderPipelineDescriptor.SetSupportVertexBinaryLinking]
- [IMTL4RenderPipelineDescriptor.VertexDescriptor]: Configures an optional vertex descriptor for the vertex input.
- [IMTL4RenderPipelineDescriptor.SetVertexDescriptor]
- [IMTL4RenderPipelineDescriptor.VertexFunctionDescriptor]: Assigns the shader function that this pipeline executes for each vertex.
- [IMTL4RenderPipelineDescriptor.SetVertexFunctionDescriptor]
- [IMTL4RenderPipelineDescriptor.VertexStaticLinkingDescriptor]: Provides static linking information for the vertex stage of the render pipeline.
- [IMTL4RenderPipelineDescriptor.SetVertexStaticLinkingDescriptor]
Instance Methods ¶
- [IMTL4RenderPipelineDescriptor.Reset]: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor
type IMTL4RenderPipelineDynamicLinkingDescriptor ¶
type IMTL4RenderPipelineDynamicLinkingDescriptor interface {
objectivec.IObject
// Controls properties for linking the fragment stage of the render pipeline.
FragmentLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
// Controls properties for linking the mesh stage of the render pipeline.
MeshLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
// Controls properties for link the object stage of the render pipeline.
ObjectLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
// Controls properties for linking the tile stage of the render pipeline.
TileLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
// Controls properties for linking the vertex stage of the render pipeline.
VertexLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
}
An interface definition for the MTL4RenderPipelineDynamicLinkingDescriptor class.
Instance Properties ¶
- [IMTL4RenderPipelineDynamicLinkingDescriptor.FragmentLinkingDescriptor]: Controls properties for linking the fragment stage of the render pipeline.
- [IMTL4RenderPipelineDynamicLinkingDescriptor.MeshLinkingDescriptor]: Controls properties for linking the mesh stage of the render pipeline.
- [IMTL4RenderPipelineDynamicLinkingDescriptor.ObjectLinkingDescriptor]: Controls properties for link the object stage of the render pipeline.
- [IMTL4RenderPipelineDynamicLinkingDescriptor.TileLinkingDescriptor]: Controls properties for linking the tile stage of the render pipeline.
- [IMTL4RenderPipelineDynamicLinkingDescriptor.VertexLinkingDescriptor]: Controls properties for linking the vertex stage of the render pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDynamicLinkingDescriptor
type IMTL4SpecializedFunctionDescriptor ¶
type IMTL4SpecializedFunctionDescriptor interface {
IMTL4FunctionDescriptor
// Configures optional function constant values to associate with the function.
ConstantValues() IMTLFunctionConstantValues
SetConstantValues(value IMTLFunctionConstantValues)
// Provides a descriptor that corresponds to a base function that the specialization applies to.
FunctionDescriptor() IMTL4FunctionDescriptor
SetFunctionDescriptor(value IMTL4FunctionDescriptor)
// Assigns an optional name to the specialized function.
SpecializedName() string
SetSpecializedName(value string)
}
An interface definition for the MTL4SpecializedFunctionDescriptor class.
Instance Properties ¶
- [IMTL4SpecializedFunctionDescriptor.ConstantValues]: Configures optional function constant values to associate with the function.
- [IMTL4SpecializedFunctionDescriptor.SetConstantValues]
- [IMTL4SpecializedFunctionDescriptor.FunctionDescriptor]: Provides a descriptor that corresponds to a base function that the specialization applies to.
- [IMTL4SpecializedFunctionDescriptor.SetFunctionDescriptor]
- [IMTL4SpecializedFunctionDescriptor.SpecializedName]: Assigns an optional name to the specialized function.
- [IMTL4SpecializedFunctionDescriptor.SetSpecializedName]
See: https://developer.apple.com/documentation/Metal/MTL4SpecializedFunctionDescriptor
type IMTL4StaticLinkingDescriptor ¶
type IMTL4StaticLinkingDescriptor interface {
objectivec.IObject
// Provides an array of functions to link at the Metal IR level.
FunctionDescriptors() []MTL4FunctionDescriptor
SetFunctionDescriptors(value []MTL4FunctionDescriptor)
// Assigns groups of functions to match call-site attributes in shader code.
Groups() foundation.INSDictionary
SetGroups(value foundation.INSDictionary)
// Provides an array of private functions to link at the Metal IR level.
PrivateFunctionDescriptors() []MTL4FunctionDescriptor
SetPrivateFunctionDescriptors(value []MTL4FunctionDescriptor)
}
An interface definition for the MTL4StaticLinkingDescriptor class.
Instance Properties ¶
- [IMTL4StaticLinkingDescriptor.FunctionDescriptors]: Provides an array of functions to link at the Metal IR level.
- [IMTL4StaticLinkingDescriptor.SetFunctionDescriptors]
- [IMTL4StaticLinkingDescriptor.Groups]: Assigns groups of functions to match call-site attributes in shader code.
- [IMTL4StaticLinkingDescriptor.SetGroups]
- [IMTL4StaticLinkingDescriptor.PrivateFunctionDescriptors]: Provides an array of private functions to link at the Metal IR level.
- [IMTL4StaticLinkingDescriptor.SetPrivateFunctionDescriptors]
See: https://developer.apple.com/documentation/Metal/MTL4StaticLinkingDescriptor
type IMTL4StitchedFunctionDescriptor ¶
type IMTL4StitchedFunctionDescriptor interface {
IMTL4FunctionDescriptor
// Configures an array of function descriptors with references to functions that contribute to the stitching process.
FunctionDescriptors() []MTL4FunctionDescriptor
SetFunctionDescriptors(value []MTL4FunctionDescriptor)
// Sets the graph representing how to stitch functions together.
FunctionGraph() IMTLFunctionStitchingGraph
SetFunctionGraph(value IMTLFunctionStitchingGraph)
}
An interface definition for the MTL4StitchedFunctionDescriptor class.
Instance Properties ¶
- [IMTL4StitchedFunctionDescriptor.FunctionDescriptors]: Configures an array of function descriptors with references to functions that contribute to the stitching process.
- [IMTL4StitchedFunctionDescriptor.SetFunctionDescriptors]
- [IMTL4StitchedFunctionDescriptor.FunctionGraph]: Sets the graph representing how to stitch functions together.
- [IMTL4StitchedFunctionDescriptor.SetFunctionGraph]
See: https://developer.apple.com/documentation/Metal/MTL4StitchedFunctionDescriptor
type IMTL4TileRenderPipelineDescriptor ¶
type IMTL4TileRenderPipelineDescriptor interface {
IMTL4PipelineDescriptor
// Access an array of descriptors that configure the properties of each color attachment in the tile render pipeline.
ColorAttachments() IMTLTileRenderPipelineColorAttachmentDescriptorArray
// Sets the maximum number of threads that the GPU can execute simultaneously within a single threadgroup in the tile render pipeline.
MaxTotalThreadsPerThreadgroup() uint
SetMaxTotalThreadsPerThreadgroup(value uint)
// Configures the number of samples per pixel used for multisampling.
RasterSampleCount() uint
SetRasterSampleCount(value uint)
// Sets the required number of threads per threadgroup for tile dispatches.
RequiredThreadsPerThreadgroup() MTLSize
SetRequiredThreadsPerThreadgroup(value MTLSize)
// Configures an object that contains information about functions to link to the tile render pipeline when Metal builds it.
StaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
SetStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
// Indicates whether the pipeline supports linking binary functions.
SupportBinaryLinking() bool
SetSupportBinaryLinking(value bool)
// Indicating whether the size of the threadgroup matches the size of a tile in the render pipeline.
ThreadgroupSizeMatchesTileSize() bool
SetThreadgroupSizeMatchesTileSize(value bool)
// Configures the tile function that the render pipeline executes for each tile in the tile shader stage.
TileFunctionDescriptor() IMTL4FunctionDescriptor
SetTileFunctionDescriptor(value IMTL4FunctionDescriptor)
// Resets the descriptor to the default state.
Reset()
}
An interface definition for the MTL4TileRenderPipelineDescriptor class.
Instance Properties ¶
- [IMTL4TileRenderPipelineDescriptor.ColorAttachments]: Access an array of descriptors that configure the properties of each color attachment in the tile render pipeline.
- [IMTL4TileRenderPipelineDescriptor.MaxTotalThreadsPerThreadgroup]: Sets the maximum number of threads that the GPU can execute simultaneously within a single threadgroup in the tile render pipeline.
- [IMTL4TileRenderPipelineDescriptor.SetMaxTotalThreadsPerThreadgroup]
- [IMTL4TileRenderPipelineDescriptor.RasterSampleCount]: Configures the number of samples per pixel used for multisampling.
- [IMTL4TileRenderPipelineDescriptor.SetRasterSampleCount]
- [IMTL4TileRenderPipelineDescriptor.RequiredThreadsPerThreadgroup]: Sets the required number of threads per threadgroup for tile dispatches.
- [IMTL4TileRenderPipelineDescriptor.SetRequiredThreadsPerThreadgroup]
- [IMTL4TileRenderPipelineDescriptor.StaticLinkingDescriptor]: Configures an object that contains information about functions to link to the tile render pipeline when Metal builds it.
- [IMTL4TileRenderPipelineDescriptor.SetStaticLinkingDescriptor]
- [IMTL4TileRenderPipelineDescriptor.SupportBinaryLinking]: Indicates whether the pipeline supports linking binary functions.
- [IMTL4TileRenderPipelineDescriptor.SetSupportBinaryLinking]
- [IMTL4TileRenderPipelineDescriptor.ThreadgroupSizeMatchesTileSize]: Indicating whether the size of the threadgroup matches the size of a tile in the render pipeline.
- [IMTL4TileRenderPipelineDescriptor.SetThreadgroupSizeMatchesTileSize]
- [IMTL4TileRenderPipelineDescriptor.TileFunctionDescriptor]: Configures the tile function that the render pipeline executes for each tile in the tile shader stage.
- [IMTL4TileRenderPipelineDescriptor.SetTileFunctionDescriptor]
Instance Methods ¶
- [IMTL4TileRenderPipelineDescriptor.Reset]: Resets the descriptor to the default state.
See: https://developer.apple.com/documentation/Metal/MTL4TileRenderPipelineDescriptor
type IMTLAccelerationStructureBoundingBoxGeometryDescriptor ¶
type IMTLAccelerationStructureBoundingBoxGeometryDescriptor interface {
IMTLAccelerationStructureGeometryDescriptor
// The number of bounding boxes in the bounding box buffer.
BoundingBoxCount() uint
SetBoundingBoxCount(value uint)
// A buffer that contains an array of bounding box structures.
BoundingBoxBuffer() MTLBuffer
SetBoundingBoxBuffer(value MTLBuffer)
// The offset, in bytes, to the first bounding box in the buffer.
BoundingBoxBufferOffset() uint
SetBoundingBoxBufferOffset(value uint)
// The stride, in bytes, between bounding boxes in the buffer.
BoundingBoxStride() uint
SetBoundingBoxStride(value uint)
}
An interface definition for the MTLAccelerationStructureBoundingBoxGeometryDescriptor class.
Specifying the number of bounding boxes ¶
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxCount]: The number of bounding boxes in the bounding box buffer.
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxCount]
Specifying bounding boxes data ¶
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxBuffer]: A buffer that contains an array of bounding box structures.
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxBuffer]
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxBufferOffset]: The offset, in bytes, to the first bounding box in the buffer.
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxBufferOffset]
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxStride]: The stride, in bytes, between bounding boxes in the buffer.
- [IMTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxStride]
type IMTLAccelerationStructureCurveGeometryDescriptor ¶
type IMTLAccelerationStructureCurveGeometryDescriptor interface {
IMTLAccelerationStructureGeometryDescriptor
// A buffer that contains curve control points.
ControlPointBuffer() MTLBuffer
SetControlPointBuffer(value MTLBuffer)
// The offset, in bytes, to the control point data in the buffer.
ControlPointBufferOffset() uint
SetControlPointBufferOffset(value uint)
// The number of control points in the control point buffer.
ControlPointCount() uint
SetControlPointCount(value uint)
// The format of the control points in the buffer.
ControlPointFormat() MTLAttributeFormat
SetControlPointFormat(value MTLAttributeFormat)
// The stride, in bytes, between control points in the buffer.
ControlPointStride() uint
SetControlPointStride(value uint)
// The basis function for the curve geometry.
CurveBasis() MTLCurveBasis
SetCurveBasis(value MTLCurveBasis)
// An end-cap type for the curves in the geometry.
CurveEndCaps() MTLCurveEndCaps
SetCurveEndCaps(value MTLCurveEndCaps)
// A curve type for curves in the geometry.
CurveType() MTLCurveType
SetCurveType(value MTLCurveType)
// A buffer that contains references to control points in the control point buffer.
IndexBuffer() MTLBuffer
SetIndexBuffer(value MTLBuffer)
// The offset, in bytes, to the index data in the buffer.
IndexBufferOffset() uint
SetIndexBufferOffset(value uint)
// The size of each index in the index buffer.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// A buffer that contains the curve radius for each control point.
RadiusBuffer() MTLBuffer
SetRadiusBuffer(value MTLBuffer)
// The offset, in bytes, to the radius data in the buffer.
RadiusBufferOffset() uint
SetRadiusBufferOffset(value uint)
// The format of each radius in the radius buffer.
RadiusFormat() MTLAttributeFormat
SetRadiusFormat(value MTLAttributeFormat)
// The stride, in bytes, between the radius elements in the radius buffer.
RadiusStride() uint
SetRadiusStride(value uint)
// The number of control points in each curve segment.
SegmentControlPointCount() uint
SetSegmentControlPointCount(value uint)
// The number of curve segments in each curve of the geometry.
SegmentCount() uint
SetSegmentCount(value uint)
}
An interface definition for the MTLAccelerationStructureCurveGeometryDescriptor class.
Instance Properties ¶
- [IMTLAccelerationStructureCurveGeometryDescriptor.ControlPointBuffer]: A buffer that contains curve control points.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetControlPointBuffer]
- [IMTLAccelerationStructureCurveGeometryDescriptor.ControlPointBufferOffset]: The offset, in bytes, to the control point data in the buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetControlPointBufferOffset]
- [IMTLAccelerationStructureCurveGeometryDescriptor.ControlPointCount]: The number of control points in the control point buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetControlPointCount]
- [IMTLAccelerationStructureCurveGeometryDescriptor.ControlPointFormat]: The format of the control points in the buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetControlPointFormat]
- [IMTLAccelerationStructureCurveGeometryDescriptor.ControlPointStride]: The stride, in bytes, between control points in the buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetControlPointStride]
- [IMTLAccelerationStructureCurveGeometryDescriptor.CurveBasis]: The basis function for the curve geometry.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetCurveBasis]
- [IMTLAccelerationStructureCurveGeometryDescriptor.CurveEndCaps]: An end-cap type for the curves in the geometry.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetCurveEndCaps]
- [IMTLAccelerationStructureCurveGeometryDescriptor.CurveType]: A curve type for curves in the geometry.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetCurveType]
- [IMTLAccelerationStructureCurveGeometryDescriptor.IndexBuffer]: A buffer that contains references to control points in the control point buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetIndexBuffer]
- [IMTLAccelerationStructureCurveGeometryDescriptor.IndexBufferOffset]: The offset, in bytes, to the index data in the buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetIndexBufferOffset]
- [IMTLAccelerationStructureCurveGeometryDescriptor.IndexType]: The size of each index in the index buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetIndexType]
- [IMTLAccelerationStructureCurveGeometryDescriptor.RadiusBuffer]: A buffer that contains the curve radius for each control point.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetRadiusBuffer]
- [IMTLAccelerationStructureCurveGeometryDescriptor.RadiusBufferOffset]: The offset, in bytes, to the radius data in the buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetRadiusBufferOffset]
- [IMTLAccelerationStructureCurveGeometryDescriptor.RadiusFormat]: The format of each radius in the radius buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetRadiusFormat]
- [IMTLAccelerationStructureCurveGeometryDescriptor.RadiusStride]: The stride, in bytes, between the radius elements in the radius buffer.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetRadiusStride]
- [IMTLAccelerationStructureCurveGeometryDescriptor.SegmentControlPointCount]: The number of control points in each curve segment.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetSegmentControlPointCount]
- [IMTLAccelerationStructureCurveGeometryDescriptor.SegmentCount]: The number of curve segments in each curve of the geometry.
- [IMTLAccelerationStructureCurveGeometryDescriptor.SetSegmentCount]
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCurveGeometryDescriptor
type IMTLAccelerationStructureDescriptor ¶
type IMTLAccelerationStructureDescriptor interface {
objectivec.IObject
// The options that describe how you intend to use the acceleration structure.
Usage() MTLAccelerationStructureUsage
SetUsage(value MTLAccelerationStructureUsage)
}
An interface definition for the MTLAccelerationStructureDescriptor class.
Specifying usage options ¶
- [IMTLAccelerationStructureDescriptor.Usage]: The options that describe how you intend to use the acceleration structure.
- [IMTLAccelerationStructureDescriptor.SetUsage]
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureDescriptor
type IMTLAccelerationStructureGeometryDescriptor ¶
type IMTLAccelerationStructureGeometryDescriptor interface {
objectivec.IObject
// A label for the geometry structure, suitable for debugging.
Label() string
SetLabel(value string)
// An index into the intersection table for determining which intersection function Metal calls when it intersects a ray with the acceleration structure.
IntersectionFunctionTableOffset() uint
SetIntersectionFunctionTableOffset(value uint)
// A Boolean value that determines whether the geometry data in the acceleration structure needs to skip triangle-intersection tests.
Opaque() bool
SetOpaque(value bool)
// A Boolean value that indicates whether Metal calls the ray-intersection test more than once per primitive on the structure.
AllowDuplicateIntersectionFunctionInvocation() bool
SetAllowDuplicateIntersectionFunctionInvocation(value bool)
PrimitiveDataBuffer() MTLBuffer
SetPrimitiveDataBuffer(value MTLBuffer)
PrimitiveDataBufferOffset() uint
SetPrimitiveDataBufferOffset(value uint)
PrimitiveDataElementSize() uint
SetPrimitiveDataElementSize(value uint)
PrimitiveDataStride() uint
SetPrimitiveDataStride(value uint)
}
An interface definition for the MTLAccelerationStructureGeometryDescriptor class.
Specifying base geometry properties ¶
- [IMTLAccelerationStructureGeometryDescriptor.Label]: A label for the geometry structure, suitable for debugging.
- [IMTLAccelerationStructureGeometryDescriptor.SetLabel]
- [IMTLAccelerationStructureGeometryDescriptor.IntersectionFunctionTableOffset]: An index into the intersection table for determining which intersection function Metal calls when it intersects a ray with the acceleration structure.
- [IMTLAccelerationStructureGeometryDescriptor.SetIntersectionFunctionTableOffset]
- [IMTLAccelerationStructureGeometryDescriptor.Opaque]: A Boolean value that determines whether the geometry data in the acceleration structure needs to skip triangle-intersection tests.
- [IMTLAccelerationStructureGeometryDescriptor.SetOpaque]
- [IMTLAccelerationStructureGeometryDescriptor.AllowDuplicateIntersectionFunctionInvocation]: A Boolean value that indicates whether Metal calls the ray-intersection test more than once per primitive on the structure.
- [IMTLAccelerationStructureGeometryDescriptor.SetAllowDuplicateIntersectionFunctionInvocation]
Instance Properties ¶
- [IMTLAccelerationStructureGeometryDescriptor.PrimitiveDataBuffer]
- [IMTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataBuffer]
- [IMTLAccelerationStructureGeometryDescriptor.PrimitiveDataBufferOffset]
- [IMTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataBufferOffset]
- [IMTLAccelerationStructureGeometryDescriptor.PrimitiveDataElementSize]
- [IMTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataElementSize]
- [IMTLAccelerationStructureGeometryDescriptor.PrimitiveDataStride]
- [IMTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataStride]
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureGeometryDescriptor
type IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor ¶
type IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor interface {
IMTLAccelerationStructureGeometryDescriptor
// The number of bounding boxes in each bounding box buffer.
BoundingBoxCount() uint
SetBoundingBoxCount(value uint)
// A array of motion keyframes, each containing bounding box data.
BoundingBoxBuffers() []MTLMotionKeyframeData
SetBoundingBoxBuffers(value []MTLMotionKeyframeData)
// The stride, in bytes, between bounding boxes in each buffer.
BoundingBoxStride() uint
SetBoundingBoxStride(value uint)
}
An interface definition for the MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor class.
Specifying the number of bounding boxes ¶
- [IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxCount]: The number of bounding boxes in each bounding box buffer.
- [IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxCount]
Specifying bounding boxes data ¶
- [IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxBuffers]: A array of motion keyframes, each containing bounding box data.
- [IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxBuffers]
- [IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxStride]: The stride, in bytes, between bounding boxes in each buffer.
- [IMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxStride]
type IMTLAccelerationStructureMotionCurveGeometryDescriptor ¶
type IMTLAccelerationStructureMotionCurveGeometryDescriptor interface {
IMTLAccelerationStructureGeometryDescriptor
ControlPointBuffers() []MTLMotionKeyframeData
SetControlPointBuffers(value []MTLMotionKeyframeData)
ControlPointCount() uint
SetControlPointCount(value uint)
ControlPointFormat() MTLAttributeFormat
SetControlPointFormat(value MTLAttributeFormat)
ControlPointStride() uint
SetControlPointStride(value uint)
CurveBasis() MTLCurveBasis
SetCurveBasis(value MTLCurveBasis)
CurveEndCaps() MTLCurveEndCaps
SetCurveEndCaps(value MTLCurveEndCaps)
CurveType() MTLCurveType
SetCurveType(value MTLCurveType)
IndexBuffer() MTLBuffer
SetIndexBuffer(value MTLBuffer)
IndexBufferOffset() uint
SetIndexBufferOffset(value uint)
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
RadiusBuffers() []MTLMotionKeyframeData
SetRadiusBuffers(value []MTLMotionKeyframeData)
RadiusFormat() MTLAttributeFormat
SetRadiusFormat(value MTLAttributeFormat)
RadiusStride() uint
SetRadiusStride(value uint)
SegmentControlPointCount() uint
SetSegmentControlPointCount(value uint)
SegmentCount() uint
SetSegmentCount(value uint)
}
An interface definition for the MTLAccelerationStructureMotionCurveGeometryDescriptor class.
Instance Properties ¶
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointBuffers]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointBuffers]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointCount]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointCount]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointFormat]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointFormat]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointStride]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointStride]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.CurveBasis]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetCurveBasis]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.CurveEndCaps]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetCurveEndCaps]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.CurveType]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetCurveType]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.IndexBuffer]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetIndexBuffer]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.IndexBufferOffset]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetIndexBufferOffset]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.IndexType]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetIndexType]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.RadiusBuffers]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetRadiusBuffers]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.RadiusFormat]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetRadiusFormat]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.RadiusStride]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetRadiusStride]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SegmentControlPointCount]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetSegmentControlPointCount]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SegmentCount]
- [IMTLAccelerationStructureMotionCurveGeometryDescriptor.SetSegmentCount]
type IMTLAccelerationStructureMotionTriangleGeometryDescriptor ¶
type IMTLAccelerationStructureMotionTriangleGeometryDescriptor interface {
IMTLAccelerationStructureGeometryDescriptor
// The number of triangles in the buffers.
TriangleCount() uint
SetTriangleCount(value uint)
// A buffer that contains indices for the vertices that compose the triangle list.
IndexBuffer() MTLBuffer
SetIndexBuffer(value MTLBuffer)
// The data type of indices in the index buffer.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// The offset, in bytes, to the first index in the buffer.
IndexBufferOffset() uint
SetIndexBufferOffset(value uint)
// An array of motion keyframes, each containing triangle data.
VertexBuffers() []MTLMotionKeyframeData
SetVertexBuffers(value []MTLMotionKeyframeData)
// The stride, in bytes, between vertices in each vertex buffer.
VertexStride() uint
SetVertexStride(value uint)
TransformationMatrixBuffer() MTLBuffer
SetTransformationMatrixBuffer(value MTLBuffer)
TransformationMatrixBufferOffset() uint
SetTransformationMatrixBufferOffset(value uint)
TransformationMatrixLayout() MTLMatrixLayout
SetTransformationMatrixLayout(value MTLMatrixLayout)
VertexFormat() MTLAttributeFormat
SetVertexFormat(value MTLAttributeFormat)
}
An interface definition for the MTLAccelerationStructureMotionTriangleGeometryDescriptor class.
Specifying the number of triangles ¶
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.TriangleCount]: The number of triangles in the buffers.
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTriangleCount]
Specifying index data ¶
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.IndexBuffer]: A buffer that contains indices for the vertices that compose the triangle list.
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetIndexBuffer]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.IndexType]: The data type of indices in the index buffer.
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetIndexType]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.IndexBufferOffset]: The offset, in bytes, to the first index in the buffer.
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetIndexBufferOffset]
Specifying vertex data ¶
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.VertexBuffers]: An array of motion keyframes, each containing triangle data.
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetVertexBuffers]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.VertexStride]: The stride, in bytes, between vertices in each vertex buffer.
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetVertexStride]
Instance Properties ¶
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixBuffer]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixBuffer]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixBufferOffset]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixBufferOffset]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixLayout]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixLayout]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.VertexFormat]
- [IMTLAccelerationStructureMotionTriangleGeometryDescriptor.SetVertexFormat]
type IMTLAccelerationStructurePassDescriptor ¶
type IMTLAccelerationStructurePassDescriptor interface {
objectivec.IObject
SampleBufferAttachments() IMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
}
An interface definition for the MTLAccelerationStructurePassDescriptor class.
Instance Properties ¶
- [IMTLAccelerationStructurePassDescriptor.SampleBufferAttachments]
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructurePassDescriptor
type IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor ¶
type IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor interface {
objectivec.IObject
EndOfEncoderSampleIndex() uint
SetEndOfEncoderSampleIndex(value uint)
// A specialized memory buffer that the GPU uses to store its counter data during the acceleration structure pass.
SampleBuffer() MTLCounterSampleBuffer
SetSampleBuffer(value MTLCounterSampleBuffer)
StartOfEncoderSampleIndex() uint
SetStartOfEncoderSampleIndex(value uint)
}
An interface definition for the MTLAccelerationStructurePassSampleBufferAttachmentDescriptor class.
Instance Properties ¶
- [IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex]
- [IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex]
- [IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SampleBuffer]: A specialized memory buffer that the GPU uses to store its counter data during the acceleration structure pass.
- [IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SetSampleBuffer]
- [IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex]
- [IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex]
type IMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray ¶
type IMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray interface {
objectivec.IObject
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor
SetObjectAtIndexedSubscript(attachment IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray class.
Subscripts ¶
- [IMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript]
type IMTLAccelerationStructureTriangleGeometryDescriptor ¶
type IMTLAccelerationStructureTriangleGeometryDescriptor interface {
IMTLAccelerationStructureGeometryDescriptor
// The number of triangles in the buffers.
TriangleCount() uint
SetTriangleCount(value uint)
// The data type of indices in the index buffer.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// A buffer that contains indices for the vertices that compose the triangle list.
IndexBuffer() MTLBuffer
SetIndexBuffer(value MTLBuffer)
// The offset, in bytes, to the first index in the buffer.
IndexBufferOffset() uint
SetIndexBufferOffset(value uint)
// The format of each vertex position in the vertex buffer property.
VertexFormat() MTLAttributeFormat
SetVertexFormat(value MTLAttributeFormat)
// A buffer that contains vertex data.
VertexBuffer() MTLBuffer
SetVertexBuffer(value MTLBuffer)
// The offset, in bytes, for the first vertex in the vertex buffer.
VertexBufferOffset() uint
SetVertexBufferOffset(value uint)
// The stride, in bytes, between vertices in the vertex buffer.
VertexStride() uint
SetVertexStride(value uint)
TransformationMatrixLayout() MTLMatrixLayout
SetTransformationMatrixLayout(value MTLMatrixLayout)
TransformationMatrixBuffer() MTLBuffer
SetTransformationMatrixBuffer(value MTLBuffer)
TransformationMatrixBufferOffset() uint
SetTransformationMatrixBufferOffset(value uint)
}
An interface definition for the MTLAccelerationStructureTriangleGeometryDescriptor class.
Configuring the number of triangles ¶
- [IMTLAccelerationStructureTriangleGeometryDescriptor.TriangleCount]: The number of triangles in the buffers.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetTriangleCount]
Configuring index data ¶
- [IMTLAccelerationStructureTriangleGeometryDescriptor.IndexType]: The data type of indices in the index buffer.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetIndexType]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.IndexBuffer]: A buffer that contains indices for the vertices that compose the triangle list.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetIndexBuffer]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.IndexBufferOffset]: The offset, in bytes, to the first index in the buffer.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetIndexBufferOffset]
Configuring vertex data ¶
- [IMTLAccelerationStructureTriangleGeometryDescriptor.VertexFormat]: The format of each vertex position in the vertex buffer property.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetVertexFormat]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.VertexBuffer]: A buffer that contains vertex data.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetVertexBuffer]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.VertexBufferOffset]: The offset, in bytes, for the first vertex in the vertex buffer.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetVertexBufferOffset]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.VertexStride]: The stride, in bytes, between vertices in the vertex buffer.
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetVertexStride]
Configuring transformation data ¶
- [IMTLAccelerationStructureTriangleGeometryDescriptor.TransformationMatrixLayout]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixLayout]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.TransformationMatrixBuffer]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixBuffer]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.TransformationMatrixBufferOffset]
- [IMTLAccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixBufferOffset]
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureTriangleGeometryDescriptor
type IMTLArchitecture ¶
type IMTLArchitecture interface {
objectivec.IObject
// The name of a GPU device’s architecture.
Name() string
// The architectural details of the GPU device.
Architecture() IMTLArchitecture
SetArchitecture(value IMTLArchitecture)
// A Boolean value that indicates whether a GPU device doesn’t have a connection to a display.
IsHeadless() bool
SetIsHeadless(value bool)
// A Boolean value that indicates whether the GPU lowers its performance to conserve energy.
IsLowPower() bool
SetIsLowPower(value bool)
// A Boolean value that indicates whether the GPU is removable.
IsRemovable() bool
SetIsRemovable(value bool)
// The physical location of the GPU relative to the system.
Location() MTLDeviceLocation
SetLocation(value MTLDeviceLocation)
// A specific GPU position based on its general location.
LocationNumber() int
SetLocationNumber(value int)
// The total number of GPUs in the peer group, if applicable.
PeerCount() uint32
SetPeerCount(value uint32)
// The peer group ID the GPU belongs to, if applicable.
PeerGroupID() uint64
SetPeerGroupID(value uint64)
// The unique identifier for a GPU in a peer group.
PeerIndex() uint32
SetPeerIndex(value uint32)
// The GPU device’s registry identifier.
RegistryID() uint64
SetRegistryID(value uint64)
}
An interface definition for the MTLArchitecture class.
Inspecting a GPU device’s architecture details ¶
- [IMTLArchitecture.Name]: The name of a GPU device’s architecture.
See: https://developer.apple.com/documentation/Metal/MTLArchitecture
type IMTLArgumentDescriptor ¶
type IMTLArgumentDescriptor interface {
objectivec.IObject
// The data type of the argument.
DataType() MTLDataType
SetDataType(value MTLDataType)
// The index ID of the argument.
Index() uint
SetIndex(value uint)
// The access permissions of the argument.
Access() MTLBindingAccess
SetAccess(value MTLBindingAccess)
// The length of an array argument.
ArrayLength() uint
SetArrayLength(value uint)
// The alignment of the constant block.
ConstantBlockAlignment() uint
SetConstantBlockAlignment(value uint)
// The texture type of a texture argument.
TextureType() MTLTextureType
SetTextureType(value MTLTextureType)
MTLAttributeStrideStatic() int
}
An interface definition for the MTLArgumentDescriptor class.
Setting the descriptor’s properties ¶
- [IMTLArgumentDescriptor.DataType]: The data type of the argument.
- [IMTLArgumentDescriptor.SetDataType]
- [IMTLArgumentDescriptor.Index]: The index ID of the argument.
- [IMTLArgumentDescriptor.SetIndex]
- [IMTLArgumentDescriptor.Access]: The access permissions of the argument.
- [IMTLArgumentDescriptor.SetAccess]
- [IMTLArgumentDescriptor.ArrayLength]: The length of an array argument.
- [IMTLArgumentDescriptor.SetArrayLength]
- [IMTLArgumentDescriptor.ConstantBlockAlignment]: The alignment of the constant block.
- [IMTLArgumentDescriptor.SetConstantBlockAlignment]
- [IMTLArgumentDescriptor.TextureType]: The texture type of a texture argument.
- [IMTLArgumentDescriptor.SetTextureType]
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor
type IMTLArrayType ¶
type IMTLArrayType interface {
IMTLType
// The number of elements in the array.
ArrayLength() uint
// The data type of the array’s elements.
ElementType() MTLDataType
// The stride between array elements, in bytes.
Stride() uint
// The stride, in bytes, between argument indices.
ArgumentIndexStride() uint
// Provides a description of the underlying type when an array holds other arrays as its elements.
ElementArrayType() IMTLArrayType
// Provides a description of the underlying struct type when an array holds structs as its elements.
ElementStructType() IMTLStructType
// Provides a description of the underlying pointer type when an array holds pointers as its elements.
ElementPointerType() IMTLPointerType
// Provides a description of the underlying texture type when an array holds textures as its elements.
ElementTextureReferenceType() IMTLTextureReferenceType
// Provides a description of the underlying tensor type when this array holds tensors as its elements.
ElementTensorReferenceType() IMTLTensorReferenceType
}
An interface definition for the MTLArrayType class.
Describing the array elements ¶
- [IMTLArrayType.ArrayLength]: The number of elements in the array.
- [IMTLArrayType.ElementType]: The data type of the array’s elements.
- [IMTLArrayType.Stride]: The stride between array elements, in bytes.
- [IMTLArrayType.ArgumentIndexStride]: The stride, in bytes, between argument indices.
Obtaining details for complex array elements ¶
- [IMTLArrayType.ElementArrayType]: Provides a description of the underlying type when an array holds other arrays as its elements.
- [IMTLArrayType.ElementStructType]: Provides a description of the underlying struct type when an array holds structs as its elements.
- [IMTLArrayType.ElementPointerType]: Provides a description of the underlying pointer type when an array holds pointers as its elements.
- [IMTLArrayType.ElementTextureReferenceType]: Provides a description of the underlying texture type when an array holds textures as its elements.
Instance Methods ¶
- [IMTLArrayType.ElementTensorReferenceType]: Provides a description of the underlying tensor type when this array holds tensors as its elements.
See: https://developer.apple.com/documentation/Metal/MTLArrayType
type IMTLAttribute ¶
type IMTLAttribute interface {
objectivec.IObject
// The name of the attribute.
Name() string
// The index of the attribute, as declared in Metal shader source code.
AttributeIndex() uint
// The data type for the attribute, as declared in Metal shader source code.
AttributeType() MTLDataType
// A Boolean value that indicates whether the attribute is active.
Active() bool
// A Boolean value that indicates whether the attribute represents control point data.
PatchControlPointData() bool
// A Boolean value that indicates whether the attribute represents tessellation patch data.
PatchData() bool
}
An interface definition for the MTLAttribute class.
Reading an attribute’s properties ¶
- [IMTLAttribute.Name]: The name of the attribute.
- [IMTLAttribute.AttributeIndex]: The index of the attribute, as declared in Metal shader source code.
- [IMTLAttribute.AttributeType]: The data type for the attribute, as declared in Metal shader source code.
- [IMTLAttribute.Active]: A Boolean value that indicates whether the attribute is active.
- [IMTLAttribute.PatchControlPointData]: A Boolean value that indicates whether the attribute represents control point data.
- [IMTLAttribute.PatchData]: A Boolean value that indicates whether the attribute represents tessellation patch data.
See: https://developer.apple.com/documentation/Metal/MTLAttribute
type IMTLAttributeDescriptor ¶
type IMTLAttributeDescriptor interface {
objectivec.IObject
// The index in the buffer argument table for the buffer that contains the data for this attribute.
BufferIndex() uint
SetBufferIndex(value uint)
// The offset, in bytes, from the start of the buffer containing the attribute data to the start of the data itself.
Offset() uint
SetOffset(value uint)
// The format of the attribute’s data.
Format() MTLAttributeFormat
SetFormat(value MTLAttributeFormat)
// The organization of input and output data for the next kernel call.
StageInputDescriptor() IMTLStageInputOutputDescriptor
SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
}
An interface definition for the MTLAttributeDescriptor class.
Defining attribute location ¶
- [IMTLAttributeDescriptor.BufferIndex]: The index in the buffer argument table for the buffer that contains the data for this attribute.
- [IMTLAttributeDescriptor.SetBufferIndex]
- [IMTLAttributeDescriptor.Offset]: The offset, in bytes, from the start of the buffer containing the attribute data to the start of the data itself.
- [IMTLAttributeDescriptor.SetOffset]
- [IMTLAttributeDescriptor.Format]: The format of the attribute’s data.
- [IMTLAttributeDescriptor.SetFormat]
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptor
type IMTLAttributeDescriptorArray ¶
type IMTLAttributeDescriptorArray interface {
objectivec.IObject
// Returns the state of the specified attribute.
ObjectAtIndexedSubscript(index uint) IMTLAttributeDescriptor
// The organization of input and output data for the next kernel call.
StageInputDescriptor() IMTLStageInputOutputDescriptor
SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
// Sets state for the specified attribute.
SetObjectAtIndexedSubscript(attributeDesc IMTLAttributeDescriptor, index uint)
}
An interface definition for the MTLAttributeDescriptorArray class.
Accessing attribute state objects ¶
- [IMTLAttributeDescriptorArray.ObjectAtIndexedSubscript]: Returns the state of the specified attribute.
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptorArray
type IMTLBinaryArchiveDescriptor ¶
type IMTLBinaryArchiveDescriptor interface {
objectivec.IObject
// A URL to a Metal binary archive file.
Url() foundation.INSURL
SetUrl(value foundation.INSURL)
// The domain for Metal binary archive errors.
MTLBinaryArchiveDomain() string
}
An interface definition for the MTLBinaryArchiveDescriptor class.
Choosing an archive file ¶
- [IMTLBinaryArchiveDescriptor.Url]: A URL to a Metal binary archive file.
- [IMTLBinaryArchiveDescriptor.SetUrl]
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchiveDescriptor
type IMTLBlitPassDescriptor ¶
type IMTLBlitPassDescriptor interface {
objectivec.IObject
// An array of counter sample buffer attachments that you configure for a blit pass.
SampleBufferAttachments() IMTLBlitPassSampleBufferAttachmentDescriptorArray
}
An interface definition for the MTLBlitPassDescriptor class.
Configuring sample buffer attachment descriptors for a blit pass ¶
- [IMTLBlitPassDescriptor.SampleBufferAttachments]: An array of counter sample buffer attachments that you configure for a blit pass.
See: https://developer.apple.com/documentation/Metal/MTLBlitPassDescriptor
type IMTLBlitPassSampleBufferAttachmentDescriptor ¶
type IMTLBlitPassSampleBufferAttachmentDescriptor interface {
objectivec.IObject
// A specialized memory buffer that the GPU uses to store its counter data during the blit pass.
SampleBuffer() MTLCounterSampleBuffer
SetSampleBuffer(value MTLCounterSampleBuffer)
// An index within a counter sample buffer that tells the GPU where to store counter data from the start of a blit pass.
StartOfEncoderSampleIndex() uint
SetStartOfEncoderSampleIndex(value uint)
// An index within a counter sample buffer that tells the GPU where to store counter data from the end of a blit pass.
EndOfEncoderSampleIndex() uint
SetEndOfEncoderSampleIndex(value uint)
}
An interface definition for the MTLBlitPassSampleBufferAttachmentDescriptor class.
Configuring the sample buffer attachment ¶
- [IMTLBlitPassSampleBufferAttachmentDescriptor.SampleBuffer]: A specialized memory buffer that the GPU uses to store its counter data during the blit pass.
- [IMTLBlitPassSampleBufferAttachmentDescriptor.SetSampleBuffer]
- [IMTLBlitPassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex]: An index within a counter sample buffer that tells the GPU where to store counter data from the start of a blit pass.
- [IMTLBlitPassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex]
- [IMTLBlitPassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex]: An index within a counter sample buffer that tells the GPU where to store counter data from the end of a blit pass.
- [IMTLBlitPassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex]
See: https://developer.apple.com/documentation/Metal/MTLBlitPassSampleBufferAttachmentDescriptor
type IMTLBlitPassSampleBufferAttachmentDescriptorArray ¶
type IMTLBlitPassSampleBufferAttachmentDescriptorArray interface {
objectivec.IObject
// Accesses one of the array’s blit pass sample buffer attachment descriptor instances.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLBlitPassSampleBufferAttachmentDescriptor
// The counter sets supported by the device object.
CounterSets() MTLCounterSet
SetCounterSets(value MTLCounterSet)
// Copies the properties of a blit pass sample buffer attachment descriptor instance to the properties of one of the array’s instances.
SetObjectAtIndexedSubscript(attachment IMTLBlitPassSampleBufferAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLBlitPassSampleBufferAttachmentDescriptorArray class.
Accessing a sample buffer attachment descriptor ¶
- [IMTLBlitPassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Accesses one of the array’s blit pass sample buffer attachment descriptor instances.
See: https://developer.apple.com/documentation/Metal/MTLBlitPassSampleBufferAttachmentDescriptorArray
type IMTLBufferLayoutDescriptor ¶
type IMTLBufferLayoutDescriptor interface {
objectivec.IObject
// The number of bytes from one buffer entry to the next.
Stride() uint
SetStride(value uint)
// Determines how and when compute functions fetch data.
StepFunction() MTLStepFunction
SetStepFunction(value MTLStepFunction)
// How frequently the step function should load data.
StepRate() uint
SetStepRate(value uint)
// The organization of input and output data for the next kernel call.
StageInputDescriptor() IMTLStageInputOutputDescriptor
SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
}
An interface definition for the MTLBufferLayoutDescriptor class.
Describing fetch behavior ¶
- [IMTLBufferLayoutDescriptor.Stride]: The number of bytes from one buffer entry to the next.
- [IMTLBufferLayoutDescriptor.SetStride]
- [IMTLBufferLayoutDescriptor.StepFunction]: Determines how and when compute functions fetch data.
- [IMTLBufferLayoutDescriptor.SetStepFunction]
- [IMTLBufferLayoutDescriptor.StepRate]: How frequently the step function should load data.
- [IMTLBufferLayoutDescriptor.SetStepRate]
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptor
type IMTLBufferLayoutDescriptorArray ¶
type IMTLBufferLayoutDescriptorArray interface {
objectivec.IObject
// Returns the state of the specified buffer layout.
ObjectAtIndexedSubscript(index uint) IMTLBufferLayoutDescriptor
// The organization of input and output data for the next kernel call.
StageInputDescriptor() IMTLStageInputOutputDescriptor
SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
// Sets the state of the specified buffer layout.
SetObjectAtIndexedSubscript(bufferDesc IMTLBufferLayoutDescriptor, index uint)
}
An interface definition for the MTLBufferLayoutDescriptorArray class.
Array accessors ¶
- [IMTLBufferLayoutDescriptorArray.ObjectAtIndexedSubscript]: Returns the state of the specified buffer layout.
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptorArray
type IMTLCaptureDescriptor ¶
type IMTLCaptureDescriptor interface {
objectivec.IObject
// The instance whose contents should be captured.
CaptureObject() objectivec.IObject
SetCaptureObject(value objectivec.IObject)
// The destination for any captured command data.
Destination() MTLCaptureDestination
SetDestination(value MTLCaptureDestination)
// A URL for a file to write the capture data into.
OutputURL() foundation.INSURL
SetOutputURL(value foundation.INSURL)
}
An interface definition for the MTLCaptureDescriptor class.
Setting capture parameters ¶
- [IMTLCaptureDescriptor.CaptureObject]: The instance whose contents should be captured.
- [IMTLCaptureDescriptor.SetCaptureObject]
- [IMTLCaptureDescriptor.Destination]: The destination for any captured command data.
- [IMTLCaptureDescriptor.SetDestination]
- [IMTLCaptureDescriptor.OutputURL]: A URL for a file to write the capture data into.
- [IMTLCaptureDescriptor.SetOutputURL]
See: https://developer.apple.com/documentation/Metal/MTLCaptureDescriptor
type IMTLCaptureManager ¶
type IMTLCaptureManager interface {
objectivec.IObject
// Checks to see whether a particular capture destination is supported.
SupportsDestination(destination MTLCaptureDestination) bool
// Creates a capture scope for commands submitted to a specific device object.
NewCaptureScopeWithDevice(device MTLDevice) MTLCaptureScope
// Creates a capture scope for commands submitted to a specific command queue.
NewCaptureScopeWithCommandQueue(commandQueue MTLCommandQueue) MTLCaptureScope
// The capture scope to use when a capture is initiated in Xcode.
DefaultCaptureScope() MTLCaptureScope
SetDefaultCaptureScope(value MTLCaptureScope)
// Starts capturing any of your app’s Metal commands, with the capture session defined by a descriptor object.
StartCaptureWithDescriptorError(descriptor IMTLCaptureDescriptor) (bool, error)
// Stops capturing Metal commands.
StopCapture()
// A Boolean value that indicates whether Metal commands are being captured.
IsCapturing() bool
NewCaptureScopeWithMTL4CommandQueue(commandQueue MTL4CommandQueue) MTLCaptureScope
}
An interface definition for the MTLCaptureManager class.
Querying support for a capture destination ¶
- [IMTLCaptureManager.SupportsDestination]: Checks to see whether a particular capture destination is supported.
Creating a capture scope ¶
- [IMTLCaptureManager.NewCaptureScopeWithDevice]: Creates a capture scope for commands submitted to a specific device object.
- [IMTLCaptureManager.NewCaptureScopeWithCommandQueue]: Creates a capture scope for commands submitted to a specific command queue.
- [IMTLCaptureManager.DefaultCaptureScope]: The capture scope to use when a capture is initiated in Xcode.
- [IMTLCaptureManager.SetDefaultCaptureScope]
Starting capture ¶
- [IMTLCaptureManager.StartCaptureWithDescriptorError]: Starts capturing any of your app’s Metal commands, with the capture session defined by a descriptor object.
Stopping capture ¶
- [IMTLCaptureManager.StopCapture]: Stops capturing Metal commands.
Monitoring capture ¶
- [IMTLCaptureManager.IsCapturing]: A Boolean value that indicates whether Metal commands are being captured.
Instance Methods ¶
- [IMTLCaptureManager.NewCaptureScopeWithMTL4CommandQueue]
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager
type IMTLCommandBufferDescriptor ¶
type IMTLCommandBufferDescriptor interface {
objectivec.IObject
// The shader logging configuration that the command buffer uses.
LogState() MTLLogState
SetLogState(value MTLLogState)
// A Boolean value that indicates whether the command buffer the descriptor creates maintains strong references to the resources it uses.
RetainedReferences() bool
SetRetainedReferences(value bool)
// The reporting configuration that indicates which information the GPU driver stores in a command buffer’s error property.
ErrorOptions() MTLCommandBufferErrorOption
SetErrorOptions(value MTLCommandBufferErrorOption)
// The domain for Metal command buffer errors.
MTLCommandBufferErrorDomain() string
// An option that instructs a command buffer to save additional details about a GPU runtime error.
EncoderExecutionStatus() MTLCommandBufferErrorOption
SetEncoderExecutionStatus(value MTLCommandBufferErrorOption)
}
An interface definition for the MTLCommandBufferDescriptor class.
Configuring the command buffer ¶
- [IMTLCommandBufferDescriptor.LogState]: The shader logging configuration that the command buffer uses.
- [IMTLCommandBufferDescriptor.SetLogState]
- [IMTLCommandBufferDescriptor.RetainedReferences]: A Boolean value that indicates whether the command buffer the descriptor creates maintains strong references to the resources it uses.
- [IMTLCommandBufferDescriptor.SetRetainedReferences]
- [IMTLCommandBufferDescriptor.ErrorOptions]: The reporting configuration that indicates which information the GPU driver stores in a command buffer’s error property.
- [IMTLCommandBufferDescriptor.SetErrorOptions]
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferDescriptor
type IMTLCommandQueueDescriptor ¶
type IMTLCommandQueueDescriptor interface {
objectivec.IObject
// The shader logging configuration that the command queue uses.
LogState() MTLLogState
SetLogState(value MTLLogState)
// An integer that sets the maximum number of uncompleted command buffers the queue can allow.
MaxCommandBufferCount() uint
SetMaxCommandBufferCount(value uint)
// The domain for Metal command buffer errors.
MTLCommandBufferErrorDomain() string
}
An interface definition for the MTLCommandQueueDescriptor class.
Instance Properties ¶
- [IMTLCommandQueueDescriptor.LogState]: The shader logging configuration that the command queue uses.
- [IMTLCommandQueueDescriptor.SetLogState]
- [IMTLCommandQueueDescriptor.MaxCommandBufferCount]: An integer that sets the maximum number of uncompleted command buffers the queue can allow.
- [IMTLCommandQueueDescriptor.SetMaxCommandBufferCount]
See: https://developer.apple.com/documentation/Metal/MTLCommandQueueDescriptor
type IMTLCompileOptions ¶
type IMTLCompileOptions interface {
objectivec.IObject
// A Boolean value that enables shader logging.
EnableLogging() bool
SetEnableLogging(value bool)
// An indication of whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
MathMode() MTLMathMode
SetMathMode(value MTLMathMode)
// The FP32 math functions Metal uses.
MathFloatingPointFunctions() MTLMathFloatingPointFunctions
SetMathFloatingPointFunctions(value MTLMathFloatingPointFunctions)
// A Boolean value that indicates whether the compiler compiles vertex shaders conservatively to generate consistent position calculations.
PreserveInvariance() bool
SetPreserveInvariance(value bool)
// The language version for interpreting the library source code.
LanguageVersion() MTLLanguageVersion
SetLanguageVersion(value MTLLanguageVersion)
// A list of preprocessor macros to apply when compiling the library source.
PreprocessorMacros() foundation.INSDictionary
SetPreprocessorMacros(value foundation.INSDictionary)
// An option that tells the compiler what to prioritize when it compiles Metal shader code.
OptimizationLevel() MTLLibraryOptimizationLevel
SetOptimizationLevel(value MTLLibraryOptimizationLevel)
// An array of dynamic libraries the Metal compiler links against.
Libraries() []objectivec.IObject
SetLibraries(value []objectivec.IObject)
// A Boolean value that indicates whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
FastMathEnabled() bool
SetFastMathEnabled(value bool)
// The kind of library to create.
LibraryType() MTLLibraryType
SetLibraryType(value MTLLibraryType)
// For a dynamic library, the name to use when installing the library.
InstallName() string
SetInstallName(value string)
AllowReferencingUndefinedSymbols() bool
SetAllowReferencingUndefinedSymbols(value bool)
CompileSymbolVisibility() MTLCompileSymbolVisibility
SetCompileSymbolVisibility(value MTLCompileSymbolVisibility)
MaxTotalThreadsPerThreadgroup() uint
SetMaxTotalThreadsPerThreadgroup(value uint)
RequiredThreadsPerThreadgroup() MTLSize
SetRequiredThreadsPerThreadgroup(value MTLSize)
}
An interface definition for the MTLCompileOptions class.
Configuring the compiler options ¶
- [IMTLCompileOptions.EnableLogging]: A Boolean value that enables shader logging.
- [IMTLCompileOptions.SetEnableLogging]
- [IMTLCompileOptions.MathMode]: An indication of whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
- [IMTLCompileOptions.SetMathMode]
- [IMTLCompileOptions.MathFloatingPointFunctions]: The FP32 math functions Metal uses.
- [IMTLCompileOptions.SetMathFloatingPointFunctions]
- [IMTLCompileOptions.PreserveInvariance]: A Boolean value that indicates whether the compiler compiles vertex shaders conservatively to generate consistent position calculations.
- [IMTLCompileOptions.SetPreserveInvariance]
- [IMTLCompileOptions.LanguageVersion]: The language version for interpreting the library source code.
- [IMTLCompileOptions.SetLanguageVersion]
- [IMTLCompileOptions.PreprocessorMacros]: A list of preprocessor macros to apply when compiling the library source.
- [IMTLCompileOptions.SetPreprocessorMacros]
- [IMTLCompileOptions.OptimizationLevel]: An option that tells the compiler what to prioritize when it compiles Metal shader code.
- [IMTLCompileOptions.SetOptimizationLevel]
- [IMTLCompileOptions.Libraries]: An array of dynamic libraries the Metal compiler links against.
- [IMTLCompileOptions.SetLibraries]
- [IMTLCompileOptions.FastMathEnabled]: A Boolean value that indicates whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
- [IMTLCompileOptions.SetFastMathEnabled]
Configuring the library output options ¶
- [IMTLCompileOptions.LibraryType]: The kind of library to create.
- [IMTLCompileOptions.SetLibraryType]
- [IMTLCompileOptions.InstallName]: For a dynamic library, the name to use when installing the library.
- [IMTLCompileOptions.SetInstallName]
Instance Properties ¶
- [IMTLCompileOptions.AllowReferencingUndefinedSymbols]
- [IMTLCompileOptions.SetAllowReferencingUndefinedSymbols]
- [IMTLCompileOptions.CompileSymbolVisibility]
- [IMTLCompileOptions.SetCompileSymbolVisibility]
- [IMTLCompileOptions.MaxTotalThreadsPerThreadgroup]
- [IMTLCompileOptions.SetMaxTotalThreadsPerThreadgroup]
- [IMTLCompileOptions.RequiredThreadsPerThreadgroup]
- [IMTLCompileOptions.SetRequiredThreadsPerThreadgroup]
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions
type IMTLComputePassDescriptor ¶
type IMTLComputePassDescriptor interface {
objectivec.IObject
// The strategy for dispatching any compute commands encoded in the compute pass.
DispatchType() MTLDispatchType
SetDispatchType(value MTLDispatchType)
// The sample buffers that the compute pass can access.
SampleBufferAttachments() IMTLComputePassSampleBufferAttachmentDescriptorArray
}
An interface definition for the MTLComputePassDescriptor class.
Configuring the dispatch mechanism ¶
- [IMTLComputePassDescriptor.DispatchType]: The strategy for dispatching any compute commands encoded in the compute pass.
- [IMTLComputePassDescriptor.SetDispatchType]
Specifying sample buffers for GPU counters ¶
- [IMTLComputePassDescriptor.SampleBufferAttachments]: The sample buffers that the compute pass can access.
See: https://developer.apple.com/documentation/Metal/MTLComputePassDescriptor
type IMTLComputePassSampleBufferAttachmentDescriptor ¶
type IMTLComputePassSampleBufferAttachmentDescriptor interface {
objectivec.IObject
// A specialized memory buffer that the GPU uses to store its counter data during a compute pass.
SampleBuffer() MTLCounterSampleBuffer
SetSampleBuffer(value MTLCounterSampleBuffer)
// An index within a counter sample buffer that tells the GPU where to store counter data from the start of a compute pass.
StartOfEncoderSampleIndex() uint
SetStartOfEncoderSampleIndex(value uint)
// An index within a counter sample buffer that tells the GPU where to store counter data from the end of a compute pass.
EndOfEncoderSampleIndex() uint
SetEndOfEncoderSampleIndex(value uint)
}
An interface definition for the MTLComputePassSampleBufferAttachmentDescriptor class.
Configuring the sample buffer attachment ¶
- [IMTLComputePassSampleBufferAttachmentDescriptor.SampleBuffer]: A specialized memory buffer that the GPU uses to store its counter data during a compute pass.
- [IMTLComputePassSampleBufferAttachmentDescriptor.SetSampleBuffer]
- [IMTLComputePassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex]: An index within a counter sample buffer that tells the GPU where to store counter data from the start of a compute pass.
- [IMTLComputePassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex]
- [IMTLComputePassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex]: An index within a counter sample buffer that tells the GPU where to store counter data from the end of a compute pass.
- [IMTLComputePassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex]
See: https://developer.apple.com/documentation/Metal/MTLComputePassSampleBufferAttachmentDescriptor
type IMTLComputePassSampleBufferAttachmentDescriptorArray ¶
type IMTLComputePassSampleBufferAttachmentDescriptorArray interface {
objectivec.IObject
// Returns the descriptor object for the specified sample buffer attachment.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLComputePassSampleBufferAttachmentDescriptor
// The counter sets supported by the device object.
CounterSets() MTLCounterSet
SetCounterSets(value MTLCounterSet)
// Sets the descriptor object for the specified sample buffer attachment.
SetObjectAtIndexedSubscript(attachment IMTLComputePassSampleBufferAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLComputePassSampleBufferAttachmentDescriptorArray class.
Accessing a sample buffer attachment ¶
- [IMTLComputePassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Returns the descriptor object for the specified sample buffer attachment.
See: https://developer.apple.com/documentation/Metal/MTLComputePassSampleBufferAttachmentDescriptorArray
type IMTLComputePipelineDescriptor ¶
type IMTLComputePipelineDescriptor interface {
objectivec.IObject
// The compute kernel the pipeline calls.
ComputeFunction() MTLFunction
SetComputeFunction(value MTLFunction)
// A Boolean value that indicates whether the threadgroup size is always a multiple of the thread execution width.
ThreadGroupSizeIsMultipleOfThreadExecutionWidth() bool
SetThreadGroupSizeIsMultipleOfThreadExecutionWidth(value bool)
// A property that limits the number of threads you can dispatch in a threadgroup for the compute function.
MaxTotalThreadsPerThreadgroup() uint
SetMaxTotalThreadsPerThreadgroup(value uint)
// The maximum call stack depth for indirect function calls in compute shaders.
MaxCallStackDepth() uint
SetMaxCallStackDepth(value uint)
// The organization of input and output data for the next kernel call.
StageInputDescriptor() IMTLStageInputOutputDescriptor
SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
// The buffer mutability options to apply to the next kernel call.
Buffers() IMTLPipelineBufferDescriptorArray
// A string that identifies the instance.
Label() string
SetLabel(value string)
// A Boolean value that indicates whether you can encode commands that reference the pipeline state object into an indirect command buffer.
SupportIndirectCommandBuffers() bool
SetSupportIndirectCommandBuffers(value bool)
// A value that enables or disables shader validation for the pipeline.
ShaderValidation() MTLShaderValidation
SetShaderValidation(value MTLShaderValidation)
// Resets all compute pipeline descriptor properties to their default values.
Reset()
// The dynamic libraries that contain precompiled shader functions you want to link.
PreloadedLibraries() []objectivec.IObject
SetPreloadedLibraries(value []objectivec.IObject)
// The functions with available function pointers for the next kernel call.
LinkedFunctions() IMTLLinkedFunctions
SetLinkedFunctions(value IMTLLinkedFunctions)
// A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
SupportAddingBinaryFunctions() bool
SetSupportAddingBinaryFunctions(value bool)
// The binary archives that contain any precompiled shader functions to link.
BinaryArchives() []objectivec.IObject
SetBinaryArchives(value []objectivec.IObject)
RequiredThreadsPerThreadgroup() MTLSize
SetRequiredThreadsPerThreadgroup(value MTLSize)
}
An interface definition for the MTLComputePipelineDescriptor class.
Configuring the compute execution environment ¶
- [IMTLComputePipelineDescriptor.ComputeFunction]: The compute kernel the pipeline calls.
- [IMTLComputePipelineDescriptor.SetComputeFunction]
- [IMTLComputePipelineDescriptor.ThreadGroupSizeIsMultipleOfThreadExecutionWidth]: A Boolean value that indicates whether the threadgroup size is always a multiple of the thread execution width.
- [IMTLComputePipelineDescriptor.SetThreadGroupSizeIsMultipleOfThreadExecutionWidth]
- [IMTLComputePipelineDescriptor.MaxTotalThreadsPerThreadgroup]: A property that limits the number of threads you can dispatch in a threadgroup for the compute function.
- [IMTLComputePipelineDescriptor.SetMaxTotalThreadsPerThreadgroup]
- [IMTLComputePipelineDescriptor.MaxCallStackDepth]: The maximum call stack depth for indirect function calls in compute shaders.
- [IMTLComputePipelineDescriptor.SetMaxCallStackDepth]
Configuring compute pass inputs ¶
- [IMTLComputePipelineDescriptor.StageInputDescriptor]: The organization of input and output data for the next kernel call.
- [IMTLComputePipelineDescriptor.SetStageInputDescriptor]
Configuring buffer mutability ¶
- [IMTLComputePipelineDescriptor.Buffers]: The buffer mutability options to apply to the next kernel call.
Identifying the pipeline state object ¶
- [IMTLComputePipelineDescriptor.Label]: A string that identifies the instance.
- [IMTLComputePipelineDescriptor.SetLabel]
Configuring indirect command buffers ¶
- [IMTLComputePipelineDescriptor.SupportIndirectCommandBuffers]: A Boolean value that indicates whether you can encode commands that reference the pipeline state object into an indirect command buffer.
- [IMTLComputePipelineDescriptor.SetSupportIndirectCommandBuffers]
Configuring shader validation ¶
- [IMTLComputePipelineDescriptor.ShaderValidation]: A value that enables or disables shader validation for the pipeline.
- [IMTLComputePipelineDescriptor.SetShaderValidation]
Reset to defaults ¶
- [IMTLComputePipelineDescriptor.Reset]: Resets all compute pipeline descriptor properties to their default values.
Loading dynamic libraries to link at runtime ¶
- [IMTLComputePipelineDescriptor.PreloadedLibraries]: The dynamic libraries that contain precompiled shader functions you want to link.
- [IMTLComputePipelineDescriptor.SetPreloadedLibraries]
Setting callable functions ¶
- [IMTLComputePipelineDescriptor.LinkedFunctions]: The functions with available function pointers for the next kernel call.
- [IMTLComputePipelineDescriptor.SetLinkedFunctions]
Loading binary archives ¶
- [IMTLComputePipelineDescriptor.SupportAddingBinaryFunctions]: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
- [IMTLComputePipelineDescriptor.SetSupportAddingBinaryFunctions]
- [IMTLComputePipelineDescriptor.BinaryArchives]: The binary archives that contain any precompiled shader functions to link.
- [IMTLComputePipelineDescriptor.SetBinaryArchives]
Instance Properties ¶
- [IMTLComputePipelineDescriptor.RequiredThreadsPerThreadgroup]
- [IMTLComputePipelineDescriptor.SetRequiredThreadsPerThreadgroup]
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor
type IMTLComputePipelineReflection ¶
type IMTLComputePipelineReflection interface {
objectivec.IObject
Bindings() []objectivec.IObject
}
An interface definition for the MTLComputePipelineReflection class.
Instance Properties ¶
- [IMTLComputePipelineReflection.Bindings]
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineReflection
type IMTLCounterSampleBufferDescriptor ¶
type IMTLCounterSampleBufferDescriptor interface {
objectivec.IObject
// A GPU device’s counter set instance that you want to sample.
CounterSet() MTLCounterSet
SetCounterSet(value MTLCounterSet)
// The name for the counter sample buffer you create with the descriptor.
Label() string
SetLabel(value string)
// The number of instances of a counter set’s data that a counter sample buffer can store.
SampleCount() uint
SetSampleCount(value uint)
// The memory storage mode for the counter sample buffers you create with the descriptor.
StorageMode() MTLStorageMode
SetStorageMode(value MTLStorageMode)
// A sentinel value that instructs an encoder to skip sampling a counter as the GPU runs the encoder’s pass.
MTLCounterDontSample() int
SetMTLCounterDontSample(value int)
}
An interface definition for the MTLCounterSampleBufferDescriptor class.
Configuring a descriptor for a counter sample buffer ¶
- [IMTLCounterSampleBufferDescriptor.CounterSet]: A GPU device’s counter set instance that you want to sample.
- [IMTLCounterSampleBufferDescriptor.SetCounterSet]
- [IMTLCounterSampleBufferDescriptor.Label]: The name for the counter sample buffer you create with the descriptor.
- [IMTLCounterSampleBufferDescriptor.SetLabel]
- [IMTLCounterSampleBufferDescriptor.SampleCount]: The number of instances of a counter set’s data that a counter sample buffer can store.
- [IMTLCounterSampleBufferDescriptor.SetSampleCount]
- [IMTLCounterSampleBufferDescriptor.StorageMode]: The memory storage mode for the counter sample buffers you create with the descriptor.
- [IMTLCounterSampleBufferDescriptor.SetStorageMode]
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBufferDescriptor
type IMTLDepthStencilDescriptor ¶
type IMTLDepthStencilDescriptor interface {
objectivec.IObject
// The comparison that is performed between a fragment’s depth value and the depth value in the attachment, which determines whether to discard the fragment.
DepthCompareFunction() MTLCompareFunction
SetDepthCompareFunction(value MTLCompareFunction)
// A Boolean value that indicates whether depth values can be written to the depth attachment.
DepthWriteEnabled() bool
SetDepthWriteEnabled(value bool)
// The stencil descriptor for back-facing primitives.
BackFaceStencil() IMTLStencilDescriptor
SetBackFaceStencil(value IMTLStencilDescriptor)
// The stencil descriptor for front-facing primitives.
FrontFaceStencil() IMTLStencilDescriptor
SetFrontFaceStencil(value IMTLStencilDescriptor)
// A string that identifies this object.
Label() string
SetLabel(value string)
}
An interface definition for the MTLDepthStencilDescriptor class.
Specifying depth operations ¶
- [IMTLDepthStencilDescriptor.DepthCompareFunction]: The comparison that is performed between a fragment’s depth value and the depth value in the attachment, which determines whether to discard the fragment.
- [IMTLDepthStencilDescriptor.SetDepthCompareFunction]
- [IMTLDepthStencilDescriptor.DepthWriteEnabled]: A Boolean value that indicates whether depth values can be written to the depth attachment.
- [IMTLDepthStencilDescriptor.SetDepthWriteEnabled]
Specifying stencil descriptors for primitives ¶
- [IMTLDepthStencilDescriptor.BackFaceStencil]: The stencil descriptor for back-facing primitives.
- [IMTLDepthStencilDescriptor.SetBackFaceStencil]
- [IMTLDepthStencilDescriptor.FrontFaceStencil]: The stencil descriptor for front-facing primitives.
- [IMTLDepthStencilDescriptor.SetFrontFaceStencil]
Identifying properties ¶
- [IMTLDepthStencilDescriptor.Label]: A string that identifies this object.
- [IMTLDepthStencilDescriptor.SetLabel]
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilDescriptor
type IMTLFunctionConstant ¶
type IMTLFunctionConstant interface {
objectivec.IObject
// The name of the function constant.
Name() string
// The data type of the function constant.
Type() MTLDataType
// The index of the function constant.
Index() uint
// A Boolean value indicating whether the function constant needs to be provided to specialize the function.
Required() bool
}
An interface definition for the MTLFunctionConstant class.
Reading the function constant’s properties ¶
- [IMTLFunctionConstant.Name]: The name of the function constant.
- [IMTLFunctionConstant.Type]: The data type of the function constant.
- [IMTLFunctionConstant.Index]: The index of the function constant.
- [IMTLFunctionConstant.Required]: A Boolean value indicating whether the function constant needs to be provided to specialize the function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstant
type IMTLFunctionConstantValues ¶
type IMTLFunctionConstantValues interface {
objectivec.IObject
// Sets a value for a function constant at a specific index.
SetConstantValueTypeAtIndex(value unsafe.Pointer, type_ MTLDataType, index uint)
// Sets a value for a function constant with a specific name.
SetConstantValueTypeWithName(value unsafe.Pointer, type_ MTLDataType, name string)
// Deletes all previously set constant values.
Reset()
// Sets values for a group of function constants within a specific index range.
SetConstantValuesTypeWithRange(values unsafe.Pointer, type_ MTLDataType, range_ foundation.NSRange)
}
An interface definition for the MTLFunctionConstantValues class.
Setting constant values ¶
- [IMTLFunctionConstantValues.SetConstantValueTypeAtIndex]: Sets a value for a function constant at a specific index.
- [IMTLFunctionConstantValues.SetConstantValueTypeWithName]: Sets a value for a function constant with a specific name.
Resetting constant values ¶
- [IMTLFunctionConstantValues.Reset]: Deletes all previously set constant values.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstantValues
type IMTLFunctionDescriptor ¶
type IMTLFunctionDescriptor interface {
objectivec.IObject
// The name of the function to fetch from the library.
Name() string
SetName(value string)
// A new name for the created function object.
SpecializedName() string
SetSpecializedName(value string)
// The set of constant values assigned to the function constants.
ConstantValues() IMTLFunctionConstantValues
SetConstantValues(value IMTLFunctionConstantValues)
// Flags specifying how Metal should create the new function object.
Options() MTLFunctionOptions
SetOptions(value MTLFunctionOptions)
// The binary archives to search for a previously-compiled version of this function.
BinaryArchives() []objectivec.IObject
SetBinaryArchives(value []objectivec.IObject)
}
An interface definition for the MTLFunctionDescriptor class.
Specifying the function configuration ¶
- [IMTLFunctionDescriptor.Name]: The name of the function to fetch from the library.
- [IMTLFunctionDescriptor.SetName]
- [IMTLFunctionDescriptor.SpecializedName]: A new name for the created function object.
- [IMTLFunctionDescriptor.SetSpecializedName]
- [IMTLFunctionDescriptor.ConstantValues]: The set of constant values assigned to the function constants.
- [IMTLFunctionDescriptor.SetConstantValues]
- [IMTLFunctionDescriptor.Options]: Flags specifying how Metal should create the new function object.
- [IMTLFunctionDescriptor.SetOptions]
- [IMTLFunctionDescriptor.BinaryArchives]: The binary archives to search for a previously-compiled version of this function.
- [IMTLFunctionDescriptor.SetBinaryArchives]
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor
type IMTLFunctionReflection ¶
type IMTLFunctionReflection interface {
objectivec.IObject
// Provides a list of inputs and outputs of the function.
Bindings() []objectivec.IObject
// The string passed to the user annotation attribute for this function. Null if no user annotation is present for this function.
UserAnnotation() string
}
An interface definition for the MTLFunctionReflection class.
Instance Properties ¶
- [IMTLFunctionReflection.Bindings]: Provides a list of inputs and outputs of the function.
- [IMTLFunctionReflection.UserAnnotation]: The string passed to the user annotation attribute for this function. Null if no user annotation is present for this function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionReflection
type IMTLFunctionStitchingAttributeAlwaysInline ¶
type IMTLFunctionStitchingAttributeAlwaysInline interface {
objectivec.IObject
MTLFunctionStitchingAttribute
// A list of attributes to configure how the Metal device object generates the new stitched function.
Attributes() MTLFunctionStitchingAttribute
SetAttributes(value MTLFunctionStitchingAttribute)
}
An interface definition for the MTLFunctionStitchingAttributeAlwaysInline class.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingAttributeAlwaysInline
type IMTLFunctionStitchingFunctionNode ¶
type IMTLFunctionStitchingFunctionNode interface {
objectivec.IObject
MTLFunctionStitchingNode
// Creates a new function node.
InitWithNameArgumentsControlDependencies(name string, arguments []objectivec.IObject, controlDependencies []MTLFunctionStitchingFunctionNode) MTLFunctionStitchingFunctionNode
// The name of the function to call.
Name() string
SetName(value string)
// An ordered list of the nodes that provide the function’s arguments.
Arguments() []objectivec.IObject
SetArguments(value []objectivec.IObject)
// The list of nodes that need to execute before executing the node.
ControlDependencies() []MTLFunctionStitchingFunctionNode
SetControlDependencies(value []MTLFunctionStitchingFunctionNode)
}
An interface definition for the MTLFunctionStitchingFunctionNode class.
Initializing a function node ¶
- [IMTLFunctionStitchingFunctionNode.InitWithNameArgumentsControlDependencies]: Creates a new function node.
Configuring a function node ¶
- [IMTLFunctionStitchingFunctionNode.Name]: The name of the function to call.
- [IMTLFunctionStitchingFunctionNode.SetName]
- [IMTLFunctionStitchingFunctionNode.Arguments]: An ordered list of the nodes that provide the function’s arguments.
- [IMTLFunctionStitchingFunctionNode.SetArguments]
- [IMTLFunctionStitchingFunctionNode.ControlDependencies]: The list of nodes that need to execute before executing the node.
- [IMTLFunctionStitchingFunctionNode.SetControlDependencies]
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingFunctionNode
type IMTLFunctionStitchingGraph ¶
type IMTLFunctionStitchingGraph interface {
objectivec.IObject
// Creates a description of a new function call graph.
InitWithFunctionNameNodesOutputNodeAttributes(functionName string, nodes []MTLFunctionStitchingFunctionNode, outputNode IMTLFunctionStitchingFunctionNode, attributes []objectivec.IObject) MTLFunctionStitchingGraph
// The name of the new stitched function.
FunctionName() string
SetFunctionName(value string)
// The nodes in the function’s call graph.
Nodes() []MTLFunctionStitchingFunctionNode
SetNodes(value []MTLFunctionStitchingFunctionNode)
// The node with the output that’s the output of the new stitched function.
OutputNode() IMTLFunctionStitchingFunctionNode
SetOutputNode(value IMTLFunctionStitchingFunctionNode)
// A list of attributes to configure how the Metal device object generates the new stitched function.
Attributes() []objectivec.IObject
SetAttributes(value []objectivec.IObject)
}
An interface definition for the MTLFunctionStitchingGraph class.
Initializing a function graph ¶
- [IMTLFunctionStitchingGraph.InitWithFunctionNameNodesOutputNodeAttributes]: Creates a description of a new function call graph.
Configuring a function graph ¶
- [IMTLFunctionStitchingGraph.FunctionName]: The name of the new stitched function.
- [IMTLFunctionStitchingGraph.SetFunctionName]
- [IMTLFunctionStitchingGraph.Nodes]: The nodes in the function’s call graph.
- [IMTLFunctionStitchingGraph.SetNodes]
- [IMTLFunctionStitchingGraph.OutputNode]: The node with the output that’s the output of the new stitched function.
- [IMTLFunctionStitchingGraph.SetOutputNode]
- [IMTLFunctionStitchingGraph.Attributes]: A list of attributes to configure how the Metal device object generates the new stitched function.
- [IMTLFunctionStitchingGraph.SetAttributes]
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingGraph
type IMTLFunctionStitchingInputNode ¶
type IMTLFunctionStitchingInputNode interface {
objectivec.IObject
MTLFunctionStitchingNode
// Creates a new input node.
InitWithArgumentIndex(argument uint) MTLFunctionStitchingInputNode
// The index in the command’s buffer argument table that declares which data to read for this input node.
ArgumentIndex() uint
SetArgumentIndex(value uint)
}
An interface definition for the MTLFunctionStitchingInputNode class.
Initializing an input node ¶
- [IMTLFunctionStitchingInputNode.InitWithArgumentIndex]: Creates a new input node.
Configuring an input node ¶
- [IMTLFunctionStitchingInputNode.ArgumentIndex]: The index in the command’s buffer argument table that declares which data to read for this input node.
- [IMTLFunctionStitchingInputNode.SetArgumentIndex]
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingInputNode
type IMTLHeapDescriptor ¶
type IMTLHeapDescriptor interface {
objectivec.IObject
// The memory placement strategy for any resources you allocate from the heaps you create with this descriptor.
Type() MTLHeapType
SetType(value MTLHeapType)
// The storage mode for the heaps you create with this descriptor.
StorageMode() MTLStorageMode
SetStorageMode(value MTLStorageMode)
// The CPU cache behavior for any resources you allocate from the heaps you create with this descriptor.
CpuCacheMode() MTLCPUCacheMode
SetCpuCacheMode(value MTLCPUCacheMode)
// The hazard tracking behavior for any resources you allocate from the heaps you create with this descriptor.
HazardTrackingMode() MTLHazardTrackingMode
SetHazardTrackingMode(value MTLHazardTrackingMode)
// The combined behavior for any resources you allocate from the heaps you create with this descriptor.
ResourceOptions() MTLResourceOptions
SetResourceOptions(value MTLResourceOptions)
// The total amount of memory, in bytes, for the heaps you create with this descriptor.
Size() uint
SetSize(value uint)
// The page size for any resources you allocate from the heaps you create with this descriptor.
SparsePageSize() MTLSparsePageSize
SetSparsePageSize(value MTLSparsePageSize)
// Specifies the largest sparse page size that the Metal heap supports.
MaxCompatiblePlacementSparsePageSize() MTLSparsePageSize
SetMaxCompatiblePlacementSparsePageSize(value MTLSparsePageSize)
}
An interface definition for the MTLHeapDescriptor class.
Configuring a heap ¶
- [IMTLHeapDescriptor.Type]: The memory placement strategy for any resources you allocate from the heaps you create with this descriptor.
- [IMTLHeapDescriptor.SetType]
- [IMTLHeapDescriptor.StorageMode]: The storage mode for the heaps you create with this descriptor.
- [IMTLHeapDescriptor.SetStorageMode]
- [IMTLHeapDescriptor.CpuCacheMode]: The CPU cache behavior for any resources you allocate from the heaps you create with this descriptor.
- [IMTLHeapDescriptor.SetCpuCacheMode]
- [IMTLHeapDescriptor.HazardTrackingMode]: The hazard tracking behavior for any resources you allocate from the heaps you create with this descriptor.
- [IMTLHeapDescriptor.SetHazardTrackingMode]
- [IMTLHeapDescriptor.ResourceOptions]: The combined behavior for any resources you allocate from the heaps you create with this descriptor.
- [IMTLHeapDescriptor.SetResourceOptions]
- [IMTLHeapDescriptor.Size]: The total amount of memory, in bytes, for the heaps you create with this descriptor.
- [IMTLHeapDescriptor.SetSize]
- [IMTLHeapDescriptor.SparsePageSize]: The page size for any resources you allocate from the heaps you create with this descriptor.
- [IMTLHeapDescriptor.SetSparsePageSize]
Instance Properties ¶
- [IMTLHeapDescriptor.MaxCompatiblePlacementSparsePageSize]: Specifies the largest sparse page size that the Metal heap supports.
- [IMTLHeapDescriptor.SetMaxCompatiblePlacementSparsePageSize]
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor
type IMTLIOCommandQueueDescriptor ¶
type IMTLIOCommandQueueDescriptor interface {
objectivec.IObject
// Configures the priority for a new input/output command queue.
Priority() MTLIOPriority
SetPriority(value MTLIOPriority)
// Configures the queue type for a new input/output command queue.
Type() MTLIOCommandQueueType
SetType(value MTLIOCommandQueueType)
// Sets the largest number of individual commands that an input/output command queue can run at a time.
MaxCommandsInFlight() uint
SetMaxCommandsInFlight(value uint)
// Sets the largest number of outstanding input/output command buffers a queue can have at any point in time.
MaxCommandBufferCount() uint
SetMaxCommandBufferCount(value uint)
// An optional memory allocator that you implement to manage the scratch memory that an input/output command queue requests.
ScratchBufferAllocator() MTLIOScratchBufferAllocator
SetScratchBufferAllocator(value MTLIOScratchBufferAllocator)
}
An interface definition for the MTLIOCommandQueueDescriptor class.
Configuring the input/output command queue ¶
- [IMTLIOCommandQueueDescriptor.Priority]: Configures the priority for a new input/output command queue.
- [IMTLIOCommandQueueDescriptor.SetPriority]
- [IMTLIOCommandQueueDescriptor.Type]: Configures the queue type for a new input/output command queue.
- [IMTLIOCommandQueueDescriptor.SetType]
- [IMTLIOCommandQueueDescriptor.MaxCommandsInFlight]: Sets the largest number of individual commands that an input/output command queue can run at a time.
- [IMTLIOCommandQueueDescriptor.SetMaxCommandsInFlight]
- [IMTLIOCommandQueueDescriptor.MaxCommandBufferCount]: Sets the largest number of outstanding input/output command buffers a queue can have at any point in time.
- [IMTLIOCommandQueueDescriptor.SetMaxCommandBufferCount]
Providing your own a scratch buffer ¶
- [IMTLIOCommandQueueDescriptor.ScratchBufferAllocator]: An optional memory allocator that you implement to manage the scratch memory that an input/output command queue requests.
- [IMTLIOCommandQueueDescriptor.SetScratchBufferAllocator]
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueDescriptor
type IMTLIndirectCommandBufferDescriptor ¶
type IMTLIndirectCommandBufferDescriptor interface {
objectivec.IObject
// The set of command types that you can encode into the indirect command buffer.
CommandTypes() MTLIndirectCommandType
SetCommandTypes(value MTLIndirectCommandType)
// A Boolean value that determines where commands in the indirect command buffer get their buffer arguments from when you execute them.
InheritBuffers() bool
SetInheritBuffers(value bool)
// A Boolean value that determines where commands in the indirect command buffer get their pipeline state from when you execute them.
InheritPipelineState() bool
SetInheritPipelineState(value bool)
// The maximum number of buffers that you can set per command for the vertex stage.
MaxVertexBufferBindCount() uint
SetMaxVertexBufferBindCount(value uint)
// The maximum number of buffers that you can set per command for the fragment stage.
MaxFragmentBufferBindCount() uint
SetMaxFragmentBufferBindCount(value uint)
// The maximum number of buffers that you can set per command for the compute kernel.
MaxKernelBufferBindCount() uint
SetMaxKernelBufferBindCount(value uint)
// Configures whether the indirect command buffer inherits the cull mode from the encoder.
InheritCullMode() bool
SetInheritCullMode(value bool)
// Configures whether the indirect command buffer inherits the depth bias from the encoder.
InheritDepthBias() bool
SetInheritDepthBias(value bool)
// Configures whether the indirect command buffer inherits the depth clip mode from the encoder.
InheritDepthClipMode() bool
SetInheritDepthClipMode(value bool)
// Configures whether the indirect command buffer inherits the depth stencil state from the encoder.
InheritDepthStencilState() bool
SetInheritDepthStencilState(value bool)
// Configures whether the indirect command buffer inherits the front facing winding from the encoder.
InheritFrontFacingWinding() bool
SetInheritFrontFacingWinding(value bool)
// Configures whether the indirect command buffer inherits the triangle fill mode from the encoder.
InheritTriangleFillMode() bool
SetInheritTriangleFillMode(value bool)
MaxKernelThreadgroupMemoryBindCount() uint
SetMaxKernelThreadgroupMemoryBindCount(value uint)
MaxMeshBufferBindCount() uint
SetMaxMeshBufferBindCount(value uint)
MaxObjectBufferBindCount() uint
SetMaxObjectBufferBindCount(value uint)
MaxObjectThreadgroupMemoryBindCount() uint
SetMaxObjectThreadgroupMemoryBindCount(value uint)
// Specifies if the indirect command buffer should support color attachment mapping.
SupportColorAttachmentMapping() bool
SetSupportColorAttachmentMapping(value bool)
SupportDynamicAttributeStride() bool
SetSupportDynamicAttributeStride(value bool)
SupportRayTracing() bool
SetSupportRayTracing(value bool)
}
An interface definition for the MTLIndirectCommandBufferDescriptor class.
Declaring command types to encode ¶
- [IMTLIndirectCommandBufferDescriptor.CommandTypes]: The set of command types that you can encode into the indirect command buffer.
- [IMTLIndirectCommandBufferDescriptor.SetCommandTypes]
Declaring command inheritance ¶
- [IMTLIndirectCommandBufferDescriptor.InheritBuffers]: A Boolean value that determines where commands in the indirect command buffer get their buffer arguments from when you execute them.
- [IMTLIndirectCommandBufferDescriptor.SetInheritBuffers]
- [IMTLIndirectCommandBufferDescriptor.InheritPipelineState]: A Boolean value that determines where commands in the indirect command buffer get their pipeline state from when you execute them.
- [IMTLIndirectCommandBufferDescriptor.SetInheritPipelineState]
Declaring the maximum number of argument buffers per command ¶
- [IMTLIndirectCommandBufferDescriptor.MaxVertexBufferBindCount]: The maximum number of buffers that you can set per command for the vertex stage.
- [IMTLIndirectCommandBufferDescriptor.SetMaxVertexBufferBindCount]
- [IMTLIndirectCommandBufferDescriptor.MaxFragmentBufferBindCount]: The maximum number of buffers that you can set per command for the fragment stage.
- [IMTLIndirectCommandBufferDescriptor.SetMaxFragmentBufferBindCount]
- [IMTLIndirectCommandBufferDescriptor.MaxKernelBufferBindCount]: The maximum number of buffers that you can set per command for the compute kernel.
- [IMTLIndirectCommandBufferDescriptor.SetMaxKernelBufferBindCount]
Instance Properties ¶
- [IMTLIndirectCommandBufferDescriptor.InheritCullMode]: Configures whether the indirect command buffer inherits the cull mode from the encoder.
- [IMTLIndirectCommandBufferDescriptor.SetInheritCullMode]
- [IMTLIndirectCommandBufferDescriptor.InheritDepthBias]: Configures whether the indirect command buffer inherits the depth bias from the encoder.
- [IMTLIndirectCommandBufferDescriptor.SetInheritDepthBias]
- [IMTLIndirectCommandBufferDescriptor.InheritDepthClipMode]: Configures whether the indirect command buffer inherits the depth clip mode from the encoder.
- [IMTLIndirectCommandBufferDescriptor.SetInheritDepthClipMode]
- [IMTLIndirectCommandBufferDescriptor.InheritDepthStencilState]: Configures whether the indirect command buffer inherits the depth stencil state from the encoder.
- [IMTLIndirectCommandBufferDescriptor.SetInheritDepthStencilState]
- [IMTLIndirectCommandBufferDescriptor.InheritFrontFacingWinding]: Configures whether the indirect command buffer inherits the front facing winding from the encoder.
- [IMTLIndirectCommandBufferDescriptor.SetInheritFrontFacingWinding]
- [IMTLIndirectCommandBufferDescriptor.InheritTriangleFillMode]: Configures whether the indirect command buffer inherits the triangle fill mode from the encoder.
- [IMTLIndirectCommandBufferDescriptor.SetInheritTriangleFillMode]
- [IMTLIndirectCommandBufferDescriptor.MaxKernelThreadgroupMemoryBindCount]
- [IMTLIndirectCommandBufferDescriptor.SetMaxKernelThreadgroupMemoryBindCount]
- [IMTLIndirectCommandBufferDescriptor.MaxMeshBufferBindCount]
- [IMTLIndirectCommandBufferDescriptor.SetMaxMeshBufferBindCount]
- [IMTLIndirectCommandBufferDescriptor.MaxObjectBufferBindCount]
- [IMTLIndirectCommandBufferDescriptor.SetMaxObjectBufferBindCount]
- [IMTLIndirectCommandBufferDescriptor.MaxObjectThreadgroupMemoryBindCount]
- [IMTLIndirectCommandBufferDescriptor.SetMaxObjectThreadgroupMemoryBindCount]
- [IMTLIndirectCommandBufferDescriptor.SupportColorAttachmentMapping]: Specifies if the indirect command buffer should support color attachment mapping.
- [IMTLIndirectCommandBufferDescriptor.SetSupportColorAttachmentMapping]
- [IMTLIndirectCommandBufferDescriptor.SupportDynamicAttributeStride]
- [IMTLIndirectCommandBufferDescriptor.SetSupportDynamicAttributeStride]
- [IMTLIndirectCommandBufferDescriptor.SupportRayTracing]
- [IMTLIndirectCommandBufferDescriptor.SetSupportRayTracing]
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferDescriptor
type IMTLIndirectInstanceAccelerationStructureDescriptor ¶
type IMTLIndirectInstanceAccelerationStructureDescriptor interface {
IMTLAccelerationStructureDescriptor
InstanceCountBuffer() MTLBuffer
SetInstanceCountBuffer(value MTLBuffer)
InstanceCountBufferOffset() uint
SetInstanceCountBufferOffset(value uint)
InstanceDescriptorBuffer() MTLBuffer
SetInstanceDescriptorBuffer(value MTLBuffer)
InstanceDescriptorBufferOffset() uint
SetInstanceDescriptorBufferOffset(value uint)
InstanceDescriptorStride() uint
SetInstanceDescriptorStride(value uint)
InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
InstanceTransformationMatrixLayout() MTLMatrixLayout
SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
MaxInstanceCount() uint
SetMaxInstanceCount(value uint)
MaxMotionTransformCount() uint
SetMaxMotionTransformCount(value uint)
MotionTransformBuffer() MTLBuffer
SetMotionTransformBuffer(value MTLBuffer)
MotionTransformBufferOffset() uint
SetMotionTransformBufferOffset(value uint)
MotionTransformCountBuffer() MTLBuffer
SetMotionTransformCountBuffer(value MTLBuffer)
MotionTransformCountBufferOffset() uint
SetMotionTransformCountBufferOffset(value uint)
MotionTransformStride() uint
SetMotionTransformStride(value uint)
MotionTransformType() MTLTransformType
SetMotionTransformType(value MTLTransformType)
}
An interface definition for the MTLIndirectInstanceAccelerationStructureDescriptor class.
Instance Properties ¶
- [IMTLIndirectInstanceAccelerationStructureDescriptor.InstanceCountBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceCountBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.InstanceCountBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceCountBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorStride]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorType]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorType]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MaxInstanceCount]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMaxInstanceCount]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MaxMotionTransformCount]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMaxMotionTransformCount]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformCountBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformCountBuffer]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformCountBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformCountBufferOffset]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformStride]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformStride]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformType]
- [IMTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformType]
See: https://developer.apple.com/documentation/Metal/MTLIndirectInstanceAccelerationStructureDescriptor
type IMTLInstanceAccelerationStructureDescriptor ¶
type IMTLInstanceAccelerationStructureDescriptor interface {
IMTLAccelerationStructureDescriptor
// The format of the instance data in the descriptor buffer.
InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
// The bottom-level acceleration structures that instances use in the instance acceleration structure .
InstancedAccelerationStructures() []objectivec.IObject
SetInstancedAccelerationStructures(value []objectivec.IObject)
// The number of instances in the instance descriptor buffer.
InstanceCount() uint
SetInstanceCount(value uint)
// A buffer that contains descriptions of each instance in the acceleration structure.
InstanceDescriptorBuffer() MTLBuffer
SetInstanceDescriptorBuffer(value MTLBuffer)
// The offset, in bytes, to the descripton of the first instance.
InstanceDescriptorBufferOffset() uint
SetInstanceDescriptorBufferOffset(value uint)
// The stride, in bytes, between instance descriptions.
InstanceDescriptorStride() uint
SetInstanceDescriptorStride(value uint)
// The number of motion transforms in the motion transform buffer.
MotionTransformCount() uint
SetMotionTransformCount(value uint)
// A buffer that contains descriptions of each motion transform in the acceleration structure.
MotionTransformBuffer() MTLBuffer
SetMotionTransformBuffer(value MTLBuffer)
// The offset, in bytes, to the descripton of the first motion transform.
MotionTransformBufferOffset() uint
SetMotionTransformBufferOffset(value uint)
InstanceTransformationMatrixLayout() MTLMatrixLayout
SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
MotionTransformStride() uint
SetMotionTransformStride(value uint)
MotionTransformType() MTLTransformType
SetMotionTransformType(value MTLTransformType)
}
An interface definition for the MTLInstanceAccelerationStructureDescriptor class.
Specifying the instance structures ¶
- [IMTLInstanceAccelerationStructureDescriptor.InstanceDescriptorType]: The format of the instance data in the descriptor buffer.
- [IMTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorType]
- [IMTLInstanceAccelerationStructureDescriptor.InstancedAccelerationStructures]: The bottom-level acceleration structures that instances use in the instance acceleration structure .
- [IMTLInstanceAccelerationStructureDescriptor.SetInstancedAccelerationStructures]
Specifying the list of instances ¶
- [IMTLInstanceAccelerationStructureDescriptor.InstanceCount]: The number of instances in the instance descriptor buffer.
- [IMTLInstanceAccelerationStructureDescriptor.SetInstanceCount]
- [IMTLInstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer]: A buffer that contains descriptions of each instance in the acceleration structure.
- [IMTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer]
- [IMTLInstanceAccelerationStructureDescriptor.InstanceDescriptorBufferOffset]: The offset, in bytes, to the descripton of the first instance.
- [IMTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBufferOffset]
- [IMTLInstanceAccelerationStructureDescriptor.InstanceDescriptorStride]: The stride, in bytes, between instance descriptions.
- [IMTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride]
Specifying motion data ¶
- [IMTLInstanceAccelerationStructureDescriptor.MotionTransformCount]: The number of motion transforms in the motion transform buffer.
- [IMTLInstanceAccelerationStructureDescriptor.SetMotionTransformCount]
- [IMTLInstanceAccelerationStructureDescriptor.MotionTransformBuffer]: A buffer that contains descriptions of each motion transform in the acceleration structure.
- [IMTLInstanceAccelerationStructureDescriptor.SetMotionTransformBuffer]
- [IMTLInstanceAccelerationStructureDescriptor.MotionTransformBufferOffset]: The offset, in bytes, to the descripton of the first motion transform.
- [IMTLInstanceAccelerationStructureDescriptor.SetMotionTransformBufferOffset]
Instance Properties ¶
- [IMTLInstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout]
- [IMTLInstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout]
- [IMTLInstanceAccelerationStructureDescriptor.MotionTransformStride]
- [IMTLInstanceAccelerationStructureDescriptor.SetMotionTransformStride]
- [IMTLInstanceAccelerationStructureDescriptor.MotionTransformType]
- [IMTLInstanceAccelerationStructureDescriptor.SetMotionTransformType]
See: https://developer.apple.com/documentation/Metal/MTLInstanceAccelerationStructureDescriptor
type IMTLIntersectionFunctionDescriptor ¶
type IMTLIntersectionFunctionDescriptor interface {
IMTLFunctionDescriptor
}
An interface definition for the MTLIntersectionFunctionDescriptor class.
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionDescriptor
type IMTLIntersectionFunctionTableDescriptor ¶
type IMTLIntersectionFunctionTableDescriptor interface {
objectivec.IObject
// The number of entries in the intersection function table.
FunctionCount() uint
SetFunctionCount(value uint)
}
An interface definition for the MTLIntersectionFunctionTableDescriptor class.
Configuring the table’s size ¶
- [IMTLIntersectionFunctionTableDescriptor.FunctionCount]: The number of entries in the intersection function table.
- [IMTLIntersectionFunctionTableDescriptor.SetFunctionCount]
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTableDescriptor
type IMTLLinkedFunctions ¶
type IMTLLinkedFunctions interface {
objectivec.IObject
// An array of function objects to link to the new function.
Functions() []objectivec.IObject
SetFunctions(value []objectivec.IObject)
// An array of function objects already compiled to a binary representation to link.
BinaryFunctions() []objectivec.IObject
SetBinaryFunctions(value []objectivec.IObject)
// An optional list of groups specifying which functions your shader can call at each call site.
Groups() foundation.INSDictionary
SetGroups(value foundation.INSDictionary)
// An array of function objects to link to the new function, without exporting the functions publicly.
PrivateFunctions() []objectivec.IObject
SetPrivateFunctions(value []objectivec.IObject)
// The binary archives to search for a previously-compiled version of this function.
BinaryArchives() MTLBinaryArchive
SetBinaryArchives(value MTLBinaryArchive)
// The set of constant values assigned to the function constants.
ConstantValues() IMTLFunctionConstantValues
SetConstantValues(value IMTLFunctionConstantValues)
// The name of the function to fetch from the library.
Name() string
SetName(value string)
// Flags specifying how Metal should create the new function object.
Options() MTLFunctionOptions
SetOptions(value MTLFunctionOptions)
// A new name for the created function object.
SpecializedName() string
SetSpecializedName(value string)
}
An interface definition for the MTLLinkedFunctions class.
Specifying related functions ¶
- [IMTLLinkedFunctions.Functions]: An array of function objects to link to the new function.
- [IMTLLinkedFunctions.SetFunctions]
- [IMTLLinkedFunctions.BinaryFunctions]: An array of function objects already compiled to a binary representation to link.
- [IMTLLinkedFunctions.SetBinaryFunctions]
- [IMTLLinkedFunctions.Groups]: An optional list of groups specifying which functions your shader can call at each call site.
- [IMTLLinkedFunctions.SetGroups]
- [IMTLLinkedFunctions.PrivateFunctions]: An array of function objects to link to the new function, without exporting the functions publicly.
- [IMTLLinkedFunctions.SetPrivateFunctions]
See: https://developer.apple.com/documentation/Metal/MTLLinkedFunctions
type IMTLLogStateDescriptor ¶
type IMTLLogStateDescriptor interface {
objectivec.IObject
// The size of the internal buffer the log state uses, specified in bytes.
BufferSize() int
SetBufferSize(value int)
// The minimum level of messages that the shader can log.
Level() MTLLogLevel
SetLevel(value MTLLogLevel)
}
An interface definition for the MTLLogStateDescriptor class.
Instance properties ¶
- [IMTLLogStateDescriptor.BufferSize]: The size of the internal buffer the log state uses, specified in bytes.
- [IMTLLogStateDescriptor.SetBufferSize]
- [IMTLLogStateDescriptor.Level]: The minimum level of messages that the shader can log.
- [IMTLLogStateDescriptor.SetLevel]
See: https://developer.apple.com/documentation/Metal/MTLLogStateDescriptor
type IMTLLogicalToPhysicalColorAttachmentMap ¶
type IMTLLogicalToPhysicalColorAttachmentMap interface {
objectivec.IObject
Reset()
// Queries the physical color attachment index corresponding to a logical index.
GetPhysicalIndexForLogicalIndex(logicalIndex uint) uint
// Maps a physical color attachment index to a logical index.
SetPhysicalIndexForLogicalIndex(physicalIndex uint, logicalIndex uint)
}
An interface definition for the MTLLogicalToPhysicalColorAttachmentMap class.
Instance Methods ¶
- [IMTLLogicalToPhysicalColorAttachmentMap.Reset]
See: https://developer.apple.com/documentation/Metal/MTLLogicalToPhysicalColorAttachmentMap
type IMTLMeshRenderPipelineDescriptor ¶
type IMTLMeshRenderPipelineDescriptor interface {
objectivec.IObject
BinaryArchives() []objectivec.IObject
SetBinaryArchives(value []objectivec.IObject)
ColorAttachments() IMTLRenderPipelineColorAttachmentDescriptorArray
DepthAttachmentPixelFormat() MTLPixelFormat
SetDepthAttachmentPixelFormat(value MTLPixelFormat)
FragmentBuffers() IMTLPipelineBufferDescriptorArray
FragmentFunction() MTLFunction
SetFragmentFunction(value MTLFunction)
FragmentLinkedFunctions() IMTLLinkedFunctions
SetFragmentLinkedFunctions(value IMTLLinkedFunctions)
AlphaToCoverageEnabled() bool
SetAlphaToCoverageEnabled(value bool)
AlphaToOneEnabled() bool
SetAlphaToOneEnabled(value bool)
RasterizationEnabled() bool
SetRasterizationEnabled(value bool)
Label() string
SetLabel(value string)
MaxTotalThreadgroupsPerMeshGrid() uint
SetMaxTotalThreadgroupsPerMeshGrid(value uint)
MaxTotalThreadsPerMeshThreadgroup() uint
SetMaxTotalThreadsPerMeshThreadgroup(value uint)
MaxTotalThreadsPerObjectThreadgroup() uint
SetMaxTotalThreadsPerObjectThreadgroup(value uint)
MaxVertexAmplificationCount() uint
SetMaxVertexAmplificationCount(value uint)
MeshBuffers() IMTLPipelineBufferDescriptorArray
MeshFunction() MTLFunction
SetMeshFunction(value MTLFunction)
MeshLinkedFunctions() IMTLLinkedFunctions
SetMeshLinkedFunctions(value IMTLLinkedFunctions)
MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
ObjectBuffers() IMTLPipelineBufferDescriptorArray
ObjectFunction() MTLFunction
SetObjectFunction(value MTLFunction)
ObjectLinkedFunctions() IMTLLinkedFunctions
SetObjectLinkedFunctions(value IMTLLinkedFunctions)
ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
PayloadMemoryLength() uint
SetPayloadMemoryLength(value uint)
RasterSampleCount() uint
SetRasterSampleCount(value uint)
RequiredThreadsPerMeshThreadgroup() MTLSize
SetRequiredThreadsPerMeshThreadgroup(value MTLSize)
RequiredThreadsPerObjectThreadgroup() MTLSize
SetRequiredThreadsPerObjectThreadgroup(value MTLSize)
// A value that enables or disables shader validation for the pipeline.
ShaderValidation() MTLShaderValidation
SetShaderValidation(value MTLShaderValidation)
StencilAttachmentPixelFormat() MTLPixelFormat
SetStencilAttachmentPixelFormat(value MTLPixelFormat)
SupportIndirectCommandBuffers() bool
SetSupportIndirectCommandBuffers(value bool)
Reset()
}
An interface definition for the MTLMeshRenderPipelineDescriptor class.
Instance Properties ¶
- [IMTLMeshRenderPipelineDescriptor.BinaryArchives]
- [IMTLMeshRenderPipelineDescriptor.SetBinaryArchives]
- [IMTLMeshRenderPipelineDescriptor.ColorAttachments]
- [IMTLMeshRenderPipelineDescriptor.DepthAttachmentPixelFormat]
- [IMTLMeshRenderPipelineDescriptor.SetDepthAttachmentPixelFormat]
- [IMTLMeshRenderPipelineDescriptor.FragmentBuffers]
- [IMTLMeshRenderPipelineDescriptor.FragmentFunction]
- [IMTLMeshRenderPipelineDescriptor.SetFragmentFunction]
- [IMTLMeshRenderPipelineDescriptor.FragmentLinkedFunctions]
- [IMTLMeshRenderPipelineDescriptor.SetFragmentLinkedFunctions]
- [IMTLMeshRenderPipelineDescriptor.AlphaToCoverageEnabled]
- [IMTLMeshRenderPipelineDescriptor.SetAlphaToCoverageEnabled]
- [IMTLMeshRenderPipelineDescriptor.AlphaToOneEnabled]
- [IMTLMeshRenderPipelineDescriptor.SetAlphaToOneEnabled]
- [IMTLMeshRenderPipelineDescriptor.RasterizationEnabled]
- [IMTLMeshRenderPipelineDescriptor.SetRasterizationEnabled]
- [IMTLMeshRenderPipelineDescriptor.Label]
- [IMTLMeshRenderPipelineDescriptor.SetLabel]
- [IMTLMeshRenderPipelineDescriptor.MaxTotalThreadgroupsPerMeshGrid]
- [IMTLMeshRenderPipelineDescriptor.SetMaxTotalThreadgroupsPerMeshGrid]
- [IMTLMeshRenderPipelineDescriptor.MaxTotalThreadsPerMeshThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.SetMaxTotalThreadsPerMeshThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.MaxTotalThreadsPerObjectThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.SetMaxTotalThreadsPerObjectThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.MaxVertexAmplificationCount]
- [IMTLMeshRenderPipelineDescriptor.SetMaxVertexAmplificationCount]
- [IMTLMeshRenderPipelineDescriptor.MeshBuffers]
- [IMTLMeshRenderPipelineDescriptor.MeshFunction]
- [IMTLMeshRenderPipelineDescriptor.SetMeshFunction]
- [IMTLMeshRenderPipelineDescriptor.MeshLinkedFunctions]
- [IMTLMeshRenderPipelineDescriptor.SetMeshLinkedFunctions]
- [IMTLMeshRenderPipelineDescriptor.MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth]
- [IMTLMeshRenderPipelineDescriptor.SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth]
- [IMTLMeshRenderPipelineDescriptor.ObjectBuffers]
- [IMTLMeshRenderPipelineDescriptor.ObjectFunction]
- [IMTLMeshRenderPipelineDescriptor.SetObjectFunction]
- [IMTLMeshRenderPipelineDescriptor.ObjectLinkedFunctions]
- [IMTLMeshRenderPipelineDescriptor.SetObjectLinkedFunctions]
- [IMTLMeshRenderPipelineDescriptor.ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth]
- [IMTLMeshRenderPipelineDescriptor.SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth]
- [IMTLMeshRenderPipelineDescriptor.PayloadMemoryLength]
- [IMTLMeshRenderPipelineDescriptor.SetPayloadMemoryLength]
- [IMTLMeshRenderPipelineDescriptor.RasterSampleCount]
- [IMTLMeshRenderPipelineDescriptor.SetRasterSampleCount]
- [IMTLMeshRenderPipelineDescriptor.RequiredThreadsPerMeshThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.SetRequiredThreadsPerMeshThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.RequiredThreadsPerObjectThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.SetRequiredThreadsPerObjectThreadgroup]
- [IMTLMeshRenderPipelineDescriptor.ShaderValidation]: A value that enables or disables shader validation for the pipeline.
- [IMTLMeshRenderPipelineDescriptor.SetShaderValidation]
- [IMTLMeshRenderPipelineDescriptor.StencilAttachmentPixelFormat]
- [IMTLMeshRenderPipelineDescriptor.SetStencilAttachmentPixelFormat]
- [IMTLMeshRenderPipelineDescriptor.SupportIndirectCommandBuffers]
- [IMTLMeshRenderPipelineDescriptor.SetSupportIndirectCommandBuffers]
Instance Methods ¶
- [IMTLMeshRenderPipelineDescriptor.Reset]
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor
type IMTLMotionKeyframeData ¶
type IMTLMotionKeyframeData interface {
objectivec.IObject
// The buffer that holds the geometry data.
Buffer() MTLBuffer
SetBuffer(value MTLBuffer)
// The offset, in bytes, to the keyframe data.
Offset() uint
SetOffset(value uint)
}
An interface definition for the MTLMotionKeyframeData class.
Specifying the keyframe data ¶
- [IMTLMotionKeyframeData.Buffer]: The buffer that holds the geometry data.
- [IMTLMotionKeyframeData.SetBuffer]
- [IMTLMotionKeyframeData.Offset]: The offset, in bytes, to the keyframe data.
- [IMTLMotionKeyframeData.SetOffset]
See: https://developer.apple.com/documentation/Metal/MTLMotionKeyframeData
type IMTLPipelineBufferDescriptor ¶
type IMTLPipelineBufferDescriptor interface {
objectivec.IObject
// A mutability option that determines whether you can update a buffer’s contents before related commands use the buffer.
Mutability() MTLMutability
SetMutability(value MTLMutability)
}
An interface definition for the MTLPipelineBufferDescriptor class.
Setting buffer mutability ¶
- [IMTLPipelineBufferDescriptor.Mutability]: A mutability option that determines whether you can update a buffer’s contents before related commands use the buffer.
- [IMTLPipelineBufferDescriptor.SetMutability]
See: https://developer.apple.com/documentation/Metal/MTLPipelineBufferDescriptor
type IMTLPipelineBufferDescriptorArray ¶
type IMTLPipelineBufferDescriptorArray interface {
objectivec.IObject
// Returns the pipeline buffer descriptor at the specified array index.
ObjectAtIndexedSubscript(bufferIndex uint) IMTLPipelineBufferDescriptor
// Sets a pipeline buffer descriptor at the specified array index.
SetObjectAtIndexedSubscript(buffer IMTLPipelineBufferDescriptor, bufferIndex uint)
}
An interface definition for the MTLPipelineBufferDescriptorArray class.
Accessing array elements ¶
- [IMTLPipelineBufferDescriptorArray.ObjectAtIndexedSubscript]: Returns the pipeline buffer descriptor at the specified array index.
See: https://developer.apple.com/documentation/Metal/MTLPipelineBufferDescriptorArray
type IMTLPointerType ¶
type IMTLPointerType interface {
IMTLType
// The required byte alignment in memory for the element data.
Alignment() uint
// The size, in bytes, of the element data.
DataSize() uint
// The data type of the element data.
ElementType() MTLDataType
// The function’s read/write access to the element data.
Access() MTLBindingAccess
// A Boolean value that indicates whether the element is an argument buffer.
ElementIsArgumentBuffer() bool
// Provides a description of the underlying array when the pointer points to an array.
ElementArrayType() IMTLArrayType
// Provides a description of the underlying struct when the pointer points to a struct.
ElementStructType() IMTLStructType
}
An interface definition for the MTLPointerType class.
Describing the pointer elements ¶
- [IMTLPointerType.Alignment]: The required byte alignment in memory for the element data.
- [IMTLPointerType.DataSize]: The size, in bytes, of the element data.
- [IMTLPointerType.ElementType]: The data type of the element data.
- [IMTLPointerType.Access]: The function’s read/write access to the element data.
- [IMTLPointerType.ElementIsArgumentBuffer]: A Boolean value that indicates whether the element is an argument buffer.
Obtaining details for complex pointer elements ¶
- [IMTLPointerType.ElementArrayType]: Provides a description of the underlying array when the pointer points to an array.
- [IMTLPointerType.ElementStructType]: Provides a description of the underlying struct when the pointer points to a struct.
See: https://developer.apple.com/documentation/Metal/MTLPointerType
type IMTLPrimitiveAccelerationStructureDescriptor ¶
type IMTLPrimitiveAccelerationStructureDescriptor interface {
IMTLAccelerationStructureDescriptor
// An array that contains the individual pieces of geometry that compose the acceleration structure.
GeometryDescriptors() []MTLAccelerationStructureGeometryDescriptor
SetGeometryDescriptors(value []MTLAccelerationStructureGeometryDescriptor)
// The number of keyframes in the geometry data.
MotionKeyframeCount() uint
SetMotionKeyframeCount(value uint)
// The start time for the range of motion that the keyframe data describes.
MotionStartTime() float32
SetMotionStartTime(value float32)
// The end time for the range of motion that the keyframe data describes.
MotionEndTime() float32
SetMotionEndTime(value float32)
// The mode to use when handling timestamps before the start time.
MotionStartBorderMode() MTLMotionBorderMode
SetMotionStartBorderMode(value MTLMotionBorderMode)
// The mode to use when handling timestamps after the end time.
MotionEndBorderMode() MTLMotionBorderMode
SetMotionEndBorderMode(value MTLMotionBorderMode)
}
An interface definition for the MTLPrimitiveAccelerationStructureDescriptor class.
Specifying geometry ¶
- [IMTLPrimitiveAccelerationStructureDescriptor.GeometryDescriptors]: An array that contains the individual pieces of geometry that compose the acceleration structure.
- [IMTLPrimitiveAccelerationStructureDescriptor.SetGeometryDescriptors]
Specifying motion behavior ¶
- [IMTLPrimitiveAccelerationStructureDescriptor.MotionKeyframeCount]: The number of keyframes in the geometry data.
- [IMTLPrimitiveAccelerationStructureDescriptor.SetMotionKeyframeCount]
- [IMTLPrimitiveAccelerationStructureDescriptor.MotionStartTime]: The start time for the range of motion that the keyframe data describes.
- [IMTLPrimitiveAccelerationStructureDescriptor.SetMotionStartTime]
- [IMTLPrimitiveAccelerationStructureDescriptor.MotionEndTime]: The end time for the range of motion that the keyframe data describes.
- [IMTLPrimitiveAccelerationStructureDescriptor.SetMotionEndTime]
- [IMTLPrimitiveAccelerationStructureDescriptor.MotionStartBorderMode]: The mode to use when handling timestamps before the start time.
- [IMTLPrimitiveAccelerationStructureDescriptor.SetMotionStartBorderMode]
- [IMTLPrimitiveAccelerationStructureDescriptor.MotionEndBorderMode]: The mode to use when handling timestamps after the end time.
- [IMTLPrimitiveAccelerationStructureDescriptor.SetMotionEndBorderMode]
See: https://developer.apple.com/documentation/Metal/MTLPrimitiveAccelerationStructureDescriptor
type IMTLRasterizationRateLayerArray ¶
type IMTLRasterizationRateLayerArray interface {
objectivec.IObject
// Retrieves the sample value at the specified index.
ObjectAtIndexedSubscript(layerIndex uint) IMTLRasterizationRateLayerDescriptor
// The number of layers in the rate map.
LayerCount() int
SetLayerCount(value int)
// The rasterization rates for one or more layers in the rate map.
Layers() IMTLRasterizationRateLayerArray
SetLayers(value IMTLRasterizationRateLayerArray)
// Stores a sample value at the specified index.
SetObjectAtIndexedSubscript(layer IMTLRasterizationRateLayerDescriptor, layerIndex uint)
}
An interface definition for the MTLRasterizationRateLayerArray class.
Accessing members of the array ¶
- [IMTLRasterizationRateLayerArray.ObjectAtIndexedSubscript]: Retrieves the sample value at the specified index.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerArray
type IMTLRasterizationRateLayerDescriptor ¶
type IMTLRasterizationRateLayerDescriptor interface {
objectivec.IObject
// Initializes the layer map with an empty grid.
InitWithSampleCount(sampleCount MTLSize) MTLRasterizationRateLayerDescriptor
// The number of rows and columns in the layer map.
SampleCount() MTLSize
// The maximum number of rows and columns in the layer map.
MaxSampleCount() MTLSize
// The horizontal rasterization rates for the layer map’s rows.
Horizontal() IMTLRasterizationRateSampleArray
// The vertical rasterization rates for the layer map’s rows.
Vertical() IMTLRasterizationRateSampleArray
// A pointer to the storage for the layer map’s horizontal rasterization rates.
HorizontalSampleStorage() unsafe.Pointer
// A pointer to the storage for the layer map’s vertical rasterization rates.
VerticalSampleStorage() unsafe.Pointer
// Initializes the layer map with the provided grid size and rasterization rates.
InitWithSampleCountHorizontalVertical(sampleCount MTLSize, horizontal unsafe.Pointer, vertical unsafe.Pointer) MTLRasterizationRateLayerDescriptor
}
An interface definition for the MTLRasterizationRateLayerDescriptor class.
Creating a layer rasterization rate descriptor ¶
- [IMTLRasterizationRateLayerDescriptor.InitWithSampleCount]: Initializes the layer map with an empty grid.
Inspecting the layer rate function parameters ¶
- [IMTLRasterizationRateLayerDescriptor.SampleCount]: The number of rows and columns in the layer map.
- [IMTLRasterizationRateLayerDescriptor.MaxSampleCount]: The maximum number of rows and columns in the layer map.
- [IMTLRasterizationRateLayerDescriptor.Horizontal]: The horizontal rasterization rates for the layer map’s rows.
- [IMTLRasterizationRateLayerDescriptor.Vertical]: The vertical rasterization rates for the layer map’s rows.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerDescriptor
type IMTLRasterizationRateMapDescriptor ¶
type IMTLRasterizationRateMapDescriptor interface {
objectivec.IObject
// A string used to identify the rate map you create with the descriptor.
Label() string
SetLabel(value string)
// The size of the viewport coordinate system, in logical pixels.
ScreenSize() MTLSize
SetScreenSize(value MTLSize)
// The number of layers in the rate map.
LayerCount() uint
// Returns the layer description for a layer in the rate map.
LayerAtIndex(layerIndex uint) IMTLRasterizationRateLayerDescriptor
// Sets a configuration for a layer rate map.
SetLayerAtIndex(layer IMTLRasterizationRateLayerDescriptor, layerIndex uint)
// The rasterization rates for one or more layers in the rate map.
Layers() IMTLRasterizationRateLayerArray
}
An interface definition for the MTLRasterizationRateMapDescriptor class.
Identifying the rate map ¶
- [IMTLRasterizationRateMapDescriptor.Label]: A string used to identify the rate map you create with the descriptor.
- [IMTLRasterizationRateMapDescriptor.SetLabel]
Configuring the viewport size ¶
- [IMTLRasterizationRateMapDescriptor.ScreenSize]: The size of the viewport coordinate system, in logical pixels.
- [IMTLRasterizationRateMapDescriptor.SetScreenSize]
Configuring the rate map layers ¶
- [IMTLRasterizationRateMapDescriptor.LayerCount]: The number of layers in the rate map.
- [IMTLRasterizationRateMapDescriptor.LayerAtIndex]: Returns the layer description for a layer in the rate map.
- [IMTLRasterizationRateMapDescriptor.SetLayerAtIndex]: Sets a configuration for a layer rate map.
- [IMTLRasterizationRateMapDescriptor.Layers]: The rasterization rates for one or more layers in the rate map.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor
type IMTLRasterizationRateSampleArray ¶
type IMTLRasterizationRateSampleArray interface {
objectivec.IObject
// The horizontal rasterization rates for the layer map’s rows.
Horizontal() IMTLRasterizationRateSampleArray
SetHorizontal(value IMTLRasterizationRateSampleArray)
// The maximum number of rows and columns in the layer map.
MaxSampleCount() MTLSize
SetMaxSampleCount(value MTLSize)
// The number of rows and columns in the layer map.
SampleCount() MTLSize
SetSampleCount(value MTLSize)
// The vertical rasterization rates for the layer map’s rows.
Vertical() IMTLRasterizationRateSampleArray
SetVertical(value IMTLRasterizationRateSampleArray)
// Retrieves the sample value at the specified index.
ObjectAtIndexedSubscript(index uint) foundation.NSNumber
// Stores a sample value at the specified index.
SetObjectAtIndexedSubscript(value foundation.NSNumber, index uint)
}
An interface definition for the MTLRasterizationRateSampleArray class.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateSampleArray
type IMTLRenderPassAttachmentDescriptor ¶
type IMTLRenderPassAttachmentDescriptor interface {
objectivec.IObject
// The texture object associated with this attachment.
Texture() MTLTexture
SetTexture(value MTLTexture)
// The mipmap level of the texture used for rendering to the attachment.
Level() uint
SetLevel(value uint)
// The slice of the texture used for rendering to the attachment.
Slice() uint
SetSlice(value uint)
// The depth plane of the texture used for rendering to the attachment.
DepthPlane() uint
SetDepthPlane(value uint)
// The action performed by this attachment at the start of a rendering pass for a render command encoder.
LoadAction() MTLLoadAction
SetLoadAction(value MTLLoadAction)
// The action performed by this attachment at the end of a rendering pass for a render command encoder.
StoreAction() MTLStoreAction
SetStoreAction(value MTLStoreAction)
// The options that modify the store action performed by this attachment.
StoreActionOptions() MTLStoreActionOptions
SetStoreActionOptions(value MTLStoreActionOptions)
// The destination texture used when resolving multisampled texture data into single sample values.
ResolveTexture() MTLTexture
SetResolveTexture(value MTLTexture)
// The mipmap level of the texture used for the multisample resolve action.
ResolveLevel() uint
SetResolveLevel(value uint)
// The slice of the texture used for the multisample resolve action.
ResolveSlice() uint
SetResolveSlice(value uint)
// The depth plane of the texture used for the multisample resolve action.
ResolveDepthPlane() uint
SetResolveDepthPlane(value uint)
}
An interface definition for the MTLRenderPassAttachmentDescriptor class.
Specifying the texture for the attachment ¶
- [IMTLRenderPassAttachmentDescriptor.Texture]: The texture object associated with this attachment.
- [IMTLRenderPassAttachmentDescriptor.SetTexture]
- [IMTLRenderPassAttachmentDescriptor.Level]: The mipmap level of the texture used for rendering to the attachment.
- [IMTLRenderPassAttachmentDescriptor.SetLevel]
- [IMTLRenderPassAttachmentDescriptor.Slice]: The slice of the texture used for rendering to the attachment.
- [IMTLRenderPassAttachmentDescriptor.SetSlice]
- [IMTLRenderPassAttachmentDescriptor.DepthPlane]: The depth plane of the texture used for rendering to the attachment.
- [IMTLRenderPassAttachmentDescriptor.SetDepthPlane]
Specifying rendering pass actions ¶
- [IMTLRenderPassAttachmentDescriptor.LoadAction]: The action performed by this attachment at the start of a rendering pass for a render command encoder.
- [IMTLRenderPassAttachmentDescriptor.SetLoadAction]
- [IMTLRenderPassAttachmentDescriptor.StoreAction]: The action performed by this attachment at the end of a rendering pass for a render command encoder.
- [IMTLRenderPassAttachmentDescriptor.SetStoreAction]
- [IMTLRenderPassAttachmentDescriptor.StoreActionOptions]: The options that modify the store action performed by this attachment.
- [IMTLRenderPassAttachmentDescriptor.SetStoreActionOptions]
Specifying the texture to resolve multisample data ¶
- [IMTLRenderPassAttachmentDescriptor.ResolveTexture]: The destination texture used when resolving multisampled texture data into single sample values.
- [IMTLRenderPassAttachmentDescriptor.SetResolveTexture]
- [IMTLRenderPassAttachmentDescriptor.ResolveLevel]: The mipmap level of the texture used for the multisample resolve action.
- [IMTLRenderPassAttachmentDescriptor.SetResolveLevel]
- [IMTLRenderPassAttachmentDescriptor.ResolveSlice]: The slice of the texture used for the multisample resolve action.
- [IMTLRenderPassAttachmentDescriptor.SetResolveSlice]
- [IMTLRenderPassAttachmentDescriptor.ResolveDepthPlane]: The depth plane of the texture used for the multisample resolve action.
- [IMTLRenderPassAttachmentDescriptor.SetResolveDepthPlane]
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor
type IMTLRenderPassColorAttachmentDescriptor ¶
type IMTLRenderPassColorAttachmentDescriptor interface {
IMTLRenderPassAttachmentDescriptor
// The color to use when clearing the color attachment.
ClearColor() MTLClearColor
SetClearColor(value MTLClearColor)
}
An interface definition for the MTLRenderPassColorAttachmentDescriptor class.
Specifying clearing value ¶
- [IMTLRenderPassColorAttachmentDescriptor.ClearColor]: The color to use when clearing the color attachment.
- [IMTLRenderPassColorAttachmentDescriptor.SetClearColor]
See: https://developer.apple.com/documentation/Metal/MTLRenderPassColorAttachmentDescriptor
type IMTLRenderPassColorAttachmentDescriptorArray ¶
type IMTLRenderPassColorAttachmentDescriptorArray interface {
objectivec.IObject
// Returns the descriptor object for the specified color attachment.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPassColorAttachmentDescriptor
// Sets the descriptor for the specified color attachment.
SetObjectAtIndexedSubscript(attachment IMTLRenderPassColorAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLRenderPassColorAttachmentDescriptorArray class.
Accessing the description of a color attachment ¶
- [IMTLRenderPassColorAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Returns the descriptor object for the specified color attachment.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassColorAttachmentDescriptorArray
type IMTLRenderPassDepthAttachmentDescriptor ¶
type IMTLRenderPassDepthAttachmentDescriptor interface {
IMTLRenderPassAttachmentDescriptor
// The depth to use when clearing the depth attachment.
ClearDepth() float64
SetClearDepth(value float64)
// The filter used for an MSAA depth resolve operation.
DepthResolveFilter() MTLMultisampleDepthResolveFilter
SetDepthResolveFilter(value MTLMultisampleDepthResolveFilter)
}
An interface definition for the MTLRenderPassDepthAttachmentDescriptor class.
Specifying clearing value ¶
- [IMTLRenderPassDepthAttachmentDescriptor.ClearDepth]: The depth to use when clearing the depth attachment.
- [IMTLRenderPassDepthAttachmentDescriptor.SetClearDepth]
MSAA depth resolve ¶
- [IMTLRenderPassDepthAttachmentDescriptor.DepthResolveFilter]: The filter used for an MSAA depth resolve operation.
- [IMTLRenderPassDepthAttachmentDescriptor.SetDepthResolveFilter]
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDepthAttachmentDescriptor
type IMTLRenderPassDescriptor ¶
type IMTLRenderPassDescriptor interface {
objectivec.IObject
// An array of state information for attachments that store color data.
ColorAttachments() IMTLRenderPassColorAttachmentDescriptorArray
// State information for an attachment that stores depth data.
DepthAttachment() IMTLRenderPassDepthAttachmentDescriptor
SetDepthAttachment(value IMTLRenderPassDepthAttachmentDescriptor)
// State information for an attachment that stores stencil data.
StencilAttachment() IMTLRenderPassStencilAttachmentDescriptor
SetStencilAttachment(value IMTLRenderPassStencilAttachmentDescriptor)
// A buffer where the GPU writes visibility test results when fragments pass depth and stencil tests.
VisibilityResultBuffer() MTLBuffer
SetVisibilityResultBuffer(value MTLBuffer)
// The number of active layers that all attachments need to have for layered rendering.
RenderTargetArrayLength() uint
SetRenderTargetArrayLength(value uint)
// The width, in pixels, to constrain the render target to.
RenderTargetWidth() uint
SetRenderTargetWidth(value uint)
// The height, in pixels, to constrain the render target to.
RenderTargetHeight() uint
SetRenderTargetHeight(value uint)
// The per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
ImageblockSampleLength() uint
SetImageblockSampleLength(value uint)
// The per-tile size, in bytes, of the persistent threadgroup memory allocation.
ThreadgroupMemoryLength() uint
SetThreadgroupMemoryLength(value uint)
// The tile width, in pixels.
TileWidth() uint
SetTileWidth(value uint)
// The tile height, in pixels.
TileHeight() uint
SetTileHeight(value uint)
// The raster sample count for the render pass when the render pass doesn’t have explicit attachments.
DefaultRasterSampleCount() uint
SetDefaultRasterSampleCount(value uint)
// The rasterization rate map to use when executing the render pass.
RasterizationRateMap() MTLRasterizationRateMap
SetRasterizationRateMap(value MTLRasterizationRateMap)
// The array of sample buffers that the render pass can access.
SampleBufferAttachments() IMTLRenderPassSampleBufferAttachmentDescriptorArray
// Specifies if the render pass should support color attachment mapping.
SupportColorAttachmentMapping() bool
SetSupportColorAttachmentMapping(value bool)
// Specifies if Metal accumulates visibility results between render encoders or resets them.
VisibilityResultType() MTLVisibilityResultType
SetVisibilityResultType(value MTLVisibilityResultType)
// An option for rendering to the texture in a render pass.
RenderTarget() MTLTextureUsage
SetRenderTarget(value MTLTextureUsage)
// Options that determine how you can use the texture.
Usage() MTLTextureUsage
SetUsage(value MTLTextureUsage)
// Retrieves the programmable sample positions set for a render pass.
GetSamplePositionsCount(positions []MTLSamplePosition, count uint) uint
// Sets the programmable sample positions for a render pass.
SetSamplePositionsCount(positions []MTLSamplePosition, count uint)
}
An interface definition for the MTLRenderPassDescriptor class.
Specifying the attachments for a rendering pass ¶
- [IMTLRenderPassDescriptor.ColorAttachments]: An array of state information for attachments that store color data.
- [IMTLRenderPassDescriptor.DepthAttachment]: State information for an attachment that stores depth data.
- [IMTLRenderPassDescriptor.SetDepthAttachment]
- [IMTLRenderPassDescriptor.StencilAttachment]: State information for an attachment that stores stencil data.
- [IMTLRenderPassDescriptor.SetStencilAttachment]
Specifying the visibility result buffer ¶
- [IMTLRenderPassDescriptor.VisibilityResultBuffer]: A buffer where the GPU writes visibility test results when fragments pass depth and stencil tests.
- [IMTLRenderPassDescriptor.SetVisibilityResultBuffer]
Layered rendering ¶
- [IMTLRenderPassDescriptor.RenderTargetArrayLength]: The number of active layers that all attachments need to have for layered rendering.
- [IMTLRenderPassDescriptor.SetRenderTargetArrayLength]
- [IMTLRenderPassDescriptor.RenderTargetWidth]: The width, in pixels, to constrain the render target to.
- [IMTLRenderPassDescriptor.SetRenderTargetWidth]
- [IMTLRenderPassDescriptor.RenderTargetHeight]: The height, in pixels, to constrain the render target to.
- [IMTLRenderPassDescriptor.SetRenderTargetHeight]
Specifying tile shading parameters ¶
- [IMTLRenderPassDescriptor.ImageblockSampleLength]: The per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
- [IMTLRenderPassDescriptor.SetImageblockSampleLength]
- [IMTLRenderPassDescriptor.ThreadgroupMemoryLength]: The per-tile size, in bytes, of the persistent threadgroup memory allocation.
- [IMTLRenderPassDescriptor.SetThreadgroupMemoryLength]
- [IMTLRenderPassDescriptor.TileWidth]: The tile width, in pixels.
- [IMTLRenderPassDescriptor.SetTileWidth]
- [IMTLRenderPassDescriptor.TileHeight]: The tile height, in pixels.
- [IMTLRenderPassDescriptor.SetTileHeight]
Specifying sample counts ¶
- [IMTLRenderPassDescriptor.DefaultRasterSampleCount]: The raster sample count for the render pass when the render pass doesn’t have explicit attachments.
- [IMTLRenderPassDescriptor.SetDefaultRasterSampleCount]
Specifying a rasterization rate map ¶
- [IMTLRenderPassDescriptor.RasterizationRateMap]: The rasterization rate map to use when executing the render pass.
- [IMTLRenderPassDescriptor.SetRasterizationRateMap]
Specifying sample buffers for GPU counters ¶
- [IMTLRenderPassDescriptor.SampleBufferAttachments]: The array of sample buffers that the render pass can access.
Instance Properties ¶
- [IMTLRenderPassDescriptor.SupportColorAttachmentMapping]: Specifies if the render pass should support color attachment mapping.
- [IMTLRenderPassDescriptor.SetSupportColorAttachmentMapping]
- [IMTLRenderPassDescriptor.VisibilityResultType]: Specifies if Metal accumulates visibility results between render encoders or resets them.
- [IMTLRenderPassDescriptor.SetVisibilityResultType]
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor
type IMTLRenderPassSampleBufferAttachmentDescriptor ¶
type IMTLRenderPassSampleBufferAttachmentDescriptor interface {
objectivec.IObject
// A specialized memory buffer that the GPU uses to store its counter data during the render pass.
SampleBuffer() MTLCounterSampleBuffer
SetSampleBuffer(value MTLCounterSampleBuffer)
// The index the Metal device object should use to store GPU counters when starting the render pass’s vertex stage.
StartOfVertexSampleIndex() uint
SetStartOfVertexSampleIndex(value uint)
// The index the Metal device object should use to store GPU counters when ending the render pass’s vertex stage.
EndOfVertexSampleIndex() uint
SetEndOfVertexSampleIndex(value uint)
// The index the Metal device object should use to store GPU counters when starting the render pass’s fragment stage.
StartOfFragmentSampleIndex() uint
SetStartOfFragmentSampleIndex(value uint)
// The index the Metal device object should use to store GPU counters when ending the render pass’s fragment stage.
EndOfFragmentSampleIndex() uint
SetEndOfFragmentSampleIndex(value uint)
}
An interface definition for the MTLRenderPassSampleBufferAttachmentDescriptor class.
Configuring the sample buffer attachment ¶
- [IMTLRenderPassSampleBufferAttachmentDescriptor.SampleBuffer]: A specialized memory buffer that the GPU uses to store its counter data during the render pass.
- [IMTLRenderPassSampleBufferAttachmentDescriptor.SetSampleBuffer]
- [IMTLRenderPassSampleBufferAttachmentDescriptor.StartOfVertexSampleIndex]: The index the Metal device object should use to store GPU counters when starting the render pass’s vertex stage.
- [IMTLRenderPassSampleBufferAttachmentDescriptor.SetStartOfVertexSampleIndex]
- [IMTLRenderPassSampleBufferAttachmentDescriptor.EndOfVertexSampleIndex]: The index the Metal device object should use to store GPU counters when ending the render pass’s vertex stage.
- [IMTLRenderPassSampleBufferAttachmentDescriptor.SetEndOfVertexSampleIndex]
- [IMTLRenderPassSampleBufferAttachmentDescriptor.StartOfFragmentSampleIndex]: The index the Metal device object should use to store GPU counters when starting the render pass’s fragment stage.
- [IMTLRenderPassSampleBufferAttachmentDescriptor.SetStartOfFragmentSampleIndex]
- [IMTLRenderPassSampleBufferAttachmentDescriptor.EndOfFragmentSampleIndex]: The index the Metal device object should use to store GPU counters when ending the render pass’s fragment stage.
- [IMTLRenderPassSampleBufferAttachmentDescriptor.SetEndOfFragmentSampleIndex]
See: https://developer.apple.com/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptor
type IMTLRenderPassSampleBufferAttachmentDescriptorArray ¶
type IMTLRenderPassSampleBufferAttachmentDescriptorArray interface {
objectivec.IObject
// Returns the descriptor object for the specified sample buffer attachment.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPassSampleBufferAttachmentDescriptor
// Sets the descriptor object for the specified sample buffer attachment.
SetObjectAtIndexedSubscript(attachment IMTLRenderPassSampleBufferAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLRenderPassSampleBufferAttachmentDescriptorArray class.
Accessing a sample buffer attachment ¶
- [IMTLRenderPassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Returns the descriptor object for the specified sample buffer attachment.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptorArray
type IMTLRenderPassStencilAttachmentDescriptor ¶
type IMTLRenderPassStencilAttachmentDescriptor interface {
IMTLRenderPassAttachmentDescriptor
// The filter used for stencil multisample resolve.
StencilResolveFilter() MTLMultisampleStencilResolveFilter
SetStencilResolveFilter(value MTLMultisampleStencilResolveFilter)
// The value to use when clearing the stencil attachment.
ClearStencil() uint32
SetClearStencil(value uint32)
}
An interface definition for the MTLRenderPassStencilAttachmentDescriptor class.
Specifying the resolve filter ¶
- [IMTLRenderPassStencilAttachmentDescriptor.StencilResolveFilter]: The filter used for stencil multisample resolve.
- [IMTLRenderPassStencilAttachmentDescriptor.SetStencilResolveFilter]
Specifying the stencil clear value ¶
- [IMTLRenderPassStencilAttachmentDescriptor.ClearStencil]: The value to use when clearing the stencil attachment.
- [IMTLRenderPassStencilAttachmentDescriptor.SetClearStencil]
See: https://developer.apple.com/documentation/Metal/MTLRenderPassStencilAttachmentDescriptor
type IMTLRenderPipelineColorAttachmentDescriptor ¶
type IMTLRenderPipelineColorAttachmentDescriptor interface {
objectivec.IObject
// The pixel format of the color attachment’s texture.
PixelFormat() MTLPixelFormat
SetPixelFormat(value MTLPixelFormat)
// A bitmask that restricts which color channels are written into the texture.
WriteMask() MTLColorWriteMask
SetWriteMask(value MTLColorWriteMask)
// A Boolean value that determines whether blending is enabled.
BlendingEnabled() bool
SetBlendingEnabled(value bool)
// The blend operation assigned for the alpha data.
AlphaBlendOperation() MTLBlendOperation
SetAlphaBlendOperation(value MTLBlendOperation)
// The blend operation assigned for the RGB data.
RgbBlendOperation() MTLBlendOperation
SetRgbBlendOperation(value MTLBlendOperation)
// The destination blend factor (DBF) used by the alpha blend operation.
DestinationAlphaBlendFactor() MTLBlendFactor
SetDestinationAlphaBlendFactor(value MTLBlendFactor)
// The destination blend factor (DBF) used by the RGB blend operation.
DestinationRGBBlendFactor() MTLBlendFactor
SetDestinationRGBBlendFactor(value MTLBlendFactor)
// The source blend factor (SBF) used by the alpha blend operation.
SourceAlphaBlendFactor() MTLBlendFactor
SetSourceAlphaBlendFactor(value MTLBlendFactor)
// The source blend factor (SBF) used by the RGB blend operation.
SourceRGBBlendFactor() MTLBlendFactor
SetSourceRGBBlendFactor(value MTLBlendFactor)
// All color channels are enabled.
All() MTLColorWriteMask
SetAll(value MTLColorWriteMask)
}
An interface definition for the MTLRenderPipelineColorAttachmentDescriptor class.
Configuring render pipeline states ¶
- [IMTLRenderPipelineColorAttachmentDescriptor.PixelFormat]: The pixel format of the color attachment’s texture.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetPixelFormat]
- [IMTLRenderPipelineColorAttachmentDescriptor.WriteMask]: A bitmask that restricts which color channels are written into the texture.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetWriteMask]
Controlling blend operations ¶
- [IMTLRenderPipelineColorAttachmentDescriptor.BlendingEnabled]: A Boolean value that determines whether blending is enabled.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetBlendingEnabled]
- [IMTLRenderPipelineColorAttachmentDescriptor.AlphaBlendOperation]: The blend operation assigned for the alpha data.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetAlphaBlendOperation]
- [IMTLRenderPipelineColorAttachmentDescriptor.RgbBlendOperation]: The blend operation assigned for the RGB data.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetRgbBlendOperation]
Configuring blend factors ¶
- [IMTLRenderPipelineColorAttachmentDescriptor.DestinationAlphaBlendFactor]: The destination blend factor (DBF) used by the alpha blend operation.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetDestinationAlphaBlendFactor]
- [IMTLRenderPipelineColorAttachmentDescriptor.DestinationRGBBlendFactor]: The destination blend factor (DBF) used by the RGB blend operation.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetDestinationRGBBlendFactor]
- [IMTLRenderPipelineColorAttachmentDescriptor.SourceAlphaBlendFactor]: The source blend factor (SBF) used by the alpha blend operation.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetSourceAlphaBlendFactor]
- [IMTLRenderPipelineColorAttachmentDescriptor.SourceRGBBlendFactor]: The source blend factor (SBF) used by the RGB blend operation.
- [IMTLRenderPipelineColorAttachmentDescriptor.SetSourceRGBBlendFactor]
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineColorAttachmentDescriptor
type IMTLRenderPipelineColorAttachmentDescriptorArray ¶
type IMTLRenderPipelineColorAttachmentDescriptorArray interface {
objectivec.IObject
// Returns the render pipeline state for the specified color attachment.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPipelineColorAttachmentDescriptor
// Sets the render pipeline state for a specified color attachment.
SetObjectAtIndexedSubscript(attachment IMTLRenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLRenderPipelineColorAttachmentDescriptorArray class.
Accessing render pipeline state for a color attachment ¶
- [IMTLRenderPipelineColorAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Returns the render pipeline state for the specified color attachment.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineColorAttachmentDescriptorArray
type IMTLRenderPipelineDescriptor ¶
type IMTLRenderPipelineDescriptor interface {
objectivec.IObject
// A string that identifies the render pipeline descriptor.
Label() string
SetLabel(value string)
// The vertex function the pipeline calls to process vertices.
VertexFunction() MTLFunction
SetVertexFunction(value MTLFunction)
// The fragment function the pipeline calls to process fragments.
FragmentFunction() MTLFunction
SetFragmentFunction(value MTLFunction)
// The maximum function call depth from the top-most vertex shader function.
MaxVertexCallStackDepth() uint
SetMaxVertexCallStackDepth(value uint)
// The maximum function call depth from the top-most fragment shader function.
MaxFragmentCallStackDepth() uint
SetMaxFragmentCallStackDepth(value uint)
// The organization of vertex data in an attribute’s argument table.
VertexDescriptor() IMTLVertexDescriptor
SetVertexDescriptor(value IMTLVertexDescriptor)
// An array that contains the buffer mutability options for a render pipeline’s vertex function.
VertexBuffers() IMTLPipelineBufferDescriptorArray
// An array that contains the buffer mutability options for a render pipeline’s fragment function.
FragmentBuffers() IMTLPipelineBufferDescriptorArray
// Specifies the default rendering pipeline state values for the descriptor.
Reset()
// An array of attachments that store color data.
ColorAttachments() IMTLRenderPipelineColorAttachmentDescriptorArray
// The pixel format of the attachment that stores depth data.
DepthAttachmentPixelFormat() MTLPixelFormat
SetDepthAttachmentPixelFormat(value MTLPixelFormat)
// The pixel format of the attachment that stores stencil data.
StencilAttachmentPixelFormat() MTLPixelFormat
SetStencilAttachmentPixelFormat(value MTLPixelFormat)
// A Boolean value that indicates whether to read and use the alpha channel fragment output for color attachments to compute a sample coverage mask.
AlphaToCoverageEnabled() bool
SetAlphaToCoverageEnabled(value bool)
// A Boolean value that indicates whether to force alpha channel values for color attachments to the largest representable value.
AlphaToOneEnabled() bool
SetAlphaToOneEnabled(value bool)
// A Boolean value that determines whether the pipeline rasterizes primitives.
RasterizationEnabled() bool
SetRasterizationEnabled(value bool)
// The type of primitive topology the pipeline renders.
InputPrimitiveTopology() MTLPrimitiveTopologyClass
SetInputPrimitiveTopology(value MTLPrimitiveTopologyClass)
// The number of samples the pipeline applies for each fragment.
RasterSampleCount() uint
SetRasterSampleCount(value uint)
// The maximum tessellation factor that the tessellator uses when tessellating patches.
MaxTessellationFactor() uint
SetMaxTessellationFactor(value uint)
// A Boolean value that determines whether the pipeline scales the tessellation factor.
TessellationFactorScaleEnabled() bool
SetTessellationFactorScaleEnabled(value bool)
// The format of the tessellation factors in the tessellation factor buffer.
TessellationFactorFormat() MTLTessellationFactorFormat
SetTessellationFactorFormat(value MTLTessellationFactorFormat)
// The size of the control point indices in a control point index buffer.
TessellationControlPointIndexType() MTLTessellationControlPointIndexType
SetTessellationControlPointIndexType(value MTLTessellationControlPointIndexType)
// The step function for determining the tessellation factors for a patch from the tessellation factor buffer.
TessellationFactorStepFunction() MTLTessellationFactorStepFunction
SetTessellationFactorStepFunction(value MTLTessellationFactorStepFunction)
// The winding order of triangles from the tessellator.
TessellationOutputWindingOrder() MTLWinding
SetTessellationOutputWindingOrder(value MTLWinding)
// The partitioning mode that the tessellator uses to derive the number and spacing of segments for subdividing a corresponding edge.
TessellationPartitionMode() MTLTessellationPartitionMode
SetTessellationPartitionMode(value MTLTessellationPartitionMode)
// A Boolean value that determines whether you can encode commands into an indirect command buffer using the render pipeline.
SupportIndirectCommandBuffers() bool
SetSupportIndirectCommandBuffers(value bool)
// The maximum vertex amplification count you can set when encoding render commands.
MaxVertexAmplificationCount() uint
SetMaxVertexAmplificationCount(value uint)
// A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the vertex shader’s callable functions list.
SupportAddingVertexBinaryFunctions() bool
SetSupportAddingVertexBinaryFunctions(value bool)
// A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader’s callable functions list.
SupportAddingFragmentBinaryFunctions() bool
SetSupportAddingFragmentBinaryFunctions(value bool)
// An array of binary archives to search for precompiled versions of the shader.
BinaryArchives() []objectivec.IObject
SetBinaryArchives(value []objectivec.IObject)
// Functions that you can specify as function arguments for the vertex shader when encoding commands that use the pipeline.
VertexLinkedFunctions() IMTLLinkedFunctions
SetVertexLinkedFunctions(value IMTLLinkedFunctions)
// Functions that you can specify as function arguments for the fragment shader when encoding commands that use the pipeline.
FragmentLinkedFunctions() IMTLLinkedFunctions
SetFragmentLinkedFunctions(value IMTLLinkedFunctions)
// A value that enables or disables shader validation for the pipeline.
ShaderValidation() MTLShaderValidation
SetShaderValidation(value MTLShaderValidation)
FragmentPreloadedLibraries() []objectivec.IObject
SetFragmentPreloadedLibraries(value []objectivec.IObject)
VertexPreloadedLibraries() []objectivec.IObject
SetVertexPreloadedLibraries(value []objectivec.IObject)
}
An interface definition for the MTLRenderPipelineDescriptor class.
Identifying the render pipeline state object ¶
- [IMTLRenderPipelineDescriptor.Label]: A string that identifies the render pipeline descriptor.
- [IMTLRenderPipelineDescriptor.SetLabel]
Specifying graphics functions and associated data ¶
- [IMTLRenderPipelineDescriptor.VertexFunction]: The vertex function the pipeline calls to process vertices.
- [IMTLRenderPipelineDescriptor.SetVertexFunction]
- [IMTLRenderPipelineDescriptor.FragmentFunction]: The fragment function the pipeline calls to process fragments.
- [IMTLRenderPipelineDescriptor.SetFragmentFunction]
- [IMTLRenderPipelineDescriptor.MaxVertexCallStackDepth]: The maximum function call depth from the top-most vertex shader function.
- [IMTLRenderPipelineDescriptor.SetMaxVertexCallStackDepth]
- [IMTLRenderPipelineDescriptor.MaxFragmentCallStackDepth]: The maximum function call depth from the top-most fragment shader function.
- [IMTLRenderPipelineDescriptor.SetMaxFragmentCallStackDepth]
Specifying buffer layouts and fetch behavior ¶
- [IMTLRenderPipelineDescriptor.VertexDescriptor]: The organization of vertex data in an attribute’s argument table.
- [IMTLRenderPipelineDescriptor.SetVertexDescriptor]
Specifying buffer mutability ¶
- [IMTLRenderPipelineDescriptor.VertexBuffers]: An array that contains the buffer mutability options for a render pipeline’s vertex function.
- [IMTLRenderPipelineDescriptor.FragmentBuffers]: An array that contains the buffer mutability options for a render pipeline’s fragment function.
Specifying rendering pipeline state ¶
- [IMTLRenderPipelineDescriptor.Reset]: Specifies the default rendering pipeline state values for the descriptor.
- [IMTLRenderPipelineDescriptor.ColorAttachments]: An array of attachments that store color data.
- [IMTLRenderPipelineDescriptor.DepthAttachmentPixelFormat]: The pixel format of the attachment that stores depth data.
- [IMTLRenderPipelineDescriptor.SetDepthAttachmentPixelFormat]
- [IMTLRenderPipelineDescriptor.StencilAttachmentPixelFormat]: The pixel format of the attachment that stores stencil data.
- [IMTLRenderPipelineDescriptor.SetStencilAttachmentPixelFormat]
Specifying rasterization and visibility state ¶
- [IMTLRenderPipelineDescriptor.AlphaToCoverageEnabled]: A Boolean value that indicates whether to read and use the alpha channel fragment output for color attachments to compute a sample coverage mask.
- [IMTLRenderPipelineDescriptor.SetAlphaToCoverageEnabled]
- [IMTLRenderPipelineDescriptor.AlphaToOneEnabled]: A Boolean value that indicates whether to force alpha channel values for color attachments to the largest representable value.
- [IMTLRenderPipelineDescriptor.SetAlphaToOneEnabled]
- [IMTLRenderPipelineDescriptor.RasterizationEnabled]: A Boolean value that determines whether the pipeline rasterizes primitives.
- [IMTLRenderPipelineDescriptor.SetRasterizationEnabled]
- [IMTLRenderPipelineDescriptor.InputPrimitiveTopology]: The type of primitive topology the pipeline renders.
- [IMTLRenderPipelineDescriptor.SetInputPrimitiveTopology]
- [IMTLRenderPipelineDescriptor.RasterSampleCount]: The number of samples the pipeline applies for each fragment.
- [IMTLRenderPipelineDescriptor.SetRasterSampleCount]
Specifying tessellation state ¶
- [IMTLRenderPipelineDescriptor.MaxTessellationFactor]: The maximum tessellation factor that the tessellator uses when tessellating patches.
- [IMTLRenderPipelineDescriptor.SetMaxTessellationFactor]
- [IMTLRenderPipelineDescriptor.TessellationFactorScaleEnabled]: A Boolean value that determines whether the pipeline scales the tessellation factor.
- [IMTLRenderPipelineDescriptor.SetTessellationFactorScaleEnabled]
- [IMTLRenderPipelineDescriptor.TessellationFactorFormat]: The format of the tessellation factors in the tessellation factor buffer.
- [IMTLRenderPipelineDescriptor.SetTessellationFactorFormat]
- [IMTLRenderPipelineDescriptor.TessellationControlPointIndexType]: The size of the control point indices in a control point index buffer.
- [IMTLRenderPipelineDescriptor.SetTessellationControlPointIndexType]
- [IMTLRenderPipelineDescriptor.TessellationFactorStepFunction]: The step function for determining the tessellation factors for a patch from the tessellation factor buffer.
- [IMTLRenderPipelineDescriptor.SetTessellationFactorStepFunction]
- [IMTLRenderPipelineDescriptor.TessellationOutputWindingOrder]: The winding order of triangles from the tessellator.
- [IMTLRenderPipelineDescriptor.SetTessellationOutputWindingOrder]
- [IMTLRenderPipelineDescriptor.TessellationPartitionMode]: The partitioning mode that the tessellator uses to derive the number and spacing of segments for subdividing a corresponding edge.
- [IMTLRenderPipelineDescriptor.SetTessellationPartitionMode]
Specifying indirect command buffers usage ¶
- [IMTLRenderPipelineDescriptor.SupportIndirectCommandBuffers]: A Boolean value that determines whether you can encode commands into an indirect command buffer using the render pipeline.
- [IMTLRenderPipelineDescriptor.SetSupportIndirectCommandBuffers]
Specifying the maximum vertex amplification count ¶
- [IMTLRenderPipelineDescriptor.MaxVertexAmplificationCount]: The maximum vertex amplification count you can set when encoding render commands.
- [IMTLRenderPipelineDescriptor.SetMaxVertexAmplificationCount]
Specifying precompiled shader binaries ¶
- [IMTLRenderPipelineDescriptor.SupportAddingVertexBinaryFunctions]: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the vertex shader’s callable functions list.
- [IMTLRenderPipelineDescriptor.SetSupportAddingVertexBinaryFunctions]
- [IMTLRenderPipelineDescriptor.SupportAddingFragmentBinaryFunctions]: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader’s callable functions list.
- [IMTLRenderPipelineDescriptor.SetSupportAddingFragmentBinaryFunctions]
- [IMTLRenderPipelineDescriptor.BinaryArchives]: An array of binary archives to search for precompiled versions of the shader.
- [IMTLRenderPipelineDescriptor.SetBinaryArchives]
Specifying callable functions for the pipeline ¶
- [IMTLRenderPipelineDescriptor.VertexLinkedFunctions]: Functions that you can specify as function arguments for the vertex shader when encoding commands that use the pipeline.
- [IMTLRenderPipelineDescriptor.SetVertexLinkedFunctions]
- [IMTLRenderPipelineDescriptor.FragmentLinkedFunctions]: Functions that you can specify as function arguments for the fragment shader when encoding commands that use the pipeline.
- [IMTLRenderPipelineDescriptor.SetFragmentLinkedFunctions]
Specifying shader validation ¶
- [IMTLRenderPipelineDescriptor.ShaderValidation]: A value that enables or disables shader validation for the pipeline.
- [IMTLRenderPipelineDescriptor.SetShaderValidation]
Instance Properties ¶
- [IMTLRenderPipelineDescriptor.FragmentPreloadedLibraries]
- [IMTLRenderPipelineDescriptor.SetFragmentPreloadedLibraries]
- [IMTLRenderPipelineDescriptor.VertexPreloadedLibraries]
- [IMTLRenderPipelineDescriptor.SetVertexPreloadedLibraries]
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor
type IMTLRenderPipelineFunctionsDescriptor ¶
type IMTLRenderPipelineFunctionsDescriptor interface {
objectivec.IObject
// The vertex functions to add to the render pipeline.
VertexAdditionalBinaryFunctions() []objectivec.IObject
SetVertexAdditionalBinaryFunctions(value []objectivec.IObject)
// The fragment functions to add to the render pipeline.
FragmentAdditionalBinaryFunctions() []objectivec.IObject
SetFragmentAdditionalBinaryFunctions(value []objectivec.IObject)
// The tile functions to add to the render pipeline.
TileAdditionalBinaryFunctions() []objectivec.IObject
SetTileAdditionalBinaryFunctions(value []objectivec.IObject)
}
An interface definition for the MTLRenderPipelineFunctionsDescriptor class.
Configuring the descriptor’s functions ¶
- [IMTLRenderPipelineFunctionsDescriptor.VertexAdditionalBinaryFunctions]: The vertex functions to add to the render pipeline.
- [IMTLRenderPipelineFunctionsDescriptor.SetVertexAdditionalBinaryFunctions]
- [IMTLRenderPipelineFunctionsDescriptor.FragmentAdditionalBinaryFunctions]: The fragment functions to add to the render pipeline.
- [IMTLRenderPipelineFunctionsDescriptor.SetFragmentAdditionalBinaryFunctions]
- [IMTLRenderPipelineFunctionsDescriptor.TileAdditionalBinaryFunctions]: The tile functions to add to the render pipeline.
- [IMTLRenderPipelineFunctionsDescriptor.SetTileAdditionalBinaryFunctions]
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineFunctionsDescriptor
type IMTLRenderPipelineReflection ¶
type IMTLRenderPipelineReflection interface {
objectivec.IObject
// An array of binding instances, each of which represents a parameter of the pipeline state’s fragment shader.
FragmentBindings() []objectivec.IObject
// An array of binding instances, each of which represents a parameter of the pipeline state’s mesh shader.
MeshBindings() []objectivec.IObject
// An array of binding instances, each of which represents a parameter of the pipeline state’s object shader.
ObjectBindings() []objectivec.IObject
// An array of binding instances, each of which represents a parameter of the pipeline state’s tile shader.
TileBindings() []objectivec.IObject
// An array of binding instances, each of which represents a parameter of the pipeline state’s vertex shader.
VertexBindings() []objectivec.IObject
}
An interface definition for the MTLRenderPipelineReflection class.
Inspecting a shader’s parameter ¶
- [IMTLRenderPipelineReflection.FragmentBindings]: An array of binding instances, each of which represents a parameter of the pipeline state’s fragment shader.
- [IMTLRenderPipelineReflection.MeshBindings]: An array of binding instances, each of which represents a parameter of the pipeline state’s mesh shader.
- [IMTLRenderPipelineReflection.ObjectBindings]: An array of binding instances, each of which represents a parameter of the pipeline state’s object shader.
- [IMTLRenderPipelineReflection.TileBindings]: An array of binding instances, each of which represents a parameter of the pipeline state’s tile shader.
- [IMTLRenderPipelineReflection.VertexBindings]: An array of binding instances, each of which represents a parameter of the pipeline state’s vertex shader.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineReflection
type IMTLResidencySetDescriptor ¶
type IMTLResidencySetDescriptor interface {
objectivec.IObject
// An optional name that can help you identify a residency set you create with the descriptor.
Label() string
SetLabel(value string)
// The number of allocations a new residency set can store without reallocating memory.
InitialCapacity() uint
SetInitialCapacity(value uint)
}
An interface definition for the MTLResidencySetDescriptor class.
Configuring the residency set ¶
- [IMTLResidencySetDescriptor.Label]: An optional name that can help you identify a residency set you create with the descriptor.
- [IMTLResidencySetDescriptor.SetLabel]
- [IMTLResidencySetDescriptor.InitialCapacity]: The number of allocations a new residency set can store without reallocating memory.
- [IMTLResidencySetDescriptor.SetInitialCapacity]
See: https://developer.apple.com/documentation/Metal/MTLResidencySetDescriptor
type IMTLResourceStatePassDescriptor ¶
type IMTLResourceStatePassDescriptor interface {
objectivec.IObject
// The array of sample buffers that the resource state pass can access.
SampleBufferAttachments() IMTLResourceStatePassSampleBufferAttachmentDescriptorArray
}
An interface definition for the MTLResourceStatePassDescriptor class.
Specifying sample buffers for GPU counters ¶
- [IMTLResourceStatePassDescriptor.SampleBufferAttachments]: The array of sample buffers that the resource state pass can access.
See: https://developer.apple.com/documentation/Metal/MTLResourceStatePassDescriptor
type IMTLResourceStatePassSampleBufferAttachmentDescriptor ¶
type IMTLResourceStatePassSampleBufferAttachmentDescriptor interface {
objectivec.IObject
// A specialized memory buffer that the GPU uses to store its counter data during the resource state pass.
SampleBuffer() MTLCounterSampleBuffer
SetSampleBuffer(value MTLCounterSampleBuffer)
// The index the Metal device object should use to store GPU counters when starting the resource state pass.
StartOfEncoderSampleIndex() uint
SetStartOfEncoderSampleIndex(value uint)
// The index the Metal device object should use to store GPU counters when ending the resource state pass.
EndOfEncoderSampleIndex() uint
SetEndOfEncoderSampleIndex(value uint)
}
An interface definition for the MTLResourceStatePassSampleBufferAttachmentDescriptor class.
Configuring the sample buffer attachment ¶
- [IMTLResourceStatePassSampleBufferAttachmentDescriptor.SampleBuffer]: A specialized memory buffer that the GPU uses to store its counter data during the resource state pass.
- [IMTLResourceStatePassSampleBufferAttachmentDescriptor.SetSampleBuffer]
- [IMTLResourceStatePassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex]: The index the Metal device object should use to store GPU counters when starting the resource state pass.
- [IMTLResourceStatePassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex]
- [IMTLResourceStatePassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex]: The index the Metal device object should use to store GPU counters when ending the resource state pass.
- [IMTLResourceStatePassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex]
See: https://developer.apple.com/documentation/Metal/MTLResourceStatePassSampleBufferAttachmentDescriptor
type IMTLResourceStatePassSampleBufferAttachmentDescriptorArray ¶
type IMTLResourceStatePassSampleBufferAttachmentDescriptorArray interface {
objectivec.IObject
// Returns the descriptor object for the specified sample buffer attachment.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLResourceStatePassSampleBufferAttachmentDescriptor
// Sets the descriptor object for the specified sample buffer attachment.
SetObjectAtIndexedSubscript(attachment IMTLResourceStatePassSampleBufferAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLResourceStatePassSampleBufferAttachmentDescriptorArray class.
Accessing a sample buffer attachment ¶
- [IMTLResourceStatePassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Returns the descriptor object for the specified sample buffer attachment.
type IMTLResourceViewPoolDescriptor ¶
type IMTLResourceViewPoolDescriptor interface {
objectivec.IObject
// Assigns an optional label you to the resource view pool for debugging purposes.
Label() string
SetLabel(value string)
// Configures the number of resource views with which Metal creates the resource view pool.
ResourceViewCount() uint
SetResourceViewCount(value uint)
}
An interface definition for the MTLResourceViewPoolDescriptor class.
Instance Properties ¶
- [IMTLResourceViewPoolDescriptor.Label]: Assigns an optional label you to the resource view pool for debugging purposes.
- [IMTLResourceViewPoolDescriptor.SetLabel]
- [IMTLResourceViewPoolDescriptor.ResourceViewCount]: Configures the number of resource views with which Metal creates the resource view pool.
- [IMTLResourceViewPoolDescriptor.SetResourceViewCount]
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPoolDescriptor
type IMTLSamplerDescriptor ¶
type IMTLSamplerDescriptor interface {
objectivec.IObject
// A Boolean value that indicates whether texture coordinates are normalized to the range `[0.0, 1.0]`.
NormalizedCoordinates() bool
SetNormalizedCoordinates(value bool)
// The address mode for the texture depth (r) coordinate.
RAddressMode() MTLSamplerAddressMode
SetRAddressMode(value MTLSamplerAddressMode)
// The address mode for the texture width (s) coordinate.
SAddressMode() MTLSamplerAddressMode
SetSAddressMode(value MTLSamplerAddressMode)
// The address mode for the texture height (t) coordinate.
TAddressMode() MTLSamplerAddressMode
SetTAddressMode(value MTLSamplerAddressMode)
// The border color for clamped texture values.
BorderColor() MTLSamplerBorderColor
SetBorderColor(value MTLSamplerBorderColor)
// The filtering option for combining pixels within one mipmap level when the sample footprint is larger than a pixel (minification).
MinFilter() MTLSamplerMinMagFilter
SetMinFilter(value MTLSamplerMinMagFilter)
// The filtering operation for combining pixels within one mipmap level when the sample footprint is smaller than a pixel (magnification).
MagFilter() MTLSamplerMinMagFilter
SetMagFilter(value MTLSamplerMinMagFilter)
// The filtering option for combining pixels between two mipmap levels.
MipFilter() MTLSamplerMipFilter
SetMipFilter(value MTLSamplerMipFilter)
// The minimum level of detail (LOD) to use when sampling from a texture.
LodMinClamp() float32
SetLodMinClamp(value float32)
// The maximum level of detail (LOD) to use when sampling from a texture.
LodMaxClamp() float32
SetLodMaxClamp(value float32)
// A Boolean value that specifies whether the GPU can use an average level of detail (LOD) when sampling from a texture.
LodAverage() bool
SetLodAverage(value bool)
// The number of samples that can be taken to improve the quality of sample footprints that are anisotropic.
MaxAnisotropy() uint
SetMaxAnisotropy(value uint)
// The sampler comparison function used when performing a sample compare operation on a depth texture.
CompareFunction() MTLCompareFunction
SetCompareFunction(value MTLCompareFunction)
// A Boolean value that indicates whether you can reference a sampler, that you make with this descriptor, by its resource ID from an argument buffer.
SupportArgumentBuffers() bool
SetSupportArgumentBuffers(value bool)
// A string that identifies the sampler.
Label() string
SetLabel(value string)
// Sets the level-of-detail (lod) bias when sampling from a texture.
LodBias() float32
SetLodBias(value float32)
// Sets the reduction mode for filtering contributing samples.
ReductionMode() MTLSamplerReductionMode
SetReductionMode(value MTLSamplerReductionMode)
}
An interface definition for the MTLSamplerDescriptor class.
Declaring the coordinate space ¶
- [IMTLSamplerDescriptor.NormalizedCoordinates]: A Boolean value that indicates whether texture coordinates are normalized to the range `[0.0, 1.0]`.
- [IMTLSamplerDescriptor.SetNormalizedCoordinates]
Declaring addressing modes ¶
- [IMTLSamplerDescriptor.RAddressMode]: The address mode for the texture depth (r) coordinate.
- [IMTLSamplerDescriptor.SetRAddressMode]
- [IMTLSamplerDescriptor.SAddressMode]: The address mode for the texture width (s) coordinate.
- [IMTLSamplerDescriptor.SetSAddressMode]
- [IMTLSamplerDescriptor.TAddressMode]: The address mode for the texture height (t) coordinate.
- [IMTLSamplerDescriptor.SetTAddressMode]
- [IMTLSamplerDescriptor.BorderColor]: The border color for clamped texture values.
- [IMTLSamplerDescriptor.SetBorderColor]
Declaring filter modes ¶
- [IMTLSamplerDescriptor.MinFilter]: The filtering option for combining pixels within one mipmap level when the sample footprint is larger than a pixel (minification).
- [IMTLSamplerDescriptor.SetMinFilter]
- [IMTLSamplerDescriptor.MagFilter]: The filtering operation for combining pixels within one mipmap level when the sample footprint is smaller than a pixel (magnification).
- [IMTLSamplerDescriptor.SetMagFilter]
- [IMTLSamplerDescriptor.MipFilter]: The filtering option for combining pixels between two mipmap levels.
- [IMTLSamplerDescriptor.SetMipFilter]
- [IMTLSamplerDescriptor.LodMinClamp]: The minimum level of detail (LOD) to use when sampling from a texture.
- [IMTLSamplerDescriptor.SetLodMinClamp]
- [IMTLSamplerDescriptor.LodMaxClamp]: The maximum level of detail (LOD) to use when sampling from a texture.
- [IMTLSamplerDescriptor.SetLodMaxClamp]
- [IMTLSamplerDescriptor.LodAverage]: A Boolean value that specifies whether the GPU can use an average level of detail (LOD) when sampling from a texture.
- [IMTLSamplerDescriptor.SetLodAverage]
- [IMTLSamplerDescriptor.MaxAnisotropy]: The number of samples that can be taken to improve the quality of sample footprints that are anisotropic.
- [IMTLSamplerDescriptor.SetMaxAnisotropy]
Declaring the depth comparison mode ¶
- [IMTLSamplerDescriptor.CompareFunction]: The sampler comparison function used when performing a sample compare operation on a depth texture.
- [IMTLSamplerDescriptor.SetCompareFunction]
Declaring whether the sampler can be used in argument buffers ¶
- [IMTLSamplerDescriptor.SupportArgumentBuffers]: A Boolean value that indicates whether you can reference a sampler, that you make with this descriptor, by its resource ID from an argument buffer.
- [IMTLSamplerDescriptor.SetSupportArgumentBuffers]
Identifying the sampler ¶
- [IMTLSamplerDescriptor.Label]: A string that identifies the sampler.
- [IMTLSamplerDescriptor.SetLabel]
Instance Properties ¶
- [IMTLSamplerDescriptor.LodBias]: Sets the level-of-detail (lod) bias when sampling from a texture.
- [IMTLSamplerDescriptor.SetLodBias]
- [IMTLSamplerDescriptor.ReductionMode]: Sets the reduction mode for filtering contributing samples.
- [IMTLSamplerDescriptor.SetReductionMode]
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor
type IMTLSharedEventHandle ¶
type IMTLSharedEventHandle interface {
objectivec.IObject
Label() string
}
An interface definition for the MTLSharedEventHandle class.
Identifying the shareable event handle ¶
- [IMTLSharedEventHandle.Label]: A string that identifies the shareable event.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventHandle
type IMTLSharedEventListener ¶
type IMTLSharedEventListener interface {
objectivec.IObject
InitWithDispatchQueue(dispatchQueue dispatch.Queue) MTLSharedEventListener
DispatchQueue() dispatch.Queue
}
An interface definition for the MTLSharedEventListener class.
Initializing a shareable event listener ¶
- [IMTLSharedEventListener.InitWithDispatchQueue]: Creates a new shareable event listener with a specific dispatch queue.
Getting the dispatch queue ¶
- [IMTLSharedEventListener.DispatchQueue]: The dispatch queue used to dispatch any notifications.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventListener
type IMTLSharedTextureHandle ¶
type IMTLSharedTextureHandle interface {
objectivec.IObject
Device() MTLDevice
Label() string
}
An interface definition for the MTLSharedTextureHandle class.
Identifying the shared texture handle ¶
- [IMTLSharedTextureHandle.Device]: The device object that created the texture.
- [IMTLSharedTextureHandle.Label]: A string that identifies the texture.
See: https://developer.apple.com/documentation/Metal/MTLSharedTextureHandle
type IMTLStageInputOutputDescriptor ¶
type IMTLStageInputOutputDescriptor interface {
objectivec.IObject
// An array that describes where and how to fetch data for the function.
Attributes() IMTLAttributeDescriptorArray
// An array that describes how the function fetches data.
Layouts() IMTLBufferLayoutDescriptorArray
// The location of the index buffer for a compute function using indexed thread addressing.
IndexBufferIndex() uint
SetIndexBufferIndex(value uint)
// The data type of the indices stored in the index buffer.
IndexType() MTLIndexType
SetIndexType(value MTLIndexType)
// Resets the default state for the descriptor.
Reset()
}
An interface definition for the MTLStageInputOutputDescriptor class.
Describing argument layouts ¶
- [IMTLStageInputOutputDescriptor.Attributes]: An array that describes where and how to fetch data for the function.
- [IMTLStageInputOutputDescriptor.Layouts]: An array that describes how the function fetches data.
Declaring index buffers for indirect compute commands ¶
- [IMTLStageInputOutputDescriptor.IndexBufferIndex]: The location of the index buffer for a compute function using indexed thread addressing.
- [IMTLStageInputOutputDescriptor.SetIndexBufferIndex]
- [IMTLStageInputOutputDescriptor.IndexType]: The data type of the indices stored in the index buffer.
- [IMTLStageInputOutputDescriptor.SetIndexType]
Resetting the descriptor ¶
- [IMTLStageInputOutputDescriptor.Reset]: Resets the default state for the descriptor.
See: https://developer.apple.com/documentation/Metal/MTLStageInputOutputDescriptor
type IMTLStencilDescriptor ¶
type IMTLStencilDescriptor interface {
objectivec.IObject
// The operation that is performed to update the values in the stencil attachment when the stencil test fails.
StencilFailureOperation() MTLStencilOperation
SetStencilFailureOperation(value MTLStencilOperation)
// The operation that is performed to update the values in the stencil attachment when the stencil test passes, but the depth test fails.
DepthFailureOperation() MTLStencilOperation
SetDepthFailureOperation(value MTLStencilOperation)
// The operation that is performed to update the values in the stencil attachment when both the stencil test and the depth test pass.
DepthStencilPassOperation() MTLStencilOperation
SetDepthStencilPassOperation(value MTLStencilOperation)
// The comparison that is performed between the masked reference value and a masked value in the stencil attachment.
StencilCompareFunction() MTLCompareFunction
SetStencilCompareFunction(value MTLCompareFunction)
// A bitmask that determines from which bits that stencil comparison tests can read.
ReadMask() uint32
SetReadMask(value uint32)
// A bitmask that determines to which bits that stencil operations can write.
WriteMask() uint32
SetWriteMask(value uint32)
}
An interface definition for the MTLStencilDescriptor class.
Configuring stencil functions and operations ¶
- [IMTLStencilDescriptor.StencilFailureOperation]: The operation that is performed to update the values in the stencil attachment when the stencil test fails.
- [IMTLStencilDescriptor.SetStencilFailureOperation]
- [IMTLStencilDescriptor.DepthFailureOperation]: The operation that is performed to update the values in the stencil attachment when the stencil test passes, but the depth test fails.
- [IMTLStencilDescriptor.SetDepthFailureOperation]
- [IMTLStencilDescriptor.DepthStencilPassOperation]: The operation that is performed to update the values in the stencil attachment when both the stencil test and the depth test pass.
- [IMTLStencilDescriptor.SetDepthStencilPassOperation]
- [IMTLStencilDescriptor.StencilCompareFunction]: The comparison that is performed between the masked reference value and a masked value in the stencil attachment.
- [IMTLStencilDescriptor.SetStencilCompareFunction]
Configuring stencil bit mask properties ¶
- [IMTLStencilDescriptor.ReadMask]: A bitmask that determines from which bits that stencil comparison tests can read.
- [IMTLStencilDescriptor.SetReadMask]
- [IMTLStencilDescriptor.WriteMask]: A bitmask that determines to which bits that stencil operations can write.
- [IMTLStencilDescriptor.SetWriteMask]
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor
type IMTLStitchedLibraryDescriptor ¶
type IMTLStitchedLibraryDescriptor interface {
objectivec.IObject
// The list of functions for creating the stitched library.
Functions() []objectivec.IObject
SetFunctions(value []objectivec.IObject)
// The function graphs that define the new stitched library’s functions.
FunctionGraphs() []MTLFunctionStitchingGraph
SetFunctionGraphs(value []MTLFunctionStitchingGraph)
BinaryArchives() []objectivec.IObject
SetBinaryArchives(value []objectivec.IObject)
Options() MTLStitchedLibraryOptions
SetOptions(value MTLStitchedLibraryOptions)
}
An interface definition for the MTLStitchedLibraryDescriptor class.
Configuring a stitched library ¶
- [IMTLStitchedLibraryDescriptor.Functions]: The list of functions for creating the stitched library.
- [IMTLStitchedLibraryDescriptor.SetFunctions]
- [IMTLStitchedLibraryDescriptor.FunctionGraphs]: The function graphs that define the new stitched library’s functions.
- [IMTLStitchedLibraryDescriptor.SetFunctionGraphs]
Instance Properties ¶
- [IMTLStitchedLibraryDescriptor.BinaryArchives]
- [IMTLStitchedLibraryDescriptor.SetBinaryArchives]
- [IMTLStitchedLibraryDescriptor.Options]
- [IMTLStitchedLibraryDescriptor.SetOptions]
See: https://developer.apple.com/documentation/Metal/MTLStitchedLibraryDescriptor
type IMTLStructMember ¶
type IMTLStructMember interface {
objectivec.IObject
// The name of the struct member.
Name() string
// The data type of the struct member.
DataType() MTLDataType
// The location of this member relative to the start of its struct, in bytes.
Offset() uint
// The index in the argument table that corresponds to the struct member.
ArgumentIndex() uint
// Provides a description of the underlying array when the struct member holds an array.
ArrayType() IMTLArrayType
// Provides a description of the underlying struct when the struct member holds a struct.
StructType() IMTLStructType
// Provides a description of the underlying pointer when the struct member holds a pointer.
PointerType() IMTLPointerType
// Provides a description of the underlying texture when the struct member holds a texture.
TextureReferenceType() IMTLTextureReferenceType
// Provides a description of the underlying tensor type when this struct member holds a tensor.
TensorReferenceType() IMTLTensorReferenceType
// An array of instances that describe the fields in the struct.
Members() IMTLStructMember
SetMembers(value IMTLStructMember)
}
An interface definition for the MTLStructMember class.
Describing the struct member ¶
- [IMTLStructMember.Name]: The name of the struct member.
- [IMTLStructMember.DataType]: The data type of the struct member.
- [IMTLStructMember.Offset]: The location of this member relative to the start of its struct, in bytes.
- [IMTLStructMember.ArgumentIndex]: The index in the argument table that corresponds to the struct member.
Obtaining struct member details ¶
- [IMTLStructMember.ArrayType]: Provides a description of the underlying array when the struct member holds an array.
- [IMTLStructMember.StructType]: Provides a description of the underlying struct when the struct member holds a struct.
- [IMTLStructMember.PointerType]: Provides a description of the underlying pointer when the struct member holds a pointer.
- [IMTLStructMember.TextureReferenceType]: Provides a description of the underlying texture when the struct member holds a texture.
Instance Methods ¶
- [IMTLStructMember.TensorReferenceType]: Provides a description of the underlying tensor type when this struct member holds a tensor.
See: https://developer.apple.com/documentation/Metal/MTLStructMember
type IMTLStructType ¶
type IMTLStructType interface {
IMTLType
// An array of instances that describe the fields in the struct.
Members() []MTLStructMember
// Provides a representation of a struct member.
MemberByName(name string) IMTLStructMember
// A description of the structure data of a buffer argument.
BufferStructType() IMTLStructType
SetBufferStructType(value IMTLStructType)
}
An interface definition for the MTLStructType class.
Obtaining information about struct members ¶
- [IMTLStructType.Members]: An array of instances that describe the fields in the struct.
- [IMTLStructType.MemberByName]: Provides a representation of a struct member.
See: https://developer.apple.com/documentation/Metal/MTLStructType
type IMTLTensorDescriptor ¶
type IMTLTensorDescriptor interface {
objectivec.IObject
// A value that configures the cache mode of CPU mapping of tensors you create with this descriptor.
CpuCacheMode() MTLCPUCacheMode
SetCpuCacheMode(value MTLCPUCacheMode)
// A data format for the tensors you create with this descriptor.
DataType() MTLTensorDataType
SetDataType(value MTLTensorDataType)
// An array of sizes, in elements, one for each dimension of the tensors you create with this descriptor.
Dimensions() IMTLTensorExtents
SetDimensions(value IMTLTensorExtents)
// A value that configures the hazard tracking of tensors you create with this descriptor.
HazardTrackingMode() MTLHazardTrackingMode
SetHazardTrackingMode(value MTLHazardTrackingMode)
// A packed set of the `storageMode`, `cpuCacheMode` and `hazardTrackingMode` properties.
ResourceOptions() MTLResourceOptions
SetResourceOptions(value MTLResourceOptions)
// A value that configures the memory location and access permissions of tensors you create with this descriptor.
StorageMode() MTLStorageMode
SetStorageMode(value MTLStorageMode)
// An array of strides, in elements, one for each dimension in the tensors you create with this descriptor, if applicable.
Strides() IMTLTensorExtents
SetStrides(value IMTLTensorExtents)
// A set of contexts in which you can use tensors you create with this descriptor.
Usage() MTLTensorUsage
SetUsage(value MTLTensorUsage)
// An error domain for errors that pertain to creating a tensor.
MTLTensorDomain() string
MTL_TENSOR_MAX_RANK() objectivec.IObject
SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
}
An interface definition for the MTLTensorDescriptor class.
Instance Properties ¶
- [IMTLTensorDescriptor.CpuCacheMode]: A value that configures the cache mode of CPU mapping of tensors you create with this descriptor.
- [IMTLTensorDescriptor.SetCpuCacheMode]
- [IMTLTensorDescriptor.DataType]: A data format for the tensors you create with this descriptor.
- [IMTLTensorDescriptor.SetDataType]
- [IMTLTensorDescriptor.Dimensions]: An array of sizes, in elements, one for each dimension of the tensors you create with this descriptor.
- [IMTLTensorDescriptor.SetDimensions]
- [IMTLTensorDescriptor.HazardTrackingMode]: A value that configures the hazard tracking of tensors you create with this descriptor.
- [IMTLTensorDescriptor.SetHazardTrackingMode]
- [IMTLTensorDescriptor.ResourceOptions]: A packed set of the `storageMode`, `cpuCacheMode` and `hazardTrackingMode` properties.
- [IMTLTensorDescriptor.SetResourceOptions]
- [IMTLTensorDescriptor.StorageMode]: A value that configures the memory location and access permissions of tensors you create with this descriptor.
- [IMTLTensorDescriptor.SetStorageMode]
- [IMTLTensorDescriptor.Strides]: An array of strides, in elements, one for each dimension in the tensors you create with this descriptor, if applicable.
- [IMTLTensorDescriptor.SetStrides]
- [IMTLTensorDescriptor.Usage]: A set of contexts in which you can use tensors you create with this descriptor.
- [IMTLTensorDescriptor.SetUsage]
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor
type IMTLTensorExtents ¶
type IMTLTensorExtents interface {
objectivec.IObject
// Retrieves the extents for this object.
Extents() int
SetExtents(value int)
// Obtains the rank of the tensor.
Rank() uint
// An error domain for errors that pertain to creating a tensor.
MTLTensorDomain() string
MTL_TENSOR_MAX_RANK() objectivec.IObject
SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
// Returns the extent at an index.
ExtentAtDimensionIndex(dimensionIndex uint) int
// Creates a new tensor extents with the rank and extent values you provide.
InitWithRankValues(rank uint, values unsafe.Pointer) MTLTensorExtents
}
An interface definition for the MTLTensorExtents class.
Instance Properties ¶
- [IMTLTensorExtents.Extents]: Retrieves the extents for this object.
- [IMTLTensorExtents.SetExtents]
- [IMTLTensorExtents.Rank]: Obtains the rank of the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorExtents
type IMTLTensorReferenceType ¶
type IMTLTensorReferenceType interface {
IMTLType
// A value that represents the read/write permissions of the tensor.
Access() MTLBindingAccess
// The array of sizes, in elements, one for each dimension of this tensor.
Dimensions() IMTLTensorExtents
// The data format you use for indexing into the tensor.
IndexType() MTLDataType
// The underlying data format of the tensor.
TensorDataType() MTLTensorDataType
// An error domain for errors that pertain to creating a tensor.
MTLTensorDomain() string
MTL_TENSOR_MAX_RANK() objectivec.IObject
SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
}
An interface definition for the MTLTensorReferenceType class.
Instance Properties ¶
- [IMTLTensorReferenceType.Access]: A value that represents the read/write permissions of the tensor.
- [IMTLTensorReferenceType.Dimensions]: The array of sizes, in elements, one for each dimension of this tensor.
- [IMTLTensorReferenceType.IndexType]: The data format you use for indexing into the tensor.
- [IMTLTensorReferenceType.TensorDataType]: The underlying data format of the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorReferenceType
type IMTLTextureDescriptor ¶
type IMTLTextureDescriptor interface {
objectivec.IObject
// The dimension and arrangement of texture image data.
TextureType() MTLTextureType
SetTextureType(value MTLTextureType)
// The size and bit layout of all pixels in the texture.
PixelFormat() MTLPixelFormat
SetPixelFormat(value MTLPixelFormat)
// The width of the texture image for the base level mipmap, in pixels.
Width() uint
SetWidth(value uint)
// The height of the texture image for the base level mipmap, in pixels.
Height() uint
SetHeight(value uint)
// The depth of the texture image for the base level mipmap, in pixels.
Depth() uint
SetDepth(value uint)
// The number of mipmap levels for this texture.
MipmapLevelCount() uint
SetMipmapLevelCount(value uint)
// The number of samples in each fragment.
SampleCount() uint
SetSampleCount(value uint)
// The number of array elements for this texture.
ArrayLength() uint
SetArrayLength(value uint)
// The behavior of a new memory allocation.
ResourceOptions() MTLResourceOptions
SetResourceOptions(value MTLResourceOptions)
// The CPU cache mode used for the CPU mapping of the texture.
CpuCacheMode() MTLCPUCacheMode
SetCpuCacheMode(value MTLCPUCacheMode)
// The location and access permissions of the texture.
StorageMode() MTLStorageMode
SetStorageMode(value MTLStorageMode)
// The texture’s hazard tracking mode.
HazardTrackingMode() MTLHazardTrackingMode
SetHazardTrackingMode(value MTLHazardTrackingMode)
// A Boolean value indicating whether the GPU is allowed to adjust the texture’s contents to improve GPU performance.
AllowGPUOptimizedContents() bool
SetAllowGPUOptimizedContents(value bool)
// Options that determine how you can use the texture.
Usage() MTLTextureUsage
SetUsage(value MTLTextureUsage)
// The pattern you want the GPU to apply to pixels when you read or sample pixels from the texture.
Swizzle() MTLTextureSwizzleChannels
SetSwizzle(value MTLTextureSwizzleChannels)
CompressionType() MTLTextureCompressionType
SetCompressionType(value MTLTextureCompressionType)
// Determines the page size for a placement sparse texture.
PlacementSparsePageSize() MTLSparsePageSize
SetPlacementSparsePageSize(value MTLSparsePageSize)
}
An interface definition for the MTLTextureDescriptor class.
Specifying texture attributes ¶
- [IMTLTextureDescriptor.TextureType]: The dimension and arrangement of texture image data.
- [IMTLTextureDescriptor.SetTextureType]
- [IMTLTextureDescriptor.PixelFormat]: The size and bit layout of all pixels in the texture.
- [IMTLTextureDescriptor.SetPixelFormat]
- [IMTLTextureDescriptor.Width]: The width of the texture image for the base level mipmap, in pixels.
- [IMTLTextureDescriptor.SetWidth]
- [IMTLTextureDescriptor.Height]: The height of the texture image for the base level mipmap, in pixels.
- [IMTLTextureDescriptor.SetHeight]
- [IMTLTextureDescriptor.Depth]: The depth of the texture image for the base level mipmap, in pixels.
- [IMTLTextureDescriptor.SetDepth]
- [IMTLTextureDescriptor.MipmapLevelCount]: The number of mipmap levels for this texture.
- [IMTLTextureDescriptor.SetMipmapLevelCount]
- [IMTLTextureDescriptor.SampleCount]: The number of samples in each fragment.
- [IMTLTextureDescriptor.SetSampleCount]
- [IMTLTextureDescriptor.ArrayLength]: The number of array elements for this texture.
- [IMTLTextureDescriptor.SetArrayLength]
- [IMTLTextureDescriptor.ResourceOptions]: The behavior of a new memory allocation.
- [IMTLTextureDescriptor.SetResourceOptions]
- [IMTLTextureDescriptor.CpuCacheMode]: The CPU cache mode used for the CPU mapping of the texture.
- [IMTLTextureDescriptor.SetCpuCacheMode]
- [IMTLTextureDescriptor.StorageMode]: The location and access permissions of the texture.
- [IMTLTextureDescriptor.SetStorageMode]
- [IMTLTextureDescriptor.HazardTrackingMode]: The texture’s hazard tracking mode.
- [IMTLTextureDescriptor.SetHazardTrackingMode]
- [IMTLTextureDescriptor.AllowGPUOptimizedContents]: A Boolean value indicating whether the GPU is allowed to adjust the texture’s contents to improve GPU performance.
- [IMTLTextureDescriptor.SetAllowGPUOptimizedContents]
- [IMTLTextureDescriptor.Usage]: Options that determine how you can use the texture.
- [IMTLTextureDescriptor.SetUsage]
- [IMTLTextureDescriptor.Swizzle]: The pattern you want the GPU to apply to pixels when you read or sample pixels from the texture.
- [IMTLTextureDescriptor.SetSwizzle]
Instance Properties ¶
- [IMTLTextureDescriptor.CompressionType]
- [IMTLTextureDescriptor.SetCompressionType]
- [IMTLTextureDescriptor.PlacementSparsePageSize]: Determines the page size for a placement sparse texture.
- [IMTLTextureDescriptor.SetPlacementSparsePageSize]
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor
type IMTLTextureReferenceType ¶
type IMTLTextureReferenceType interface {
IMTLType
// The texture type of the texture.
TextureType() MTLTextureType
// The data type of the texture.
TextureDataType() MTLDataType
// The texture’s read/write access to the argument.
Access() MTLBindingAccess
// A Boolean value that indicates whether the texture is a depth texture.
IsDepthTexture() bool
}
An interface definition for the MTLTextureReferenceType class.
Describing the texture ¶
- [IMTLTextureReferenceType.TextureType]: The texture type of the texture.
- [IMTLTextureReferenceType.TextureDataType]: The data type of the texture.
- [IMTLTextureReferenceType.Access]: The texture’s read/write access to the argument.
- [IMTLTextureReferenceType.IsDepthTexture]: A Boolean value that indicates whether the texture is a depth texture.
See: https://developer.apple.com/documentation/Metal/MTLTextureReferenceType
type IMTLTextureViewDescriptor ¶
type IMTLTextureViewDescriptor interface {
objectivec.IObject
PixelFormat() MTLPixelFormat
SetPixelFormat(value MTLPixelFormat)
Swizzle() MTLTextureSwizzleChannels
SetSwizzle(value MTLTextureSwizzleChannels)
TextureType() MTLTextureType
SetTextureType(value MTLTextureType)
LevelRange() foundation.NSRange
SetLevelRange(value foundation.NSRange)
SliceRange() foundation.NSRange
SetSliceRange(value foundation.NSRange)
}
An interface definition for the MTLTextureViewDescriptor class.
Instance Properties ¶
- [IMTLTextureViewDescriptor.PixelFormat]
- [IMTLTextureViewDescriptor.SetPixelFormat]
- [IMTLTextureViewDescriptor.Swizzle]
- [IMTLTextureViewDescriptor.SetSwizzle]
- [IMTLTextureViewDescriptor.TextureType]
- [IMTLTextureViewDescriptor.SetTextureType]
See: https://developer.apple.com/documentation/Metal/MTLTextureViewDescriptor
type IMTLTileRenderPipelineColorAttachmentDescriptor ¶
type IMTLTileRenderPipelineColorAttachmentDescriptor interface {
objectivec.IObject
// The pixel format associated with the tile shading render pipeline.
PixelFormat() MTLPixelFormat
SetPixelFormat(value MTLPixelFormat)
}
An interface definition for the MTLTileRenderPipelineColorAttachmentDescriptor class.
Specifying pixel format ¶
- [IMTLTileRenderPipelineColorAttachmentDescriptor.PixelFormat]: The pixel format associated with the tile shading render pipeline.
- [IMTLTileRenderPipelineColorAttachmentDescriptor.SetPixelFormat]
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineColorAttachmentDescriptor
type IMTLTileRenderPipelineColorAttachmentDescriptorArray ¶
type IMTLTileRenderPipelineColorAttachmentDescriptorArray interface {
objectivec.IObject
// Returns the render pipeline state for the specified color attachment.
ObjectAtIndexedSubscript(attachmentIndex uint) IMTLTileRenderPipelineColorAttachmentDescriptor
// Sets the render pipeline state for a specified color attachment.
SetObjectAtIndexedSubscript(attachment IMTLTileRenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
}
An interface definition for the MTLTileRenderPipelineColorAttachmentDescriptorArray class.
Instance methods ¶
- [IMTLTileRenderPipelineColorAttachmentDescriptorArray.ObjectAtIndexedSubscript]: Returns the render pipeline state for the specified color attachment.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineColorAttachmentDescriptorArray
type IMTLTileRenderPipelineDescriptor ¶
type IMTLTileRenderPipelineDescriptor interface {
objectivec.IObject
// A string that identifies the tile pipeline descriptor.
Label() string
SetLabel(value string)
// The compute kernel or fragment function the pipeline calls.
TileFunction() MTLFunction
SetTileFunction(value MTLFunction)
// An array that contains the buffer mutability options for a render pipeline’s tile function.
TileBuffers() IMTLPipelineBufferDescriptorArray
// The maximum call stack depth for indirect function calls in tile shaders.
MaxCallStackDepth() uint
SetMaxCallStackDepth(value uint)
// A Boolean value that indicates whether all threadgroups for this pipeline completely cover tiles.
ThreadgroupSizeMatchesTileSize() bool
SetThreadgroupSizeMatchesTileSize(value bool)
// The number of samples in each fragment.
RasterSampleCount() uint
SetRasterSampleCount(value uint)
// Specifies the default rendering pipeline state values for the descriptor.
Reset()
// An array of attachments that store color data.
ColorAttachments() IMTLTileRenderPipelineColorAttachmentDescriptorArray
// The maximum number of threads in a threadgroup when dispatching a command using the pipeline.
MaxTotalThreadsPerThreadgroup() uint
SetMaxTotalThreadsPerThreadgroup(value uint)
// A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
SupportAddingBinaryFunctions() bool
SetSupportAddingBinaryFunctions(value bool)
// An array of binary archives to search for precompiled versions of the shader.
BinaryArchives() []objectivec.IObject
SetBinaryArchives(value []objectivec.IObject)
// Functions that you can specify as function arguments for the tile shader when encoding commands that use the pipeline.
LinkedFunctions() IMTLLinkedFunctions
SetLinkedFunctions(value IMTLLinkedFunctions)
// A value that enables or disables shader validation for the pipeline.
ShaderValidation() MTLShaderValidation
SetShaderValidation(value MTLShaderValidation)
PreloadedLibraries() []objectivec.IObject
SetPreloadedLibraries(value []objectivec.IObject)
RequiredThreadsPerThreadgroup() MTLSize
SetRequiredThreadsPerThreadgroup(value MTLSize)
}
An interface definition for the MTLTileRenderPipelineDescriptor class.
Identifying the render pipeline ¶
- [IMTLTileRenderPipelineDescriptor.Label]: A string that identifies the tile pipeline descriptor.
- [IMTLTileRenderPipelineDescriptor.SetLabel]
Specifying graphics functions and associated data ¶
- [IMTLTileRenderPipelineDescriptor.TileFunction]: The compute kernel or fragment function the pipeline calls.
- [IMTLTileRenderPipelineDescriptor.SetTileFunction]
- [IMTLTileRenderPipelineDescriptor.TileBuffers]: An array that contains the buffer mutability options for a render pipeline’s tile function.
- [IMTLTileRenderPipelineDescriptor.MaxCallStackDepth]: The maximum call stack depth for indirect function calls in tile shaders.
- [IMTLTileRenderPipelineDescriptor.SetMaxCallStackDepth]
Specifying rasterization and visibility state ¶
- [IMTLTileRenderPipelineDescriptor.ThreadgroupSizeMatchesTileSize]: A Boolean value that indicates whether all threadgroups for this pipeline completely cover tiles.
- [IMTLTileRenderPipelineDescriptor.SetThreadgroupSizeMatchesTileSize]
- [IMTLTileRenderPipelineDescriptor.RasterSampleCount]: The number of samples in each fragment.
- [IMTLTileRenderPipelineDescriptor.SetRasterSampleCount]
Specifying rendering pipeline state ¶
- [IMTLTileRenderPipelineDescriptor.Reset]: Specifies the default rendering pipeline state values for the descriptor.
- [IMTLTileRenderPipelineDescriptor.ColorAttachments]: An array of attachments that store color data.
Specifying threads per threadgroup ¶
- [IMTLTileRenderPipelineDescriptor.MaxTotalThreadsPerThreadgroup]: The maximum number of threads in a threadgroup when dispatching a command using the pipeline.
- [IMTLTileRenderPipelineDescriptor.SetMaxTotalThreadsPerThreadgroup]
Specifying precompiled shader binaries ¶
- [IMTLTileRenderPipelineDescriptor.SupportAddingBinaryFunctions]: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
- [IMTLTileRenderPipelineDescriptor.SetSupportAddingBinaryFunctions]
- [IMTLTileRenderPipelineDescriptor.BinaryArchives]: An array of binary archives to search for precompiled versions of the shader.
- [IMTLTileRenderPipelineDescriptor.SetBinaryArchives]
Specifying callable functions for the pipeline ¶
- [IMTLTileRenderPipelineDescriptor.LinkedFunctions]: Functions that you can specify as function arguments for the tile shader when encoding commands that use the pipeline.
- [IMTLTileRenderPipelineDescriptor.SetLinkedFunctions]
Specifying shader validation ¶
- [IMTLTileRenderPipelineDescriptor.ShaderValidation]: A value that enables or disables shader validation for the pipeline.
- [IMTLTileRenderPipelineDescriptor.SetShaderValidation]
Instance Properties ¶
- [IMTLTileRenderPipelineDescriptor.PreloadedLibraries]
- [IMTLTileRenderPipelineDescriptor.SetPreloadedLibraries]
- [IMTLTileRenderPipelineDescriptor.RequiredThreadsPerThreadgroup]
- [IMTLTileRenderPipelineDescriptor.SetRequiredThreadsPerThreadgroup]
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor
type IMTLType ¶
type IMTLType interface {
objectivec.IObject
// The data type of the function argument.
DataType() MTLDataType
}
An interface definition for the MTLType class.
Identifying the data type ¶
- [IMTLType.DataType]: The data type of the function argument.
See: https://developer.apple.com/documentation/Metal/MTLType
type IMTLVertexAttribute ¶
type IMTLVertexAttribute interface {
objectivec.IObject
// The name of the attribute.
Name() string
// The index of the attribute, as declared in Metal shader source code.
AttributeIndex() uint
// The data type for the attribute, as declared in Metal shader source code.
AttributeType() MTLDataType
// A Boolean value that indicates whether this vertex attribute is active.
Active() bool
// A Boolean value that indicates whether this vertex attribute represents control point data.
PatchControlPointData() bool
// A Boolean value that indicates whether this vertex attribute represents patch data.
PatchData() bool
// An array that describes the vertex input attributes to a vertex function.
VertexAttributes() IMTLVertexAttribute
SetVertexAttributes(value IMTLVertexAttribute)
}
An interface definition for the MTLVertexAttribute class.
Describing the attribute ¶
- [IMTLVertexAttribute.Name]: The name of the attribute.
- [IMTLVertexAttribute.AttributeIndex]: The index of the attribute, as declared in Metal shader source code.
- [IMTLVertexAttribute.AttributeType]: The data type for the attribute, as declared in Metal shader source code.
- [IMTLVertexAttribute.Active]: A Boolean value that indicates whether this vertex attribute is active.
- [IMTLVertexAttribute.PatchControlPointData]: A Boolean value that indicates whether this vertex attribute represents control point data.
- [IMTLVertexAttribute.PatchData]: A Boolean value that indicates whether this vertex attribute represents patch data.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute
type IMTLVertexAttributeDescriptor ¶
type IMTLVertexAttributeDescriptor interface {
objectivec.IObject
// The format of the vertex attribute.
Format() MTLVertexFormat
SetFormat(value MTLVertexFormat)
// The location of an attribute in vertex data, determined by the byte offset from the start of the vertex data.
Offset() uint
SetOffset(value uint)
// The index in the argument table for the associated vertex buffer.
BufferIndex() uint
SetBufferIndex(value uint)
MTLBufferLayoutStrideDynamic() int
}
An interface definition for the MTLVertexAttributeDescriptor class.
Organizing the vertex attribute ¶
- [IMTLVertexAttributeDescriptor.Format]: The format of the vertex attribute.
- [IMTLVertexAttributeDescriptor.SetFormat]
- [IMTLVertexAttributeDescriptor.Offset]: The location of an attribute in vertex data, determined by the byte offset from the start of the vertex data.
- [IMTLVertexAttributeDescriptor.SetOffset]
- [IMTLVertexAttributeDescriptor.BufferIndex]: The index in the argument table for the associated vertex buffer.
- [IMTLVertexAttributeDescriptor.SetBufferIndex]
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptor
type IMTLVertexAttributeDescriptorArray ¶
type IMTLVertexAttributeDescriptorArray interface {
objectivec.IObject
// Returns the state of the specified vertex attribute.
ObjectAtIndexedSubscript(index uint) IMTLVertexAttributeDescriptor
MTLBufferLayoutStrideDynamic() int
// Sets state for the specified vertex attribute.
SetObjectAtIndexedSubscript(attributeDesc IMTLVertexAttributeDescriptor, index uint)
}
An interface definition for the MTLVertexAttributeDescriptorArray class.
Accessing a specified vertex attribute ¶
- [IMTLVertexAttributeDescriptorArray.ObjectAtIndexedSubscript]: Returns the state of the specified vertex attribute.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptorArray
type IMTLVertexBufferLayoutDescriptor ¶
type IMTLVertexBufferLayoutDescriptor interface {
objectivec.IObject
// The circumstances under which the vertex and its attributes are presented to the vertex function.
StepFunction() MTLVertexStepFunction
SetStepFunction(value MTLVertexStepFunction)
// The interval at which the vertex and its attributes are presented to the vertex function.
StepRate() uint
SetStepRate(value uint)
// The number of bytes between the first byte of two consecutive vertices in a buffer.
Stride() uint
SetStride(value uint)
MTLBufferLayoutStrideDynamic() int
}
An interface definition for the MTLVertexBufferLayoutDescriptor class.
Organizing the vertex buffer layout ¶
- [IMTLVertexBufferLayoutDescriptor.StepFunction]: The circumstances under which the vertex and its attributes are presented to the vertex function.
- [IMTLVertexBufferLayoutDescriptor.SetStepFunction]
- [IMTLVertexBufferLayoutDescriptor.StepRate]: The interval at which the vertex and its attributes are presented to the vertex function.
- [IMTLVertexBufferLayoutDescriptor.SetStepRate]
- [IMTLVertexBufferLayoutDescriptor.Stride]: The number of bytes between the first byte of two consecutive vertices in a buffer.
- [IMTLVertexBufferLayoutDescriptor.SetStride]
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptor
type IMTLVertexBufferLayoutDescriptorArray ¶
type IMTLVertexBufferLayoutDescriptorArray interface {
objectivec.IObject
// Returns the state of the specified vertex buffer layout.
ObjectAtIndexedSubscript(index uint) IMTLVertexBufferLayoutDescriptor
MTLBufferLayoutStrideDynamic() int
// Sets the state of the specified vertex buffer layout.
SetObjectAtIndexedSubscript(bufferDesc IMTLVertexBufferLayoutDescriptor, index uint)
}
An interface definition for the MTLVertexBufferLayoutDescriptorArray class.
Accessing a specified vertex buffer layout ¶
- [IMTLVertexBufferLayoutDescriptorArray.ObjectAtIndexedSubscript]: Returns the state of the specified vertex buffer layout.
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptorArray
type IMTLVertexDescriptor ¶
type IMTLVertexDescriptor interface {
objectivec.IObject
// Resets the default state for the vertex descriptor.
Reset()
// An array of state data that describes how vertex attribute data is stored in memory and is mapped to arguments for a vertex shader function.
Attributes() IMTLVertexAttributeDescriptorArray
// An array of state data that describes how data are fetched by a vertex shader function when rendering primitives.
Layouts() IMTLVertexBufferLayoutDescriptorArray
MTLBufferLayoutStrideDynamic() int
// The organization of vertex data in an attribute’s argument table.
VertexDescriptor() IMTLVertexDescriptor
SetVertexDescriptor(value IMTLVertexDescriptor)
}
An interface definition for the MTLVertexDescriptor class.
Setting default values ¶
- [IMTLVertexDescriptor.Reset]: Resets the default state for the vertex descriptor.
Accessing the vertex buffer layouts and vertex attributes ¶
- [IMTLVertexDescriptor.Attributes]: An array of state data that describes how vertex attribute data is stored in memory and is mapped to arguments for a vertex shader function.
- [IMTLVertexDescriptor.Layouts]: An array of state data that describes how data are fetched by a vertex shader function when rendering primitives.
See: https://developer.apple.com/documentation/Metal/MTLVertexDescriptor
type IMTLVisibleFunctionTableDescriptor ¶
type IMTLVisibleFunctionTableDescriptor interface {
objectivec.IObject
// The number of entries in the function table.
FunctionCount() uint
SetFunctionCount(value uint)
}
An interface definition for the MTLVisibleFunctionTableDescriptor class.
Configuring the function table ¶
- [IMTLVisibleFunctionTableDescriptor.FunctionCount]: The number of entries in the function table.
- [IMTLVisibleFunctionTableDescriptor.SetFunctionCount]
See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTableDescriptor
type MTL4AccelerationStructureBoundingBoxGeometryDescriptor ¶
type MTL4AccelerationStructureBoundingBoxGeometryDescriptor struct {
MTL4AccelerationStructureGeometryDescriptor
}
Describes bounding-box geometry suitable for ray tracing.
Overview ¶
You use bounding boxes to implement procedural geometry for ray tracing, such as spheres or any other shape you define by using intersection functions.
Use a MTLResidencySet to mark residency of all buffers this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4AccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxBuffer: References a buffer containing bounding box data in [MTLAxisAlignedBoundingBoxes] format.
- MTL4AccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxBuffer
- MTL4AccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxCount: Describes the number of bounding boxes the `boundingBoxBuffer` contains.
- MTL4AccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxCount
- MTL4AccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxStride: Assigns the stride, in bytes, between bounding boxes in the bounding box buffer `boundingBoxBuffer` references.
- MTL4AccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxStride
func MTL4AccelerationStructureBoundingBoxGeometryDescriptorFromID ¶
func MTL4AccelerationStructureBoundingBoxGeometryDescriptorFromID(id objc.ID) MTL4AccelerationStructureBoundingBoxGeometryDescriptor
MTL4AccelerationStructureBoundingBoxGeometryDescriptorFromID constructs a MTL4AccelerationStructureBoundingBoxGeometryDescriptor from an objc.ID.
Describes bounding-box geometry suitable for ray tracing.
func NewMTL4AccelerationStructureBoundingBoxGeometryDescriptor ¶
func NewMTL4AccelerationStructureBoundingBoxGeometryDescriptor() MTL4AccelerationStructureBoundingBoxGeometryDescriptor
NewMTL4AccelerationStructureBoundingBoxGeometryDescriptor creates a new MTL4AccelerationStructureBoundingBoxGeometryDescriptor instance.
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) Autorelease() MTL4AccelerationStructureBoundingBoxGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBuffer ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBuffer() MTL4BufferRange
References a buffer containing bounding box data in [MTLAxisAlignedBoundingBoxes] format.
Discussion ¶
You are responsible for ensuring the buffer address of the range is not zero.
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxCount ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
Describes the number of bounding boxes the `boundingBoxBuffer` contains.
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxStride ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
Assigns the stride, in bytes, between bounding boxes in the bounding box buffer `boundingBoxBuffer` references.
Discussion ¶
You are responsible for ensuring this stride is at least 24 bytes and a multiple of 4 bytes.
This property defaults to `24` bytes.
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) Init ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) Init() MTL4AccelerationStructureBoundingBoxGeometryDescriptor
Init initializes the instance.
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBuffer ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxCount ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxStride ¶
func (m MTL4AccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
type MTL4AccelerationStructureBoundingBoxGeometryDescriptorClass ¶
type MTL4AccelerationStructureBoundingBoxGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureBoundingBoxGeometryDescriptorClass ¶
func GetMTL4AccelerationStructureBoundingBoxGeometryDescriptorClass() MTL4AccelerationStructureBoundingBoxGeometryDescriptorClass
GetMTL4AccelerationStructureBoundingBoxGeometryDescriptorClass returns the class object for MTL4AccelerationStructureBoundingBoxGeometryDescriptor.
func (MTL4AccelerationStructureBoundingBoxGeometryDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureBoundingBoxGeometryDescriptorClass) Alloc() MTL4AccelerationStructureBoundingBoxGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AccelerationStructureCurveGeometryDescriptor ¶
type MTL4AccelerationStructureCurveGeometryDescriptor struct {
MTL4AccelerationStructureGeometryDescriptor
}
Describes curve geometry suitable for ray tracing.
Overview ¶
Use a MTLResidencySet to mark residency of all buffers this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4AccelerationStructureCurveGeometryDescriptor.ControlPointBuffer: References a buffer containing curve control points.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointBuffer
- MTL4AccelerationStructureCurveGeometryDescriptor.ControlPointCount: Declares the number of control points in the control point buffer.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointCount
- MTL4AccelerationStructureCurveGeometryDescriptor.ControlPointFormat: Declares the format of the control points the control point buffer references.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointFormat
- MTL4AccelerationStructureCurveGeometryDescriptor.ControlPointStride: Sets the stride, in bytes, between control points in the control point buffer the control point buffer references.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetControlPointStride
- MTL4AccelerationStructureCurveGeometryDescriptor.CurveBasis: Controls the curve basis function, determining how Metal interpolates the control points.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetCurveBasis
- MTL4AccelerationStructureCurveGeometryDescriptor.CurveEndCaps: Sets the type of curve end caps.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetCurveEndCaps
- MTL4AccelerationStructureCurveGeometryDescriptor.CurveType: Controls the curve type.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetCurveType
- MTL4AccelerationStructureCurveGeometryDescriptor.IndexBuffer: Assigns an optional index buffer containing references to control points in the control point buffer.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetIndexBuffer
- MTL4AccelerationStructureCurveGeometryDescriptor.IndexType: Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetIndexType
- MTL4AccelerationStructureCurveGeometryDescriptor.RadiusBuffer: Assigns a reference to a buffer containing the curve radius for each control point.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetRadiusBuffer
- MTL4AccelerationStructureCurveGeometryDescriptor.RadiusFormat: Declares the format of the radii in the radius buffer.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetRadiusFormat
- MTL4AccelerationStructureCurveGeometryDescriptor.RadiusStride: Configures the stride, in bytes, between radii in the radius buffer.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetRadiusStride
- MTL4AccelerationStructureCurveGeometryDescriptor.SegmentControlPointCount: Declares the number of control points per curve segment.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetSegmentControlPointCount
- MTL4AccelerationStructureCurveGeometryDescriptor.SegmentCount: Declares the number of curve segments.
- MTL4AccelerationStructureCurveGeometryDescriptor.SetSegmentCount
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureCurveGeometryDescriptor
func MTL4AccelerationStructureCurveGeometryDescriptorFromID ¶
func MTL4AccelerationStructureCurveGeometryDescriptorFromID(id objc.ID) MTL4AccelerationStructureCurveGeometryDescriptor
MTL4AccelerationStructureCurveGeometryDescriptorFromID constructs a MTL4AccelerationStructureCurveGeometryDescriptor from an objc.ID.
Describes curve geometry suitable for ray tracing.
func NewMTL4AccelerationStructureCurveGeometryDescriptor ¶
func NewMTL4AccelerationStructureCurveGeometryDescriptor() MTL4AccelerationStructureCurveGeometryDescriptor
NewMTL4AccelerationStructureCurveGeometryDescriptor creates a new MTL4AccelerationStructureCurveGeometryDescriptor instance.
func (MTL4AccelerationStructureCurveGeometryDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) Autorelease() MTL4AccelerationStructureCurveGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointBuffer ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointBuffer() MTL4BufferRange
References a buffer containing curve control points.
Discussion ¶
Control points are interpolated according to the basis function you specify in [CurveBasis].
You are responsible for ensuring each control is in a format matching the control point format [ControlPointFormat] specifies, as well as ensuring that the buffer address of the range is not zero.
func (MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointCount ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointCount() uint
Declares the number of control points in the control point buffer.
func (MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointFormat ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
Declares the format of the control points the control point buffer references.
Discussion ¶
Defaults to MTLAttributeFormatFloat3, representing 3 floating point values tightly packed.
func (MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointStride ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) ControlPointStride() uint
Sets the stride, in bytes, between control points in the control point buffer the control point buffer references.
Discussion ¶
You are responsible for ensuring this stride is a multiple of the control point format’s element size, and at a minimum exactly the control point format’s size.
This property defaults to `0`, indicating that the control points are tightly-packed.
func (MTL4AccelerationStructureCurveGeometryDescriptor) CurveBasis ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
Controls the curve basis function, determining how Metal interpolates the control points.
Discussion ¶
Defaults to MTLCurveBasisBSpline.
func (MTL4AccelerationStructureCurveGeometryDescriptor) CurveEndCaps ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
Sets the type of curve end caps.
Discussion ¶
Defaults to MTLCurveEndCapsNone.
func (MTL4AccelerationStructureCurveGeometryDescriptor) CurveType ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) CurveType() MTLCurveType
Controls the curve type.
Discussion ¶
Defaults to MTLCurveTypeRound.
func (MTL4AccelerationStructureCurveGeometryDescriptor) IndexBuffer ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) IndexBuffer() MTL4BufferRange
Assigns an optional index buffer containing references to control points in the control point buffer.
Discussion ¶
Each index represents the first control point of a curve segment. You are responsible for ensuring the buffer address of the range is not zero.
func (MTL4AccelerationStructureCurveGeometryDescriptor) IndexType ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) IndexType() MTLIndexType
Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
func (MTL4AccelerationStructureCurveGeometryDescriptor) Init ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) Init() MTL4AccelerationStructureCurveGeometryDescriptor
Init initializes the instance.
func (MTL4AccelerationStructureCurveGeometryDescriptor) RadiusBuffer ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) RadiusBuffer() MTL4BufferRange
Assigns a reference to a buffer containing the curve radius for each control point.
Discussion ¶
Metal interpolates curve radii according to the basis function you specify via [CurveBasis].
You are responsible for ensuring the type of each radius matches the type property [RadiusFormat] specifies, that each radius is at least zero, and that the buffer address of the range is not zero.
func (MTL4AccelerationStructureCurveGeometryDescriptor) RadiusFormat ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
Declares the format of the radii in the radius buffer.
Discussion ¶
Defaults to MTLAttributeFormatFloat.
func (MTL4AccelerationStructureCurveGeometryDescriptor) RadiusStride ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) RadiusStride() uint
Configures the stride, in bytes, between radii in the radius buffer.
Discussion ¶
You are responsible for ensuring this property is set to a multiple of the size corresponding to the [RadiusFormat].
This property defaults to `0` bytes, indicating that the radii are tightly packed.
func (MTL4AccelerationStructureCurveGeometryDescriptor) SegmentControlPointCount ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SegmentControlPointCount() uint
Declares the number of control points per curve segment.
Discussion ¶
Valid values for this property are `2`, `3`, or `4`.
func (MTL4AccelerationStructureCurveGeometryDescriptor) SegmentCount ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SegmentCount() uint
Declares the number of curve segments.
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointBuffer ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointCount ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointCount(value uint)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointFormat ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointStride ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetControlPointStride(value uint)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveBasis ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveEndCaps ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveType ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetIndexBuffer ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetIndexType ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusBuffer ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusFormat ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusStride ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetRadiusStride(value uint)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetSegmentControlPointCount ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
func (MTL4AccelerationStructureCurveGeometryDescriptor) SetSegmentCount ¶
func (m MTL4AccelerationStructureCurveGeometryDescriptor) SetSegmentCount(value uint)
type MTL4AccelerationStructureCurveGeometryDescriptorClass ¶
type MTL4AccelerationStructureCurveGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureCurveGeometryDescriptorClass ¶
func GetMTL4AccelerationStructureCurveGeometryDescriptorClass() MTL4AccelerationStructureCurveGeometryDescriptorClass
GetMTL4AccelerationStructureCurveGeometryDescriptorClass returns the class object for MTL4AccelerationStructureCurveGeometryDescriptor.
func (MTL4AccelerationStructureCurveGeometryDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureCurveGeometryDescriptorClass) Alloc() MTL4AccelerationStructureCurveGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AccelerationStructureDescriptor ¶
type MTL4AccelerationStructureDescriptor struct {
MTLAccelerationStructureDescriptor
}
Base class for Metal 4 acceleration structure descriptors.
Overview ¶
Don’t use this class directly. Use one of its subclasses instead.
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureDescriptor
func MTL4AccelerationStructureDescriptorFromID ¶
func MTL4AccelerationStructureDescriptorFromID(id objc.ID) MTL4AccelerationStructureDescriptor
MTL4AccelerationStructureDescriptorFromID constructs a MTL4AccelerationStructureDescriptor from an objc.ID.
Base class for Metal 4 acceleration structure descriptors.
func NewMTL4AccelerationStructureDescriptor ¶
func NewMTL4AccelerationStructureDescriptor() MTL4AccelerationStructureDescriptor
NewMTL4AccelerationStructureDescriptor creates a new MTL4AccelerationStructureDescriptor instance.
func (MTL4AccelerationStructureDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureDescriptor) Autorelease() MTL4AccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
type MTL4AccelerationStructureDescriptorClass ¶
type MTL4AccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureDescriptorClass ¶
func GetMTL4AccelerationStructureDescriptorClass() MTL4AccelerationStructureDescriptorClass
GetMTL4AccelerationStructureDescriptorClass returns the class object for MTL4AccelerationStructureDescriptor.
func (MTL4AccelerationStructureDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureDescriptorClass) Alloc() MTL4AccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AccelerationStructureGeometryDescriptor ¶
type MTL4AccelerationStructureGeometryDescriptor struct {
objectivec.Object
}
Base class for all Metal 4 acceleration structure geometry descriptors.
Overview ¶
Don’t use this class directly. Use one of the derived classes instead.
Instance Properties ¶
- MTL4AccelerationStructureGeometryDescriptor.AllowDuplicateIntersectionFunctionInvocation: A boolean value that indicates whether the ray-tracing system in Metal allows the invocation of intersection functions more than once per ray-primitive intersection.
- MTL4AccelerationStructureGeometryDescriptor.SetAllowDuplicateIntersectionFunctionInvocation
- MTL4AccelerationStructureGeometryDescriptor.IntersectionFunctionTableOffset: Sets the offset that this geometry contributes to determining the intersection function to invoke when a ray intersects it.
- MTL4AccelerationStructureGeometryDescriptor.SetIntersectionFunctionTableOffset
- MTL4AccelerationStructureGeometryDescriptor.Label: Assigns an optional label you can assign to this geometry for debugging purposes.
- MTL4AccelerationStructureGeometryDescriptor.SetLabel
- MTL4AccelerationStructureGeometryDescriptor.Opaque: Provides a hint to Metal that this geometry is opaque, potentially accelerating the ray/primitive intersection process.
- MTL4AccelerationStructureGeometryDescriptor.SetOpaque
- MTL4AccelerationStructureGeometryDescriptor.PrimitiveDataBuffer: Assigns optional buffer containing data to associate with each primitive in this geometry.
- MTL4AccelerationStructureGeometryDescriptor.SetPrimitiveDataBuffer
- MTL4AccelerationStructureGeometryDescriptor.PrimitiveDataElementSize: Sets the size, in bytes, of the data for each primitive in the primitive data buffer [primitiveDataBuffer](<doc://com.apple.metal/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/primitiveDataBuffer>) references.
- MTL4AccelerationStructureGeometryDescriptor.SetPrimitiveDataElementSize
- MTL4AccelerationStructureGeometryDescriptor.PrimitiveDataStride: Defines the stride, in bytes, between each primitive’s data in the primitive data buffer [primitiveDataBuffer](<doc://com.apple.metal/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/primitiveDataBuffer>) references.
- MTL4AccelerationStructureGeometryDescriptor.SetPrimitiveDataStride
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor
func MTL4AccelerationStructureGeometryDescriptorFromID ¶
func MTL4AccelerationStructureGeometryDescriptorFromID(id objc.ID) MTL4AccelerationStructureGeometryDescriptor
MTL4AccelerationStructureGeometryDescriptorFromID constructs a MTL4AccelerationStructureGeometryDescriptor from an objc.ID.
Base class for all Metal 4 acceleration structure geometry descriptors.
func NewMTL4AccelerationStructureGeometryDescriptor ¶
func NewMTL4AccelerationStructureGeometryDescriptor() MTL4AccelerationStructureGeometryDescriptor
NewMTL4AccelerationStructureGeometryDescriptor creates a new MTL4AccelerationStructureGeometryDescriptor instance.
func (MTL4AccelerationStructureGeometryDescriptor) AllowDuplicateIntersectionFunctionInvocation ¶
func (m MTL4AccelerationStructureGeometryDescriptor) AllowDuplicateIntersectionFunctionInvocation() bool
A boolean value that indicates whether the ray-tracing system in Metal allows the invocation of intersection functions more than once per ray-primitive intersection.
Discussion ¶
The property’s default value is true.
func (MTL4AccelerationStructureGeometryDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureGeometryDescriptor) Autorelease() MTL4AccelerationStructureGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4AccelerationStructureGeometryDescriptor) Init ¶
func (m MTL4AccelerationStructureGeometryDescriptor) Init() MTL4AccelerationStructureGeometryDescriptor
Init initializes the instance.
func (MTL4AccelerationStructureGeometryDescriptor) IntersectionFunctionTableOffset ¶
func (m MTL4AccelerationStructureGeometryDescriptor) IntersectionFunctionTableOffset() uint
Sets the offset that this geometry contributes to determining the intersection function to invoke when a ray intersects it.
Discussion ¶
When you perform a ray tracing operation in the Metal Shading Language, and provide the ray intersector object with an instance of MTLIntersectionFunctionTable, Metal adds this offset to the instance offset from structs such as:
- MTLAccelerationStructureInstanceDescriptor - MTLAccelerationStructureUserIDInstanceDescriptor - MTLAccelerationStructureMotionInstanceDescriptor - MTLIndirectAccelerationStructureInstanceDescriptor - MTLIndirectAccelerationStructureMotionInstanceDescriptor
The sum of these offsets provides an index into the intersection function table that the ray tracing system uses to retrieve and invoke the function at this index, allowing you to customize the intersection evaluation process.
func (MTL4AccelerationStructureGeometryDescriptor) Label ¶
func (m MTL4AccelerationStructureGeometryDescriptor) Label() string
Assigns an optional label you can assign to this geometry for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/label
func (MTL4AccelerationStructureGeometryDescriptor) Opaque ¶
func (m MTL4AccelerationStructureGeometryDescriptor) Opaque() bool
Provides a hint to Metal that this geometry is opaque, potentially accelerating the ray/primitive intersection process.
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureGeometryDescriptor/opaque
func (MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataBuffer ¶
func (m MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataBuffer() MTL4BufferRange
Assigns optional buffer containing data to associate with each primitive in this geometry.
Discussion ¶
You can use zero as the buffer address in this buffer range.
func (MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataElementSize ¶
func (m MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataElementSize() uint
Sets the size, in bytes, of the data for each primitive in the primitive data buffer [PrimitiveDataBuffer] references.
Discussion ¶
This size needs to be at most [PrimitiveDataStride] in size and a multiple of 4 bytes.
This property defaults to 0 bytes.
func (MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataStride ¶
func (m MTL4AccelerationStructureGeometryDescriptor) PrimitiveDataStride() uint
Defines the stride, in bytes, between each primitive’s data in the primitive data buffer [PrimitiveDataBuffer] references.
Discussion ¶
You are responsible for ensuring the stride is at least [PrimitiveDataElementSize] in size and a multiple of 4 bytes.
This property defaults to `0` bytes, which indicates the stride is equal to [PrimitiveDataElementSize].
func (MTL4AccelerationStructureGeometryDescriptor) SetAllowDuplicateIntersectionFunctionInvocation ¶
func (m MTL4AccelerationStructureGeometryDescriptor) SetAllowDuplicateIntersectionFunctionInvocation(value bool)
func (MTL4AccelerationStructureGeometryDescriptor) SetIntersectionFunctionTableOffset ¶
func (m MTL4AccelerationStructureGeometryDescriptor) SetIntersectionFunctionTableOffset(value uint)
func (MTL4AccelerationStructureGeometryDescriptor) SetLabel ¶
func (m MTL4AccelerationStructureGeometryDescriptor) SetLabel(value string)
func (MTL4AccelerationStructureGeometryDescriptor) SetOpaque ¶
func (m MTL4AccelerationStructureGeometryDescriptor) SetOpaque(value bool)
func (MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataBuffer ¶
func (m MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataElementSize ¶
func (m MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataElementSize(value uint)
func (MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataStride ¶
func (m MTL4AccelerationStructureGeometryDescriptor) SetPrimitiveDataStride(value uint)
type MTL4AccelerationStructureGeometryDescriptorClass ¶
type MTL4AccelerationStructureGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureGeometryDescriptorClass ¶
func GetMTL4AccelerationStructureGeometryDescriptorClass() MTL4AccelerationStructureGeometryDescriptorClass
GetMTL4AccelerationStructureGeometryDescriptorClass returns the class object for MTL4AccelerationStructureGeometryDescriptor.
func (MTL4AccelerationStructureGeometryDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureGeometryDescriptorClass) Alloc() MTL4AccelerationStructureGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor ¶
type MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor struct {
MTL4AccelerationStructureGeometryDescriptor
}
Describes motion bounding box geometry, suitable for motion ray tracing.
Overview ¶
You use bounding boxes to implement procedural geometry for ray tracing, such as spheres or any other shape you define by using intersection functions.
Use a MTLResidencySet to mark residency of all buffers this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxBuffers: Configures a reference to a buffer where each entry contains a reference to a buffer of bounding boxes.
- MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxBuffers
- MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxCount: Declares the number of bounding boxes in each buffer that `boundingBoxBuffer` references.
- MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxCount
- MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxStride: Declares the stride, in bytes, between bounding boxes in the bounding box buffers each entry in `boundingBoxBuffer` references.
- MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxStride
func MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorFromID ¶
func MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorFromID(id objc.ID) MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorFromID constructs a MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor from an objc.ID.
Describes motion bounding box geometry, suitable for motion ray tracing.
func NewMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor ¶
func NewMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor() MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
NewMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor creates a new MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor instance.
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) Autorelease() MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxBuffers ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxBuffers() MTL4BufferRange
Configures a reference to a buffer where each entry contains a reference to a buffer of bounding boxes.
Discussion ¶
This property references a buffer that conceptually represents an array with one entry for each keyframe in the motion animation. Each one of these entries consists of a MTL4BufferRange that, in turn, references a vertex buffer containing the bounding box data for the keyframe.
You are responsible for ensuring the buffer address is not zero for the top-level buffer, as well as for all the vertex buffers it references.
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxCount ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
Declares the number of bounding boxes in each buffer that `boundingBoxBuffer` references.
Discussion ¶
All keyframes share the same bounding box count.
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxStride ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
Declares the stride, in bytes, between bounding boxes in the bounding box buffers each entry in `boundingBoxBuffer` references.
Discussion ¶
All keyframes share the same bounding box stride. You are responsible for ensuring this stride is at least 24 bytes and a multiple of 4 bytes.
This property defaults to `24` bytes.
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) Init ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) Init() MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
Init initializes the instance.
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxBuffers ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxBuffers(value MTL4BufferRange)
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxCount ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxStride ¶
func (m MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
type MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass ¶
type MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass ¶
func GetMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass() MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass
GetMTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass returns the class object for MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor.
func (MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Alloc() MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AccelerationStructureMotionCurveGeometryDescriptor ¶
type MTL4AccelerationStructureMotionCurveGeometryDescriptor struct {
MTL4AccelerationStructureGeometryDescriptor
}
Describes motion curve geometry, suitable for motion ray tracing.
Overview ¶
Use a MTLResidencySet to mark residency of all buffers this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointBuffers: Assigns a reference to a buffer where each entry contains a reference to a buffer of control points.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointBuffers
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointCount: Specifies the number of control points in the buffers the control point buffers reference.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointCount
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointFormat: Declares the format of the control points in the buffers that the control point buffers reference.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointFormat
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.ControlPointStride: Sets the stride, in bytes, between control points in the control point buffer.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetControlPointStride
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.CurveBasis: Sets the curve basis function, determining how Metal interpolates the control points.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetCurveBasis
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.CurveEndCaps: Configures the type of curve end caps.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetCurveEndCaps
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.CurveType: Controls the curve type.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetCurveType
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.IndexBuffer: Assigns an optional index buffer containing references to control points in the control point buffers.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetIndexBuffer
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.IndexType: Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetIndexType
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.RadiusBuffers: Assigns a reference to a buffer containing, in turn, references to curve radii buffers.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetRadiusBuffers
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.RadiusFormat: Sets the format of the radii in the radius buffer.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetRadiusFormat
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.RadiusStride: Sets the stride, in bytes, between radii in the radius buffer.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetRadiusStride
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SegmentControlPointCount: Controls the number of control points per curve segment.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetSegmentControlPointCount
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SegmentCount: Declares the number of curve segments.
- MTL4AccelerationStructureMotionCurveGeometryDescriptor.SetSegmentCount
func MTL4AccelerationStructureMotionCurveGeometryDescriptorFromID ¶
func MTL4AccelerationStructureMotionCurveGeometryDescriptorFromID(id objc.ID) MTL4AccelerationStructureMotionCurveGeometryDescriptor
MTL4AccelerationStructureMotionCurveGeometryDescriptorFromID constructs a MTL4AccelerationStructureMotionCurveGeometryDescriptor from an objc.ID.
Describes motion curve geometry, suitable for motion ray tracing.
func NewMTL4AccelerationStructureMotionCurveGeometryDescriptor ¶
func NewMTL4AccelerationStructureMotionCurveGeometryDescriptor() MTL4AccelerationStructureMotionCurveGeometryDescriptor
NewMTL4AccelerationStructureMotionCurveGeometryDescriptor creates a new MTL4AccelerationStructureMotionCurveGeometryDescriptor instance.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) Autorelease() MTL4AccelerationStructureMotionCurveGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointBuffers ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointBuffers() MTL4BufferRange
Assigns a reference to a buffer where each entry contains a reference to a buffer of control points.
Discussion ¶
This property references a buffer that conceptually represents an array with one entry for each keyframe in the motion animation. Each one of these entries consists of a MTL4BufferRange that, in turn, references a buffer containing the control points corresponding to the keyframe.
You are responsible for ensuring the buffer address is not zero for the top-level buffer, as well as for all the vertex buffers it references.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointCount ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointCount() uint
Specifies the number of control points in the buffers the control point buffers reference.
Discussion ¶
All keyframes have the same number of control points.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointFormat ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
Declares the format of the control points in the buffers that the control point buffers reference.
Discussion ¶
All keyframes share the same control point format. Defaults to MTLAttributeFormatFloat3, representing 3 floating point values tightly packed.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointStride ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) ControlPointStride() uint
Sets the stride, in bytes, between control points in the control point buffer.
Discussion ¶
All keyframes share the same control point stride.
You are responsible for ensuring this stride is a multiple of the control point format’s element size, and at a minimum exactly the control point format’s size.
This property defaults to `0`, indicating that the control points are tightly-packed.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveBasis ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
Sets the curve basis function, determining how Metal interpolates the control points.
Discussion ¶
Defaults to MTLCurveBasisBSpline. All keyframes share the same curve basis function.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveEndCaps ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
Configures the type of curve end caps.
Discussion ¶
Defaults to MTLCurveEndCapsNone. All keyframes share the same end cap type.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveType ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) CurveType() MTLCurveType
Controls the curve type.
Discussion ¶
Defaults to MTLCurveTypeRound. All keyframes share the same curve type.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) IndexBuffer ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) IndexBuffer() MTL4BufferRange
Assigns an optional index buffer containing references to control points in the control point buffers.
Discussion ¶
All keyframes share the same index buffer, with each index representing the first control point of a curve segment.
You are responsible for ensuring the buffer address of the range is not zero.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) IndexType ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) IndexType() MTLIndexType
Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) Init ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) Init() MTL4AccelerationStructureMotionCurveGeometryDescriptor
Init initializes the instance.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusBuffers ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusBuffers() MTL4BufferRange
Assigns a reference to a buffer containing, in turn, references to curve radii buffers.
Discussion ¶
This property references a buffer that conceptually represents an array with one entry for each keyframe in the motion animation. Each one of these entries consists of a MTL4BufferRange that, in turn, references a buffer containing the radii corresponding to the keyframe.
Metal interpolates curve radii according to the basis function you specify via [CurveBasis].
You are responsible for ensuring the type of each radius matches the type property [RadiusFormat] specifies, that each radius is at least zero, and that the buffer address of the top-level buffer, as well as of buffer it references, is not zero.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusFormat ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
Sets the format of the radii in the radius buffer.
Discussion ¶
Defaults to MTLAttributeFormatFloat. All keyframes share the same radius format.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusStride ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) RadiusStride() uint
Sets the stride, in bytes, between radii in the radius buffer.
Discussion ¶
You are responsible for ensuring this property is set to a multiple of the size corresponding to the [RadiusFormat]. All keyframes share the same radius stride.
This property defaults to `0` bytes, indicating that the radii are tightly packed.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SegmentControlPointCount ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SegmentControlPointCount() uint
Controls the number of control points per curve segment.
Discussion ¶
Valid values for this property are `2`, `3`, or `4`. All keyframes have the same number of control points per curve segment.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SegmentCount ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SegmentCount() uint
Declares the number of curve segments.
Discussion ¶
All keyframes have the same number of curve segments.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointBuffers ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointBuffers(value MTL4BufferRange)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointCount ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointCount(value uint)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointFormat ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointStride ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetControlPointStride(value uint)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveBasis ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveEndCaps ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveType ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetIndexBuffer ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetIndexType ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusBuffers ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusBuffers(value MTL4BufferRange)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusFormat ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusStride ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetRadiusStride(value uint)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetSegmentControlPointCount ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
func (MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetSegmentCount ¶
func (m MTL4AccelerationStructureMotionCurveGeometryDescriptor) SetSegmentCount(value uint)
type MTL4AccelerationStructureMotionCurveGeometryDescriptorClass ¶
type MTL4AccelerationStructureMotionCurveGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureMotionCurveGeometryDescriptorClass ¶
func GetMTL4AccelerationStructureMotionCurveGeometryDescriptorClass() MTL4AccelerationStructureMotionCurveGeometryDescriptorClass
GetMTL4AccelerationStructureMotionCurveGeometryDescriptorClass returns the class object for MTL4AccelerationStructureMotionCurveGeometryDescriptor.
func (MTL4AccelerationStructureMotionCurveGeometryDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureMotionCurveGeometryDescriptorClass) Alloc() MTL4AccelerationStructureMotionCurveGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AccelerationStructureMotionTriangleGeometryDescriptor ¶
type MTL4AccelerationStructureMotionTriangleGeometryDescriptor struct {
MTL4AccelerationStructureGeometryDescriptor
}
Describes motion triangle geometry, suitable for motion ray tracing.
Overview ¶
Use a MTLResidencySet to mark residency of all buffers this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.IndexBuffer: Assigns an optional index buffer containing references to vertices in the vertex buffers you reference through the vertex buffers property.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetIndexBuffer
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.IndexType: Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetIndexType
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixBuffer: Assings an optional reference to a buffer containing a `float4x3` transformation matrix.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixBuffer
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixLayout: Configures the layout for the transformation matrix in the transformation matrix buffer.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixLayout
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.TriangleCount: Declares the number of triangles in the vertex buffers that the buffer in the vertex buffers property references.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetTriangleCount
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.VertexBuffers: Assigns a buffer where each entry contains a reference to a vertex buffer.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetVertexBuffers
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.VertexFormat: Defines the format of the vertices in the vertex buffers.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetVertexFormat
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.VertexStride: Sets the stride, in bytes, between vertices in all the vertex buffer.
- MTL4AccelerationStructureMotionTriangleGeometryDescriptor.SetVertexStride
func MTL4AccelerationStructureMotionTriangleGeometryDescriptorFromID ¶
func MTL4AccelerationStructureMotionTriangleGeometryDescriptorFromID(id objc.ID) MTL4AccelerationStructureMotionTriangleGeometryDescriptor
MTL4AccelerationStructureMotionTriangleGeometryDescriptorFromID constructs a MTL4AccelerationStructureMotionTriangleGeometryDescriptor from an objc.ID.
Describes motion triangle geometry, suitable for motion ray tracing.
func NewMTL4AccelerationStructureMotionTriangleGeometryDescriptor ¶
func NewMTL4AccelerationStructureMotionTriangleGeometryDescriptor() MTL4AccelerationStructureMotionTriangleGeometryDescriptor
NewMTL4AccelerationStructureMotionTriangleGeometryDescriptor creates a new MTL4AccelerationStructureMotionTriangleGeometryDescriptor instance.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) Autorelease() MTL4AccelerationStructureMotionTriangleGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) IndexBuffer ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) IndexBuffer() MTL4BufferRange
Assigns an optional index buffer containing references to vertices in the vertex buffers you reference through the vertex buffers property.
Discussion ¶
You can set this property to `0`, the default, to avoid specifying an index buffer. All keyframes share the same index buffer.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) IndexType ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) IndexType() MTLIndexType
Specifies the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) Init ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) Init() MTL4AccelerationStructureMotionTriangleGeometryDescriptor
Init initializes the instance.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBuffer ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetIndexType ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBuffer ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixLayout ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTriangleCount ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetTriangleCount(value uint)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexBuffers ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexBuffers(value MTL4BufferRange)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexFormat ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexStride ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) SetVertexStride(value uint)
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBuffer ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBuffer() MTL4BufferRange
Assings an optional reference to a buffer containing a `float4x3` transformation matrix.
Discussion ¶
When the buffer address is non-zero, Metal applies this transform to the vertex data positions when building the acceleration structure. All keyframes share the same transformation matrix.
Building an acceleration structure with a descriptor that specifies this property doesn’t modify the contents of the input `vertexBuffer`.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixLayout ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
Configures the layout for the transformation matrix in the transformation matrix buffer.
Discussion ¶
You can provide matrices in column-major or row-major form, and this property allows you to control how Metal interprets them.
Defaults to MTLMatrixLayoutColumnMajor.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TriangleCount ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) TriangleCount() uint
Declares the number of triangles in the vertex buffers that the buffer in the vertex buffers property references.
Discussion ¶
All keyframes share the same triangle count.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexBuffers ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexBuffers() MTL4BufferRange
Assigns a buffer where each entry contains a reference to a vertex buffer.
Discussion ¶
This property references a buffer that conceptually represents an array with one entry for each keyframe in the motion animation. Each one of these entries consists of a MTL4BufferRange that, in turn, references a vertex buffer containing the vertex data for the keyframe.
You are responsible for ensuring the buffer address is not zero for the top-level buffer, as well as for all the vertex buffers it references.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexFormat ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
Defines the format of the vertices in the vertex buffers.
Discussion ¶
All keyframes share the same vertex format. Defaults to MTLAttributeFormatFloat3, corresponding to three packed floating point numbers.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexStride ¶
func (m MTL4AccelerationStructureMotionTriangleGeometryDescriptor) VertexStride() uint
Sets the stride, in bytes, between vertices in all the vertex buffer.
Discussion ¶
All keyframes share the same vertex stride. This stride needs to be a multiple of the size of the vertex format you provide in the [VertexFormat] property.
Similarly, you are responsible for ensuring this stride matches the vertex format data type’s alignment.
Defaults to `0`, which signals the stride matches the size of the [VertexFormat] data.
type MTL4AccelerationStructureMotionTriangleGeometryDescriptorClass ¶
type MTL4AccelerationStructureMotionTriangleGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureMotionTriangleGeometryDescriptorClass ¶
func GetMTL4AccelerationStructureMotionTriangleGeometryDescriptorClass() MTL4AccelerationStructureMotionTriangleGeometryDescriptorClass
GetMTL4AccelerationStructureMotionTriangleGeometryDescriptorClass returns the class object for MTL4AccelerationStructureMotionTriangleGeometryDescriptor.
func (MTL4AccelerationStructureMotionTriangleGeometryDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureMotionTriangleGeometryDescriptorClass) Alloc() MTL4AccelerationStructureMotionTriangleGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AccelerationStructureTriangleGeometryDescriptor ¶
type MTL4AccelerationStructureTriangleGeometryDescriptor struct {
MTL4AccelerationStructureGeometryDescriptor
}
Describes triangle geometry suitable for ray tracing.
Overview ¶
Use a MTLResidencySet to mark residency of all buffers this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4AccelerationStructureTriangleGeometryDescriptor.IndexBuffer: Sets an optional index buffer containing references to vertices in the `vertexBuffer`.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetIndexBuffer
- MTL4AccelerationStructureTriangleGeometryDescriptor.IndexType: Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetIndexType
- MTL4AccelerationStructureTriangleGeometryDescriptor.TransformationMatrixBuffer: Assigns an optional reference to a buffer containing a `float4x3` transformation matrix.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixBuffer
- MTL4AccelerationStructureTriangleGeometryDescriptor.TransformationMatrixLayout: Configures the layout for the transformation matrix in the transformation matrix buffer.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixLayout
- MTL4AccelerationStructureTriangleGeometryDescriptor.TriangleCount: Declares the number of triangles in this geometry descriptor.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetTriangleCount
- MTL4AccelerationStructureTriangleGeometryDescriptor.VertexBuffer: Associates a vertex buffer containing triangle vertices.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetVertexBuffer
- MTL4AccelerationStructureTriangleGeometryDescriptor.VertexFormat: Describes the format of the vertices in the vertex buffer.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetVertexFormat
- MTL4AccelerationStructureTriangleGeometryDescriptor.VertexStride: Sets the stride, in bytes, between vertices in the vertex buffer.
- MTL4AccelerationStructureTriangleGeometryDescriptor.SetVertexStride
See: https://developer.apple.com/documentation/Metal/MTL4AccelerationStructureTriangleGeometryDescriptor
func MTL4AccelerationStructureTriangleGeometryDescriptorFromID ¶
func MTL4AccelerationStructureTriangleGeometryDescriptorFromID(id objc.ID) MTL4AccelerationStructureTriangleGeometryDescriptor
MTL4AccelerationStructureTriangleGeometryDescriptorFromID constructs a MTL4AccelerationStructureTriangleGeometryDescriptor from an objc.ID.
Describes triangle geometry suitable for ray tracing.
func NewMTL4AccelerationStructureTriangleGeometryDescriptor ¶
func NewMTL4AccelerationStructureTriangleGeometryDescriptor() MTL4AccelerationStructureTriangleGeometryDescriptor
NewMTL4AccelerationStructureTriangleGeometryDescriptor creates a new MTL4AccelerationStructureTriangleGeometryDescriptor instance.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) Autorelease ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) Autorelease() MTL4AccelerationStructureTriangleGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) IndexBuffer ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) IndexBuffer() MTL4BufferRange
Sets an optional index buffer containing references to vertices in the `vertexBuffer`.
Discussion ¶
You can set this property to `0`, the default, to avoid specifying an index buffer.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) IndexType ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) IndexType() MTLIndexType
Configures the size of the indices the `indexBuffer` contains, which is typically either 16 or 32-bits for each index.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) Init ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) Init() MTL4AccelerationStructureTriangleGeometryDescriptor
Init initializes the instance.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetIndexBuffer ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetIndexBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetIndexType ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBuffer ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixLayout ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetTriangleCount ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetTriangleCount(value uint)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexBuffer ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexBuffer(value MTL4BufferRange)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexFormat ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexStride ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) SetVertexStride(value uint)
func (MTL4AccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBuffer ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBuffer() MTL4BufferRange
Assigns an optional reference to a buffer containing a `float4x3` transformation matrix.
Discussion ¶
When the buffer address is non-zero, Metal applies this transform to the vertex data positions when building the acceleration structure.
Building an acceleration structure with a descriptor that specifies this property doesn’t modify the contents of the input `vertexBuffer`.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) TransformationMatrixLayout ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
Configures the layout for the transformation matrix in the transformation matrix buffer.
Discussion ¶
You can provide matrices in column-major or row-major form, and this property allows you to control how Metal interprets them.
Defaults to MTLMatrixLayoutColumnMajor.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) TriangleCount ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) TriangleCount() uint
Declares the number of triangles in this geometry descriptor.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) VertexBuffer ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) VertexBuffer() MTL4BufferRange
Associates a vertex buffer containing triangle vertices.
Discussion ¶
You are responsible for ensuring that the format of all vertex positions match the [VertexFormat] property, and that the buffer address for the buffer range is not zero.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) VertexFormat ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
Describes the format of the vertices in the vertex buffer.
Discussion ¶
This property controls the format of the position attribute of the vertices the [VertexBuffer] references.
The format defaults to MTLAttributeFormatFloat3, corresponding to three packed floating point numbers.
func (MTL4AccelerationStructureTriangleGeometryDescriptor) VertexStride ¶
func (m MTL4AccelerationStructureTriangleGeometryDescriptor) VertexStride() uint
Sets the stride, in bytes, between vertices in the vertex buffer.
Discussion ¶
The stride you specify needs to be a multiple of the size of the vertex format you provide in the [VertexFormat] property. Similarly, you are responsible for ensuring this stride matches the vertex format data type’s alignment.
Defaults to `0`, which signals the stride matches the size of the [VertexFormat] data.
type MTL4AccelerationStructureTriangleGeometryDescriptorClass ¶
type MTL4AccelerationStructureTriangleGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4AccelerationStructureTriangleGeometryDescriptorClass ¶
func GetMTL4AccelerationStructureTriangleGeometryDescriptorClass() MTL4AccelerationStructureTriangleGeometryDescriptorClass
GetMTL4AccelerationStructureTriangleGeometryDescriptorClass returns the class object for MTL4AccelerationStructureTriangleGeometryDescriptor.
func (MTL4AccelerationStructureTriangleGeometryDescriptorClass) Alloc ¶
func (mc MTL4AccelerationStructureTriangleGeometryDescriptorClass) Alloc() MTL4AccelerationStructureTriangleGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4AlphaToCoverageState ¶
type MTL4AlphaToCoverageState int
See: https://developer.apple.com/documentation/Metal/MTL4AlphaToCoverageState
const ( // MTL4AlphaToCoverageStateDisabled: Disables alpha-to-coverage. MTL4AlphaToCoverageStateDisabled MTL4AlphaToCoverageState = 0 // MTL4AlphaToCoverageStateEnabled: Enables alpha-to-coverage. MTL4AlphaToCoverageStateEnabled MTL4AlphaToCoverageState = 1 )
func (MTL4AlphaToCoverageState) String ¶
func (e MTL4AlphaToCoverageState) String() string
type MTL4AlphaToOneState ¶
type MTL4AlphaToOneState int
See: https://developer.apple.com/documentation/Metal/MTL4AlphaToOneState
const ( // MTL4AlphaToOneStateDisabled: Disables alpha-to-one. MTL4AlphaToOneStateDisabled MTL4AlphaToOneState = 0 // MTL4AlphaToOneStateEnabled: Enables alpha-to-one. MTL4AlphaToOneStateEnabled MTL4AlphaToOneState = 1 )
func (MTL4AlphaToOneState) String ¶
func (e MTL4AlphaToOneState) String() string
type MTL4Archive ¶
type MTL4Archive interface {
objectivec.IObject
// A label that you can associate with this archive.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Archive/label
Label() string
// Synchronously creates a binary version of a GPU visible function or GPU intersection function.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Archive/makeBinaryFunction(descriptor:)
NewBinaryFunctionWithDescriptorError(descriptor IMTL4BinaryFunctionDescriptor) (MTL4BinaryFunction, error)
// Creates a compute pipeline state from the archive with a compute descriptor and a dynamic linking descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Archive/newComputePipelineStateWithDescriptor:dynamicLinkingDescriptor:error:
NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorError(descriptor IMTL4ComputePipelineDescriptor, dynamicLinkingDescriptor IMTL4PipelineStageDynamicLinkingDescriptor) (MTLComputePipelineState, error)
// Creates a compute pipeline state from the archive with a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Archive/newComputePipelineStateWithDescriptor:error:
NewComputePipelineStateWithDescriptorError(descriptor IMTL4ComputePipelineDescriptor) (MTLComputePipelineState, error)
// Creates a render pipeline state from the archive with a render descriptor and a dynamic linking descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Archive/newRenderPipelineStateWithDescriptor:dynamicLinkingDescriptor:error:
NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorError(descriptor IMTL4PipelineDescriptor, dynamicLinkingDescriptor IMTL4RenderPipelineDynamicLinkingDescriptor) (MTLRenderPipelineState, error)
// Creates a render pipeline state from the archive with a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Archive/newRenderPipelineStateWithDescriptor:error:
NewRenderPipelineStateWithDescriptorError(descriptor IMTL4PipelineDescriptor) (MTLRenderPipelineState, error)
// A label that you can associate with this archive.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Archive/label
SetLabel(value string)
}
A read-only container that stores pipeline states from a shader compiler.
See: https://developer.apple.com/documentation/Metal/MTL4Archive
type MTL4ArchiveObject ¶
type MTL4ArchiveObject struct {
objectivec.Object
}
MTL4ArchiveObject wraps an existing Objective-C object that conforms to the MTL4Archive protocol.
func MTL4ArchiveObjectFromID ¶
func MTL4ArchiveObjectFromID(id objc.ID) MTL4ArchiveObject
MTL4ArchiveObjectFromID constructs a MTL4ArchiveObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4ArchiveObject) BaseObject ¶
func (o MTL4ArchiveObject) BaseObject() objectivec.Object
func (MTL4ArchiveObject) Label ¶
func (o MTL4ArchiveObject) Label() string
A label that you can associate with this archive.
See: https://developer.apple.com/documentation/Metal/MTL4Archive/label
func (MTL4ArchiveObject) NewBinaryFunctionWithDescriptorError ¶
func (o MTL4ArchiveObject) NewBinaryFunctionWithDescriptorError(descriptor IMTL4BinaryFunctionDescriptor) (MTL4BinaryFunction, error)
Synchronously creates a binary version of a GPU visible function or GPU intersection function.
descriptor: A configuration that tells the method which GPU function to make into a binary function and which options to apply when compiling it.
Return Value ¶
A new GPU binary function instance if the method succeeds; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTL4Archive/makeBinaryFunction(descriptor:)
func (MTL4ArchiveObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorError ¶
func (o MTL4ArchiveObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorError(descriptor IMTL4ComputePipelineDescriptor, dynamicLinkingDescriptor IMTL4PipelineStageDynamicLinkingDescriptor) (MTLComputePipelineState, error)
Creates a compute pipeline state from the archive with a compute descriptor and a dynamic linking descriptor.
descriptor: A compute pipeline descriptor.
dynamicLinkingDescriptor: A descriptor that provides additional properties to link other functions with the pipeline.
error: On return, if the method fails, a pointer to an error information instance; otherwise `nil`.
Return Value ¶
A compute pipeline state if the method succeeds, otherwise `nil`.
func (MTL4ArchiveObject) NewComputePipelineStateWithDescriptorError ¶
func (o MTL4ArchiveObject) NewComputePipelineStateWithDescriptorError(descriptor IMTL4ComputePipelineDescriptor) (MTLComputePipelineState, error)
Creates a compute pipeline state from the archive with a descriptor.
descriptor: A compute pipeline descriptor.
error: On return, if the method fails, a pointer to an error information instance; otherwise `nil`.
Return Value ¶
A compute pipeline state if the method succeeds, otherwise `nil`.
func (MTL4ArchiveObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorError ¶
func (o MTL4ArchiveObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorError(descriptor IMTL4PipelineDescriptor, dynamicLinkingDescriptor IMTL4RenderPipelineDynamicLinkingDescriptor) (MTLRenderPipelineState, error)
Creates a render pipeline state from the archive with a render descriptor and a dynamic linking descriptor.
descriptor: A render pipeline descriptor.
dynamicLinkingDescriptor: A descriptor that provides additional properties to link other functions with the pipeline.
error: On return, if the method fails, a pointer to an error information instance; otherwise `nil`.
Return Value ¶
A render pipeline state if the method succeeds, otherwise `nil`.
Discussion ¶
You create any kind of render pipeline states with this method, including:
- Traditional render pipelines - Mesh render pipelines - Tile render pipelines
func (MTL4ArchiveObject) NewRenderPipelineStateWithDescriptorError ¶
func (o MTL4ArchiveObject) NewRenderPipelineStateWithDescriptorError(descriptor IMTL4PipelineDescriptor) (MTLRenderPipelineState, error)
Creates a render pipeline state from the archive with a descriptor.
descriptor: A render pipeline descriptor.
error: On return, if the method fails, a pointer to an error information instance; otherwise `nil`.
Return Value ¶
A render pipeline state if the method succeeds, otherwise `nil`.
Discussion ¶
You create any kind of render pipeline states with this method, including:
- Traditional render pipelines - Mesh render pipelines - Tile render pipelines
func (MTL4ArchiveObject) SetLabel ¶
func (o MTL4ArchiveObject) SetLabel(value string)
type MTL4ArgumentTable ¶
type MTL4ArgumentTable interface {
objectivec.IObject
// The device from which you created this argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/device
Device() MTLDevice
// Assigns an optional label with this argument table for debugging purposes.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/label
Label() string
// Binds a GPU address to a buffer binding slot, providing a dynamic vertex stride.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setAddress(_:attributeStride:index:)
SetAddressAttributeStrideAtIndex(gpuAddress MTLGPUAddress, stride uint, bindingIndex uint)
// Binds a GPU address to a buffer binding slot.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setAddress(_:index:)
SetAddressAtIndex(gpuAddress MTLGPUAddress, bindingIndex uint)
// Binds a resource to a buffer binding slot.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setResource(_:bufferIndex:)
SetResourceAtBufferIndex(resourceID MTLResourceID, bindingIndex uint)
// Binds a sampler state to a sampler state binding slot.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setSamplerState(_:index:)
SetSamplerStateAtIndex(resourceID MTLResourceID, bindingIndex uint)
// Binds a texture to a texture binding slot.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setTexture(_:index:)
SetTextureAtIndex(resourceID MTLResourceID, bindingIndex uint)
}
Provides a mechanism to manage and provide resource bindings for buffers, textures, sampler states and other Metal resources.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable
type MTL4ArgumentTableDescriptor ¶
type MTL4ArgumentTableDescriptor struct {
objectivec.Object
}
Groups parameters for the creation of a Metal argument table.
Overview ¶
Argument tables provide resource bindings to your Metal pipeline states.
Instance Properties ¶
- MTL4ArgumentTableDescriptor.InitializeBindings: Configures whether Metal initializes the bindings to nil values upon creation of argument table.
- MTL4ArgumentTableDescriptor.SetInitializeBindings
- MTL4ArgumentTableDescriptor.Label: Assigns an optional label with the argument table for debug purposes.
- MTL4ArgumentTableDescriptor.SetLabel
- MTL4ArgumentTableDescriptor.MaxBufferBindCount: Determines the number of buffer-binding slots for the argument table.
- MTL4ArgumentTableDescriptor.SetMaxBufferBindCount
- MTL4ArgumentTableDescriptor.MaxSamplerStateBindCount: Determines the number of sampler state-binding slots for the argument table.
- MTL4ArgumentTableDescriptor.SetMaxSamplerStateBindCount
- MTL4ArgumentTableDescriptor.MaxTextureBindCount: Determines the number of texture-binding slots for the argument table.
- MTL4ArgumentTableDescriptor.SetMaxTextureBindCount
- MTL4ArgumentTableDescriptor.SupportAttributeStrides: Controls whether Metal should reserve memory for attribute strides in the argument table.
- MTL4ArgumentTableDescriptor.SetSupportAttributeStrides
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor
func MTL4ArgumentTableDescriptorFromID ¶
func MTL4ArgumentTableDescriptorFromID(id objc.ID) MTL4ArgumentTableDescriptor
MTL4ArgumentTableDescriptorFromID constructs a MTL4ArgumentTableDescriptor from an objc.ID.
Groups parameters for the creation of a Metal argument table.
func NewMTL4ArgumentTableDescriptor ¶
func NewMTL4ArgumentTableDescriptor() MTL4ArgumentTableDescriptor
NewMTL4ArgumentTableDescriptor creates a new MTL4ArgumentTableDescriptor instance.
func (MTL4ArgumentTableDescriptor) Autorelease ¶
func (m MTL4ArgumentTableDescriptor) Autorelease() MTL4ArgumentTableDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4ArgumentTableDescriptor) Init ¶
func (m MTL4ArgumentTableDescriptor) Init() MTL4ArgumentTableDescriptor
Init initializes the instance.
func (MTL4ArgumentTableDescriptor) InitializeBindings ¶
func (m MTL4ArgumentTableDescriptor) InitializeBindings() bool
Configures whether Metal initializes the bindings to nil values upon creation of argument table.
Discussion ¶
The default value of this property is false.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor/initializeBindings
func (MTL4ArgumentTableDescriptor) Label ¶
func (m MTL4ArgumentTableDescriptor) Label() string
Assigns an optional label with the argument table for debug purposes.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor/label
func (MTL4ArgumentTableDescriptor) MTL4CommandQueueErrorDomain ¶
func (m MTL4ArgumentTableDescriptor) MTL4CommandQueueErrorDomain() string
See: https://developer.apple.com/documentation/metal/mtl4commandqueueerrordomain
func (MTL4ArgumentTableDescriptor) MaxBufferBindCount ¶
func (m MTL4ArgumentTableDescriptor) MaxBufferBindCount() uint
Determines the number of buffer-binding slots for the argument table.
Discussion ¶
The maximum value of this parameter is 31.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor/maxBufferBindCount
func (MTL4ArgumentTableDescriptor) MaxSamplerStateBindCount ¶
func (m MTL4ArgumentTableDescriptor) MaxSamplerStateBindCount() uint
Determines the number of sampler state-binding slots for the argument table.
Discussion ¶
The maximum value of this parameter is 16.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor/maxSamplerStateBindCount
func (MTL4ArgumentTableDescriptor) MaxTextureBindCount ¶
func (m MTL4ArgumentTableDescriptor) MaxTextureBindCount() uint
Determines the number of texture-binding slots for the argument table.
Discussion ¶
The maximum value of this parameter is 128.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor/maxTextureBindCount
func (MTL4ArgumentTableDescriptor) SetInitializeBindings ¶
func (m MTL4ArgumentTableDescriptor) SetInitializeBindings(value bool)
func (MTL4ArgumentTableDescriptor) SetLabel ¶
func (m MTL4ArgumentTableDescriptor) SetLabel(value string)
func (MTL4ArgumentTableDescriptor) SetMaxBufferBindCount ¶
func (m MTL4ArgumentTableDescriptor) SetMaxBufferBindCount(value uint)
func (MTL4ArgumentTableDescriptor) SetMaxSamplerStateBindCount ¶
func (m MTL4ArgumentTableDescriptor) SetMaxSamplerStateBindCount(value uint)
func (MTL4ArgumentTableDescriptor) SetMaxTextureBindCount ¶
func (m MTL4ArgumentTableDescriptor) SetMaxTextureBindCount(value uint)
func (MTL4ArgumentTableDescriptor) SetSupportAttributeStrides ¶
func (m MTL4ArgumentTableDescriptor) SetSupportAttributeStrides(value bool)
func (MTL4ArgumentTableDescriptor) SupportAttributeStrides ¶
func (m MTL4ArgumentTableDescriptor) SupportAttributeStrides() bool
Controls whether Metal should reserve memory for attribute strides in the argument table.
Discussion ¶
Set this value to true if you intend to provide dynamic attribute strides when binding vertex array buffers to the argument table by calling [SetAddressAttributeStrideAtIndex]
The default value of this property is false.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTableDescriptor/supportAttributeStrides
type MTL4ArgumentTableDescriptorClass ¶
type MTL4ArgumentTableDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4ArgumentTableDescriptorClass ¶
func GetMTL4ArgumentTableDescriptorClass() MTL4ArgumentTableDescriptorClass
GetMTL4ArgumentTableDescriptorClass returns the class object for MTL4ArgumentTableDescriptor.
func (MTL4ArgumentTableDescriptorClass) Alloc ¶
func (mc MTL4ArgumentTableDescriptorClass) Alloc() MTL4ArgumentTableDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4ArgumentTableObject ¶
type MTL4ArgumentTableObject struct {
objectivec.Object
}
MTL4ArgumentTableObject wraps an existing Objective-C object that conforms to the MTL4ArgumentTable protocol.
func MTL4ArgumentTableObjectFromID ¶
func MTL4ArgumentTableObjectFromID(id objc.ID) MTL4ArgumentTableObject
MTL4ArgumentTableObjectFromID constructs a MTL4ArgumentTableObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4ArgumentTableObject) BaseObject ¶
func (o MTL4ArgumentTableObject) BaseObject() objectivec.Object
func (MTL4ArgumentTableObject) Device ¶
func (o MTL4ArgumentTableObject) Device() MTLDevice
The device from which you created this argument table.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/device
func (MTL4ArgumentTableObject) Label ¶
func (o MTL4ArgumentTableObject) Label() string
Assigns an optional label with this argument table for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/label
func (MTL4ArgumentTableObject) SetAddressAtIndex ¶
func (o MTL4ArgumentTableObject) SetAddressAtIndex(gpuAddress MTLGPUAddress, bindingIndex uint)
Binds a GPU address to a buffer binding slot.
gpuAddress: The GPU address of a MTLBuffer to set.
bindingIndex: A valid binding index in the buffer binding range. It is an error for this value to match or exceed the value of property [MaxBufferBindCount] on the descriptor from which you created this argument table.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setAddress(_:index:)
func (MTL4ArgumentTableObject) SetAddressAttributeStrideAtIndex ¶
func (o MTL4ArgumentTableObject) SetAddressAttributeStrideAtIndex(gpuAddress MTLGPUAddress, stride uint, bindingIndex uint)
Binds a GPU address to a buffer binding slot, providing a dynamic vertex stride.
gpuAddress: The GPU address of a MTLBuffer to set.
stride: The stride between attributes in the buffer.
bindingIndex: A valid binding index in the buffer binding range. It is an error for this value to match or exceed the value of property [MaxBufferBindCount] on the descriptor from which you created this argument table.
Discussion ¶
This method requires that the value of property [SupportAttributeStrides] on the descriptor from which you created this argument table is true.
func (MTL4ArgumentTableObject) SetResourceAtBufferIndex ¶
func (o MTL4ArgumentTableObject) SetResourceAtBufferIndex(resourceID MTLResourceID, bindingIndex uint)
Binds a resource to a buffer binding slot.
resourceID: The MTLResourceID of the Metal resource to bind. // MTLResourceID: https://developer.apple.com/documentation/Metal/MTLResourceID
bindingIndex: A valid binding index in the buffer binding range. It is an error for this value to match or exceed the value of property [MaxBufferBindCount] on the descriptor from which you created this argument table.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setResource(_:bufferIndex:)
func (MTL4ArgumentTableObject) SetSamplerStateAtIndex ¶
func (o MTL4ArgumentTableObject) SetSamplerStateAtIndex(resourceID MTLResourceID, bindingIndex uint)
Binds a sampler state to a sampler state binding slot.
resourceID: The MTLResourceID of the MTLSamplerState instance to bind. // MTLResourceID: https://developer.apple.com/documentation/Metal/MTLResourceID
bindingIndex: A valid binding index in the sampler binding range. It is an error for this value to match or exceed the value of property [MaxSamplerStateBindCount] on the descriptor from which you created this argument table.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setSamplerState(_:index:)
func (MTL4ArgumentTableObject) SetTextureAtIndex ¶
func (o MTL4ArgumentTableObject) SetTextureAtIndex(resourceID MTLResourceID, bindingIndex uint)
Binds a texture to a texture binding slot.
resourceID: The MTLResourceID of the MTLTexture instance to bind. // MTLResourceID: https://developer.apple.com/documentation/Metal/MTLResourceID
bindingIndex: A valid binding index in the texture binding range. It is an error for this value to match or exceed the value of property [MaxTextureBindCount] on the descriptor from which you created this argument table.
See: https://developer.apple.com/documentation/Metal/MTL4ArgumentTable/setTexture(_:index:)
type MTL4BinaryFunction ¶
type MTL4BinaryFunction interface {
objectivec.IObject
// Describes the type of this binary function.
//
// See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunction/functionType
FunctionType() MTLFunctionType
// Obtains the optional name of this binary function.
//
// See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunction/name
Name() string
}
Represents a binary function.
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunction
type MTL4BinaryFunctionDescriptor ¶
type MTL4BinaryFunctionDescriptor struct {
objectivec.Object
}
Base interface for other function-derived interfaces.
Instance Properties ¶
- MTL4BinaryFunctionDescriptor.FunctionDescriptor: Provides the function descriptor corresponding to the function to compile into a binary function.
- MTL4BinaryFunctionDescriptor.SetFunctionDescriptor
- MTL4BinaryFunctionDescriptor.Name: Associates a string that uniquely identifies a binary function.
- MTL4BinaryFunctionDescriptor.SetName
- MTL4BinaryFunctionDescriptor.Options: Configure the options to use at binary function creation time.
- MTL4BinaryFunctionDescriptor.SetOptions
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunctionDescriptor
func MTL4BinaryFunctionDescriptorFromID ¶
func MTL4BinaryFunctionDescriptorFromID(id objc.ID) MTL4BinaryFunctionDescriptor
MTL4BinaryFunctionDescriptorFromID constructs a MTL4BinaryFunctionDescriptor from an objc.ID.
Base interface for other function-derived interfaces.
func NewMTL4BinaryFunctionDescriptor ¶
func NewMTL4BinaryFunctionDescriptor() MTL4BinaryFunctionDescriptor
NewMTL4BinaryFunctionDescriptor creates a new MTL4BinaryFunctionDescriptor instance.
func (MTL4BinaryFunctionDescriptor) Autorelease ¶
func (m MTL4BinaryFunctionDescriptor) Autorelease() MTL4BinaryFunctionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4BinaryFunctionDescriptor) FunctionDescriptor ¶
func (m MTL4BinaryFunctionDescriptor) FunctionDescriptor() IMTL4FunctionDescriptor
Provides the function descriptor corresponding to the function to compile into a binary function.
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunctionDescriptor/functionDescriptor
func (MTL4BinaryFunctionDescriptor) Init ¶
func (m MTL4BinaryFunctionDescriptor) Init() MTL4BinaryFunctionDescriptor
Init initializes the instance.
func (MTL4BinaryFunctionDescriptor) Name ¶
func (m MTL4BinaryFunctionDescriptor) Name() string
Associates a string that uniquely identifies a binary function.
Discussion ¶
You can use this property to look up a corresponding binary function by name in a MTL4Archive instance.
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunctionDescriptor/name
func (MTL4BinaryFunctionDescriptor) Options ¶
func (m MTL4BinaryFunctionDescriptor) Options() MTL4BinaryFunctionOptions
Configure the options to use at binary function creation time.
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunctionDescriptor/options
func (MTL4BinaryFunctionDescriptor) SetFunctionDescriptor ¶
func (m MTL4BinaryFunctionDescriptor) SetFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4BinaryFunctionDescriptor) SetName ¶
func (m MTL4BinaryFunctionDescriptor) SetName(value string)
func (MTL4BinaryFunctionDescriptor) SetOptions ¶
func (m MTL4BinaryFunctionDescriptor) SetOptions(value MTL4BinaryFunctionOptions)
type MTL4BinaryFunctionDescriptorClass ¶
type MTL4BinaryFunctionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4BinaryFunctionDescriptorClass ¶
func GetMTL4BinaryFunctionDescriptorClass() MTL4BinaryFunctionDescriptorClass
GetMTL4BinaryFunctionDescriptorClass returns the class object for MTL4BinaryFunctionDescriptor.
func (MTL4BinaryFunctionDescriptorClass) Alloc ¶
func (mc MTL4BinaryFunctionDescriptorClass) Alloc() MTL4BinaryFunctionDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4BinaryFunctionObject ¶
type MTL4BinaryFunctionObject struct {
objectivec.Object
}
MTL4BinaryFunctionObject wraps an existing Objective-C object that conforms to the MTL4BinaryFunction protocol.
func MTL4BinaryFunctionObjectFromID ¶
func MTL4BinaryFunctionObjectFromID(id objc.ID) MTL4BinaryFunctionObject
MTL4BinaryFunctionObjectFromID constructs a MTL4BinaryFunctionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4BinaryFunctionObject) BaseObject ¶
func (o MTL4BinaryFunctionObject) BaseObject() objectivec.Object
func (MTL4BinaryFunctionObject) FunctionType ¶
func (o MTL4BinaryFunctionObject) FunctionType() MTLFunctionType
Describes the type of this binary function.
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunction/functionType
func (MTL4BinaryFunctionObject) Name ¶
func (o MTL4BinaryFunctionObject) Name() string
Obtains the optional name of this binary function.
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunction/name
type MTL4BinaryFunctionOptions ¶
type MTL4BinaryFunctionOptions int
See: https://developer.apple.com/documentation/Metal/MTL4BinaryFunctionOptions
const ( // MTL4BinaryFunctionOptionNone: Represents the default value: no options. MTL4BinaryFunctionOptionNone MTL4BinaryFunctionOptions = 0 // MTL4BinaryFunctionOptionPipelineIndependent: Compiles the function to have its function handles return a constant MTLResourceID across all pipeline states. MTL4BinaryFunctionOptionPipelineIndependent MTL4BinaryFunctionOptions = 2 )
func (MTL4BinaryFunctionOptions) String ¶
func (e MTL4BinaryFunctionOptions) String() string
type MTL4BlendState ¶
type MTL4BlendState int
See: https://developer.apple.com/documentation/Metal/MTL4BlendState
const ( // MTL4BlendStateDisabled: Disables blending. MTL4BlendStateDisabled MTL4BlendState = 0 // MTL4BlendStateEnabled: Enables blending. MTL4BlendStateEnabled MTL4BlendState = 1 // MTL4BlendStateUnspecialized: Defers determining the blending stage. MTL4BlendStateUnspecialized MTL4BlendState = 2 )
func (MTL4BlendState) String ¶
func (e MTL4BlendState) String() string
type MTL4BufferRange ¶
type MTL4BufferRange struct {
BufferAddress MTLGPUAddress
Length uint64
}
C struct types MTL4BufferRange
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTL4BufferRange
type MTL4CommandAllocator ¶
type MTL4CommandAllocator interface {
objectivec.IObject
// Returns the GPU device that this command allocator belongs to.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/device
Device() MTLDevice
// Provides the optional label you specify at creation time for debug purposes.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/label
Label() string
// Queries the size of the internal memory heaps of this command allocator that support encoding commands into command buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/allocatedSize()
AllocatedSize() uint64
// Marks the command allocator’s heaps for reuse.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/reset()
Reset()
}
Manages the memory backing the encoding of GPU commands into command buffers.
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator
type MTL4CommandAllocatorDescriptor ¶
type MTL4CommandAllocatorDescriptor struct {
objectivec.Object
}
Groups together parameters for creating a command allocator.
Instance Properties ¶
- MTL4CommandAllocatorDescriptor.Label: An optional label you can assign to the command allocator to aid debugging.
- MTL4CommandAllocatorDescriptor.SetLabel
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocatorDescriptor
func MTL4CommandAllocatorDescriptorFromID ¶
func MTL4CommandAllocatorDescriptorFromID(id objc.ID) MTL4CommandAllocatorDescriptor
MTL4CommandAllocatorDescriptorFromID constructs a MTL4CommandAllocatorDescriptor from an objc.ID.
Groups together parameters for creating a command allocator.
func NewMTL4CommandAllocatorDescriptor ¶
func NewMTL4CommandAllocatorDescriptor() MTL4CommandAllocatorDescriptor
NewMTL4CommandAllocatorDescriptor creates a new MTL4CommandAllocatorDescriptor instance.
func (MTL4CommandAllocatorDescriptor) Autorelease ¶
func (m MTL4CommandAllocatorDescriptor) Autorelease() MTL4CommandAllocatorDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4CommandAllocatorDescriptor) Init ¶
func (m MTL4CommandAllocatorDescriptor) Init() MTL4CommandAllocatorDescriptor
Init initializes the instance.
func (MTL4CommandAllocatorDescriptor) Label ¶
func (m MTL4CommandAllocatorDescriptor) Label() string
An optional label you can assign to the command allocator to aid debugging.
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocatorDescriptor/label
func (MTL4CommandAllocatorDescriptor) MTL4CommandQueueErrorDomain ¶
func (m MTL4CommandAllocatorDescriptor) MTL4CommandQueueErrorDomain() string
See: https://developer.apple.com/documentation/metal/mtl4commandqueueerrordomain
func (MTL4CommandAllocatorDescriptor) SetLabel ¶
func (m MTL4CommandAllocatorDescriptor) SetLabel(value string)
type MTL4CommandAllocatorDescriptorClass ¶
type MTL4CommandAllocatorDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4CommandAllocatorDescriptorClass ¶
func GetMTL4CommandAllocatorDescriptorClass() MTL4CommandAllocatorDescriptorClass
GetMTL4CommandAllocatorDescriptorClass returns the class object for MTL4CommandAllocatorDescriptor.
func (MTL4CommandAllocatorDescriptorClass) Alloc ¶
func (mc MTL4CommandAllocatorDescriptorClass) Alloc() MTL4CommandAllocatorDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4CommandAllocatorObject ¶
type MTL4CommandAllocatorObject struct {
objectivec.Object
}
MTL4CommandAllocatorObject wraps an existing Objective-C object that conforms to the MTL4CommandAllocator protocol.
func MTL4CommandAllocatorObjectFromID ¶
func MTL4CommandAllocatorObjectFromID(id objc.ID) MTL4CommandAllocatorObject
MTL4CommandAllocatorObjectFromID constructs a MTL4CommandAllocatorObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CommandAllocatorObject) AllocatedSize ¶
func (o MTL4CommandAllocatorObject) AllocatedSize() uint64
Queries the size of the internal memory heaps of this command allocator that support encoding commands into command buffers.
Return Value ¶
A size in bytes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/allocatedSize()
func (MTL4CommandAllocatorObject) BaseObject ¶
func (o MTL4CommandAllocatorObject) BaseObject() objectivec.Object
func (MTL4CommandAllocatorObject) Device ¶
func (o MTL4CommandAllocatorObject) Device() MTLDevice
Returns the GPU device that this command allocator belongs to.
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/device
func (MTL4CommandAllocatorObject) Label ¶
func (o MTL4CommandAllocatorObject) Label() string
Provides the optional label you specify at creation time for debug purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/label
func (MTL4CommandAllocatorObject) Reset ¶
func (o MTL4CommandAllocatorObject) Reset()
Marks the command allocator’s heaps for reuse.
Discussion ¶
Calling this method allows new MTL4CommandBuffer to reuse its existing internal memory heaps to encode new GPU commands.
You are responsible to ensure that all command buffers with memory originating from this allocator instance are complete before calling resetting it.
See: https://developer.apple.com/documentation/Metal/MTL4CommandAllocator/reset()
type MTL4CommandBuffer ¶
type MTL4CommandBuffer interface {
objectivec.IObject
// Returns the GPU device that this command buffer belongs to.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/device
Device() MTLDevice
// Assigns an optional label with this command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/label
Label() string
// Prepares a command buffer for encoding.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/beginCommandBuffer(allocator:)
BeginCommandBufferWithAllocator(allocator MTL4CommandAllocator)
// Prepares a command buffer for encoding with additional options.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/beginCommandBuffer(allocator:options:)
BeginCommandBufferWithAllocatorOptions(allocator MTL4CommandAllocator, options IMTL4CommandBufferOptions)
// Closes a command buffer to prepare it for submission to a command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/endCommandBuffer()
EndCommandBuffer()
// Creates a compute command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/makeComputeCommandEncoder()
ComputeCommandEncoder() MTL4ComputeCommandEncoder
// Creates a machine learning command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/makeMachineLearningCommandEncoder()
MachineLearningCommandEncoder() MTL4MachineLearningCommandEncoder
// Creates a render command encoder from a render pass descriptor with additional options.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/makeRenderCommandEncoder(descriptor:options:)
RenderCommandEncoderWithDescriptorOptions(descriptor IMTL4RenderPassDescriptor, options MTL4RenderEncoderOptions) MTL4RenderCommandEncoder
// Pops the latest string from the stack of debug groups for this command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/popDebugGroup()
PopDebugGroup()
// Pushes a string onto a stack of debug groups for this command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/pushDebugGroup(_:)
PushDebugGroup(string_ string)
// Applies a residency set to a command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/useResidencySet(_:)
UseResidencySet(residencySet MTLResidencySet)
// Writes a GPU timestamp into the given counter heap.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/writeTimestamp(counterHeap:index:)
WriteTimestampIntoHeapAtIndex(counterHeap MTL4CounterHeap, index uint)
// Creates a render command encoder from a render pass descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/renderCommandEncoderWithDescriptor:
RenderCommandEncoderWithDescriptor(descriptor IMTL4RenderPassDescriptor) MTL4RenderCommandEncoder
// Encodes a command that resolves an opaque counter heap into a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/resolveCounterHeap:withRange:intoBuffer:waitFence:updateFence:
ResolveCounterHeapWithRangeIntoBufferWaitFenceUpdateFence(counterHeap MTL4CounterHeap, range_ foundation.NSRange, bufferRange MTL4BufferRange, fenceToWait MTLFence, fenceToUpdate MTLFence)
// Applies multiple residency sets to a command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/useResidencySets:count:
UseResidencySetsCount(residencySets []MTLResidencySet, count uint)
// Assigns an optional label with this command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/label
SetLabel(value string)
}
Records a sequence of GPU commands.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer
type MTL4CommandBufferObject ¶
type MTL4CommandBufferObject struct {
objectivec.Object
}
MTL4CommandBufferObject wraps an existing Objective-C object that conforms to the MTL4CommandBuffer protocol.
func MTL4CommandBufferObjectFromID ¶
func MTL4CommandBufferObjectFromID(id objc.ID) MTL4CommandBufferObject
MTL4CommandBufferObjectFromID constructs a MTL4CommandBufferObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CommandBufferObject) BaseObject ¶
func (o MTL4CommandBufferObject) BaseObject() objectivec.Object
func (MTL4CommandBufferObject) BeginCommandBufferWithAllocator ¶
func (o MTL4CommandBufferObject) BeginCommandBufferWithAllocator(allocator MTL4CommandAllocator)
Prepares a command buffer for encoding.
allocator: MTL4CommandAllocator to attach to.
Discussion ¶
Attaches the command buffer to the specified MTL4CommandAllocator and declares that the application is ready to encode commands into the command buffer.
Command allocators only service a single command buffer at a time. If you need to issue multiple calls to this method simultaneously, for example, in a multi-threaded command encoding scenario, create multiple instances of [MTLCommandAllocator] and use one for each call.
You can safely reuse command allocators after ending the command buffer using it by calling [EndCommandBuffer].
After calling this method, any prior calls to [UseResidencySet] and [UseResidencySetsCount] on this command buffer instance no longer apply. Make sure to call these methods again to signal your residency requirements to Metal.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/beginCommandBuffer(allocator:)
func (MTL4CommandBufferObject) BeginCommandBufferWithAllocatorOptions ¶
func (o MTL4CommandBufferObject) BeginCommandBufferWithAllocatorOptions(allocator MTL4CommandAllocator, options IMTL4CommandBufferOptions)
Prepares a command buffer for encoding with additional options.
allocator: MTL4CommandAllocator to attach to.
options: MTL4CommandBufferOptions to configure the command buffer.
Discussion ¶
Attaches the command buffer to the specified MTL4CommandAllocator and declares that the application is ready to encode commands into the command buffer.
Command allocators only service a single command buffer at a time. If you need to issue multiple calls to this method simultaneously, for example, in a multi-threaded command encoding scenario, create multiple instances of [MTLCommandAllocator] and use one for each call.
You can safely reuse command allocators after ending the command buffer using it by calling [EndCommandBuffer].
After calling this method, any prior calls to [UseResidencySet] and [UseResidencySetsCount] on this command buffer instance no longer apply. Make sure to call these methods again to signal your residency requirements to Metal.
The options you provide configure the command buffer only until the command buffer ends, in the next call to [EndCommandBuffer].
func (MTL4CommandBufferObject) ComputeCommandEncoder ¶
func (o MTL4CommandBufferObject) ComputeCommandEncoder() MTL4ComputeCommandEncoder
Creates a compute command encoder.
Return Value ¶
The created MTL4ComputeCommandEncoder instance, or `nil` if the function fails.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/makeComputeCommandEncoder()
func (MTL4CommandBufferObject) Device ¶
func (o MTL4CommandBufferObject) Device() MTLDevice
Returns the GPU device that this command buffer belongs to.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/device
func (MTL4CommandBufferObject) EndCommandBuffer ¶
func (o MTL4CommandBufferObject) EndCommandBuffer()
Closes a command buffer to prepare it for submission to a command queue.
Discussion ¶
Explicitly ending the command buffer allows you to reuse the MTL4CommandAllocator to start servicing other command buffers. It is an error to call `commit` on a command buffer previously recording before calling this method.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/endCommandBuffer()
func (MTL4CommandBufferObject) Label ¶
func (o MTL4CommandBufferObject) Label() string
Assigns an optional label with this command buffer.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/label
func (MTL4CommandBufferObject) MachineLearningCommandEncoder ¶
func (o MTL4CommandBufferObject) MachineLearningCommandEncoder() MTL4MachineLearningCommandEncoder
Creates a machine learning command encoder.
Return Value ¶
The created MTL4MachineLearningCommandEncoder instance , or `nil` if the function fails.
func (MTL4CommandBufferObject) PopDebugGroup ¶
func (o MTL4CommandBufferObject) PopDebugGroup()
Pops the latest string from the stack of debug groups for this command buffer.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/popDebugGroup()
func (MTL4CommandBufferObject) PushDebugGroup ¶
func (o MTL4CommandBufferObject) PushDebugGroup(string_ string)
Pushes a string onto a stack of debug groups for this command buffer.
string: The string to push.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/pushDebugGroup(_:)
func (MTL4CommandBufferObject) RenderCommandEncoderWithDescriptor ¶
func (o MTL4CommandBufferObject) RenderCommandEncoderWithDescriptor(descriptor IMTL4RenderPassDescriptor) MTL4RenderCommandEncoder
Creates a render command encoder from a render pass descriptor.
descriptor: Descriptor for the render pass.
Return Value ¶
The created MTL4RenderCommandEncoder instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/renderCommandEncoderWithDescriptor:
func (MTL4CommandBufferObject) RenderCommandEncoderWithDescriptorOptions ¶
func (o MTL4CommandBufferObject) RenderCommandEncoderWithDescriptorOptions(descriptor IMTL4RenderPassDescriptor, options MTL4RenderEncoderOptions) MTL4RenderCommandEncoder
Creates a render command encoder from a render pass descriptor with additional options.
descriptor: Descriptor for the render pass.
options: MTL4RenderEncoderOptions instance that provide render pass options. // MTL4RenderEncoderOptions: https://developer.apple.com/documentation/Metal/MTL4RenderEncoderOptions
Return Value ¶
The created MTL4RenderCommandEncoder instance, or `nil` if the function fails.
Discussion ¶
This method creates a render command encoder to encode a render pass, whilst providing you the option to define some render pass characteristics via an instance of MTL4RenderEncoderOptions.
Use these options to configure suspending/resuming render command encoders, which allow you to encode render passes from multiple threads simultaneously.
func (MTL4CommandBufferObject) ResolveCounterHeapWithRangeIntoBufferWaitFenceUpdateFence ¶
func (o MTL4CommandBufferObject) ResolveCounterHeapWithRangeIntoBufferWaitFenceUpdateFence(counterHeap MTL4CounterHeap, range_ foundation.NSRange, bufferRange MTL4BufferRange, fenceToWait MTLFence, fenceToUpdate MTLFence)
Encodes a command that resolves an opaque counter heap into a buffer.
counterHeap: A heap the command resolves.
range: A range of index values within the heap the command resolves.
bufferRange: The buffer the command saves the data it resolves into.
fenceToWait: A fence the GPU waits for before starting, if applicable; otherwise `nil`.
fenceToUpdate: A fence the system updates after the command finishes resolving the data; otherwise `nil`.
Discussion ¶
The command this method encodes converts the data within `counterHeap` into a common format and stores it into the `bufferRange` parameter.
The command places each entry in the counter heap within `range` sequentially, starting at `alignedOffset`. Each entry needs to be a fixed size that you can query by calling the [SizeOfCounterHeapEntry] method.
This command runs during the MTLStageBlit stage of the GPU timeline. Barrier against this stage to ensure the data is present in the resolve buffer parameter before you access it.
Similarly, your app needs to synchronize any GPU accesses to `bufferRange` after the command completes with barrier.
If your app needs to access `bufferRange` from the CPU, signal an MTLSharedEvent to notify the CPU when it’s ready. Alternatively, you can resolve the heap’s data from the CPU by calling the heap’s [ResolveCounterRange] method.
func (MTL4CommandBufferObject) SetLabel ¶
func (o MTL4CommandBufferObject) SetLabel(value string)
func (MTL4CommandBufferObject) UseResidencySet ¶
func (o MTL4CommandBufferObject) UseResidencySet(residencySet MTLResidencySet)
Applies a residency set to a command buffer.
residencySet: A residency set that contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
Discussion ¶
Each command buffer can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/useResidencySet(_:)
func (MTL4CommandBufferObject) UseResidencySetsCount ¶
func (o MTL4CommandBufferObject) UseResidencySetsCount(residencySets []MTLResidencySet, count uint)
Applies multiple residency sets to a command buffer.
residencySets: A C array of residency sets, each of which contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `residencySets`.
Discussion ¶
Each command buffer can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/useResidencySets:count:
func (MTL4CommandBufferObject) WriteTimestampIntoHeapAtIndex ¶
func (o MTL4CommandBufferObject) WriteTimestampIntoHeapAtIndex(counterHeap MTL4CounterHeap, index uint)
Writes a GPU timestamp into the given counter heap.
counterHeap: MTL4CounterHeap to write the timestamp into.
index: The index within the MTL4CounterHeap that Metal writes the timestamp to.
Discussion ¶
This method captures a timestamp after work prior to this command in the command buffer is complete. Work after this call may or may not have started.
You are responsible for ensuring the `counterHeap` is of type MTL4CounterHeapTypeTimestamp.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBuffer/writeTimestamp(counterHeap:index:)
type MTL4CommandBufferOptions ¶
type MTL4CommandBufferOptions struct {
objectivec.Object
}
Options to configure a command buffer before encoding work into it.
Instance Properties ¶
- MTL4CommandBufferOptions.LogState: Contains information related to shader logging.
- MTL4CommandBufferOptions.SetLogState
See: https://developer.apple.com/documentation/Metal/MTL4CommandBufferOptions
func MTL4CommandBufferOptionsFromID ¶
func MTL4CommandBufferOptionsFromID(id objc.ID) MTL4CommandBufferOptions
MTL4CommandBufferOptionsFromID constructs a MTL4CommandBufferOptions from an objc.ID.
Options to configure a command buffer before encoding work into it.
func NewMTL4CommandBufferOptions ¶
func NewMTL4CommandBufferOptions() MTL4CommandBufferOptions
NewMTL4CommandBufferOptions creates a new MTL4CommandBufferOptions instance.
func (MTL4CommandBufferOptions) Autorelease ¶
func (m MTL4CommandBufferOptions) Autorelease() MTL4CommandBufferOptions
Autorelease adds the receiver to the current autorelease pool.
func (MTL4CommandBufferOptions) Init ¶
func (m MTL4CommandBufferOptions) Init() MTL4CommandBufferOptions
Init initializes the instance.
func (MTL4CommandBufferOptions) LogState ¶
func (m MTL4CommandBufferOptions) LogState() MTLLogState
Contains information related to shader logging.
Discussion ¶
To enable shader logging, call [BeginCommandBufferWithAllocatorOptions] with an instance of MTL4CommandBufferOptions that contains a non-`nil` MTLLogState instance in this property.
Shader functions log messages until the command buffer ends.
See: https://developer.apple.com/documentation/Metal/MTL4CommandBufferOptions/logState
func (MTL4CommandBufferOptions) MTL4CommandQueueErrorDomain ¶
func (m MTL4CommandBufferOptions) MTL4CommandQueueErrorDomain() string
See: https://developer.apple.com/documentation/metal/mtl4commandqueueerrordomain
func (MTL4CommandBufferOptions) SetLogState ¶
func (m MTL4CommandBufferOptions) SetLogState(value MTLLogState)
type MTL4CommandBufferOptionsClass ¶
type MTL4CommandBufferOptionsClass struct {
// contains filtered or unexported fields
}
func GetMTL4CommandBufferOptionsClass ¶
func GetMTL4CommandBufferOptionsClass() MTL4CommandBufferOptionsClass
GetMTL4CommandBufferOptionsClass returns the class object for MTL4CommandBufferOptions.
func (MTL4CommandBufferOptionsClass) Alloc ¶
func (mc MTL4CommandBufferOptionsClass) Alloc() MTL4CommandBufferOptions
Alloc allocates memory for a new instance of the class.
type MTL4CommandEncoder ¶
type MTL4CommandEncoder interface {
objectivec.IObject
// Returns the command buffer that is currently encoding commands.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/commandBuffer
CommandBuffer() MTL4CommandBuffer
// Provides an optional label to assign to the command encoder for debug purposes.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/label
Label() string
// Declares that all command generation from this encoder is complete.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/endEncoding()
EndEncoding()
// Inserts a debug string into the frame data to aid debugging.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/insertDebugSignpost(_:)
InsertDebugSignpost(string_ string)
// Pops the latest debug group string from this encoder’s stack of debug groups.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/popDebugGroup()
PopDebugGroup()
// Pushes a string onto this encoder’s stack of debug groups.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/pushDebugGroup(_:)
PushDebugGroup(string_ string)
// Encodes a command that instructs the GPU to update a fence after one or more stages, which can unblock other passes waiting for the fence.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/updateFence(_:afterEncoderStages:)
UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
// Encodes a command that instructs the GPU to pause before starting one or more stages of the pass until a pass updates a fence.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/waitForFence(_:beforeEncoderStages:)
WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
// Encodes an intra-pass barrier.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/barrierAfterEncoderStages:beforeEncoderStages:visibilityOptions:
BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, visibilityOptions MTL4VisibilityOptions)
// Encodes a consumer barrier on work you commit to the same command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/barrierAfterQueueStages:beforeStages:visibilityOptions:
BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, visibilityOptions MTL4VisibilityOptions)
// Encodes a producer barrier on work committed to the same command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/barrierAfterStages:beforeQueueStages:visibilityOptions:
BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, visibilityOptions MTL4VisibilityOptions)
// Provides an optional label to assign to the command encoder for debug purposes.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/label
SetLabel(value string)
}
An encoder that writes GPU commands into a command buffer.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder
type MTL4CommandEncoderObject ¶
type MTL4CommandEncoderObject struct {
objectivec.Object
}
MTL4CommandEncoderObject wraps an existing Objective-C object that conforms to the MTL4CommandEncoder protocol.
func MTL4CommandEncoderObjectFromID ¶
func MTL4CommandEncoderObjectFromID(id objc.ID) MTL4CommandEncoderObject
MTL4CommandEncoderObjectFromID constructs a MTL4CommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions ¶
func (o MTL4CommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes an intra-pass barrier.
afterEncoderStages: MTLStages mask that represents the stages of work to wait for. This argument only applies to subsequent work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeEncoderStages: MTLStages mask that represents the stages of work that wait. This argument only applies to work you encode in the current command encoder prior to this barrier. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the , corresponding to `beforeEncoderStages`, doesn’t begin until all prior commands in this command encoder, corresponding to `afterEncoderStages`, completes.
When calling this method, it’s your responsibility to ensure parameters `afterEncoderStages` and `beforeEncoderStages` contain a combination of MTLStages for which this encoder can encode commands. For example, for a MTL4ComputeCommandEncoder instance, you can provide any combination of [StageDispatch], [StageBlit] and [StageAccelerationStructure].
func (MTL4CommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions ¶
func (o MTL4CommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so encode the barrier as close to the command that consumes the resource as possible. Don’t use this method for synchronizing resource access within the same pass.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTL4CommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions ¶
func (o MTL4CommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a producer barrier on work committed to the same command queue.
afterStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in the current command encoder prior to this barrier command. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeQueueStages: MTLStages mask that represents the stages of work that need to wait. This argument applies to subsequent encoders and not to work in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
This method encodes a barrier that guarantees that any work you encode using , corresponding to `beforeQueueStages`, don’t begin until all commands you previously encode in the current encoder (and prior encoders), corresponding to `afterStages`, complete.
When calling this method, you can pass any MTLStages to parameters `afterStages` and `beforeQueueStages`, even stages that don’t relate to the current or prior command encoders.
func (MTL4CommandEncoderObject) BaseObject ¶
func (o MTL4CommandEncoderObject) BaseObject() objectivec.Object
func (MTL4CommandEncoderObject) CommandBuffer ¶
func (o MTL4CommandEncoderObject) CommandBuffer() MTL4CommandBuffer
Returns the command buffer that is currently encoding commands.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/commandBuffer
func (MTL4CommandEncoderObject) EndEncoding ¶
func (o MTL4CommandEncoderObject) EndEncoding()
Declares that all command generation from this encoder is complete.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/endEncoding()
func (MTL4CommandEncoderObject) InsertDebugSignpost ¶
func (o MTL4CommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the frame data to aid debugging.
string: The debug string to insert as a signpost.
Discussion ¶
Calling this method doesn’t change any behaviors, but can be useful for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/insertDebugSignpost(_:)
func (MTL4CommandEncoderObject) Label ¶
func (o MTL4CommandEncoderObject) Label() string
Provides an optional label to assign to the command encoder for debug purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/label
func (MTL4CommandEncoderObject) PopDebugGroup ¶
func (o MTL4CommandEncoderObject) PopDebugGroup()
Pops the latest debug group string from this encoder’s stack of debug groups.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/popDebugGroup()
func (MTL4CommandEncoderObject) PushDebugGroup ¶
func (o MTL4CommandEncoderObject) PushDebugGroup(string_ string)
Pushes a string onto this encoder’s stack of debug groups.
string: The debug string to push.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/pushDebugGroup(_:)
func (MTL4CommandEncoderObject) SetLabel ¶
func (o MTL4CommandEncoderObject) SetLabel(value string)
func (MTL4CommandEncoderObject) UpdateFenceAfterEncoderStages ¶
func (o MTL4CommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
Encodes a command that instructs the GPU to update a fence after one or more stages, which can unblock other passes waiting for the fence.
fence: A fence the pass updates after the stages in `afterEncoderStages` complete.
afterEncoderStages: The encoder stages that need to complete before the pass updates `fence`.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the pass to update `fence` after the stages you pass to the `afterEncoderStages` run all their memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
func (MTL4CommandEncoderObject) WaitForFenceBeforeEncoderStages ¶
func (o MTL4CommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
Encodes a command that instructs the GPU to pause before starting one or more stages of the pass until a pass updates a fence.
fence: A fence that the pass waits for before running the stages you pass to `beforeEncoderStages`.
beforeEncoderStages: The encoder stages that need to wait for another pass to update `fence` before they run.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the stages you pass to the `beforeEncoderStages` parameter. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
type MTL4CommandQueue ¶
type MTL4CommandQueue interface {
objectivec.IObject
// Returns the GPU device that the command queue belongs to.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/device
Device() MTLDevice
// Obtains this queue’s optional label for debugging purposes.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/label
Label() string
// Applies a residency set to a queue, which Metal applies to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/addResidencySet(_:)
AddResidencySet(residencySet MTLResidencySet)
// Removes a residency set from a command queue’s list, which means Metal doesn’t apply it to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/removeResidencySet(_:)
RemoveResidencySet(residencySet MTLResidencySet)
// Schedules a signal operation on the command queue to indicate when rendering to a Metal drawable is complete.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/signalDrawable(_:)
SignalDrawable(drawable MTLDrawable)
// Schedules an operation to signal a GPU event with a specific value after all GPU work prior to this point is complete.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/signalEvent(_:value:)
SignalEventValue(event MTLEvent, value uint64)
// Schedules a wait operation on the command queue to ensure the display is no longer using a specific Metal drawable.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/waitForDrawable(_:)
WaitForDrawable(drawable MTLDrawable)
// Schedules an operation to wait for a GPU event of a specific value before continuing to execute any future GPU work.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/waitForEvent(_:value:)
WaitForEventValue(event MTLEvent, value uint64)
// Applies multiple residency sets to a queue, which Metal applies to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/addResidencySets:count:
AddResidencySetsCount(residencySets []MTLResidencySet, count uint)
// Enqueues an array of command buffers for execution.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/commit:count:
CommitCount(commandBuffers []MTL4CommandBuffer, count uint)
// Enqueues an array of command buffer instances for execution with a set of options.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/commit:count:options:
CommitCountOptions(commandBuffers []MTL4CommandBuffer, count uint, options IMTL4CommitOptions)
// Copies multiple offsets within a source placement sparse buffer to a destination placement sparse buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/copyBufferMappingsFromBuffer:toBuffer:operations:count:
CopyBufferMappingsFromBufferToBufferOperationsCount(sourceBuffer MTLBuffer, destinationBuffer MTLBuffer, operations []MTL4CopySparseBufferMappingOperation, count uint)
// Copies multiple regions within a source placement sparse texture to a destination placement sparse texture.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/copyTextureMappingsFromTexture:toTexture:operations:count:
CopyTextureMappingsFromTextureToTextureOperationsCount(sourceTexture MTLTexture, destinationTexture MTLTexture, operations []MTL4CopySparseTextureMappingOperation, count uint)
// Removes multiple residency sets from a command queue’s list, which means Metal doesn’t apply them to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/removeResidencySets:count:
RemoveResidencySetsCount(residencySets []MTLResidencySet, count uint)
// Updates multiple regions within a placement sparse buffer to alias specific tiles from a Metal heap.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/updateBufferMappings:heap:operations:count:
UpdateBufferMappingsHeapOperationsCount(buffer MTLBuffer, heap MTLHeap, operations []MTL4UpdateSparseBufferMappingOperation, count uint)
// Updates multiple regions within a placement sparse texture to alias specific tiles of a Metal heap.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/updateTextureMappings:heap:operations:count:
UpdateTextureMappingsHeapOperationsCount(texture MTLTexture, heap MTLHeap, operations []MTL4UpdateSparseTextureMappingOperation, count uint)
}
An abstraction representing a command queue that you use commit and synchronize command buffers and to perform other GPU operations.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue
type MTL4CommandQueueDescriptor ¶
type MTL4CommandQueueDescriptor struct {
objectivec.Object
}
Groups together parameters for the creation of a new command queue.
Instance Properties ¶
- MTL4CommandQueueDescriptor.FeedbackQueue: Assigns a dispatch queue to which Metal submits feedback notification blocks.
- MTL4CommandQueueDescriptor.SetFeedbackQueue
- MTL4CommandQueueDescriptor.Label: Assigns an optional label to the command queue instance for debugging purposes.
- MTL4CommandQueueDescriptor.SetLabel
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueueDescriptor
func MTL4CommandQueueDescriptorFromID ¶
func MTL4CommandQueueDescriptorFromID(id objc.ID) MTL4CommandQueueDescriptor
MTL4CommandQueueDescriptorFromID constructs a MTL4CommandQueueDescriptor from an objc.ID.
Groups together parameters for the creation of a new command queue.
func NewMTL4CommandQueueDescriptor ¶
func NewMTL4CommandQueueDescriptor() MTL4CommandQueueDescriptor
NewMTL4CommandQueueDescriptor creates a new MTL4CommandQueueDescriptor instance.
func (MTL4CommandQueueDescriptor) Autorelease ¶
func (m MTL4CommandQueueDescriptor) Autorelease() MTL4CommandQueueDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4CommandQueueDescriptor) FeedbackQueue ¶
func (m MTL4CommandQueueDescriptor) FeedbackQueue() dispatch.Queue
Assigns a dispatch queue to which Metal submits feedback notification blocks.
Discussion ¶
When you assign a dispatch queue via this method, Metal requires that the queue parameter you provide is a serial queue.
If you set the value of property to `nil`, the default, Metal allocates an internal dispatch queue to service feedback notifications.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueueDescriptor/feedbackQueue
func (MTL4CommandQueueDescriptor) Init ¶
func (m MTL4CommandQueueDescriptor) Init() MTL4CommandQueueDescriptor
Init initializes the instance.
func (MTL4CommandQueueDescriptor) Label ¶
func (m MTL4CommandQueueDescriptor) Label() string
Assigns an optional label to the command queue instance for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueueDescriptor/label
func (MTL4CommandQueueDescriptor) MTL4CommandQueueErrorDomain ¶
func (m MTL4CommandQueueDescriptor) MTL4CommandQueueErrorDomain() string
See: https://developer.apple.com/documentation/metal/mtl4commandqueueerrordomain
func (MTL4CommandQueueDescriptor) SetFeedbackQueue ¶
func (m MTL4CommandQueueDescriptor) SetFeedbackQueue(value dispatch.Queue)
func (MTL4CommandQueueDescriptor) SetLabel ¶
func (m MTL4CommandQueueDescriptor) SetLabel(value string)
type MTL4CommandQueueDescriptorClass ¶
type MTL4CommandQueueDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4CommandQueueDescriptorClass ¶
func GetMTL4CommandQueueDescriptorClass() MTL4CommandQueueDescriptorClass
GetMTL4CommandQueueDescriptorClass returns the class object for MTL4CommandQueueDescriptor.
func (MTL4CommandQueueDescriptorClass) Alloc ¶
func (mc MTL4CommandQueueDescriptorClass) Alloc() MTL4CommandQueueDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4CommandQueueError ¶
type MTL4CommandQueueError int
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueueError-swift.struct/Code
const ( // MTL4CommandQueueErrorAccessRevoked: Indicates that the system revokes GPU access because it’s responsible for too many timeouts or hangs. MTL4CommandQueueErrorAccessRevoked MTL4CommandQueueError = 5 // MTL4CommandQueueErrorDeviceRemoved: Indicates the physical removal of the GPU before the command buffer completed. MTL4CommandQueueErrorDeviceRemoved MTL4CommandQueueError = 4 // MTL4CommandQueueErrorInternal: Indicates an internal problem in the Metal framework. MTL4CommandQueueErrorInternal MTL4CommandQueueError = 6 // MTL4CommandQueueErrorNone: Indicates the absence of any problems. MTL4CommandQueueErrorNone MTL4CommandQueueError = 0 // MTL4CommandQueueErrorNotPermitted: Indicates a process doesn’t have access to a GPU device. MTL4CommandQueueErrorNotPermitted MTL4CommandQueueError = 2 // MTL4CommandQueueErrorOutOfMemory: Indicates the GPU doesn’t have sufficient memory to execute a command buffer. MTL4CommandQueueErrorOutOfMemory MTL4CommandQueueError = 3 // MTL4CommandQueueErrorTimeout: Indicates the workload takes longer to execute than the system allows. MTL4CommandQueueErrorTimeout MTL4CommandQueueError = 1 )
func (MTL4CommandQueueError) String ¶
func (e MTL4CommandQueueError) String() string
type MTL4CommandQueueObject ¶
type MTL4CommandQueueObject struct {
objectivec.Object
}
MTL4CommandQueueObject wraps an existing Objective-C object that conforms to the MTL4CommandQueue protocol.
func MTL4CommandQueueObjectFromID ¶
func MTL4CommandQueueObjectFromID(id objc.ID) MTL4CommandQueueObject
MTL4CommandQueueObjectFromID constructs a MTL4CommandQueueObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CommandQueueObject) AddResidencySet ¶
func (o MTL4CommandQueueObject) AddResidencySet(residencySet MTLResidencySet)
Applies a residency set to a queue, which Metal applies to the queue’s command buffers as you commit them.
residencySet: A residency set that contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
Discussion ¶
Each command queue can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/addResidencySet(_:)
func (MTL4CommandQueueObject) AddResidencySetsCount ¶
func (o MTL4CommandQueueObject) AddResidencySetsCount(residencySets []MTLResidencySet, count uint)
Applies multiple residency sets to a queue, which Metal applies to the queue’s command buffers as you commit them.
residencySets: A C array of residency sets, each of which contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `residencySets`.
Discussion ¶
Each command queue can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/addResidencySets:count:
func (MTL4CommandQueueObject) BaseObject ¶
func (o MTL4CommandQueueObject) BaseObject() objectivec.Object
func (MTL4CommandQueueObject) CommitCount ¶
func (o MTL4CommandQueueObject) CommitCount(commandBuffers []MTL4CommandBuffer, count uint)
Enqueues an array of command buffers for execution.
commandBuffers: An array of MTL4CommandBuffer.
count: The number of MTL4CommandBuffer instances in the `commandBuffers` array.
Discussion ¶
The order in which you sort the command buffers in the array is meaningful, especially when it contains suspending/resuming render passes. A suspending/resuming render pass is a render pass you create by calling [RenderCommandEncoderWithDescriptorOptions], and provide MTL4RenderEncoderOptionSuspending or MTL4RenderEncoderOptionResuming for the `options` parameter.
If your command buffers contain suspend/resume render passes, ensure that the first command buffer only suspends, and the last one only resumes. Additionally, make sure that all intermediate command buffers are both suspending and resuming.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/commit:count:
func (MTL4CommandQueueObject) CommitCountOptions ¶
func (o MTL4CommandQueueObject) CommitCountOptions(commandBuffers []MTL4CommandBuffer, count uint, options IMTL4CommitOptions)
Enqueues an array of command buffer instances for execution with a set of options.
commandBuffers: An array of MTL4CommandBuffer.
count: The number of MTL4CommandBuffer instances in the `commandBuffers` array.
options: An instance of MTL4CommitOptions that configures the commit operation.
Discussion ¶
Provide an MTL4CommitOptions instance to configure the commit operation.
The order in which you sort the command buffers in the array is meaningful, especially when it contains suspending/resuming render passes. A suspending/resuming render pass is a render pass you create by calling [RenderCommandEncoderWithDescriptorOptions], and provide MTL4RenderEncoderOptionSuspending or MTL4RenderEncoderOptionResuming for the `options` parameter.
If your command buffers contain suspend/resume render passes, ensure that the first command buffer only suspends, and the last one only resumes. Additionally, make sure that all intermediate command buffers are both suspending and resuming.
When you commit work from multiple threads, modifying and reusing the same options instance, you are responsible for externally synchronizing access to it.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/commit:count:options:
func (MTL4CommandQueueObject) CopyBufferMappingsFromBufferToBufferOperationsCount ¶
func (o MTL4CommandQueueObject) CopyBufferMappingsFromBufferToBufferOperationsCount(sourceBuffer MTLBuffer, destinationBuffer MTLBuffer, operations []MTL4CopySparseBufferMappingOperation, count uint)
Copies multiple offsets within a source placement sparse buffer to a destination placement sparse buffer.
sourceBuffer: The source placement sparse MTLBuffer.
destinationBuffer: The destination placement sparse MTLBuffer.
operations: An array of MTL4CopySparseBufferMappingOperation instances to perform. // MTL4CopySparseBufferMappingOperation: https://developer.apple.com/documentation/Metal/MTL4CopySparseBufferMappingOperation
count: Number of operations to perform.
Discussion ¶
You are responsible for ensuring the source destination sparse buffers have the same `placementSparsePageSize` when you create them via [NewBufferWithLengthOptionsPlacementSparsePageSize].
Additionally, you are responsible for ensuring both the source and destination sparse buffers don’t use the same aliased tiles at the same time.
func (MTL4CommandQueueObject) CopyTextureMappingsFromTextureToTextureOperationsCount ¶
func (o MTL4CommandQueueObject) CopyTextureMappingsFromTextureToTextureOperationsCount(sourceTexture MTLTexture, destinationTexture MTLTexture, operations []MTL4CopySparseTextureMappingOperation, count uint)
Copies multiple regions within a source placement sparse texture to a destination placement sparse texture.
sourceTexture: The source placement sparse MTLTexture.
destinationTexture: The destination placement sparse MTLTexture.
operations: An array of MTL4CopySparseTextureMappingOperation instances to perform. // MTL4CopySparseTextureMappingOperation: https://developer.apple.com/documentation/Metal/MTL4CopySparseTextureMappingOperation
count: Number of operations to perform.
Discussion ¶
You are responsible for ensuring the source and destination textures have the same [PlacementSparsePageSize].
Additionally, you are responsible for ensuring that the source and destination textures don’t use the same aliased tiles at the same time.
func (MTL4CommandQueueObject) Device ¶
func (o MTL4CommandQueueObject) Device() MTLDevice
Returns the GPU device that the command queue belongs to.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/device
func (MTL4CommandQueueObject) Label ¶
func (o MTL4CommandQueueObject) Label() string
Obtains this queue’s optional label for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/label
func (MTL4CommandQueueObject) RemoveResidencySet ¶
func (o MTL4CommandQueueObject) RemoveResidencySet(residencySet MTLResidencySet)
Removes a residency set from a command queue’s list, which means Metal doesn’t apply it to the queue’s command buffers as you commit them.
residencySet: A residency set that contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
Discussion ¶
The method doesn’t remove the residency set from command buffers the queue owns with an [Status] property that’s equal to [CommandBufferStatusCommitted] or [CommandBufferStatusScheduled].
See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/removeResidencySet(_:)
func (MTL4CommandQueueObject) RemoveResidencySetsCount ¶
func (o MTL4CommandQueueObject) RemoveResidencySetsCount(residencySets []MTLResidencySet, count uint)
Removes multiple residency sets from a command queue’s list, which means Metal doesn’t apply them to the queue’s command buffers as you commit them.
residencySets: A C array of residency sets, each of which contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `residencySets`.
Discussion ¶
The method doesn’t remove the residency sets from command buffers the queue owns with an [Status] property that’s equal to [CommandBufferStatusCommitted] or [CommandBufferStatusScheduled].
See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/removeResidencySets:count:
func (MTL4CommandQueueObject) SignalDrawable ¶
func (o MTL4CommandQueueObject) SignalDrawable(drawable MTLDrawable)
Schedules a signal operation on the command queue to indicate when rendering to a Metal drawable is complete.
drawable: MTLDrawable instance to signal.
Discussion ¶
Signaling when rendering to a MTLDrawable instance is complete indicates that it’s safe to present it to the display.
You are responsible for calling this method after committing all command buffers that contain commands targeting this drawable, and before calling [Present], [PresentAtTime], or [PresentAfterMinimumDuration].
Metal doesn’t guarantee that command buffers you commit to the command queue after calling this method execute before presentation.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/signalDrawable(_:)
func (MTL4CommandQueueObject) SignalEventValue ¶
func (o MTL4CommandQueueObject) SignalEventValue(event MTLEvent, value uint64)
Schedules an operation to signal a GPU event with a specific value after all GPU work prior to this point is complete.
event: MTLEvent to signal.
value: The value to signal the MTLEvent with.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/signalEvent(_:value:)
func (MTL4CommandQueueObject) UpdateBufferMappingsHeapOperationsCount ¶
func (o MTL4CommandQueueObject) UpdateBufferMappingsHeapOperationsCount(buffer MTLBuffer, heap MTLHeap, operations []MTL4UpdateSparseBufferMappingOperation, count uint)
Updates multiple regions within a placement sparse buffer to alias specific tiles from a Metal heap.
buffer: A placement sparse MTLBuffer.
heap: An MTLHeap you allocate with type [HeapTypePlacement].
operations: An array of MTL4UpdateSparseBufferMappingOperation instances to perform. // MTL4UpdateSparseBufferMappingOperation: https://developer.apple.com/documentation/Metal/MTL4UpdateSparseBufferMappingOperation
count: Number of operations to perform.
Discussion ¶
You can provide a `nil` parameter to the `heap` argument only when you perform unmap operations. Otherwise, you are responsible for ensuring parameter `heap` references an MTLHeap that has a [MaxCompatiblePlacementSparsePageSize] of at least the buffer’s `placementSparsePageSize` you assign when creating the sparse buffer via [NewBufferWithLengthOptionsPlacementSparsePageSize].
func (MTL4CommandQueueObject) UpdateTextureMappingsHeapOperationsCount ¶
func (o MTL4CommandQueueObject) UpdateTextureMappingsHeapOperationsCount(texture MTLTexture, heap MTLHeap, operations []MTL4UpdateSparseTextureMappingOperation, count uint)
Updates multiple regions within a placement sparse texture to alias specific tiles of a Metal heap.
texture: A placement sparse MTLTexture.
heap: MTLHeap you allocate with type [HeapTypePlacement].
operations: An array of MTL4UpdateSparseTextureMappingOperation instances to perform. // MTL4UpdateSparseTextureMappingOperation: https://developer.apple.com/documentation/Metal/MTL4UpdateSparseTextureMappingOperation
count: Number of operations to perform.
Discussion ¶
You can provide a `nil` parameter to the `heap` argument only if when you perform unmap operations. Otherwise, you are responsible for ensuring the heap is non-nil and has a [MaxCompatiblePlacementSparsePageSize] of at least the texture’s [PlacementSparsePageSize].
When performing a sparse mapping update, you are responsible for issuing a barrier against stage MTLStageResourceState.
You can determine the sparse texture tier by calling `MTLTexture/sparseTextureTier`.
func (MTL4CommandQueueObject) WaitForDrawable ¶
func (o MTL4CommandQueueObject) WaitForDrawable(drawable MTLDrawable)
Schedules a wait operation on the command queue to ensure the display is no longer using a specific Metal drawable.
drawable: MTLDrawable instance to signal.
Discussion ¶
Use this method to ensure the display is no longer using a MTLDrawable instance before executing any subsequent commands.
This method returns immediately and doesn’t perform any synchronization on the current thread. You are responsible for calling this method before committing any command buffers containing commands that target this drawable.
Call this method multiple times if you commit your command buffers to multiple command queues.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/waitForDrawable(_:)
func (MTL4CommandQueueObject) WaitForEventValue ¶
func (o MTL4CommandQueueObject) WaitForEventValue(event MTLEvent, value uint64)
Schedules an operation to wait for a GPU event of a specific value before continuing to execute any future GPU work.
event: MTLEvent to wait on.
value: The specific value to wait for.
See: https://developer.apple.com/documentation/Metal/MTL4CommandQueue/waitForEvent(_:value:)
type MTL4CommitFeedback ¶
type MTL4CommitFeedback interface {
objectivec.IObject
// A description of an error when the GPU encounters an issue as it runs the committed command buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedback/error
Error() foundation.INSError
// The host time, in seconds, when the GPU finishes execution of the committed command buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedback/gpuEndTime
GPUEndTime() float64
// The host time, in seconds, when the GPU starts execution of the committed command buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedback/gpuStartTime
GPUStartTime() float64
}
Describes an object containing debug information from Metal to your app after completing a workload.
See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedback
type MTL4CommitFeedbackHandler ¶
type MTL4CommitFeedbackHandler = func(MTL4CommitFeedback)
MTL4CommitFeedbackHandler is defines the block signature for a callback Metal invokes to provide your app feedback after completing a workload.
See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedbackHandler
type MTL4CommitFeedbackObject ¶
type MTL4CommitFeedbackObject struct {
objectivec.Object
}
MTL4CommitFeedbackObject wraps an existing Objective-C object that conforms to the MTL4CommitFeedback protocol.
func MTL4CommitFeedbackObjectFromID ¶
func MTL4CommitFeedbackObjectFromID(id objc.ID) MTL4CommitFeedbackObject
MTL4CommitFeedbackObjectFromID constructs a MTL4CommitFeedbackObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CommitFeedbackObject) BaseObject ¶
func (o MTL4CommitFeedbackObject) BaseObject() objectivec.Object
func (MTL4CommitFeedbackObject) Error ¶
func (o MTL4CommitFeedbackObject) Error() foundation.INSError
A description of an error when the GPU encounters an issue as it runs the committed command buffers.
See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedback/error
func (MTL4CommitFeedbackObject) GPUEndTime ¶
func (o MTL4CommitFeedbackObject) GPUEndTime() float64
The host time, in seconds, when the GPU finishes execution of the committed command buffers.
See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedback/gpuEndTime
func (MTL4CommitFeedbackObject) GPUStartTime ¶
func (o MTL4CommitFeedbackObject) GPUStartTime() float64
The host time, in seconds, when the GPU starts execution of the committed command buffers.
See: https://developer.apple.com/documentation/Metal/MTL4CommitFeedback/gpuStartTime
type MTL4CommitOptions ¶
type MTL4CommitOptions struct {
objectivec.Object
}
Represents options to configure a commit operation on a command queue.
Overview ¶
You pass these options as a parameter when you call [CommitCountOptions].
- Note Instances of this class are not thread-safe. If your app modifies a shared commit options instance from multiple threads simultaneously, you are responsible for providing external synchronization.
Instance Methods ¶
- MTL4CommitOptions.AddFeedbackHandler: Registers a commit feedback handler that Metal calls with feedback data when available.
See: https://developer.apple.com/documentation/Metal/MTL4CommitOptions
func MTL4CommitOptionsFromID ¶
func MTL4CommitOptionsFromID(id objc.ID) MTL4CommitOptions
MTL4CommitOptionsFromID constructs a MTL4CommitOptions from an objc.ID.
Represents options to configure a commit operation on a command queue.
func NewMTL4CommitOptions ¶
func NewMTL4CommitOptions() MTL4CommitOptions
NewMTL4CommitOptions creates a new MTL4CommitOptions instance.
func (MTL4CommitOptions) AddFeedbackHandler ¶
func (m MTL4CommitOptions) AddFeedbackHandler(block MTL4CommitFeedbackHandler)
Registers a commit feedback handler that Metal calls with feedback data when available.
block: MTL4CommitFeedbackHandler that Metal invokes.
See: https://developer.apple.com/documentation/Metal/MTL4CommitOptions/addFeedbackHandler(_:)
func (MTL4CommitOptions) Autorelease ¶
func (m MTL4CommitOptions) Autorelease() MTL4CommitOptions
Autorelease adds the receiver to the current autorelease pool.
func (MTL4CommitOptions) Init ¶
func (m MTL4CommitOptions) Init() MTL4CommitOptions
Init initializes the instance.
func (MTL4CommitOptions) MTL4CommandQueueErrorDomain ¶
func (m MTL4CommitOptions) MTL4CommandQueueErrorDomain() string
See: https://developer.apple.com/documentation/metal/mtl4commandqueueerrordomain
type MTL4CommitOptionsClass ¶
type MTL4CommitOptionsClass struct {
// contains filtered or unexported fields
}
func GetMTL4CommitOptionsClass ¶
func GetMTL4CommitOptionsClass() MTL4CommitOptionsClass
GetMTL4CommitOptionsClass returns the class object for MTL4CommitOptions.
func (MTL4CommitOptionsClass) Alloc ¶
func (mc MTL4CommitOptionsClass) Alloc() MTL4CommitOptions
Alloc allocates memory for a new instance of the class.
type MTL4Compiler ¶
type MTL4Compiler interface {
objectivec.IObject
// Returns the device that this compiler belongs to.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/device
Device() MTLDevice
// Returns the optional label you specify at creation time.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/label
Label() string
// Returns the pipeline data set serializer into which this compiler stores data for all pipelines it creates.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/pipelineDataSetSerializer
PipelineDataSetSerializer() MTL4PipelineDataSetSerializer
// Creates a new dynamic library from a library containing Metal IR code synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/makeDynamicLibrary(library:)
NewDynamicLibraryError(library MTLLibrary) (MTLDynamicLibrary, error)
// Creates a new dynamic library from the contents of a file at an URL location synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/makeDynamicLibrary(url:)
NewDynamicLibraryWithURLError(url foundation.INSURL) (MTLDynamicLibrary, error)
// Creates a new Metal library synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/makeLibrary(descriptor:)
NewLibraryWithDescriptorError(descriptor IMTL4LibraryDescriptor) (MTLLibrary, error)
// Returns a new compiler task that asyncrhonously creates a binary version of a GPU visible function or GPU intersection function.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newBinaryFunctionWithDescriptor:compilerTaskOptions:completionHandler:
NewBinaryFunctionWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4BinaryFunctionDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new binary visible or intersection function synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newBinaryFunctionWithDescriptor:compilerTaskOptions:error:
NewBinaryFunctionWithDescriptorCompilerTaskOptionsError(descriptor IMTL4BinaryFunctionDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTL4BinaryFunction, error)
// Creates a new compute pipeline state asynchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newComputePipelineStateWithDescriptor:compilerTaskOptions:completionHandler:
NewComputePipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4ComputePipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new compute pipeline state object synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newComputePipelineStateWithDescriptor:compilerTaskOptions:error:
NewComputePipelineStateWithDescriptorCompilerTaskOptionsError(descriptor IMTL4ComputePipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLComputePipelineState, error)
// Creates a new compute pipeline state asynchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newComputePipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:completionHandler:
NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4ComputePipelineDescriptor, dynamicLinkingDescriptor IMTL4PipelineStageDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new compute pipeline state synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newComputePipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:error:
NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError(descriptor IMTL4ComputePipelineDescriptor, dynamicLinkingDescriptor IMTL4PipelineStageDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLComputePipelineState, error)
// Creates a new dynamic Metal library instance asynchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newDynamicLibrary:completionHandler:
NewDynamicLibraryCompletionHandler(library MTLLibrary, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new dynamic library from the contents of a file at an URL location synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newDynamicLibraryWithURL:completionHandler:
NewDynamicLibraryWithURLCompletionHandler(url foundation.INSURL, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new Metal library instance asynchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newLibraryWithDescriptor:completionHandler:
NewLibraryWithDescriptorCompletionHandler(descriptor IMTL4LibraryDescriptor, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new machine learning pipeline state asynchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newMachineLearningPipelineStateWithDescriptor:completionHandler:
NewMachineLearningPipelineStateWithDescriptorCompletionHandler(descriptor IMTL4MachineLearningPipelineDescriptor, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new ML pipeline state with descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newMachineLearningPipelineStateWithDescriptor:error:
NewMachineLearningPipelineStateWithDescriptorError(descriptor IMTL4MachineLearningPipelineDescriptor) (MTL4MachineLearningPipelineState, error)
// Creates a new render pipeline state from another, previously unspecialized, pipeline state
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newRenderPipelineStateBySpecializationWithDescriptor:pipeline:completionHandler:
NewRenderPipelineStateBySpecializationWithDescriptorPipelineCompletionHandler(descriptor IMTL4PipelineDescriptor, pipeline MTLRenderPipelineState, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new render pipeline state from another, previously unspecialized, pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newRenderPipelineStateBySpecializationWithDescriptor:pipeline:error:
NewRenderPipelineStateBySpecializationWithDescriptorPipelineError(descriptor IMTL4PipelineDescriptor, pipeline MTLRenderPipelineState) (MTLRenderPipelineState, error)
// Creates a new render pipeline state asynchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newRenderPipelineStateWithDescriptor:compilerTaskOptions:completionHandler:
NewRenderPipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4PipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new render pipeline state synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newRenderPipelineStateWithDescriptor:compilerTaskOptions:error:
NewRenderPipelineStateWithDescriptorCompilerTaskOptionsError(descriptor IMTL4PipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLRenderPipelineState, error)
// Creates a new render pipeline state asynchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newRenderPipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:completionHandler:
NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4PipelineDescriptor, dynamicLinkingDescriptor IMTL4RenderPipelineDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
// Creates a new render pipeline state synchronously.
//
// See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newRenderPipelineStateWithDescriptor:dynamicLinkingDescriptor:compilerTaskOptions:error:
NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError(descriptor IMTL4PipelineDescriptor, dynamicLinkingDescriptor IMTL4RenderPipelineDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLRenderPipelineState, error)
}
A abstraction for a pipeline state and shader function compiler.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler
type MTL4CompilerDescriptor ¶
type MTL4CompilerDescriptor struct {
objectivec.Object
}
Groups together properties for creating a compiler context.
Instance Properties ¶
- MTL4CompilerDescriptor.Label: Assigns an optional descriptor label to the compiler for debugging purposes.
- MTL4CompilerDescriptor.SetLabel
- MTL4CompilerDescriptor.PipelineDataSetSerializer: Assigns a pipeline data set serializer into which this compiler stores data for all pipelines it creates.
- MTL4CompilerDescriptor.SetPipelineDataSetSerializer
See: https://developer.apple.com/documentation/Metal/MTL4CompilerDescriptor
func MTL4CompilerDescriptorFromID ¶
func MTL4CompilerDescriptorFromID(id objc.ID) MTL4CompilerDescriptor
MTL4CompilerDescriptorFromID constructs a MTL4CompilerDescriptor from an objc.ID.
Groups together properties for creating a compiler context.
func NewMTL4CompilerDescriptor ¶
func NewMTL4CompilerDescriptor() MTL4CompilerDescriptor
NewMTL4CompilerDescriptor creates a new MTL4CompilerDescriptor instance.
func (MTL4CompilerDescriptor) Autorelease ¶
func (m MTL4CompilerDescriptor) Autorelease() MTL4CompilerDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4CompilerDescriptor) Init ¶
func (m MTL4CompilerDescriptor) Init() MTL4CompilerDescriptor
Init initializes the instance.
func (MTL4CompilerDescriptor) Label ¶
func (m MTL4CompilerDescriptor) Label() string
Assigns an optional descriptor label to the compiler for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CompilerDescriptor/label
func (MTL4CompilerDescriptor) PipelineDataSetSerializer ¶
func (m MTL4CompilerDescriptor) PipelineDataSetSerializer() MTL4PipelineDataSetSerializer
Assigns a pipeline data set serializer into which this compiler stores data for all pipelines it creates.
See: https://developer.apple.com/documentation/Metal/MTL4CompilerDescriptor/pipelineDataSetSerializer
func (MTL4CompilerDescriptor) SetLabel ¶
func (m MTL4CompilerDescriptor) SetLabel(value string)
func (MTL4CompilerDescriptor) SetPipelineDataSetSerializer ¶
func (m MTL4CompilerDescriptor) SetPipelineDataSetSerializer(value MTL4PipelineDataSetSerializer)
type MTL4CompilerDescriptorClass ¶
type MTL4CompilerDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4CompilerDescriptorClass ¶
func GetMTL4CompilerDescriptorClass() MTL4CompilerDescriptorClass
GetMTL4CompilerDescriptorClass returns the class object for MTL4CompilerDescriptor.
func (MTL4CompilerDescriptorClass) Alloc ¶
func (mc MTL4CompilerDescriptorClass) Alloc() MTL4CompilerDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4CompilerObject ¶
type MTL4CompilerObject struct {
objectivec.Object
}
MTL4CompilerObject wraps an existing Objective-C object that conforms to the MTL4Compiler protocol.
func MTL4CompilerObjectFromID ¶
func MTL4CompilerObjectFromID(id objc.ID) MTL4CompilerObject
MTL4CompilerObjectFromID constructs a MTL4CompilerObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CompilerObject) BaseObject ¶
func (o MTL4CompilerObject) BaseObject() objectivec.Object
func (MTL4CompilerObject) Device ¶
func (o MTL4CompilerObject) Device() MTLDevice
Returns the device that this compiler belongs to.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler/device
func (MTL4CompilerObject) Label ¶
func (o MTL4CompilerObject) Label() string
Returns the optional label you specify at creation time.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler/label
func (MTL4CompilerObject) NewBinaryFunctionWithDescriptorCompilerTaskOptionsCompletionHandler ¶
func (o MTL4CompilerObject) NewBinaryFunctionWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4BinaryFunctionDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
Returns a new compiler task that asyncrhonously creates a binary version of a GPU visible function or GPU intersection function.
descriptor: A configuration that tells the method which GPU function to make into a binary function and which options to apply when compiling it.
compilerTaskOptions: A configuration for the compiler task.
completionHandler: A completetion handler that you provide, which the task calls when it finishes compiling the binary function.
func (MTL4CompilerObject) NewBinaryFunctionWithDescriptorCompilerTaskOptionsError ¶
func (o MTL4CompilerObject) NewBinaryFunctionWithDescriptorCompilerTaskOptionsError(descriptor IMTL4BinaryFunctionDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTL4BinaryFunction, error)
Creates a new binary visible or intersection function synchronously.
descriptor: A binary function descriptor to use for creating the binary function.
compilerTaskOptions: A descriptor of the compilation itself, providing parameters that influence execution of the compilation process.
error: An optional parameter into which Metal stores information in case of an error.
Return Value ¶
A new binary function upon success, `nil` otherwise.
func (MTL4CompilerObject) NewComputePipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler ¶
func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4ComputePipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new compute pipeline state asynchronously.
descriptor: A compute pipeline state descriptor, describing the compute pipeline to create.
compilerTaskOptions: A descriptor of the compilation itself, providing parameters that influence execution of the compilation process.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
func (MTL4CompilerObject) NewComputePipelineStateWithDescriptorCompilerTaskOptionsError ¶
func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorCompilerTaskOptionsError(descriptor IMTL4ComputePipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLComputePipelineState, error)
Creates a new compute pipeline state object synchronously.
descriptor: A compute pipeline state descriptor describing the pipeline this compiler creates.
compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.
error: An optional parameter into which Metal stores information in case of an error.
Return Value ¶
A new compute pipeline state object upon success, `nil` otherwise.
func (MTL4CompilerObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler ¶
func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4ComputePipelineDescriptor, dynamicLinkingDescriptor IMTL4PipelineStageDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new compute pipeline state asynchronously.
descriptor: A compute pipeline state descriptor, describing the compute pipeline to create.
dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.
compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
func (MTL4CompilerObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError ¶
func (o MTL4CompilerObject) NewComputePipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError(descriptor IMTL4ComputePipelineDescriptor, dynamicLinkingDescriptor IMTL4PipelineStageDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLComputePipelineState, error)
Creates a new compute pipeline state synchronously.
descriptor: A compute pipeline state descriptor describing the pipeline this compiler creates.
dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.
compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.
error: An optional parameter into which Metal stores information in case of an error.
Return Value ¶
A new compute pipeline state object upon success, `nil` otherwise.
func (MTL4CompilerObject) NewDynamicLibraryCompletionHandler ¶
func (o MTL4CompilerObject) NewDynamicLibraryCompletionHandler(library MTLLibrary, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new dynamic Metal library instance asynchronously.
library: A library from which this compiler creates the new a dynamic library
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler/newDynamicLibrary:completionHandler:
func (MTL4CompilerObject) NewDynamicLibraryError ¶
func (o MTL4CompilerObject) NewDynamicLibraryError(library MTLLibrary) (MTLDynamicLibrary, error)
Creates a new dynamic library from a library containing Metal IR code synchronously.
library: A library from which this compiler creates the new a dynamic library
Return Value ¶
A new dynamic Metal library upon success, `nil` otherwise.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler/makeDynamicLibrary(library:)
func (MTL4CompilerObject) NewDynamicLibraryWithURLCompletionHandler ¶
func (o MTL4CompilerObject) NewDynamicLibraryWithURLCompletionHandler(url foundation.INSURL, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new dynamic library from the contents of a file at an URL location synchronously.
url: An URL referencing a file whose contents this compiler uses to build a dynamic library.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
func (MTL4CompilerObject) NewDynamicLibraryWithURLError ¶
func (o MTL4CompilerObject) NewDynamicLibraryWithURLError(url foundation.INSURL) (MTLDynamicLibrary, error)
Creates a new dynamic library from the contents of a file at an URL location synchronously.
url: An URL referencing a file whose contents this compiler uses to build a dynamic library.
Return Value ¶
A new dynamic Metal library upon success, `nil` otherwise.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler/makeDynamicLibrary(url:)
func (MTL4CompilerObject) NewLibraryWithDescriptorCompletionHandler ¶
func (o MTL4CompilerObject) NewLibraryWithDescriptorCompletionHandler(descriptor IMTL4LibraryDescriptor, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new Metal library instance asynchronously.
descriptor: A description of the library to create.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
func (MTL4CompilerObject) NewLibraryWithDescriptorError ¶
func (o MTL4CompilerObject) NewLibraryWithDescriptorError(descriptor IMTL4LibraryDescriptor) (MTLLibrary, error)
Creates a new Metal library synchronously.
descriptor: A description of the library to create.
Return Value ¶
A Metal library instance upon success, `nil` otherwise.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler/makeLibrary(descriptor:)
func (MTL4CompilerObject) NewMachineLearningPipelineStateWithDescriptorCompletionHandler ¶
func (o MTL4CompilerObject) NewMachineLearningPipelineStateWithDescriptorCompletionHandler(descriptor IMTL4MachineLearningPipelineDescriptor, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new machine learning pipeline state asynchronously.
descriptor: A machine learning pipeline state descriptor to use for creating the new pipeline state.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
func (MTL4CompilerObject) NewMachineLearningPipelineStateWithDescriptorError ¶
func (o MTL4CompilerObject) NewMachineLearningPipelineStateWithDescriptorError(descriptor IMTL4MachineLearningPipelineDescriptor) (MTL4MachineLearningPipelineState, error)
Creates a new ML pipeline state with descriptor.
descriptor: A machine learning pipeline state descriptor to use for creating the new pipeline state.
error: An optional parameter into which Metal stores information in case of an error.
Return Value ¶
A machine learning pipeline state if operation is successful, otherwise `nil`.
func (MTL4CompilerObject) NewRenderPipelineStateBySpecializationWithDescriptorPipelineCompletionHandler ¶
func (o MTL4CompilerObject) NewRenderPipelineStateBySpecializationWithDescriptorPipelineCompletionHandler(descriptor IMTL4PipelineDescriptor, pipeline MTLRenderPipelineState, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new render pipeline state from another, previously unspecialized, pipeline state
descriptor: A render pipeline state descriptor or any type: default, tile, or mesh render pipeline descriptor.
pipeline: A render pipeline state containing unspecialized substate.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
Discussion ¶
Metal specializes the pipeline state with new state values the descriptor provides, observing the following rules:
- The compiler only updates properties that were originally specified as . It doesn’t modify other already-specialized properties - The compiler sets to their default behavior any unspecialized properties that your passed-in descriptor doesn’t specialize
Additionally, there are some cases where the Metal can’t specialize a pipeline:
- If the original pipeline state object doesn’t have any unspecialized properties - You can’t re-specialize a previously specialized pipeline state object
func (MTL4CompilerObject) NewRenderPipelineStateBySpecializationWithDescriptorPipelineError ¶
func (o MTL4CompilerObject) NewRenderPipelineStateBySpecializationWithDescriptorPipelineError(descriptor IMTL4PipelineDescriptor, pipeline MTLRenderPipelineState) (MTLRenderPipelineState, error)
Creates a new render pipeline state from another, previously unspecialized, pipeline state.
descriptor: A render pipeline state descriptor or any type: default, tile, or mesh render pipeline descriptor.
pipeline: A render pipeline state containing unspecialized substate.
error: An optional parameter into which Metal stores information in case of an error.
Return Value ¶
A fully-specialized pipeline state object.
Discussion ¶
Metal specializes the pipeline state with new state values the descriptor provides, observing the following rules:
- The compiler only updates properties that were originally specified as . It doesn’t modify other already-specialized properties - The compiler sets to their default behavior any unspecialized properties that your passed-in descriptor doesn’t specialize
Additionally, there are some cases where the Metal can’t specialize a pipeline:
- If the original pipeline state object doesn’t have any unspecialized properties - You can’t re-specialize a previously specialized pipeline state object
func (MTL4CompilerObject) NewRenderPipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler ¶
func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4PipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new render pipeline state asynchronously.
descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.
compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
Discussion ¶
Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.
Passing in a compute pipeline descriptor to the `descriptor` parameter produces an error.
func (MTL4CompilerObject) NewRenderPipelineStateWithDescriptorCompilerTaskOptionsError ¶
func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorCompilerTaskOptionsError(descriptor IMTL4PipelineDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLRenderPipelineState, error)
Creates a new render pipeline state synchronously.
descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.
compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.
error: An optional parameter into which Metal stores information in case of an error.
Return Value ¶
A new render pipeline state object upon success, `nil` otherwise.
Discussion ¶
Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.
Passing in a compute pipeline descriptor to the `descriptor` parameter produces an error.
func (MTL4CompilerObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler ¶
func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsCompletionHandler(descriptor IMTL4PipelineDescriptor, dynamicLinkingDescriptor IMTL4RenderPipelineDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions, completionHandler ErrorHandler) MTL4CompilerTask
Creates a new render pipeline state asynchronously.
descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.
dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.
compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.
completionHandler: A block Metal calls when it finishes the build task.
Return Value ¶
A compiler task representing the asynchronous compilation task.
Discussion ¶
Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.
Passing in a compute pipeline descriptor to the `descriptor` parameter produces an error.
func (MTL4CompilerObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError ¶
func (o MTL4CompilerObject) NewRenderPipelineStateWithDescriptorDynamicLinkingDescriptorCompilerTaskOptionsError(descriptor IMTL4PipelineDescriptor, dynamicLinkingDescriptor IMTL4RenderPipelineDynamicLinkingDescriptor, compilerTaskOptions IMTL4CompilerTaskOptions) (MTLRenderPipelineState, error)
Creates a new render pipeline state synchronously.
descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.
dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.
compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.
error: An optional parameter into which Metal stores information in case of an error.
Return Value ¶
A new render pipeline state object upon success, `nil` otherwise.
Discussion ¶
Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.
Passing in a compute pipeline descriptor to the `descriptor` parameter produces an error.
func (MTL4CompilerObject) PipelineDataSetSerializer ¶
func (o MTL4CompilerObject) PipelineDataSetSerializer() MTL4PipelineDataSetSerializer
Returns the pipeline data set serializer into which this compiler stores data for all pipelines it creates.
See: https://developer.apple.com/documentation/Metal/MTL4Compiler/pipelineDataSetSerializer
type MTL4CompilerTask ¶
type MTL4CompilerTask interface {
objectivec.IObject
// Returns the compiler instance that this asynchronous compiler task belongs to.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CompilerTask/compiler
Compiler() MTL4Compiler
// Returns the compiler task status.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CompilerTask/status
Status() MTL4CompilerTaskStatus
// Waits synchronously for this compile task to complete by blocking the calling thread.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CompilerTask/waitUntilCompleted
WaitUntilCompleted()
}
A reference to an asynchronous compilation task that you initiate from a compiler instance.
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTask
type MTL4CompilerTaskObject ¶
type MTL4CompilerTaskObject struct {
objectivec.Object
}
MTL4CompilerTaskObject wraps an existing Objective-C object that conforms to the MTL4CompilerTask protocol.
func MTL4CompilerTaskObjectFromID ¶
func MTL4CompilerTaskObjectFromID(id objc.ID) MTL4CompilerTaskObject
MTL4CompilerTaskObjectFromID constructs a MTL4CompilerTaskObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CompilerTaskObject) BaseObject ¶
func (o MTL4CompilerTaskObject) BaseObject() objectivec.Object
func (MTL4CompilerTaskObject) Compiler ¶
func (o MTL4CompilerTaskObject) Compiler() MTL4Compiler
Returns the compiler instance that this asynchronous compiler task belongs to.
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTask/compiler
func (MTL4CompilerTaskObject) Status ¶
func (o MTL4CompilerTaskObject) Status() MTL4CompilerTaskStatus
Returns the compiler task status.
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTask/status
func (MTL4CompilerTaskObject) WaitUntilCompleted ¶
func (o MTL4CompilerTaskObject) WaitUntilCompleted()
Waits synchronously for this compile task to complete by blocking the calling thread.
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTask/waitUntilCompleted
type MTL4CompilerTaskOptions ¶
type MTL4CompilerTaskOptions struct {
objectivec.Object
}
The configuration options that control the behavior of a compilation task for a Metal 4 compiler instance.
Overview ¶
You can configure task-specific settings that affect a compilation task by creating an instance of this class, setting its properties, and passing it to one of the applicable methods of an MTL4Compiler instance.
Instance Properties ¶
- MTL4CompilerTaskOptions.LookupArchives: An array of archive instances that can potentially accelerate a compilation task.
- MTL4CompilerTaskOptions.SetLookupArchives
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTaskOptions
func MTL4CompilerTaskOptionsFromID ¶
func MTL4CompilerTaskOptionsFromID(id objc.ID) MTL4CompilerTaskOptions
MTL4CompilerTaskOptionsFromID constructs a MTL4CompilerTaskOptions from an objc.ID.
The configuration options that control the behavior of a compilation task for a Metal 4 compiler instance.
func NewMTL4CompilerTaskOptions ¶
func NewMTL4CompilerTaskOptions() MTL4CompilerTaskOptions
NewMTL4CompilerTaskOptions creates a new MTL4CompilerTaskOptions instance.
func (MTL4CompilerTaskOptions) Autorelease ¶
func (m MTL4CompilerTaskOptions) Autorelease() MTL4CompilerTaskOptions
Autorelease adds the receiver to the current autorelease pool.
func (MTL4CompilerTaskOptions) Init ¶
func (m MTL4CompilerTaskOptions) Init() MTL4CompilerTaskOptions
Init initializes the instance.
func (MTL4CompilerTaskOptions) LookupArchives ¶
func (m MTL4CompilerTaskOptions) LookupArchives() []objectivec.IObject
An array of archive instances that can potentially accelerate a compilation task.
Discussion ¶
The compiler can reduce the runtime of a compilation task if it finds an entry that matches a function description within any of the archives in this array. The compiler searches the archives in the order of the array’s element.
Consider adding archives to the array in scenarios that can benefit from the runtime savings, such as repeat builds or when your app can share compilation results across multiple contexts.
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTaskOptions/lookupArchives
func (MTL4CompilerTaskOptions) SetLookupArchives ¶
func (m MTL4CompilerTaskOptions) SetLookupArchives(value []objectivec.IObject)
type MTL4CompilerTaskOptionsClass ¶
type MTL4CompilerTaskOptionsClass struct {
// contains filtered or unexported fields
}
func GetMTL4CompilerTaskOptionsClass ¶
func GetMTL4CompilerTaskOptionsClass() MTL4CompilerTaskOptionsClass
GetMTL4CompilerTaskOptionsClass returns the class object for MTL4CompilerTaskOptions.
func (MTL4CompilerTaskOptionsClass) Alloc ¶
func (mc MTL4CompilerTaskOptionsClass) Alloc() MTL4CompilerTaskOptions
Alloc allocates memory for a new instance of the class.
type MTL4CompilerTaskStatus ¶
type MTL4CompilerTaskStatus int
See: https://developer.apple.com/documentation/Metal/MTL4CompilerTaskStatus
const ( // MTL4CompilerTaskStatusCompiling: The compiler task is currently compiling. MTL4CompilerTaskStatusCompiling MTL4CompilerTaskStatus = 2 // MTL4CompilerTaskStatusFinished: The compiler task is finished. MTL4CompilerTaskStatusFinished MTL4CompilerTaskStatus = 3 // MTL4CompilerTaskStatusNone: No status. MTL4CompilerTaskStatusNone MTL4CompilerTaskStatus = 0 // MTL4CompilerTaskStatusScheduled: The compiler task is currently scheduled. MTL4CompilerTaskStatusScheduled MTL4CompilerTaskStatus = 1 )
func (MTL4CompilerTaskStatus) String ¶
func (e MTL4CompilerTaskStatus) String() string
type MTL4ComputeCommandEncoder ¶
type MTL4ComputeCommandEncoder interface {
objectivec.IObject
MTL4CommandEncoder
// Configures this encoder with a compute pipeline state that applies to your subsequent dispatch commands.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/setComputePipelineState(_:)
SetComputePipelineState(state MTLComputePipelineState)
// Sets an argument table for the compute shader stage of this pipeline.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/setArgumentTable(_:)
SetArgumentTable(argumentTable MTL4ArgumentTable)
// Configures the size of a threadgroup memory buffer for a threadgroup argument in the compute shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/setThreadgroupMemoryLength(_:index:)
SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
// Specifies the size, in pixels, of imageblock data in tile memory.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/setImageblockSize(width:height:)
SetImageblockWidthHeight(width uint, height uint)
// Queries a bitmask representing the shader stages on which commands currently present in this command encoder operate.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/stages()
Stages() MTLStages
// Encodes a compute dispatch command using an arbitrarily-sized grid.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/dispatchThreads(threadsPerGrid:threadsPerThreadgroup:)
DispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
// Encodes a compute dispatch command with an arbitrarily sized grid, using an indirect buffer for arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/dispatchThreads(indirectBuffer:)
DispatchThreadsWithIndirectBuffer(indirectBuffer MTLGPUAddress)
// Encodes a compute dispatch command with a grid that aligns to threadgroup boundaries.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/dispatchThreadgroups(threadgroupsPerGrid:threadsPerThreadgroup:)
DispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
// Encodes a compute dispatch command with a grid that aligns to threadgroup boundaries, using an indirect buffer for arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/dispatchThreadgroups(indirectBuffer:threadsPerThreadgroup:)
DispatchThreadgroupsWithIndirectBufferThreadsPerThreadgroup(indirectBuffer MTLGPUAddress, threadsPerThreadgroup MTLSize)
// Encodes a command that copies data from a buffer instance into another.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copy(sourceBuffer:sourceOffset:destinationBuffer:destinationOffset:size:)
CopyFromBufferSourceOffsetToBufferDestinationOffsetSize(sourceBuffer MTLBuffer, sourceOffset uint, destinationBuffer MTLBuffer, destinationOffset uint, size uint)
// Encodes a command to copy data from a tensor instance into another.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copy(sourceTensor:sourceOrigin:sourceDimensions:destinationTensor:destinationOrigin:destinationDimensions:)
CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions(sourceTensor MTLTensor, sourceOrigin IMTLTensorExtents, sourceDimensions IMTLTensorExtents, destinationTensor MTLTensor, destinationOrigin IMTLTensorExtents, destinationDimensions IMTLTensorExtents)
// Encodes a command that copies data from a texture to another.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copy(sourceTexture:destinationTexture:)
CopyFromTextureToTexture(sourceTexture MTLTexture, destinationTexture MTLTexture)
// Encodes a command that copies slices of a texture to slices of another texture.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copy(sourceTexture:sourceSlice:sourceLevel:destinationTexture:destinationSlice:destinationLevel:sliceCount:levelCount:)
CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, sliceCount uint, levelCount uint)
// Encodes a command that copies image data from a slice of a texture into a slice of another texture.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copy(sourceTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:destinationTexture:destinationSlice:destinationLevel:destinationOrigin:)
CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
// Encodes a command that generates mipmaps for a texture instance from the base mipmap level up to the highest mipmap level.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/generateMipmaps(texture:)
GenerateMipmapsForTexture(texture MTLTexture)
// Encodes a command that modifies the contents of a texture to improve the performance of CPU accesses to its contents.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/optimizeContents(forCPUAccess:)
OptimizeContentsForCPUAccess(texture MTLTexture)
// Encodes a command that modifies the contents of a texture to improve the performance of CPU accesses to its contents in a specific region.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/optimizeContents(forCPUAccess:slice:level:)
OptimizeContentsForCPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
// Encodes a command that modifies the contents of a texture to improve the performance of GPU accesses to its contents.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/optimizeContents(forGPUAccess:)
OptimizeContentsForGPUAccess(texture MTLTexture)
// Encodes a command that modifies the contents of a texture instance to improve the performance of GPU accesses to its contents in a specific region.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/optimizeContents(forGPUAccess:slice:level:)
OptimizeContentsForGPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
// Encodes an acceleration structure build into the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/build(destinationAccelerationStructure:descriptor:scratchBuffer:)
BuildAccelerationStructureDescriptorScratchBuffer(accelerationStructure MTLAccelerationStructure, descriptor IMTL4AccelerationStructureDescriptor, scratchBuffer MTL4BufferRange)
// Encodes an acceleration structure copy operation into the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copy(sourceAccelerationStructure:destinationAccelerationStructure:)
CopyAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
// Encodes a command to copy and compact an acceleration structure.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copyAndCompact(sourceAccelerationStructure:destinationAccelerationStructure:)
CopyAndCompactAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
// Encodes a command to compute the size an acceleration structure can compact into, writing the result into a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/writeCompactedSize(sourceAccelerationStructure:destinationBuffer:)
WriteCompactedAccelerationStructureSizeToBuffer(accelerationStructure MTLAccelerationStructure, buffer MTL4BufferRange)
// Encodes an acceleration structure refit operation into the command buffer, providing additional options.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/refit(sourceAccelerationStructure:descriptor:destinationAccelerationStructure:scratchBuffer:options:)
RefitAccelerationStructureDescriptorDestinationScratchBufferOptions(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTL4AccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTL4BufferRange, options MTLAccelerationStructureRefitOptions)
// Encodes an instruction to execute commands from an indirect command buffer, using an indirect buffer for arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/executeCommands(buffer:indirectBuffer:)
ExecuteCommandsInBufferIndirectBuffer(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLGPUAddress)
// Writes a GPU timestamp into a heap.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/writeTimestamp(granularity:counterHeap:index:)
WriteTimestampWithGranularityIntoHeapAtIndex(granularity MTL4TimestampGranularity, counterHeap MTL4CounterHeap, index uint)
// Encodes a command to copy image data from a buffer instance into a texture.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:
CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
// Encodes a command to copy image data from a buffer into a texture with options for special texture formats.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options:
CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin, options MTLBlitOption)
// Encodes a command that copies image data from a slice of an [MTLTexture](<doc://com.apple.metal/documentation/Metal/MTLTexture>) instance to an [MTLBuffer](<doc://com.apple.metal/documentation/Metal/MTLBuffer>) instance.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:
CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint)
// Encodes a command that copies image data from a slice of a texture instance to a buffer, with options for special texture formats.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options:
CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint, options MTLBlitOption)
// Encodes a command that copies commands from an indirect command buffer into another.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/copyIndirectCommandBuffer:sourceRange:destination:destinationIndex:
CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex(source MTLIndirectCommandBuffer, sourceRange foundation.NSRange, destination MTLIndirectCommandBuffer, destinationIndex uint)
// Encodes a command to execute a series of commands from an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/executeCommandsInBuffer:withRange:
ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
// Encodes a command that fills a buffer with a constant value for each byte.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/fillBuffer:range:value:
FillBufferRangeValue(buffer MTLBuffer, range_ foundation.NSRange, value uint8)
// Encode a command to attempt to improve the performance of a range of commands within an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/optimizeIndirectCommandBuffer:withRange:
OptimizeIndirectCommandBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
// Encodes an acceleration structure refit into the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/refitAccelerationStructure:descriptor:destination:scratchBuffer:
RefitAccelerationStructureDescriptorDestinationScratchBuffer(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTL4AccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTL4BufferRange)
// Encodes a command that resets a range of commands in an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/resetCommandsInBuffer:withRange:
ResetCommandsInBufferWithRange(buffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
}
Encodes computation dispatches, resource copying commands, and acceleration structure building commands for a single pass into a command buffer.
See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder
type MTL4ComputeCommandEncoderObject ¶
type MTL4ComputeCommandEncoderObject struct {
objectivec.Object
}
MTL4ComputeCommandEncoderObject wraps an existing Objective-C object that conforms to the MTL4ComputeCommandEncoder protocol.
func MTL4ComputeCommandEncoderObjectFromID ¶
func MTL4ComputeCommandEncoderObjectFromID(id objc.ID) MTL4ComputeCommandEncoderObject
MTL4ComputeCommandEncoderObjectFromID constructs a MTL4ComputeCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4ComputeCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions ¶
func (o MTL4ComputeCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes an intra-pass barrier.
afterEncoderStages: MTLStages mask that represents the stages of work to wait for. This argument only applies to subsequent work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeEncoderStages: MTLStages mask that represents the stages of work that wait. This argument only applies to work you encode in the current command encoder prior to this barrier. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the , corresponding to `beforeEncoderStages`, doesn’t begin until all prior commands in this command encoder, corresponding to `afterEncoderStages`, completes.
When calling this method, it’s your responsibility to ensure parameters `afterEncoderStages` and `beforeEncoderStages` contain a combination of MTLStages for which this encoder can encode commands. For example, for a MTL4ComputeCommandEncoder instance, you can provide any combination of [StageDispatch], [StageBlit] and [StageAccelerationStructure].
func (MTL4ComputeCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions ¶
func (o MTL4ComputeCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so encode the barrier as close to the command that consumes the resource as possible. Don’t use this method for synchronizing resource access within the same pass.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTL4ComputeCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions ¶
func (o MTL4ComputeCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a producer barrier on work committed to the same command queue.
afterStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in the current command encoder prior to this barrier command. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeQueueStages: MTLStages mask that represents the stages of work that need to wait. This argument applies to subsequent encoders and not to work in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
This method encodes a barrier that guarantees that any work you encode using , corresponding to `beforeQueueStages`, don’t begin until all commands you previously encode in the current encoder (and prior encoders), corresponding to `afterStages`, complete.
When calling this method, you can pass any MTLStages to parameters `afterStages` and `beforeQueueStages`, even stages that don’t relate to the current or prior command encoders.
func (MTL4ComputeCommandEncoderObject) BaseObject ¶
func (o MTL4ComputeCommandEncoderObject) BaseObject() objectivec.Object
func (MTL4ComputeCommandEncoderObject) BuildAccelerationStructureDescriptorScratchBuffer ¶
func (o MTL4ComputeCommandEncoderObject) BuildAccelerationStructureDescriptorScratchBuffer(accelerationStructure MTLAccelerationStructure, descriptor IMTL4AccelerationStructureDescriptor, scratchBuffer MTL4BufferRange)
Encodes an acceleration structure build into the command buffer.
accelerationStructure: Acceleration structure storage to build into.
descriptor: A descriptor for the acceleration structure Metal builds.
scratchBuffer: Scratch buffer Metal can use while building the acceleration structure. Metal may overwrite the contents of this buffer, and you should consider them “undefined” after the refit operation starts and completes.
Discussion ¶
Before you build an instance acceleration structure, you are responsible for ensuring the build operations for all primitive acceleration structures is complete. The built acceleration structure doesn’t retain any references to the input buffers of the descriptor, such as the vertex buffer or instance buffer, among others.
The acceleration structure build process may continue as long as the command buffer is not completed. However, you can safely encode ray tracing work against the acceleration structure if you schedule and synchronize the command buffers that contain this ray tracing work such that the command buffer with the build command is complete by the time ray tracing starts.
You are responsible for ensuring that the acceleration structure and scratch buffer are at least the size that the query [AccelerationStructureSizesWithDescriptor] returns.
Use an instance of MTLResidencySet to mark residency of the scratch buffer the `scratchBuffer` parameter references, as well as for all the primitive acceleration structures you directly and indirectly reference.
func (MTL4ComputeCommandEncoderObject) CommandBuffer ¶
func (o MTL4ComputeCommandEncoderObject) CommandBuffer() MTL4CommandBuffer
Returns the command buffer that is currently encoding commands.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/commandBuffer
func (MTL4ComputeCommandEncoderObject) CopyAccelerationStructureToAccelerationStructure ¶
func (o MTL4ComputeCommandEncoderObject) CopyAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
Encodes an acceleration structure copy operation into the command buffer.
sourceAccelerationStructure: Acceleration structure to copy from.
destinationAccelerationStructure: Acceleration structure to copy to.
Discussion ¶
You are responsible for ensuring the source and destination acceleration structures don’t overlap in memory. If this is an instance acceleration structure, Metal preserves references to the primitive acceleration structures it references.
Typically, the destination acceleration structure is at least as large as the source acceleration structure, except in cases where you compact the source acceleration structure. In this case, you need to allocate the destination acceleration to be at least as large as the compacted size of the source acceleration structure.
func (MTL4ComputeCommandEncoderObject) CopyAndCompactAccelerationStructureToAccelerationStructure ¶
func (o MTL4ComputeCommandEncoderObject) CopyAndCompactAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
Encodes a command to copy and compact an acceleration structure.
sourceAccelerationStructure: Acceleration structure to copy and compact.
destinationAccelerationStructure: Acceleration structure to copy to.
Discussion ¶
You are responsible for ensuring that the source and destination acceleration structures don’t overlap in memory. If this is an instance acceleration structure, Metal preserves references to primitive acceleration structures it references.
This operation requires that the destination acceleration structure is at least as large as the compacted size of the source acceleration structure. You can compute this size by calling the [WriteCompactedAccelerationStructureSizeToBuffer] method.
func (MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
Encodes a command to copy image data from a buffer instance into a texture.
sourceBuffer: A MTLBuffer instance the command copies data from.
sourceOffset: A byte offset within `sourceBuffer` the command copies from. Set this value to a multiple of `destinationTexture's` pixel size, in bytes.
sourceBytesPerRow: The number of bytes between adjacent rows of pixels in `sourceBuffer`. Set this value to a multiple of `destinationTexture's` pixel size, in bytes, and less than or equal to the product of `destinationTexture's` pixel size, in bytes, and the largest pixel width `destinationTexture's` type allows. If `destinationTexture` uses a compressed pixel format, set `sourceBytesPerRow` to the number of bytes between the starts of two row blocks.
sourceBytesPerImage: The number of bytes between each 2D image of a 3D texture. Set this value to a multiple of `destinationTexture's` pixel size, in bytes, or `0` if `sourceSize's` [depth] value is `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
sourceSize: A MTLSize instance that represents the size of the region in `destinationTexture`, in pixels, that the command copies data to, starting at `destinationOrigin`. Assign `1` to each dimension that’s not relevant to `destinationTexture`. If `destinationTexture` uses a compressed pixel format, set `sourceSize` to a multiple of `destinationTexture's` [PixelFormat] block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
destinationTexture: An MTLTexture instance the command copies data to. In order to copy the contents into the destination texture, set its [IsFramebufferOnly] property to [false] and don’t use a combined depth/stencil [PixelFormat]. // [false]: https://developer.apple.com/documentation/Swift/false
destinationSlice: A slice within `destinationTexture` the command uses as its starting point for copying data to. Set this to `0` if `destinationTexture` isn’t a texture array or a cube texture.
destinationLevel: A mipmap level within `destinationTexture` the command copies data to.
destinationOrigin: An MTLOrigin instance that represents a location within `destinationTexture` that the command begins copying data to. Assign `0` to each dimension that’s not relevant to `destinationTexture`. // MTLOrigin: https://developer.apple.com/documentation/Metal/MTLOrigin
func (MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin, options MTLBlitOption)
Encodes a command to copy image data from a buffer into a texture with options for special texture formats.
sourceBuffer: An MTLBuffer instance the command copies data from.
sourceOffset: A byte offset within `sourceBuffer` the command copies from. Set this value to a multiple of `destinationTexture's` pixel size, in bytes.
sourceBytesPerRow: The number of bytes between adjacent rows of pixels in `sourceBuffer`. Set this value to a multiple of `destinationTexture's` pixel size, in bytes, and less than or equal to the product of `destinationTexture's` pixel size, in bytes, and the largest pixel width `destinationTexture's` type allows. If `destinationTexture` uses a compressed pixel format, set `sourceBytesPerRow` to the number of bytes between the starts of two row blocks.
sourceBytesPerImage: The number of bytes between each 2D image of a 3D texture. Set this value to a multiple of `destinationTexture's` pixel size, in bytes, or `0` if `sourceSize's` [depth] value is `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
sourceSize: An MTLSize instance that represents the size of the region in `destinationTexture`, in pixels, that the command copies data to, starting at `destinationOrigin`. Assign `1` to each dimension that’s not relevant to `destinationTexture`. If `destinationTexture` uses a compressed pixel format, set `sourceSize` to a multiple of `destinationTexture's` [PixelFormat] block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
destinationTexture: An MTLTexture instance the command copies data to. In order to copy the contents into the destination texture, set its [IsFramebufferOnly] property to [false] and don’t use a combined depth/stencil [PixelFormat]. // [false]: https://developer.apple.com/documentation/Swift/false
destinationSlice: A slice within `destinationTexture` the command uses as its starting point for copying data to. Set this to `0` if `destinationTexture` isn’t a texture array or a cube texture.
destinationLevel: A mipmap level within `destinationTexture` the command copies data to.
destinationOrigin: An MTLOrigin instance that represents a location within `destinationTexture` that the command begins copying data to. Assign `0` to each dimension that’s not relevant to `destinationTexture`. // MTLOrigin: https://developer.apple.com/documentation/Metal/MTLOrigin
options: An MTLBlitOption value that applies to textures with applicable pixel formats, such as combined depth/stencil or PVRTC formats. If `destinationTexture's` [PixelFormat] is a combined depth/stencil format, set `options` to either [BlitOptionDepthFromDepthStencil] or [BlitOptionStencilFromDepthStencil], but not both. If `destinationTexture's` [PixelFormat] is a PVRTC format, set `options` to [BlitOptionRowLinearPVRTC]. // MTLBlitOption: https://developer.apple.com/documentation/Metal/MTLBlitOption
func (MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetToBufferDestinationOffsetSize ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromBufferSourceOffsetToBufferDestinationOffsetSize(sourceBuffer MTLBuffer, sourceOffset uint, destinationBuffer MTLBuffer, destinationOffset uint, size uint)
Encodes a command that copies data from a buffer instance into another.
sourceBuffer: An MTLBuffer instance the command copies data from.
sourceOffset: A byte offset within `sourceBuffer` the command copies from.
destinationBuffer: An MTLBuffer instance the command copies data to.
destinationOffset: A byte offset within `destinationBuffer` the command copies to.
size: The number of bytes the command copies from `sourceBuffer` to `destinationBuffer`.
func (MTL4ComputeCommandEncoderObject) CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions(sourceTensor MTLTensor, sourceOrigin IMTLTensorExtents, sourceDimensions IMTLTensorExtents, destinationTensor MTLTensor, destinationOrigin IMTLTensorExtents, destinationDimensions IMTLTensorExtents)
Encodes a command to copy data from a tensor instance into another.
sourceTensor: An MTLTensor instance the command copies data from.
destinationTensor: An MTLTensor instance the command copies data to.
Discussion ¶
If the `sourceTensor` and `destinationTensor` instances are not aliasable, this command applies the correct reshapes to enable this operation.
func (MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint)
Encodes a command that copies image data from a slice of an MTLTexture instance to an MTLBuffer instance.
sourceTexture: An MTLTexture texture that the command copies data from. To read the source texture contents, you need to set its [IsFramebufferOnly] property to [false] prior to drawing into it. // [false]: https://developer.apple.com/documentation/Swift/false
sourceSlice: A slice within `sourceTexture` the command uses as a starting point to copy data from. Set this to `0` if `sourceTexture` isn’t a texture array or a cube texture.
sourceLevel: A mipmap level within `sourceTexture`.
sourceOrigin: An MTLOrigin instance that represents a location within `sourceTexture` that the command begins copying data from. Assign `0` to each dimension that’s not relevant to `sourceTexture`. // MTLOrigin: https://developer.apple.com/documentation/Metal/MTLOrigin
sourceSize: An MTLSize instance that represents the size of the region, in pixels, that the command copies from `sourceTexture`, starting at `sourceOrigin`. Assign `1` to each dimension that’s not relevant to `sourceTexture`. If `sourceTexture` uses a compressed pixel format, set `sourceSize` to a multiple of the `sourceTexture's` [PixelFormat] block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
destinationBuffer: An MTLBuffer instance the command copies data to.
destinationOffset: A byte offset within `destinationBuffer` the command copies to. The value you provide as this argument needs to be a multiple of `sourceTexture's` pixel size, in bytes.
destinationBytesPerRow: The number of bytes between adjacent rows of pixels in `destinationBuffer`. This value must be a multiple of `sourceTexture's` pixel size, in bytes, and less than or equal to the product of `sourceTexture's` pixel size, in bytes, and the largest pixel width `sourceTexture’s` type allows. If `sourceTexture` uses a compressed pixel format, set `destinationBytesPerRow` to the number of bytes between the starts of two row blocks.
destinationBytesPerImage: The number of bytes between each 2D image of a 3D texture. This value must be a multiple of `sourceTexture's` pixel size, in bytes. Set this value to `0` if `sourceSize's` [depth] value is `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
func (MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint, options MTLBlitOption)
Encodes a command that copies image data from a slice of a texture instance to a buffer, with options for special texture formats.
sourceTexture: An MTLTexture texture that the command copies data from. To read the source texture contents, you need to set its [IsFramebufferOnly] property to [false] prior to drawing into it. // [false]: https://developer.apple.com/documentation/Swift/false
sourceSlice: A slice within `sourceTexture` the command uses as a starting point to copy data from. Set this to `0` if `sourceTexture` isn’t a texture array or a cube texture.
sourceLevel: A mipmap level within `sourceTexture`.
sourceOrigin: An MTLOrigin instance that represents a location within `sourceTexture` that the command begins copying data from. Assign `0` to each dimension that’s not relevant to `sourceTexture`. // MTLOrigin: https://developer.apple.com/documentation/Metal/MTLOrigin
sourceSize: An MTLSize instance that represents the size of the region, in pixels, that the command copies from `sourceTexture`, starting at `sourceOrigin`. Assign `1` to each dimension that’s not relevant to `sourceTexture`. If `sourceTexture` uses a compressed pixel format, set `sourceSize` to a multiple of the `sourceTexture's` [PixelFormat] block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
destinationBuffer: An MTLBuffer instance the command copies data to.
destinationOffset: A byte offset within `destinationBuffer` the command copies to. The value you provide as this argument needs to be a multiple of `sourceTexture's` pixel size, in bytes.
destinationBytesPerRow: The number of bytes between adjacent rows of pixels in `destinationBuffer`. This value must be a multiple of `sourceTexture's` pixel size, in bytes, and less than or equal to the product of `sourceTexture's` pixel size, in bytes, and the largest pixel width `sourceTexture’s` type allows. If `sourceTexture` uses a compressed pixel format, set `destinationBytesPerRow` to the number of bytes between the starts of two row blocks.
destinationBytesPerImage: The number of bytes between each 2D image of a 3D texture. This value must be a multiple of `sourceTexture's` pixel size, in bytes. Set this value to `0` if `sourceSize's` [depth] value is `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
options: A MTLBlitOption value that applies to textures with applicable pixel formats, such as combined depth/stencil or PVRTC formats. If `sourceTexture's` [PixelFormat] is a combined depth/stencil format, set `options` to either [BlitOptionDepthFromDepthStencil] or [BlitOptionStencilFromDepthStencil], but not both. If `sourceTexture's` [PixelFormat] is a PVRTC format, set `options` to [BlitOptionRowLinearPVRTC]. // MTLBlitOption: https://developer.apple.com/documentation/Metal/MTLBlitOption
func (MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
Encodes a command that copies image data from a slice of a texture into a slice of another texture.
sourceTexture: An MTLTexture texture that the command copies data from. To read the source texture contents, you need to set its [IsFramebufferOnly] property to [false] prior to drawing into it. // [false]: https://developer.apple.com/documentation/Swift/false
sourceSlice: A slice within `sourceTexture` the command uses as a starting point to copy data from. Set this to `0` if `sourceTexture` isn’t a texture array or a cube texture.
sourceLevel: A mipmap level within `sourceTexture`.
sourceOrigin: An MTLOrigin instance that represents a location within `sourceTexture` that the command begins copying data from. Assign `0` to each dimension that’s not relevant to `sourceTexture`. // MTLOrigin: https://developer.apple.com/documentation/Metal/MTLOrigin
sourceSize: An MTLSize instance that represents the size of the region, in pixels, that the command copies from `sourceTexture`, starting at `sourceOrigin`. Assign `1` to each dimension that’s not relevant to `sourceTexture`. If sourceTexture uses a compressed pixel format, set `sourceSize` to a multiple of the pixel format’s block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
destinationTexture: Another MTLTexture the command copies the data to that has the same [PixelFormat] and [SampleCount] as `sourceTexture`. To write the contents into this texture, you need to set its [IsFramebufferOnly] property to [false]. // [false]: https://developer.apple.com/documentation/Swift/false
destinationSlice: A slice within `destinationTexture` the command uses as its starting point for copying data to. Set this to `0` if `destinationTexture` isn’t a texture array or a cube texture.
destinationLevel: A mipmap level within `destinationTexture`. The mipmap level you reference needs to have the same size as the `sourceTexture` slice’s mipmap at `sourceLevel`.
destinationOrigin: An MTLOrigin instance that represents a location within `destinationTexture` that the command begins copying data to. Assign `0` to each dimension that’s not relevant to `destinationTexture`. // MTLOrigin: https://developer.apple.com/documentation/Metal/MTLOrigin
func (MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, sliceCount uint, levelCount uint)
Encodes a command that copies slices of a texture to slices of another texture.
sourceTexture: A MTLTexture texture that the command copies data from. To read the source texture contents, you need to set its [IsFramebufferOnly] property to [false] prior to drawing into it. // [false]: https://developer.apple.com/documentation/Swift/false
sourceSlice: A slice within `sourceTexture` the command uses as a starting point to copy data from. Set this to `0` if `sourceTexture` isn’t a texture array or a cube texture.
sourceLevel: A mipmap level within `sourceTexture`.
destinationTexture: Another MTLTexture the command copies the data to that has the same [PixelFormat] and [SampleCount] as `sourceTexture`. To write the contents into this texture, you need to set its [IsFramebufferOnly] property to [false]. // [false]: https://developer.apple.com/documentation/Swift/false
destinationSlice: A slice within `destinationTexture` the command uses as its starting point for copying data to. Set this to `0` if `destinationTexture` isn’t a texture array or a cube texture.
destinationLevel: A mipmap level within `destinationTexture`. The mipmap level you reference needs to have the same size as the `sourceTexture` slice’s mipmap at `sourceLevel`.
sliceCount: The number of slices the command copies so that it satisfies the conditions that the sum of `sourceSlice` and `sliceCount` doesn’t exceed the number of slices in `sourceTexture` and the sum of `destinationSlice` and `sliceCount` doesn’t exceed the number of slices in `destinationTexture`.
levelCount: The number of mipmap levels the command copies so that it satisfies the conditions that the sum of `sourceLevel` and `levelCount` doesn’t exceed the number of mipmap levels in `sourceTexture` and the sum of `destinationLevel` and `levelCount` doesn’t exceed the number of mipmap levels in `destinationTexture`.
func (MTL4ComputeCommandEncoderObject) CopyFromTextureToTexture ¶
func (o MTL4ComputeCommandEncoderObject) CopyFromTextureToTexture(sourceTexture MTLTexture, destinationTexture MTLTexture)
Encodes a command that copies data from a texture to another.
sourceTexture: An MTLTexture instance the command copies data from.
destinationTexture: Another MTLTexture instance the command copies the data into that has the same [PixelFormat] and [SampleCount] as `sourceTexture`.
func (MTL4ComputeCommandEncoderObject) CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex ¶
func (o MTL4ComputeCommandEncoderObject) CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex(source MTLIndirectCommandBuffer, sourceRange foundation.NSRange, destination MTLIndirectCommandBuffer, destinationIndex uint)
Encodes a command that copies commands from an indirect command buffer into another.
source: An MTLIndirectCommandBuffer instance from where the command copies.
sourceRange: The range of commands in `source` to copy. The copy operation requires that the source range starts at a valid execution point.
destination: Another MTLIndirectCommandBuffer instance into which the command copies.
destinationIndex: An index in `destination` into where the command copies content to. The copy operation requires that the destination index is a valid execution point with enough space left in `destination` to accommodate `sourceRange.Count()` commands.
func (MTL4ComputeCommandEncoderObject) DispatchThreadgroupsThreadsPerThreadgroup ¶
func (o MTL4ComputeCommandEncoderObject) DispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
Encodes a compute dispatch command with a grid that aligns to threadgroup boundaries.
threadgroupsPerGrid: An MTLSize instance that represents the number of threadgroups in the grid, in each dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerThreadgroup: An MTLSize instance that represents the number of threads in one threadgroup, in each dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
func (MTL4ComputeCommandEncoderObject) DispatchThreadgroupsWithIndirectBufferThreadsPerThreadgroup ¶
func (o MTL4ComputeCommandEncoderObject) DispatchThreadgroupsWithIndirectBufferThreadsPerThreadgroup(indirectBuffer MTLGPUAddress, threadsPerThreadgroup MTLSize)
Encodes a compute dispatch command with a grid that aligns to threadgroup boundaries, using an indirect buffer for arguments.
indirectBuffer: GPUAddress of a MTLBuffer instance providing compute parameters. Lay out the data in this buffer as described in the MTLDispatchThreadgroupsIndirectArguments structure. This address requires 4-byte alignment. // MTLDispatchThreadgroupsIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDispatchThreadgroupsIndirectArguments
threadsPerThreadgroup: A MTLSize instance that represents the number of threads in one threadgroup, in each dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
Discussion ¶
This method allows you to supply the threadgroups-per-grid counts indirectly via an MTLBuffer index. This enables you to calculate this value in the GPU timeline from a shader function, enabling GPU-driven workflows.
Metal assumes that the buffer contents correspond to the layout of struct MTLDispatchThreadgroupsIndirectArguments. You are responsible for ensuring this address aligns to 4-bytes.
Use an instance of MTLResidencySet to mark residency of the indirect buffer that the `indirectBuffer` parameter references.
func (MTL4ComputeCommandEncoderObject) DispatchThreadsThreadsPerThreadgroup ¶
func (o MTL4ComputeCommandEncoderObject) DispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
Encodes a compute dispatch command using an arbitrarily-sized grid.
threadsPerGrid: An MTLSize instance that represents the number of threads in the grid, in each dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerThreadgroup: An MTLSize instance that represents the number of threads in one threadgroup, in each dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
func (MTL4ComputeCommandEncoderObject) DispatchThreadsWithIndirectBuffer ¶
func (o MTL4ComputeCommandEncoderObject) DispatchThreadsWithIndirectBuffer(indirectBuffer MTLGPUAddress)
Encodes a compute dispatch command with an arbitrarily sized grid, using an indirect buffer for arguments.
indirectBuffer: GPUAddress of a MTLBuffer instance providing arguments. Lay out the data in this buffer as described in the MTLDispatchThreadsIndirectArguments structure. This address requires 4-byte alignment. // MTLDispatchThreadsIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDispatchThreadsIndirectArguments
func (MTL4ComputeCommandEncoderObject) EndEncoding ¶
func (o MTL4ComputeCommandEncoderObject) EndEncoding()
Declares that all command generation from this encoder is complete.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/endEncoding()
func (MTL4ComputeCommandEncoderObject) ExecuteCommandsInBufferIndirectBuffer ¶
func (o MTL4ComputeCommandEncoderObject) ExecuteCommandsInBufferIndirectBuffer(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLGPUAddress)
Encodes an instruction to execute commands from an indirect command buffer, using an indirect buffer for arguments.
indirectCommandbuffer: MTLIndirectCommandBuffer instance containing the commands to execute.
indirectRangeBuffer: GPUAddress of a MTLBuffer containing the execution range. Lay out the data in this buffer as described in the MTLIndirectCommandBufferExecutionRange structure. This address requires 4-byte alignment. // MTLIndirectCommandBufferExecutionRange: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferExecutionRange
Discussion ¶
Use an instance of MTLResidencySet to mark residency of the indirect buffer that the `indirectRangeBuffer` parameter references.
func (MTL4ComputeCommandEncoderObject) ExecuteCommandsInBufferWithRange ¶
func (o MTL4ComputeCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
Encodes a command to execute a series of commands from an indirect command buffer.
indirectCommandBuffer: MTLIndirectCommandBuffer instance containing the commands to execute.
executionRange: The range of commands to execute.
func (MTL4ComputeCommandEncoderObject) FillBufferRangeValue ¶
func (o MTL4ComputeCommandEncoderObject) FillBufferRangeValue(buffer MTLBuffer, range_ foundation.NSRange, value uint8)
Encodes a command that fills a buffer with a constant value for each byte.
buffer: A MTLBuffer instance for which this command assigns each byte in a range to a value.
range: A range of bytes within `buffer` the command assigns value to. When calling this method, pass in a range with a length greater than `0`.
value: The value to write to each byte.
See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/fillBuffer:range:value:
func (MTL4ComputeCommandEncoderObject) GenerateMipmapsForTexture ¶
func (o MTL4ComputeCommandEncoderObject) GenerateMipmapsForTexture(texture MTLTexture)
Encodes a command that generates mipmaps for a texture instance from the base mipmap level up to the highest mipmap level.
texture: A mipmapped, color-renderable or color-filterable MTLTexture instance the command generates mipmaps for.
Discussion ¶
This method generates mipmaps for a mipmapped texture. The texture you provide needs to have a [MipmapLevelCount] greater than `1`, and a color-renderable or color-filterable [PixelFormat].
See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/generateMipmaps(texture:)
func (MTL4ComputeCommandEncoderObject) InsertDebugSignpost ¶
func (o MTL4ComputeCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the frame data to aid debugging.
string: The debug string to insert as a signpost.
Discussion ¶
Calling this method doesn’t change any behaviors, but can be useful for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/insertDebugSignpost(_:)
func (MTL4ComputeCommandEncoderObject) Label ¶
func (o MTL4ComputeCommandEncoderObject) Label() string
Provides an optional label to assign to the command encoder for debug purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/label
func (MTL4ComputeCommandEncoderObject) OptimizeContentsForCPUAccess ¶
func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForCPUAccess(texture MTLTexture)
Encodes a command that modifies the contents of a texture to improve the performance of CPU accesses to its contents.
texture: A MTLTexture instance the command optimizes for CPU access.
Discussion ¶
Optimizing a texture for CPU access may affect the performance of GPU accesses, however, the data the GPU retrieves from the texture remains consistent.
You typically use this command for:
- Textures the CPU accesses for an extended period of time. - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged].
func (MTL4ComputeCommandEncoderObject) OptimizeContentsForCPUAccessSliceLevel ¶
func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForCPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
Encodes a command that modifies the contents of a texture to improve the performance of CPU accesses to its contents in a specific region.
texture: A MTLTexture the command optimizes for CPU access.
slice: A slice within `texture`.
level: A mipmap level within `texture`.
Discussion ¶
Optimizing a texture for CPU access may affect the performance of GPU accesses, however, the data the GPU retrieves from the texture remains consistent.
You typically use this command for:
- Textures the CPU accesses for an extended period of time. - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged].
func (MTL4ComputeCommandEncoderObject) OptimizeContentsForGPUAccess ¶
func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForGPUAccess(texture MTLTexture)
Encodes a command that modifies the contents of a texture to improve the performance of GPU accesses to its contents.
texture: A MTLTexture instance the command optimizes for GPU access.
Discussion ¶
Optimizing a texture for GPU access may affect the performance of CPU accesses, however, the data the CPU retrieves from the texture remains consistent.
You typically run this command for:
- Textures the GPU accesses for an extended period of time. - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged].
func (MTL4ComputeCommandEncoderObject) OptimizeContentsForGPUAccessSliceLevel ¶
func (o MTL4ComputeCommandEncoderObject) OptimizeContentsForGPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
Encodes a command that modifies the contents of a texture instance to improve the performance of GPU accesses to its contents in a specific region.
texture: A MTLTexture the command optimizes for GPU access.
slice: A slice within `texture`.
level: A mipmap level within `texture`.
Discussion ¶
Optimizing a texture for GPU access may affect the performance of CPU accesses, however, the data the CPU retrieves from the texture remains consistent.
You typically run this command for:
- Textures the GPU accesses for an extended period of time. - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged].
func (MTL4ComputeCommandEncoderObject) OptimizeIndirectCommandBufferWithRange ¶
func (o MTL4ComputeCommandEncoderObject) OptimizeIndirectCommandBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
Encode a command to attempt to improve the performance of a range of commands within an indirect command buffer.
indirectCommandBuffer: An MTLIndirectCommandBuffer instance that this command optimizes.
range: A range of commands within `indirectCommandBuffer`.
func (MTL4ComputeCommandEncoderObject) PopDebugGroup ¶
func (o MTL4ComputeCommandEncoderObject) PopDebugGroup()
Pops the latest debug group string from this encoder’s stack of debug groups.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/popDebugGroup()
func (MTL4ComputeCommandEncoderObject) PushDebugGroup ¶
func (o MTL4ComputeCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a string onto this encoder’s stack of debug groups.
string: The debug string to push.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/pushDebugGroup(_:)
func (MTL4ComputeCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBuffer ¶
func (o MTL4ComputeCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBuffer(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTL4AccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTL4BufferRange)
Encodes an acceleration structure refit into the command buffer.
sourceAccelerationStructure: Acceleration structure to refit.
descriptor: A descriptor for the acceleration structure to refit.
destinationAccelerationStructure: Acceleration structure to store the refit result into. If `destinationAccelerationStructure` is `nil`, Metal performs an in-place refit operation of the `sourceAccelerationStructure`.
scratchBuffer: Scratch buffer Metal can use while refitting the acceleration structure. Metal may overwrite the contents of this buffer, and you should consider them “undefined” after the refit operation starts and completes.
Discussion ¶
You refit an acceleration structure to update it when the geometry it references changes. This operation is typically much faster than rebuilding the acceleration structure from scratch. The trade off is that after you refit the acceleration structure, its quality, as well as the performance of any subsequent ray tracing operation degrades, depending on how much the geometry changes.
After certain operations, refitting an acceleration structure may not be possible, for example, after adding or removing geometry.
When you refit an acceleration structure, you can do so in place, by specifying the same source and destination acceleration structures, or by providing a `nil` destination acceleration structure. If the source and destination acceleration structures aren’t the same, then you are responsible for ensuring they don’t overlap in memory.
Typically, the destination acceleration structure is at least as large as the source acceleration structure, except in cases where you compact the source acceleration structure. In this case, you need to allocate the destination acceleration to be at least as large as the compacted size of the source acceleration structure.
The scratch buffer you provide for the refit operation needs to be at least as large as the size that the query [AccelerationStructureSizesWithDescriptor] returns. If the size this query returns is zero, you can omit providing a scratch buffer by passing `0` as the address to the `scratchBuffer` parameter.
Use an instance of MTLResidencySet to mark residency of the scratch buffer the `scratchBuffer` parameter references, as well as for all the instance and primitive acceleration structures you directly and indirectly reference.
func (MTL4ComputeCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferOptions ¶
func (o MTL4ComputeCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferOptions(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTL4AccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTL4BufferRange, options MTLAccelerationStructureRefitOptions)
Encodes an acceleration structure refit operation into the command buffer, providing additional options.
sourceAccelerationStructure: Acceleration structure to refit.
descriptor: A descriptor for the acceleration structure to refit.
destinationAccelerationStructure: Acceleration structure to store the refit result into. If `destinationAccelerationStructure` is `nil`, Metal performs an in-place refit operation of the `sourceAccelerationStructure`.
scratchBuffer: Scratch buffer Metal can use while refitting the acceleration structure. Metal may overwrite the contents of this buffer, and you should consider them “undefined” after the refit operation starts and completes.
options: Options specifying the elements of the acceleration structure to refit.
Discussion ¶
You refit an acceleration structure to update it when the geometry it references changes. This operation is typically much faster than rebuilding the acceleration structure from scratch. The trade off is that after you refit the acceleration structure, its quality, as well as the performance of any subsequent ray tracing operation degrades, depending on how much the geometry changes.
After certain operations, refitting an acceleration structure may not be possible, for example, after adding or removing geometry.
When you refit an acceleration structure, you can do so in place, by specifying the same source and destination acceleration structures, or by providing a `nil` destination acceleration structure. If the source and destination acceleration structures aren’t the same, then you are responsible for ensuring they don’t overlap in memory.
Typically, the destination acceleration structure is at least as large as the source acceleration structure, except in cases where you compact the source acceleration structure. In this case, you need to allocate the destination acceleration to be at least as large as the compacted size of the source acceleration structure.
The scratch buffer you provide for the refit operation needs to be at least as large as the size that the query [AccelerationStructureSizesWithDescriptor] returns. If the size this query returns is zero, you can omit providing a scratch buffer by passing `0` as the address to the `scratchBuffer` parameter.
Use an instance of MTLResidencySet to mark residency of the scratch buffer the `scratchBuffer` parameter references, as well as for all the instance and primitive acceleration structures you directly and indirectly reference.
func (MTL4ComputeCommandEncoderObject) ResetCommandsInBufferWithRange ¶
func (o MTL4ComputeCommandEncoderObject) ResetCommandsInBufferWithRange(buffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
Encodes a command that resets a range of commands in an indirect command buffer.
buffer: An MTLIndirectCommandBuffer the command resets.
range: A range of commands within `buffer`.
func (MTL4ComputeCommandEncoderObject) SetArgumentTable ¶
func (o MTL4ComputeCommandEncoderObject) SetArgumentTable(argumentTable MTL4ArgumentTable)
Sets an argument table for the compute shader stage of this pipeline.
argumentTable: A MTL4ArgumentTable to set on the command encoder.
Discussion ¶
Metal takes a snapshot of the resources in the argument table when you make dispatch or execute calls on this encoder instance. Metal makes the snapshot contents available to the compute shader function of the current pipeline state.
See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/setArgumentTable(_:)
func (MTL4ComputeCommandEncoderObject) SetComputePipelineState ¶
func (o MTL4ComputeCommandEncoderObject) SetComputePipelineState(state MTLComputePipelineState)
Configures this encoder with a compute pipeline state that applies to your subsequent dispatch commands.
state: A non-`nil` MTLComputePipelineState.
func (MTL4ComputeCommandEncoderObject) SetImageblockWidthHeight ¶
func (o MTL4ComputeCommandEncoderObject) SetImageblockWidthHeight(width uint, height uint)
Specifies the size, in pixels, of imageblock data in tile memory.
width: The width of the imageblock, in pixels.
height: The height of the imageblock, in pixels.
func (MTL4ComputeCommandEncoderObject) SetLabel ¶
func (o MTL4ComputeCommandEncoderObject) SetLabel(value string)
func (MTL4ComputeCommandEncoderObject) SetThreadgroupMemoryLengthAtIndex ¶
func (o MTL4ComputeCommandEncoderObject) SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
Configures the size of a threadgroup memory buffer for a threadgroup argument in the compute shader function.
length: The size of the threadgroup memory, in bytes. Use a multiple of `16` bytes.
index: An integer that corresponds to the index of the argument you annotate with attribute `[[threadgroup(index)]]` in the shader function.
func (MTL4ComputeCommandEncoderObject) Stages ¶
func (o MTL4ComputeCommandEncoderObject) Stages() MTLStages
Queries a bitmask representing the shader stages on which commands currently present in this command encoder operate.
Return Value ¶
A bitmask representing shader stages that commands currently present in this command encoder operate on.
Discussion ¶
Metal dynamically updates this property based on the commands you encode into the command encoder, for example, it sets the bit [StageDispatch] if this encoder contains any commands that dispatch a compute kernel.
Similarly, it sets the bit [StageBlit] if this encoder contains any commands to copy or modify buffers, textures, or indirect command buffers.
Finally, Metal sets the bit [StageAccelerationStructure] if this encoder contains any commands that build, copy, or refit acceleration structures.
See: https://developer.apple.com/documentation/Metal/MTL4ComputeCommandEncoder/stages()
func (MTL4ComputeCommandEncoderObject) UpdateFenceAfterEncoderStages ¶
func (o MTL4ComputeCommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
Encodes a command that instructs the GPU to update a fence after one or more stages, which can unblock other passes waiting for the fence.
fence: A fence the pass updates after the stages in `afterEncoderStages` complete.
afterEncoderStages: The encoder stages that need to complete before the pass updates `fence`.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the pass to update `fence` after the stages you pass to the `afterEncoderStages` run all their memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
func (MTL4ComputeCommandEncoderObject) WaitForFenceBeforeEncoderStages ¶
func (o MTL4ComputeCommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
Encodes a command that instructs the GPU to pause before starting one or more stages of the pass until a pass updates a fence.
fence: A fence that the pass waits for before running the stages you pass to `beforeEncoderStages`.
beforeEncoderStages: The encoder stages that need to wait for another pass to update `fence` before they run.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the stages you pass to the `beforeEncoderStages` parameter. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
func (MTL4ComputeCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBuffer ¶
func (o MTL4ComputeCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBuffer(accelerationStructure MTLAccelerationStructure, buffer MTL4BufferRange)
Encodes a command to compute the size an acceleration structure can compact into, writing the result into a buffer.
accelerationStructure: Source acceleration structure.
buffer: Destination size buffer. Metal writes the compacted size as a 64-bit unsigned integer value, representing the compacted size in bytes.
Discussion ¶
This size is potentially smaller than the acceleration structure. To perform compaction, you typically read this size from the buffer once the command buffer completes. You then use it to allocate a new, potentially smaller acceleration structure. Finally, you call the [CopyAndCompactAccelerationStructureToAccelerationStructure] method to perform the copy.
func (MTL4ComputeCommandEncoderObject) WriteTimestampWithGranularityIntoHeapAtIndex ¶
func (o MTL4ComputeCommandEncoderObject) WriteTimestampWithGranularityIntoHeapAtIndex(granularity MTL4TimestampGranularity, counterHeap MTL4CounterHeap, index uint)
Writes a GPU timestamp into a heap.
granularity: MTL4TimestampGranularity hint to Metal about acceptable the level of precision. // MTL4TimestampGranularity: https://developer.apple.com/documentation/Metal/MTL4TimestampGranularity
counterHeap: MTL4CounterHeap to write timestamps into.
index: The index value into which Metal writes the timestamp.
Discussion ¶
The method ensures that any prior work finishes, but doesn’t delay any subsequent work.
You can alter this command’s behavior through the `granularity` parameter.
- Pass MTL4TimestampGranularityRelaxed to allow Metal to provide timestamps with minimal impact to runtime performance, but with less detail. For example, the command may group all timestamps for a pass together. - Pass MTL4TimestampGranularityPrecise to request that Metal provides timestamps with the most detail. This can affect runtime performance.
type MTL4ComputePipelineDescriptor ¶
type MTL4ComputePipelineDescriptor struct {
MTL4PipelineDescriptor
}
Describes a compute pipeline state.
Instance Properties ¶
- MTL4ComputePipelineDescriptor.ComputeFunctionDescriptor: A descriptor representing the compute pipeline’s function.
- MTL4ComputePipelineDescriptor.SetComputeFunctionDescriptor
- MTL4ComputePipelineDescriptor.MaxTotalThreadsPerThreadgroup: The maximum total number of threads that Metal can execute in a single threadgroup for the compute function.
- MTL4ComputePipelineDescriptor.SetMaxTotalThreadsPerThreadgroup
- MTL4ComputePipelineDescriptor.RequiredThreadsPerThreadgroup: The required number of threads per threadgroup for compute dispatches.
- MTL4ComputePipelineDescriptor.SetRequiredThreadsPerThreadgroup
- MTL4ComputePipelineDescriptor.StaticLinkingDescriptor: An object that contains information about functions to link to the compute pipeline.
- MTL4ComputePipelineDescriptor.SetStaticLinkingDescriptor
- MTL4ComputePipelineDescriptor.SupportBinaryLinking: A boolean value indicating whether the compute pipeline supports linking binary functions.
- MTL4ComputePipelineDescriptor.SetSupportBinaryLinking
- MTL4ComputePipelineDescriptor.SupportIndirectCommandBuffers: A value indicating whether the pipeline supports Metal indirect command buffers.
- MTL4ComputePipelineDescriptor.SetSupportIndirectCommandBuffers
- MTL4ComputePipelineDescriptor.ThreadGroupSizeIsMultipleOfThreadExecutionWidth: A boolean value indicating whether each dimension of the threadgroup size is a multiple of its corresponding thread execution width.
- MTL4ComputePipelineDescriptor.SetThreadGroupSizeIsMultipleOfThreadExecutionWidth
Instance Methods ¶
- MTL4ComputePipelineDescriptor.Reset: Resets the descriptor to its default values.
See: https://developer.apple.com/documentation/Metal/MTL4ComputePipelineDescriptor
func MTL4ComputePipelineDescriptorFromID ¶
func MTL4ComputePipelineDescriptorFromID(id objc.ID) MTL4ComputePipelineDescriptor
MTL4ComputePipelineDescriptorFromID constructs a MTL4ComputePipelineDescriptor from an objc.ID.
Describes a compute pipeline state.
func NewMTL4ComputePipelineDescriptor ¶
func NewMTL4ComputePipelineDescriptor() MTL4ComputePipelineDescriptor
NewMTL4ComputePipelineDescriptor creates a new MTL4ComputePipelineDescriptor instance.
func (MTL4ComputePipelineDescriptor) Autorelease ¶
func (m MTL4ComputePipelineDescriptor) Autorelease() MTL4ComputePipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4ComputePipelineDescriptor) ComputeFunctionDescriptor ¶
func (m MTL4ComputePipelineDescriptor) ComputeFunctionDescriptor() IMTL4FunctionDescriptor
A descriptor representing the compute pipeline’s function.
Discussion ¶
You don’t assign instances of MTL4FunctionDescriptor to this property directly, instead assign an instance of one of its subclasses, such as MTL4LibraryFunctionDescriptor, which represents a function from a Metal library.
func (MTL4ComputePipelineDescriptor) Init ¶
func (m MTL4ComputePipelineDescriptor) Init() MTL4ComputePipelineDescriptor
Init initializes the instance.
func (MTL4ComputePipelineDescriptor) MaxTotalThreadsPerThreadgroup ¶
func (m MTL4ComputePipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
The maximum total number of threads that Metal can execute in a single threadgroup for the compute function.
func (MTL4ComputePipelineDescriptor) RequiredThreadsPerThreadgroup ¶
func (m MTL4ComputePipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
The required number of threads per threadgroup for compute dispatches.
Discussion ¶
When you set this value, you are responsible for ensuring that the `threadsPerThreadgroup` argument of any compute dispatch matches it.
Setting this property is optional, except in cases where the pipeline uses .
This property’s default value is `0`, which disables its effect.
func (MTL4ComputePipelineDescriptor) Reset ¶
func (m MTL4ComputePipelineDescriptor) Reset()
Resets the descriptor to its default values.
See: https://developer.apple.com/documentation/Metal/MTL4ComputePipelineDescriptor/reset()
func (MTL4ComputePipelineDescriptor) SetComputeFunctionDescriptor ¶
func (m MTL4ComputePipelineDescriptor) SetComputeFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4ComputePipelineDescriptor) SetMaxTotalThreadsPerThreadgroup ¶
func (m MTL4ComputePipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
func (MTL4ComputePipelineDescriptor) SetRequiredThreadsPerThreadgroup ¶
func (m MTL4ComputePipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
func (MTL4ComputePipelineDescriptor) SetStaticLinkingDescriptor ¶
func (m MTL4ComputePipelineDescriptor) SetStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
func (MTL4ComputePipelineDescriptor) SetSupportBinaryLinking ¶
func (m MTL4ComputePipelineDescriptor) SetSupportBinaryLinking(value bool)
func (MTL4ComputePipelineDescriptor) SetSupportIndirectCommandBuffers ¶
func (m MTL4ComputePipelineDescriptor) SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
func (MTL4ComputePipelineDescriptor) SetThreadGroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTL4ComputePipelineDescriptor) SetThreadGroupSizeIsMultipleOfThreadExecutionWidth(value bool)
func (MTL4ComputePipelineDescriptor) StaticLinkingDescriptor ¶
func (m MTL4ComputePipelineDescriptor) StaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
An object that contains information about functions to link to the compute pipeline.
func (MTL4ComputePipelineDescriptor) SupportBinaryLinking ¶
func (m MTL4ComputePipelineDescriptor) SupportBinaryLinking() bool
A boolean value indicating whether the compute pipeline supports linking binary functions.
See: https://developer.apple.com/documentation/Metal/MTL4ComputePipelineDescriptor/supportBinaryLinking
func (MTL4ComputePipelineDescriptor) SupportIndirectCommandBuffers ¶
func (m MTL4ComputePipelineDescriptor) SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
A value indicating whether the pipeline supports Metal indirect command buffers.
func (MTL4ComputePipelineDescriptor) ThreadGroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTL4ComputePipelineDescriptor) ThreadGroupSizeIsMultipleOfThreadExecutionWidth() bool
A boolean value indicating whether each dimension of the threadgroup size is a multiple of its corresponding thread execution width.
type MTL4ComputePipelineDescriptorClass ¶
type MTL4ComputePipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4ComputePipelineDescriptorClass ¶
func GetMTL4ComputePipelineDescriptorClass() MTL4ComputePipelineDescriptorClass
GetMTL4ComputePipelineDescriptorClass returns the class object for MTL4ComputePipelineDescriptor.
func (MTL4ComputePipelineDescriptorClass) Alloc ¶
func (mc MTL4ComputePipelineDescriptorClass) Alloc() MTL4ComputePipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4CopySparseBufferMappingOperation ¶
type MTL4CopySparseBufferMappingOperation struct {
DestinationOffset uint // The origin in the destination buffer, in tiles.
SourceRange foundation.NSRange // The range in the source buffer, in tiles.
}
MTL4CopySparseBufferMappingOperation - Groups together arguments for an operation to copy a sparse buffer mapping.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTL4CopySparseBufferMappingOperation
type MTL4CopySparseTextureMappingOperation ¶
type MTL4CopySparseTextureMappingOperation struct {
DestinationLevel uint // The index of the mipmap level in the destination texture.
DestinationOrigin MTLOrigin // The origin in the destination texture to copy into, in tiles.
DestinationSlice uint // The index of the array slice in the destination texture to copy into.
SourceLevel uint // The index of the mipmap level in the source texture.
SourceRegion MTLRegion // The region in the source texture, in tiles.
SourceSlice uint // The index of the array slice in the texture source of the copy operation.
}
MTL4CopySparseTextureMappingOperation - Groups together arguments for an operation to copy a sparse texture mapping.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTL4CopySparseTextureMappingOperation
type MTL4CounterHeap ¶
type MTL4CounterHeap interface {
objectivec.IObject
// Queries the number of entries in the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/count
Count() uint
// Assigns a label for later inspection or visualization.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/label
Label() string
// Queries the type of the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/type
Type() MTL4CounterHeapType
// Invalidates a range of entries in this counter heap.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/invalidateCounterRange:
InvalidateCounterRange(range_ foundation.NSRange)
// Resolves heap data on the CPU timeline.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/resolveCounterRange:
ResolveCounterRange(range_ foundation.NSRange) foundation.INSData
// Assigns a label for later inspection or visualization.
//
// See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/label
SetLabel(value string)
}
Represents an opaque, driver-controlled section of memory that can store GPU counter data.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap
type MTL4CounterHeapDescriptor ¶
type MTL4CounterHeapDescriptor struct {
objectivec.Object
}
Groups together parameters for configuring a counter heap object at creation time.
Instance Properties ¶
- MTL4CounterHeapDescriptor.Count: Assigns the number of entries in the heap.
- MTL4CounterHeapDescriptor.SetCount
- MTL4CounterHeapDescriptor.Type: Assigns the type of data that the heap contains.
- MTL4CounterHeapDescriptor.SetType
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeapDescriptor
func MTL4CounterHeapDescriptorFromID ¶
func MTL4CounterHeapDescriptorFromID(id objc.ID) MTL4CounterHeapDescriptor
MTL4CounterHeapDescriptorFromID constructs a MTL4CounterHeapDescriptor from an objc.ID.
Groups together parameters for configuring a counter heap object at creation time.
func NewMTL4CounterHeapDescriptor ¶
func NewMTL4CounterHeapDescriptor() MTL4CounterHeapDescriptor
NewMTL4CounterHeapDescriptor creates a new MTL4CounterHeapDescriptor instance.
func (MTL4CounterHeapDescriptor) Autorelease ¶
func (m MTL4CounterHeapDescriptor) Autorelease() MTL4CounterHeapDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4CounterHeapDescriptor) Count ¶
func (m MTL4CounterHeapDescriptor) Count() uint
Assigns the number of entries in the heap.
Discussion ¶
Each entry represents one item in the heap. The size of the individual entries depends on the heap type.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeapDescriptor/count
func (MTL4CounterHeapDescriptor) Init ¶
func (m MTL4CounterHeapDescriptor) Init() MTL4CounterHeapDescriptor
Init initializes the instance.
func (MTL4CounterHeapDescriptor) MTL4CommandQueueErrorDomain ¶
func (m MTL4CounterHeapDescriptor) MTL4CommandQueueErrorDomain() string
See: https://developer.apple.com/documentation/metal/mtl4commandqueueerrordomain
func (MTL4CounterHeapDescriptor) SetCount ¶
func (m MTL4CounterHeapDescriptor) SetCount(value uint)
func (MTL4CounterHeapDescriptor) SetType ¶
func (m MTL4CounterHeapDescriptor) SetType(value MTL4CounterHeapType)
func (MTL4CounterHeapDescriptor) Type ¶
func (m MTL4CounterHeapDescriptor) Type() MTL4CounterHeapType
Assigns the type of data that the heap contains.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeapDescriptor/type
type MTL4CounterHeapDescriptorClass ¶
type MTL4CounterHeapDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4CounterHeapDescriptorClass ¶
func GetMTL4CounterHeapDescriptorClass() MTL4CounterHeapDescriptorClass
GetMTL4CounterHeapDescriptorClass returns the class object for MTL4CounterHeapDescriptor.
func (MTL4CounterHeapDescriptorClass) Alloc ¶
func (mc MTL4CounterHeapDescriptorClass) Alloc() MTL4CounterHeapDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4CounterHeapObject ¶
type MTL4CounterHeapObject struct {
objectivec.Object
}
MTL4CounterHeapObject wraps an existing Objective-C object that conforms to the MTL4CounterHeap protocol.
func MTL4CounterHeapObjectFromID ¶
func MTL4CounterHeapObjectFromID(id objc.ID) MTL4CounterHeapObject
MTL4CounterHeapObjectFromID constructs a MTL4CounterHeapObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4CounterHeapObject) BaseObject ¶
func (o MTL4CounterHeapObject) BaseObject() objectivec.Object
func (MTL4CounterHeapObject) Count ¶
func (o MTL4CounterHeapObject) Count() uint
Queries the number of entries in the heap.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/count
func (MTL4CounterHeapObject) InvalidateCounterRange ¶
func (o MTL4CounterHeapObject) InvalidateCounterRange(range_ foundation.NSRange)
Invalidates a range of entries in this counter heap.
range: A heap index range to invalidate.
Discussion ¶
The effect of this call is immediate on the CPU timeline. You are responsible for ensuring that this counter heap is not currently in use on the GPU.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/invalidateCounterRange:
func (MTL4CounterHeapObject) Label ¶
func (o MTL4CounterHeapObject) Label() string
Assigns a label for later inspection or visualization.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/label
func (MTL4CounterHeapObject) ResolveCounterRange ¶
func (o MTL4CounterHeapObject) ResolveCounterRange(range_ foundation.NSRange) foundation.INSData
Resolves heap data on the CPU timeline.
range: The range in the heap to resolve.
Discussion ¶
This method resolves heap data in the CPU timeline. Your app needs to ensure the GPU work has completed in order to retrieve the data correctly. You can alternatively resolve the heap data in the GPU timeline by calling [ResolveCounterHeapWithRangeIntoBufferWaitFenceUpdateFence].
- Returns a newly allocated autoreleased NSData containing tightly packed resolved heap counter values.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/resolveCounterRange:
func (MTL4CounterHeapObject) SetLabel ¶
func (o MTL4CounterHeapObject) SetLabel(value string)
func (MTL4CounterHeapObject) Type ¶
func (o MTL4CounterHeapObject) Type() MTL4CounterHeapType
Queries the type of the heap.
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeap/type
type MTL4CounterHeapType ¶
type MTL4CounterHeapType int
See: https://developer.apple.com/documentation/Metal/MTL4CounterHeapType
const ( // MTL4CounterHeapTypeInvalid: Specifies that MTL4CounterHeap entries contain invalid data. MTL4CounterHeapTypeInvalid MTL4CounterHeapType = 0 // MTL4CounterHeapTypeTimestamp: Specifies that MTL4CounterHeap entries contain GPU timestamp data. MTL4CounterHeapTypeTimestamp MTL4CounterHeapType = 1 )
func (MTL4CounterHeapType) String ¶
func (e MTL4CounterHeapType) String() string
type MTL4FunctionDescriptor ¶
type MTL4FunctionDescriptor struct {
objectivec.Object
}
Base interface for describing a Metal 4 shader function.
See: https://developer.apple.com/documentation/Metal/MTL4FunctionDescriptor
func MTL4FunctionDescriptorFromID ¶
func MTL4FunctionDescriptorFromID(id objc.ID) MTL4FunctionDescriptor
MTL4FunctionDescriptorFromID constructs a MTL4FunctionDescriptor from an objc.ID.
Base interface for describing a Metal 4 shader function.
func NewMTL4FunctionDescriptor ¶
func NewMTL4FunctionDescriptor() MTL4FunctionDescriptor
NewMTL4FunctionDescriptor creates a new MTL4FunctionDescriptor instance.
func (MTL4FunctionDescriptor) Autorelease ¶
func (m MTL4FunctionDescriptor) Autorelease() MTL4FunctionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4FunctionDescriptor) Init ¶
func (m MTL4FunctionDescriptor) Init() MTL4FunctionDescriptor
Init initializes the instance.
type MTL4FunctionDescriptorClass ¶
type MTL4FunctionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4FunctionDescriptorClass ¶
func GetMTL4FunctionDescriptorClass() MTL4FunctionDescriptorClass
GetMTL4FunctionDescriptorClass returns the class object for MTL4FunctionDescriptor.
func (MTL4FunctionDescriptorClass) Alloc ¶
func (mc MTL4FunctionDescriptorClass) Alloc() MTL4FunctionDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4IndirectCommandBufferSupportState ¶
type MTL4IndirectCommandBufferSupportState int
See: https://developer.apple.com/documentation/Metal/MTL4IndirectCommandBufferSupportState
const ( // MTL4IndirectCommandBufferSupportStateDisabled: Disables support for indirect command buffers. MTL4IndirectCommandBufferSupportStateDisabled MTL4IndirectCommandBufferSupportState = 0 // MTL4IndirectCommandBufferSupportStateEnabled: Enables support for indirect command buffers. MTL4IndirectCommandBufferSupportStateEnabled MTL4IndirectCommandBufferSupportState = 1 )
func (MTL4IndirectCommandBufferSupportState) String ¶
func (e MTL4IndirectCommandBufferSupportState) String() string
type MTL4IndirectInstanceAccelerationStructureDescriptor ¶
type MTL4IndirectInstanceAccelerationStructureDescriptor struct {
MTL4AccelerationStructureDescriptor
}
Descriptor for an “indirect” instance acceleration structure that allows providing the instance count and motion transform count indirectly, through buffer references.
Overview ¶
An instance acceleration structure references other acceleration structures, and provides the ability to “instantiate” them multiple times, each one with potentially a different transformation matrix.
You specify the properties of the instances in the acceleration structure this descriptor builds by providing a buffer of `structs` via its MTL4IndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer property.
Compared to MTL4InstanceAccelerationStructureDescriptor, this descriptor allows you to provide the number of instances it references indirectly through a buffer reference, as well as the number of motion transforms.
This enables you to determine these counts indirectly in the GPU timeline via a compute pipeline. Metal needs only to know the maximum possible number of instances and motion transforms to support, which you specify via the MTL4IndirectInstanceAccelerationStructureDescriptor.MaxInstanceCount and MTL4IndirectInstanceAccelerationStructureDescriptor.MaxMotionTransformCount properties.
Use a MTLResidencySet to mark residency of all buffers and acceleration structures this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4IndirectInstanceAccelerationStructureDescriptor.InstanceCountBuffer: Provides a reference to a buffer containing the number of instances in the instance descriptor buffer, formatted as a 32-bit unsigned integer.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceCountBuffer
- MTL4IndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer: Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer
- MTL4IndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorStride: Sets the stride, in bytes, between instance descriptors in the instance descriptor buffer.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride
- MTL4IndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorType: Controls the type of instance descriptor that the instance descriptor buffer references.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorType
- MTL4IndirectInstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout: Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout
- MTL4IndirectInstanceAccelerationStructureDescriptor.MaxInstanceCount: Controls the maximum number of instance descriptors the instance descriptor buffer can reference.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetMaxInstanceCount
- MTL4IndirectInstanceAccelerationStructureDescriptor.MaxMotionTransformCount: Controls the maximum number of motion transforms in the motion transform buffer.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetMaxMotionTransformCount
- MTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformBuffer: A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformBuffer
- MTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformCountBuffer: Associates a buffer reference containing the number of motion transforms in the motion transform buffer, formatted as a 32-bit unsigned integer.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformCountBuffer
- MTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformStride: Sets the stride for motion transform.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformStride
- MTL4IndirectInstanceAccelerationStructureDescriptor.MotionTransformType: Sets the type of motion transforms, either as a matrix or individual components.
- MTL4IndirectInstanceAccelerationStructureDescriptor.SetMotionTransformType
See: https://developer.apple.com/documentation/Metal/MTL4IndirectInstanceAccelerationStructureDescriptor
func MTL4IndirectInstanceAccelerationStructureDescriptorFromID ¶
func MTL4IndirectInstanceAccelerationStructureDescriptorFromID(id objc.ID) MTL4IndirectInstanceAccelerationStructureDescriptor
MTL4IndirectInstanceAccelerationStructureDescriptorFromID constructs a MTL4IndirectInstanceAccelerationStructureDescriptor from an objc.ID.
Descriptor for an “indirect” instance acceleration structure that allows providing the instance count and motion transform count indirectly, through buffer references.
func NewMTL4IndirectInstanceAccelerationStructureDescriptor ¶
func NewMTL4IndirectInstanceAccelerationStructureDescriptor() MTL4IndirectInstanceAccelerationStructureDescriptor
NewMTL4IndirectInstanceAccelerationStructureDescriptor creates a new MTL4IndirectInstanceAccelerationStructureDescriptor instance.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) Autorelease ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) Autorelease() MTL4IndirectInstanceAccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) Init ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) Init() MTL4IndirectInstanceAccelerationStructureDescriptor
Init initializes the instance.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceCountBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceCountBuffer() MTL4BufferRange
Provides a reference to a buffer containing the number of instances in the instance descriptor buffer, formatted as a 32-bit unsigned integer.
Discussion ¶
You are responsible for ensuring that the final number of instances at build time, which you provide indirectly via this buffer reference , is less than or equal to the value of property [MaxInstanceCount].
func (MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTL4BufferRange
Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
Discussion ¶
This buffer conceptually represents an array of instance data. The specific format for the structs that comprise each entry depends on the value of the [InstanceDescriptorType] property.
You are responsible for ensuring the buffer address the range contains is not zero.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorStride ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
Sets the stride, in bytes, between instance descriptors in the instance descriptor buffer.
Discussion ¶
You are responsible for ensuring this stride is at least the size of the structure type corresponding to the instance descriptor type and a multiple of 4 bytes.
Defaults to `0`, indicating the instance descriptors are tightly packed.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorType ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
Controls the type of instance descriptor that the instance descriptor buffer references.
Discussion ¶
This value determines the layout Metal expects for the structs the instance descriptor buffer contains.
Defaults to MTLAccelerationStructureInstanceDescriptorTypeIndirect. Valid values for this property are MTLAccelerationStructureInstanceDescriptorTypeIndirect or MTLAccelerationStructureInstanceDescriptorTypeIndirectMotion.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
Discussion ¶
Metal interprets the value of this property as the layout for the buffers that both [InstanceDescriptorBuffer] and [MotionTransformBuffer] reference.
Defaults to MTLMatrixLayoutColumnMajor.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) MaxInstanceCount ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MaxInstanceCount() uint
Controls the maximum number of instance descriptors the instance descriptor buffer can reference.
Discussion ¶
You are responsible for ensuring that the final number of instances at build time, which you provide indirectly via a buffer reference in [InstanceCountBuffer], is less than or equal to this number.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) MaxMotionTransformCount ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MaxMotionTransformCount() uint
Controls the maximum number of motion transforms in the motion transform buffer.
Discussion ¶
You are responsible for ensuring that final number of motion transforms at build time that the buffer [MotionTransformCountBuffer] references is less than or equal to this number.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTL4BufferRange
A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
Discussion ¶
Each instance can have a different number of keyframes that you configure via individual instance descriptors.
You are responsible for ensuring the buffer address the range references is not zero when using motion instance descriptors.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBuffer() MTL4BufferRange
Associates a buffer reference containing the number of motion transforms in the motion transform buffer, formatted as a 32-bit unsigned integer.
Discussion ¶
You are responsible for ensuring that the final number of motion transforms at build time in the buffer this property references is less than or equal to the value of property [MaxMotionTransformCount].
func (MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformStride ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformStride() uint
Sets the stride for motion transform.
Discussion ¶
Defaults to `0`, indicating that transforms are tightly packed according to the motion transform type.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformType ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
Sets the type of motion transforms, either as a matrix or individual components.
Discussion ¶
Defaults to MTLTransformTypePackedFloat4x3. Using a MTLTransformTypeComponent allows you to represent the rotation by a quaternion (instead as of part of the matrix), allowing for correct motion interpolation.
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBuffer(value MTL4BufferRange)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTL4BufferRange)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetMaxInstanceCount ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMaxInstanceCount(value uint)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetMaxMotionTransformCount ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMaxMotionTransformCount(value uint)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTL4BufferRange)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBuffer ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBuffer(value MTL4BufferRange)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformStride ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
func (MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformType ¶
func (m MTL4IndirectInstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
type MTL4IndirectInstanceAccelerationStructureDescriptorClass ¶
type MTL4IndirectInstanceAccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4IndirectInstanceAccelerationStructureDescriptorClass ¶
func GetMTL4IndirectInstanceAccelerationStructureDescriptorClass() MTL4IndirectInstanceAccelerationStructureDescriptorClass
GetMTL4IndirectInstanceAccelerationStructureDescriptorClass returns the class object for MTL4IndirectInstanceAccelerationStructureDescriptor.
func (MTL4IndirectInstanceAccelerationStructureDescriptorClass) Alloc ¶
func (mc MTL4IndirectInstanceAccelerationStructureDescriptorClass) Alloc() MTL4IndirectInstanceAccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4InstanceAccelerationStructureDescriptor ¶
type MTL4InstanceAccelerationStructureDescriptor struct {
MTL4AccelerationStructureDescriptor
}
Descriptor for an instance acceleration structure.
Overview ¶
An instance acceleration structure references other acceleration structures, and provides the ability to “instantiate” them multiple times, each one with potentially a different transformation matrix.
You specify the properties of the instances in the acceleration structure this descriptor builds by providing a buffer of `structs` via its MTL4InstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer property.
Use a MTLResidencySet to mark residency of all buffers and acceleration structures this descriptor references when you build this acceleration structure.
Instance Properties ¶
- MTL4InstanceAccelerationStructureDescriptor.InstanceCount: Controls the number of instance descriptors in the instance descriptor buffer references.
- MTL4InstanceAccelerationStructureDescriptor.SetInstanceCount
- MTL4InstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer: Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
- MTL4InstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer
- MTL4InstanceAccelerationStructureDescriptor.InstanceDescriptorStride: Sets the stride, in bytes, between instance descriptors the instance descriptor buffer references.
- MTL4InstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride
- MTL4InstanceAccelerationStructureDescriptor.InstanceDescriptorType: The type of instance descriptor that the instance descriptor buffer references.
- MTL4InstanceAccelerationStructureDescriptor.SetInstanceDescriptorType
- MTL4InstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout: Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
- MTL4InstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout
- MTL4InstanceAccelerationStructureDescriptor.MotionTransformBuffer: A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
- MTL4InstanceAccelerationStructureDescriptor.SetMotionTransformBuffer
- MTL4InstanceAccelerationStructureDescriptor.MotionTransformCount: Controls the total number of motion transforms in the motion transform buffer.
- MTL4InstanceAccelerationStructureDescriptor.SetMotionTransformCount
- MTL4InstanceAccelerationStructureDescriptor.MotionTransformStride: Specify the stride for motion transform.
- MTL4InstanceAccelerationStructureDescriptor.SetMotionTransformStride
- MTL4InstanceAccelerationStructureDescriptor.MotionTransformType: Controls the type of motion transforms, either as a matrix or individual components.
- MTL4InstanceAccelerationStructureDescriptor.SetMotionTransformType
See: https://developer.apple.com/documentation/Metal/MTL4InstanceAccelerationStructureDescriptor
func MTL4InstanceAccelerationStructureDescriptorFromID ¶
func MTL4InstanceAccelerationStructureDescriptorFromID(id objc.ID) MTL4InstanceAccelerationStructureDescriptor
MTL4InstanceAccelerationStructureDescriptorFromID constructs a MTL4InstanceAccelerationStructureDescriptor from an objc.ID.
Descriptor for an instance acceleration structure.
func NewMTL4InstanceAccelerationStructureDescriptor ¶
func NewMTL4InstanceAccelerationStructureDescriptor() MTL4InstanceAccelerationStructureDescriptor
NewMTL4InstanceAccelerationStructureDescriptor creates a new MTL4InstanceAccelerationStructureDescriptor instance.
func (MTL4InstanceAccelerationStructureDescriptor) Autorelease ¶
func (m MTL4InstanceAccelerationStructureDescriptor) Autorelease() MTL4InstanceAccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4InstanceAccelerationStructureDescriptor) Init ¶
func (m MTL4InstanceAccelerationStructureDescriptor) Init() MTL4InstanceAccelerationStructureDescriptor
Init initializes the instance.
func (MTL4InstanceAccelerationStructureDescriptor) InstanceCount ¶
func (m MTL4InstanceAccelerationStructureDescriptor) InstanceCount() uint
Controls the number of instance descriptors in the instance descriptor buffer references.
func (MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer ¶
func (m MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTL4BufferRange
Assigns a reference to a buffer containing instance descriptors for acceleration structures to reference.
Discussion ¶
This buffer conceptually represents an array of instance data. The specific format for the structs that comprise each entry depends on the value of the [InstanceDescriptorType] property.
You are responsible for ensuring the buffer address the range contains is not zero.
func (MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorStride ¶
func (m MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
Sets the stride, in bytes, between instance descriptors the instance descriptor buffer references.
Discussion ¶
You are responsible for ensuring this stride is at least the size of the structure type corresponding to the instance descriptor type and a multiple of 4 bytes.
Defaults to `0`, indicating the instance descriptors are tightly packed.
func (MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorType ¶
func (m MTL4InstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
The type of instance descriptor that the instance descriptor buffer references.
Discussion ¶
This value determines the layout Metal expects for the structs the instance descriptor buffer contains:
- [AccelerationStructureInstanceDescriptorTypeIndirect]: Use the MTLIndirectAccelerationStructureInstanceDescriptor struct layout. - [AccelerationStructureInstanceDescriptorTypeIndirectMotion]: Use the MTLIndirectAccelerationStructureMotionInstanceDescriptor struct layout.
The default value is [AccelerationStructureInstanceDescriptorTypeIndirect].
func (MTL4InstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout ¶
func (m MTL4InstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
Specifies the layout for the transformation matrices in the instance descriptor buffer and the motion transformation matrix buffer.
Discussion ¶
Metal interprets the value of this property as the layout for the buffers that both [InstanceDescriptorBuffer] and [MotionTransformBuffer] reference.
Defaults to MTLMatrixLayoutColumnMajor.
func (MTL4InstanceAccelerationStructureDescriptor) MotionTransformBuffer ¶
func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTL4BufferRange
A buffer containing transformation information for instance motion keyframes, formatted according to the motion transform type.
Discussion ¶
Each instance can have a different number of keyframes that you configure via individual instance descriptors.
You are responsible for ensuring the buffer address the range references is not zero when using motion instance descriptors.
func (MTL4InstanceAccelerationStructureDescriptor) MotionTransformCount ¶
func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformCount() uint
Controls the total number of motion transforms in the motion transform buffer.
func (MTL4InstanceAccelerationStructureDescriptor) MotionTransformStride ¶
func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformStride() uint
Specify the stride for motion transform.
Discussion ¶
Defaults to `0`, indicating that transforms are tightly packed according to the motion transform type.
func (MTL4InstanceAccelerationStructureDescriptor) MotionTransformType ¶
func (m MTL4InstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
Controls the type of motion transforms, either as a matrix or individual components.
Discussion ¶
Defaults to MTLTransformTypePackedFloat4x3. Using a MTLTransformTypeComponent allows you to represent the rotation by a quaternion (instead as of part of the matrix), allowing for correct motion interpolation.
func (MTL4InstanceAccelerationStructureDescriptor) SetInstanceCount ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceCount(value uint)
func (MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTL4BufferRange)
func (MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
func (MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorType ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
func (MTL4InstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
func (MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformBuffer ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTL4BufferRange)
func (MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformCount ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformCount(value uint)
func (MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformStride ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
func (MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformType ¶
func (m MTL4InstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
type MTL4InstanceAccelerationStructureDescriptorClass ¶
type MTL4InstanceAccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4InstanceAccelerationStructureDescriptorClass ¶
func GetMTL4InstanceAccelerationStructureDescriptorClass() MTL4InstanceAccelerationStructureDescriptorClass
GetMTL4InstanceAccelerationStructureDescriptorClass returns the class object for MTL4InstanceAccelerationStructureDescriptor.
func (MTL4InstanceAccelerationStructureDescriptorClass) Alloc ¶
func (mc MTL4InstanceAccelerationStructureDescriptorClass) Alloc() MTL4InstanceAccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4LibraryDescriptor ¶
type MTL4LibraryDescriptor struct {
objectivec.Object
}
Serves as the base descriptor for creating a Metal library.
Instance Properties ¶
- MTL4LibraryDescriptor.Name: Assigns an optional name to the Metal library.
- MTL4LibraryDescriptor.SetName
- MTL4LibraryDescriptor.Options: Provides compile-time options for the Metal library.
- MTL4LibraryDescriptor.SetOptions
- MTL4LibraryDescriptor.Source: Assigns an optional string containing the source code of the shader language program to compile into a Metal library.
- MTL4LibraryDescriptor.SetSource
See: https://developer.apple.com/documentation/Metal/MTL4LibraryDescriptor
func MTL4LibraryDescriptorFromID ¶
func MTL4LibraryDescriptorFromID(id objc.ID) MTL4LibraryDescriptor
MTL4LibraryDescriptorFromID constructs a MTL4LibraryDescriptor from an objc.ID.
Serves as the base descriptor for creating a Metal library.
func NewMTL4LibraryDescriptor ¶
func NewMTL4LibraryDescriptor() MTL4LibraryDescriptor
NewMTL4LibraryDescriptor creates a new MTL4LibraryDescriptor instance.
func (MTL4LibraryDescriptor) Autorelease ¶
func (m MTL4LibraryDescriptor) Autorelease() MTL4LibraryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4LibraryDescriptor) Init ¶
func (m MTL4LibraryDescriptor) Init() MTL4LibraryDescriptor
Init initializes the instance.
func (MTL4LibraryDescriptor) Name ¶
func (m MTL4LibraryDescriptor) Name() string
Assigns an optional name to the Metal library.
See: https://developer.apple.com/documentation/Metal/MTL4LibraryDescriptor/name
func (MTL4LibraryDescriptor) Options ¶
func (m MTL4LibraryDescriptor) Options() IMTLCompileOptions
Provides compile-time options for the Metal library.
See: https://developer.apple.com/documentation/Metal/MTL4LibraryDescriptor/options
func (MTL4LibraryDescriptor) SetName ¶
func (m MTL4LibraryDescriptor) SetName(value string)
func (MTL4LibraryDescriptor) SetOptions ¶
func (m MTL4LibraryDescriptor) SetOptions(value IMTLCompileOptions)
func (MTL4LibraryDescriptor) SetSource ¶
func (m MTL4LibraryDescriptor) SetSource(value string)
func (MTL4LibraryDescriptor) Source ¶
func (m MTL4LibraryDescriptor) Source() string
Assigns an optional string containing the source code of the shader language program to compile into a Metal library.
See: https://developer.apple.com/documentation/Metal/MTL4LibraryDescriptor/source
type MTL4LibraryDescriptorClass ¶
type MTL4LibraryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4LibraryDescriptorClass ¶
func GetMTL4LibraryDescriptorClass() MTL4LibraryDescriptorClass
GetMTL4LibraryDescriptorClass returns the class object for MTL4LibraryDescriptor.
func (MTL4LibraryDescriptorClass) Alloc ¶
func (mc MTL4LibraryDescriptorClass) Alloc() MTL4LibraryDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4LibraryFunctionDescriptor ¶
type MTL4LibraryFunctionDescriptor struct {
MTL4FunctionDescriptor
}
Describes a shader function from a Metal library.
Instance Properties ¶
- MTL4LibraryFunctionDescriptor.Library: Returns a reference to the library containing the function.
- MTL4LibraryFunctionDescriptor.SetLibrary
- MTL4LibraryFunctionDescriptor.Name: Assigns a name to the function.
- MTL4LibraryFunctionDescriptor.SetName
See: https://developer.apple.com/documentation/Metal/MTL4LibraryFunctionDescriptor
func MTL4LibraryFunctionDescriptorFromID ¶
func MTL4LibraryFunctionDescriptorFromID(id objc.ID) MTL4LibraryFunctionDescriptor
MTL4LibraryFunctionDescriptorFromID constructs a MTL4LibraryFunctionDescriptor from an objc.ID.
Describes a shader function from a Metal library.
func NewMTL4LibraryFunctionDescriptor ¶
func NewMTL4LibraryFunctionDescriptor() MTL4LibraryFunctionDescriptor
NewMTL4LibraryFunctionDescriptor creates a new MTL4LibraryFunctionDescriptor instance.
func (MTL4LibraryFunctionDescriptor) Autorelease ¶
func (m MTL4LibraryFunctionDescriptor) Autorelease() MTL4LibraryFunctionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4LibraryFunctionDescriptor) Init ¶
func (m MTL4LibraryFunctionDescriptor) Init() MTL4LibraryFunctionDescriptor
Init initializes the instance.
func (MTL4LibraryFunctionDescriptor) Library ¶
func (m MTL4LibraryFunctionDescriptor) Library() MTLLibrary
Returns a reference to the library containing the function.
See: https://developer.apple.com/documentation/Metal/MTL4LibraryFunctionDescriptor/library
func (MTL4LibraryFunctionDescriptor) Name ¶
func (m MTL4LibraryFunctionDescriptor) Name() string
Assigns a name to the function.
See: https://developer.apple.com/documentation/Metal/MTL4LibraryFunctionDescriptor/name
func (MTL4LibraryFunctionDescriptor) SetLibrary ¶
func (m MTL4LibraryFunctionDescriptor) SetLibrary(value MTLLibrary)
func (MTL4LibraryFunctionDescriptor) SetName ¶
func (m MTL4LibraryFunctionDescriptor) SetName(value string)
type MTL4LibraryFunctionDescriptorClass ¶
type MTL4LibraryFunctionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4LibraryFunctionDescriptorClass ¶
func GetMTL4LibraryFunctionDescriptorClass() MTL4LibraryFunctionDescriptorClass
GetMTL4LibraryFunctionDescriptorClass returns the class object for MTL4LibraryFunctionDescriptor.
func (MTL4LibraryFunctionDescriptorClass) Alloc ¶
func (mc MTL4LibraryFunctionDescriptorClass) Alloc() MTL4LibraryFunctionDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4LogicalToPhysicalColorAttachmentMappingState ¶
type MTL4LogicalToPhysicalColorAttachmentMappingState int
See: https://developer.apple.com/documentation/Metal/MTL4LogicalToPhysicalColorAttachmentMappingState
const ( // MTL4LogicalToPhysicalColorAttachmentMappingStateIdentity: Treats the logical color attachment descriptor array for render and tile render pipelines to match the physical one. MTL4LogicalToPhysicalColorAttachmentMappingStateIdentity MTL4LogicalToPhysicalColorAttachmentMappingState = 0 // MTL4LogicalToPhysicalColorAttachmentMappingStateInherited: Deduces the color attachment mapping by inheriting it from the color attachment map of the current encoder. MTL4LogicalToPhysicalColorAttachmentMappingStateInherited MTL4LogicalToPhysicalColorAttachmentMappingState = 1 )
func (MTL4LogicalToPhysicalColorAttachmentMappingState) String ¶
func (e MTL4LogicalToPhysicalColorAttachmentMappingState) String() string
type MTL4MachineLearningCommandEncoder ¶
type MTL4MachineLearningCommandEncoder interface {
objectivec.IObject
MTL4CommandEncoder
// Configures the encoder with a machine learning pipeline state instance.
//
// See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningCommandEncoder/setPipelineState(_:)
SetPipelineState(pipelineState MTL4MachineLearningPipelineState)
// Sets an argument table for the command encoder’s machine learning shader stage.
//
// See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningCommandEncoder/setArgumentTable(_:)
SetArgumentTable(argumentTable MTL4ArgumentTable)
// Dispatches a machine learning network using the current pipeline state and argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningCommandEncoder/dispatchNetwork(intermediatesHeap:)
DispatchNetworkWithIntermediatesHeap(heap MTLHeap)
}
Encodes machine-learning model inference commands for a single pass.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningCommandEncoder
type MTL4MachineLearningCommandEncoderObject ¶
type MTL4MachineLearningCommandEncoderObject struct {
objectivec.Object
}
MTL4MachineLearningCommandEncoderObject wraps an existing Objective-C object that conforms to the MTL4MachineLearningCommandEncoder protocol.
func MTL4MachineLearningCommandEncoderObjectFromID ¶
func MTL4MachineLearningCommandEncoderObjectFromID(id objc.ID) MTL4MachineLearningCommandEncoderObject
MTL4MachineLearningCommandEncoderObjectFromID constructs a MTL4MachineLearningCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4MachineLearningCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions ¶
func (o MTL4MachineLearningCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes an intra-pass barrier.
afterEncoderStages: MTLStages mask that represents the stages of work to wait for. This argument only applies to subsequent work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeEncoderStages: MTLStages mask that represents the stages of work that wait. This argument only applies to work you encode in the current command encoder prior to this barrier. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the , corresponding to `beforeEncoderStages`, doesn’t begin until all prior commands in this command encoder, corresponding to `afterEncoderStages`, completes.
When calling this method, it’s your responsibility to ensure parameters `afterEncoderStages` and `beforeEncoderStages` contain a combination of MTLStages for which this encoder can encode commands. For example, for a MTL4ComputeCommandEncoder instance, you can provide any combination of [StageDispatch], [StageBlit] and [StageAccelerationStructure].
func (MTL4MachineLearningCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions ¶
func (o MTL4MachineLearningCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so encode the barrier as close to the command that consumes the resource as possible. Don’t use this method for synchronizing resource access within the same pass.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTL4MachineLearningCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions ¶
func (o MTL4MachineLearningCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a producer barrier on work committed to the same command queue.
afterStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in the current command encoder prior to this barrier command. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeQueueStages: MTLStages mask that represents the stages of work that need to wait. This argument applies to subsequent encoders and not to work in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
This method encodes a barrier that guarantees that any work you encode using , corresponding to `beforeQueueStages`, don’t begin until all commands you previously encode in the current encoder (and prior encoders), corresponding to `afterStages`, complete.
When calling this method, you can pass any MTLStages to parameters `afterStages` and `beforeQueueStages`, even stages that don’t relate to the current or prior command encoders.
func (MTL4MachineLearningCommandEncoderObject) BaseObject ¶
func (o MTL4MachineLearningCommandEncoderObject) BaseObject() objectivec.Object
func (MTL4MachineLearningCommandEncoderObject) CommandBuffer ¶
func (o MTL4MachineLearningCommandEncoderObject) CommandBuffer() MTL4CommandBuffer
Returns the command buffer that is currently encoding commands.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/commandBuffer
func (MTL4MachineLearningCommandEncoderObject) DispatchNetworkWithIntermediatesHeap ¶
func (o MTL4MachineLearningCommandEncoderObject) DispatchNetworkWithIntermediatesHeap(heap MTLHeap)
Dispatches a machine learning network using the current pipeline state and argument table.
heap: A heap that Metal can use to allocate intermediate tensors.
Discussion ¶
This method takes a parameter consisting of a MTLHeap that Metal can use to allocate intermediate tensors. You can query the minimum size Metal requires for this heap by calling [IntermediatesHeapSize].
func (MTL4MachineLearningCommandEncoderObject) EndEncoding ¶
func (o MTL4MachineLearningCommandEncoderObject) EndEncoding()
Declares that all command generation from this encoder is complete.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/endEncoding()
func (MTL4MachineLearningCommandEncoderObject) InsertDebugSignpost ¶
func (o MTL4MachineLearningCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the frame data to aid debugging.
string: The debug string to insert as a signpost.
Discussion ¶
Calling this method doesn’t change any behaviors, but can be useful for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/insertDebugSignpost(_:)
func (MTL4MachineLearningCommandEncoderObject) Label ¶
func (o MTL4MachineLearningCommandEncoderObject) Label() string
Provides an optional label to assign to the command encoder for debug purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/label
func (MTL4MachineLearningCommandEncoderObject) PopDebugGroup ¶
func (o MTL4MachineLearningCommandEncoderObject) PopDebugGroup()
Pops the latest debug group string from this encoder’s stack of debug groups.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/popDebugGroup()
func (MTL4MachineLearningCommandEncoderObject) PushDebugGroup ¶
func (o MTL4MachineLearningCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a string onto this encoder’s stack of debug groups.
string: The debug string to push.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/pushDebugGroup(_:)
func (MTL4MachineLearningCommandEncoderObject) SetArgumentTable ¶
func (o MTL4MachineLearningCommandEncoderObject) SetArgumentTable(argumentTable MTL4ArgumentTable)
Sets an argument table for the command encoder’s machine learning shader stage.
argumentTable: An argument table to set on the command encoder’s Machine Learning stage.
Discussion ¶
The argument table provides inputs to all subsequent Machine Learning dispatches.
func (MTL4MachineLearningCommandEncoderObject) SetLabel ¶
func (o MTL4MachineLearningCommandEncoderObject) SetLabel(value string)
func (MTL4MachineLearningCommandEncoderObject) SetPipelineState ¶
func (o MTL4MachineLearningCommandEncoderObject) SetPipelineState(pipelineState MTL4MachineLearningPipelineState)
Configures the encoder with a machine learning pipeline state instance.
pipelineState: A Machine Learning pipeline state instance.
Discussion ¶
The pipeline state instance affects all subsequent Machine Learning commands.
func (MTL4MachineLearningCommandEncoderObject) UpdateFenceAfterEncoderStages ¶
func (o MTL4MachineLearningCommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
Encodes a command that instructs the GPU to update a fence after one or more stages, which can unblock other passes waiting for the fence.
fence: A fence the pass updates after the stages in `afterEncoderStages` complete.
afterEncoderStages: The encoder stages that need to complete before the pass updates `fence`.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the pass to update `fence` after the stages you pass to the `afterEncoderStages` run all their memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
func (MTL4MachineLearningCommandEncoderObject) WaitForFenceBeforeEncoderStages ¶
func (o MTL4MachineLearningCommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
Encodes a command that instructs the GPU to pause before starting one or more stages of the pass until a pass updates a fence.
fence: A fence that the pass waits for before running the stages you pass to `beforeEncoderStages`.
beforeEncoderStages: The encoder stages that need to wait for another pass to update `fence` before they run.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the stages you pass to the `beforeEncoderStages` parameter. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
type MTL4MachineLearningPipelineDescriptor ¶
type MTL4MachineLearningPipelineDescriptor struct {
MTL4PipelineDescriptor
}
Description for a machine learning pipeline state.
Instance Properties ¶
- MTL4MachineLearningPipelineDescriptor.MachineLearningFunctionDescriptor: Assigns the function that the machine learning pipeline you create from this descriptor executes.
- MTL4MachineLearningPipelineDescriptor.SetMachineLearningFunctionDescriptor
Instance Methods ¶
- MTL4MachineLearningPipelineDescriptor.InputDimensionsAtBufferIndex: Obtains the dimensions of the input tensor at `bufferIndex` if set, `nil` otherwise.
- MTL4MachineLearningPipelineDescriptor.Reset: Resets the descriptor to its default values.
- MTL4MachineLearningPipelineDescriptor.SetInputDimensionsAtBufferIndex: Sets the dimension of an input tensor at a buffer index.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineDescriptor
func MTL4MachineLearningPipelineDescriptorFromID ¶
func MTL4MachineLearningPipelineDescriptorFromID(id objc.ID) MTL4MachineLearningPipelineDescriptor
MTL4MachineLearningPipelineDescriptorFromID constructs a MTL4MachineLearningPipelineDescriptor from an objc.ID.
Description for a machine learning pipeline state.
func NewMTL4MachineLearningPipelineDescriptor ¶
func NewMTL4MachineLearningPipelineDescriptor() MTL4MachineLearningPipelineDescriptor
NewMTL4MachineLearningPipelineDescriptor creates a new MTL4MachineLearningPipelineDescriptor instance.
func (MTL4MachineLearningPipelineDescriptor) Autorelease ¶
func (m MTL4MachineLearningPipelineDescriptor) Autorelease() MTL4MachineLearningPipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4MachineLearningPipelineDescriptor) InputDimensionsAtBufferIndex ¶
func (m MTL4MachineLearningPipelineDescriptor) InputDimensionsAtBufferIndex(bufferIndex int) IMTLTensorExtents
Obtains the dimensions of the input tensor at `bufferIndex` if set, `nil` otherwise.
func (MTL4MachineLearningPipelineDescriptor) MachineLearningFunctionDescriptor ¶
func (m MTL4MachineLearningPipelineDescriptor) MachineLearningFunctionDescriptor() IMTL4FunctionDescriptor
Assigns the function that the machine learning pipeline you create from this descriptor executes.
func (MTL4MachineLearningPipelineDescriptor) Reset ¶
func (m MTL4MachineLearningPipelineDescriptor) Reset()
Resets the descriptor to its default values.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineDescriptor/reset()
func (MTL4MachineLearningPipelineDescriptor) SetInputDimensionsAtBufferIndex ¶
func (m MTL4MachineLearningPipelineDescriptor) SetInputDimensionsAtBufferIndex(dimensions IMTLTensorExtents, bufferIndex int)
Sets the dimension of an input tensor at a buffer index.
dimensions: The dimensions of the tensor.
bufferIndex: Index of the tensor to modify.
func (MTL4MachineLearningPipelineDescriptor) SetInputDimensionsWithRange ¶
func (m MTL4MachineLearningPipelineDescriptor) SetInputDimensionsWithRange(dimensions []MTLTensorExtents, range_ foundation.NSRange)
Sets the dimensions of multiple input tensors on a range of buffer bindings.
dimensions: An array of tensor extents.
range: The range of inputs of the `dimensions` argument. The range’s `length` needs to match the dimensions’ `count` property.
Discussion ¶
Use this method to specify the dimensions of multiple input tensors at a range of indices in a single call.
You can indicate that any tensors in the range have unspecified dimensions by providing [NSNull] at the their corresponding index location in the array.
func (MTL4MachineLearningPipelineDescriptor) SetMachineLearningFunctionDescriptor ¶
func (m MTL4MachineLearningPipelineDescriptor) SetMachineLearningFunctionDescriptor(value IMTL4FunctionDescriptor)
type MTL4MachineLearningPipelineDescriptorClass ¶
type MTL4MachineLearningPipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4MachineLearningPipelineDescriptorClass ¶
func GetMTL4MachineLearningPipelineDescriptorClass() MTL4MachineLearningPipelineDescriptorClass
GetMTL4MachineLearningPipelineDescriptorClass returns the class object for MTL4MachineLearningPipelineDescriptor.
type MTL4MachineLearningPipelineReflection ¶
type MTL4MachineLearningPipelineReflection struct {
objectivec.Object
}
Represents reflection information for a machine learning pipeline state.
Instance Properties ¶
- MTL4MachineLearningPipelineReflection.Bindings: Describes every input and output of the pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineReflection
func MTL4MachineLearningPipelineReflectionFromID ¶
func MTL4MachineLearningPipelineReflectionFromID(id objc.ID) MTL4MachineLearningPipelineReflection
MTL4MachineLearningPipelineReflectionFromID constructs a MTL4MachineLearningPipelineReflection from an objc.ID.
Represents reflection information for a machine learning pipeline state.
func NewMTL4MachineLearningPipelineReflection ¶
func NewMTL4MachineLearningPipelineReflection() MTL4MachineLearningPipelineReflection
NewMTL4MachineLearningPipelineReflection creates a new MTL4MachineLearningPipelineReflection instance.
func (MTL4MachineLearningPipelineReflection) Autorelease ¶
func (m MTL4MachineLearningPipelineReflection) Autorelease() MTL4MachineLearningPipelineReflection
Autorelease adds the receiver to the current autorelease pool.
func (MTL4MachineLearningPipelineReflection) Bindings ¶
func (m MTL4MachineLearningPipelineReflection) Bindings() []objectivec.IObject
Describes every input and output of the pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineReflection/bindings
type MTL4MachineLearningPipelineReflectionClass ¶
type MTL4MachineLearningPipelineReflectionClass struct {
// contains filtered or unexported fields
}
func GetMTL4MachineLearningPipelineReflectionClass ¶
func GetMTL4MachineLearningPipelineReflectionClass() MTL4MachineLearningPipelineReflectionClass
GetMTL4MachineLearningPipelineReflectionClass returns the class object for MTL4MachineLearningPipelineReflection.
type MTL4MachineLearningPipelineState ¶
type MTL4MachineLearningPipelineState interface {
objectivec.IObject
MTLAllocation
// Returns the device the pipeline state belongs to.
//
// See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState/device
Device() MTLDevice
// Obtain the size of the heap, in bytes, this pipeline requires during the execution.
//
// See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState/intermediatesHeapSize
IntermediatesHeapSize() uint
// Queries the string that helps identify this object.
//
// See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState/label
Label() string
// Returns reflection information for this machine learning pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState/reflection
Reflection() IMTL4MachineLearningPipelineReflection
}
A pipeline state that you can use with machine-learning encoder instances.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState
type MTL4MachineLearningPipelineStateObject ¶
type MTL4MachineLearningPipelineStateObject struct {
objectivec.Object
}
MTL4MachineLearningPipelineStateObject wraps an existing Objective-C object that conforms to the MTL4MachineLearningPipelineState protocol.
func MTL4MachineLearningPipelineStateObjectFromID ¶
func MTL4MachineLearningPipelineStateObjectFromID(id objc.ID) MTL4MachineLearningPipelineStateObject
MTL4MachineLearningPipelineStateObjectFromID constructs a MTL4MachineLearningPipelineStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4MachineLearningPipelineStateObject) AllocatedSize ¶
func (o MTL4MachineLearningPipelineStateObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTL4MachineLearningPipelineStateObject) BaseObject ¶
func (o MTL4MachineLearningPipelineStateObject) BaseObject() objectivec.Object
func (MTL4MachineLearningPipelineStateObject) Device ¶
func (o MTL4MachineLearningPipelineStateObject) Device() MTLDevice
Returns the device the pipeline state belongs to.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState/device
func (MTL4MachineLearningPipelineStateObject) IntermediatesHeapSize ¶
func (o MTL4MachineLearningPipelineStateObject) IntermediatesHeapSize() uint
Obtain the size of the heap, in bytes, this pipeline requires during the execution.
func (MTL4MachineLearningPipelineStateObject) Label ¶
func (o MTL4MachineLearningPipelineStateObject) Label() string
Queries the string that helps identify this object.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState/label
func (MTL4MachineLearningPipelineStateObject) Reflection ¶
func (o MTL4MachineLearningPipelineStateObject) Reflection() IMTL4MachineLearningPipelineReflection
Returns reflection information for this machine learning pipeline state.
See: https://developer.apple.com/documentation/Metal/MTL4MachineLearningPipelineState/reflection
type MTL4MeshRenderPipelineDescriptor ¶
type MTL4MeshRenderPipelineDescriptor struct {
MTL4PipelineDescriptor
}
Groups together properties you use to create a mesh render pipeline state object.
Overview ¶
Compared to MTLMeshRenderPipelineDescriptor, this interface doesn’t offer a mechanism to hint to Metal mutability of object, mesh, or fragment buffers. Additionally, when you use this descriptor, you don’t specify binary archives.
Instance Properties ¶
- MTL4MeshRenderPipelineDescriptor.AlphaToCoverageState: Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
- MTL4MeshRenderPipelineDescriptor.SetAlphaToCoverageState
- MTL4MeshRenderPipelineDescriptor.AlphaToOneState: Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
- MTL4MeshRenderPipelineDescriptor.SetAlphaToOneState
- MTL4MeshRenderPipelineDescriptor.ColorAttachmentMappingState: Sets the logical-to-physical rendering remap state.
- MTL4MeshRenderPipelineDescriptor.SetColorAttachmentMappingState
- MTL4MeshRenderPipelineDescriptor.ColorAttachments: Accesses an array containing descriptions of the color attachments this pipeline writes to.
- MTL4MeshRenderPipelineDescriptor.FragmentFunctionDescriptor: Assigns a function descriptor representing the function this pipeline executes for each fragment.
- MTL4MeshRenderPipelineDescriptor.SetFragmentFunctionDescriptor
- MTL4MeshRenderPipelineDescriptor.FragmentStaticLinkingDescriptor: Provides static linking information for the fragment stage of the render pipeline.
- MTL4MeshRenderPipelineDescriptor.SetFragmentStaticLinkingDescriptor
- MTL4MeshRenderPipelineDescriptor.RasterizationEnabled: Determines whether the pipeline rasterizes primitives.
- MTL4MeshRenderPipelineDescriptor.SetRasterizationEnabled
- MTL4MeshRenderPipelineDescriptor.MaxTotalThreadgroupsPerMeshGrid: Controls the largest number of threads the pipeline state can execute when the object stage of a mesh render pipeline you create from this descriptor dispatches its mesh stage.
- MTL4MeshRenderPipelineDescriptor.SetMaxTotalThreadgroupsPerMeshGrid
- MTL4MeshRenderPipelineDescriptor.MaxTotalThreadsPerMeshThreadgroup: Controls the largest number of threads the pipeline state can execute in a single mesh shader threadgroup dispatch.
- MTL4MeshRenderPipelineDescriptor.SetMaxTotalThreadsPerMeshThreadgroup
- MTL4MeshRenderPipelineDescriptor.MaxTotalThreadsPerObjectThreadgroup: Controls the largest number of threads the pipeline state can execute in a single object shader threadgroup dispatch.
- MTL4MeshRenderPipelineDescriptor.SetMaxTotalThreadsPerObjectThreadgroup
- MTL4MeshRenderPipelineDescriptor.MaxVertexAmplificationCount: Determines the maximum value that can you can pass as the pipeline’s amplification count.
- MTL4MeshRenderPipelineDescriptor.SetMaxVertexAmplificationCount
- MTL4MeshRenderPipelineDescriptor.MeshFunctionDescriptor: Assigns a function descriptor representing the function this pipeline executes for each primitive in the mesh shader stage.
- MTL4MeshRenderPipelineDescriptor.SetMeshFunctionDescriptor
- MTL4MeshRenderPipelineDescriptor.MeshStaticLinkingDescriptor: Provides static linking information for the mesh stage of the render pipeline.
- MTL4MeshRenderPipelineDescriptor.SetMeshStaticLinkingDescriptor
- MTL4MeshRenderPipelineDescriptor.MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth: Provides a guarantee to Metal regarding the number of threadgroup threads for the mesh stage of a pipeline you create from this descriptor.
- MTL4MeshRenderPipelineDescriptor.SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth
- MTL4MeshRenderPipelineDescriptor.ObjectFunctionDescriptor: Assigns a function descriptor representing the function this pipeline executes for each in the object shader stage.
- MTL4MeshRenderPipelineDescriptor.SetObjectFunctionDescriptor
- MTL4MeshRenderPipelineDescriptor.ObjectStaticLinkingDescriptor: Provides static linking information for the object stage of the render pipeline.
- MTL4MeshRenderPipelineDescriptor.SetObjectStaticLinkingDescriptor
- MTL4MeshRenderPipelineDescriptor.ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth: Provides a guarantee to Metal regarding the number of threadgroup threads for the object stage of a pipeline you create from this descriptor.
- MTL4MeshRenderPipelineDescriptor.SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth
- MTL4MeshRenderPipelineDescriptor.PayloadMemoryLength: Reserves storage for the object-to-mesh stage payload.
- MTL4MeshRenderPipelineDescriptor.SetPayloadMemoryLength
- MTL4MeshRenderPipelineDescriptor.RasterSampleCount: Sets number of samples this pipeline applies for each fragment.
- MTL4MeshRenderPipelineDescriptor.SetRasterSampleCount
- MTL4MeshRenderPipelineDescriptor.RequiredThreadsPerMeshThreadgroup: Controls the required number of mesh threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
- MTL4MeshRenderPipelineDescriptor.SetRequiredThreadsPerMeshThreadgroup
- MTL4MeshRenderPipelineDescriptor.RequiredThreadsPerObjectThreadgroup: Controls the required number of object threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
- MTL4MeshRenderPipelineDescriptor.SetRequiredThreadsPerObjectThreadgroup
- MTL4MeshRenderPipelineDescriptor.SupportFragmentBinaryLinking: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
- MTL4MeshRenderPipelineDescriptor.SetSupportFragmentBinaryLinking
- MTL4MeshRenderPipelineDescriptor.SupportIndirectCommandBuffers: Indicates whether the pipeline supports indirect command buffers.
- MTL4MeshRenderPipelineDescriptor.SetSupportIndirectCommandBuffers
- MTL4MeshRenderPipelineDescriptor.SupportMeshBinaryLinking: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the mesh shader function’s callable functions list.
- MTL4MeshRenderPipelineDescriptor.SetSupportMeshBinaryLinking
- MTL4MeshRenderPipelineDescriptor.SupportObjectBinaryLinking: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the object shader function’s callable functions list.
- MTL4MeshRenderPipelineDescriptor.SetSupportObjectBinaryLinking
Instance Methods ¶
- MTL4MeshRenderPipelineDescriptor.Reset: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4MeshRenderPipelineDescriptor
func MTL4MeshRenderPipelineDescriptorFromID ¶
func MTL4MeshRenderPipelineDescriptorFromID(id objc.ID) MTL4MeshRenderPipelineDescriptor
MTL4MeshRenderPipelineDescriptorFromID constructs a MTL4MeshRenderPipelineDescriptor from an objc.ID.
Groups together properties you use to create a mesh render pipeline state object.
func NewMTL4MeshRenderPipelineDescriptor ¶
func NewMTL4MeshRenderPipelineDescriptor() MTL4MeshRenderPipelineDescriptor
NewMTL4MeshRenderPipelineDescriptor creates a new MTL4MeshRenderPipelineDescriptor instance.
func (MTL4MeshRenderPipelineDescriptor) AlphaToCoverageState ¶
func (m MTL4MeshRenderPipelineDescriptor) AlphaToCoverageState() MTL4AlphaToCoverageState
Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
func (MTL4MeshRenderPipelineDescriptor) AlphaToOneState ¶
func (m MTL4MeshRenderPipelineDescriptor) AlphaToOneState() MTL4AlphaToOneState
Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
See: https://developer.apple.com/documentation/Metal/MTL4MeshRenderPipelineDescriptor/alphaToOneState
func (MTL4MeshRenderPipelineDescriptor) Autorelease ¶
func (m MTL4MeshRenderPipelineDescriptor) Autorelease() MTL4MeshRenderPipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4MeshRenderPipelineDescriptor) ColorAttachmentMappingState ¶
func (m MTL4MeshRenderPipelineDescriptor) ColorAttachmentMappingState() MTL4LogicalToPhysicalColorAttachmentMappingState
Sets the logical-to-physical rendering remap state.
Discussion ¶
Use this property to assign how a MTL4RenderCommandEncoder instance maps the output of your fragment shader to physical color attachments.
func (MTL4MeshRenderPipelineDescriptor) ColorAttachments ¶
func (m MTL4MeshRenderPipelineDescriptor) ColorAttachments() IMTL4RenderPipelineColorAttachmentDescriptorArray
Accesses an array containing descriptions of the color attachments this pipeline writes to.
See: https://developer.apple.com/documentation/Metal/MTL4MeshRenderPipelineDescriptor/colorAttachments
func (MTL4MeshRenderPipelineDescriptor) FragmentFunctionDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) FragmentFunctionDescriptor() IMTL4FunctionDescriptor
Assigns a function descriptor representing the function this pipeline executes for each fragment.
func (MTL4MeshRenderPipelineDescriptor) FragmentStaticLinkingDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) FragmentStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
Provides static linking information for the fragment stage of the render pipeline.
Discussion ¶
Use this property to link extra shader functions to the fragment stage of the render pipeline.
func (MTL4MeshRenderPipelineDescriptor) Init ¶
func (m MTL4MeshRenderPipelineDescriptor) Init() MTL4MeshRenderPipelineDescriptor
Init initializes the instance.
func (MTL4MeshRenderPipelineDescriptor) MaxTotalThreadgroupsPerMeshGrid ¶
func (m MTL4MeshRenderPipelineDescriptor) MaxTotalThreadgroupsPerMeshGrid() uint
Controls the largest number of threads the pipeline state can execute when the object stage of a mesh render pipeline you create from this descriptor dispatches its mesh stage.
Discussion ¶
This number represents the maximum size of the product of the components of the parameter you pass to Metal Shading Language’s built-in function `:set_threadgroups_per_grid`.
The default value of this property is `0`, which indicates that the Metal Shading Language attribute `[[max_total_threadgroups_per_mesh_grid(N)]]` you attach to the pipeline’s mesh shader function determines the value of this property.
When you specify both the `[[max_total_threadgroups_per_mesh_grid(N)]]` attribute and this property, you are responsible for making sure these values match.
Additionally, you are responsible for ensuring this value doesn’t exceed the “maximum threads per mesh grid” device limit documented in the “Metal Feature Set Tables” PDF: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf.
func (MTL4MeshRenderPipelineDescriptor) MaxTotalThreadsPerMeshThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) MaxTotalThreadsPerMeshThreadgroup() uint
Controls the largest number of threads the pipeline state can execute in a single mesh shader threadgroup dispatch.
Discussion ¶
This number represents the maximum size of the product of the components of parameter `threadsPerMeshThreadgroup` that Metal can use when drawing with this pipeline in mesh shader dispatch methods, such as [DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup].
The compiler’s optimizer can use the value of this property to generate more efficient code, specifically when the value doesn’t exceed the thread execution width of the underlying GPU.
The default value of this property is `0`, thish indicates that the Metal Shader Language attribute `[[max_total_threads_per_threadgroup]]` you attache to the pipeline’s mesh shader function determines the value of this property.
When you specify both the `[[max_total_threads_per_threadgroup(N)]]` attribute and this property, you are responsible for making sure these values match.
Additionally, you are responsible for ensuring this value doesn’t exceed the “maximum threads per threadgroup” device limit documented in the “Metal Feature Set Tables” PDF: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf.
func (MTL4MeshRenderPipelineDescriptor) MaxTotalThreadsPerObjectThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) MaxTotalThreadsPerObjectThreadgroup() uint
Controls the largest number of threads the pipeline state can execute in a single object shader threadgroup dispatch.
Discussion ¶
This number represents the maximum size of the product of the components of parameter `threadsPerObjectThreadgroup` that Metal can use when drawing with this pipeline in mesh shader dispatch methods, such as [DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup].
The compiler’s optimizer can use the value of this property to generate more efficient code, specifically when the value doesn’t exceed the thread execution width of the underlying GPU.
The default value of this property is `0`, which indicates that the number you pass to attribute `[[max_total_threads_per_threadgroup(N)]]` of the pipeline’s object function determines the maximum total threads per threadgroup.
When you specify both the `[[max_total_threads_per_threadgroup(N)]]` attribute and this property, you are responsible for making sure these values match.
Additionally, you are responsible for ensuring this value doesn’t exceed the “maximum threads per threadgroup” device limit documented in the “Metal Feature Set Tables” PDF: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf.
func (MTL4MeshRenderPipelineDescriptor) MaxVertexAmplificationCount ¶
func (m MTL4MeshRenderPipelineDescriptor) MaxVertexAmplificationCount() uint
Determines the maximum value that can you can pass as the pipeline’s amplification count.
Discussion ¶
This property controls the maximum count you pass to [SetVertexAmplificationCountViewMappings] when using vertex amplification with this pipeline.
func (MTL4MeshRenderPipelineDescriptor) MeshFunctionDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) MeshFunctionDescriptor() IMTL4FunctionDescriptor
Assigns a function descriptor representing the function this pipeline executes for each primitive in the mesh shader stage.
func (MTL4MeshRenderPipelineDescriptor) MeshStaticLinkingDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) MeshStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
Provides static linking information for the mesh stage of the render pipeline.
Discussion ¶
Use this property to link extra shader functions to the mesh stage of the render pipeline.
func (MTL4MeshRenderPipelineDescriptor) MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTL4MeshRenderPipelineDescriptor) MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
Provides a guarantee to Metal regarding the number of threadgroup threads for the mesh stage of a pipeline you create from this descriptor.
Discussion ¶
If you set this property to true, you state to Metal that when you use a mesh render pipeline you create from this descriptor, the number of threadgroup threads you dispatch for the mesh stage is a multiple of its [MeshThreadExecutionWidth]. The compiler’s optimizer can use this guarantee to generate more efficient code.
This property’s default value is false.
func (MTL4MeshRenderPipelineDescriptor) ObjectFunctionDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) ObjectFunctionDescriptor() IMTL4FunctionDescriptor
Assigns a function descriptor representing the function this pipeline executes for each in the object shader stage.
func (MTL4MeshRenderPipelineDescriptor) ObjectStaticLinkingDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) ObjectStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
Provides static linking information for the object stage of the render pipeline.
Discussion ¶
Use this property to link extra shader functions to the object stage of the render pipeline.
func (MTL4MeshRenderPipelineDescriptor) ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTL4MeshRenderPipelineDescriptor) ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
Provides a guarantee to Metal regarding the number of threadgroup threads for the object stage of a pipeline you create from this descriptor.
Discussion ¶
If you set this property to true, you state to Metal that when you use a mesh render pipeline you create from this descriptor, the number of threadgroup threads you dispatch for the object stage is a multiple of its [ObjectThreadExecutionWidth]. The compiler’s optimizer can use this guarantee to generate more efficient code.
This property’s default value is false.
func (MTL4MeshRenderPipelineDescriptor) PayloadMemoryLength ¶
func (m MTL4MeshRenderPipelineDescriptor) PayloadMemoryLength() uint
Reserves storage for the object-to-mesh stage payload.
Discussion ¶
This property determines the size, in bytes, of the buffer you indicate via the Metal Shading Language `[[payload]]` attribute in the object and mesh shader functions of the mesh render pipeline.
If this value is `0`, Metal derives the size from the (dereferenced) type you declare for the payload in the object shader function. If the type is a pointer, Metal reserves space for a single element.
The default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTL4MeshRenderPipelineDescriptor/payloadMemoryLength
func (MTL4MeshRenderPipelineDescriptor) RasterSampleCount ¶
func (m MTL4MeshRenderPipelineDescriptor) RasterSampleCount() uint
Sets number of samples this pipeline applies for each fragment.
See: https://developer.apple.com/documentation/Metal/MTL4MeshRenderPipelineDescriptor/rasterSampleCount
func (MTL4MeshRenderPipelineDescriptor) RasterizationEnabled ¶
func (m MTL4MeshRenderPipelineDescriptor) RasterizationEnabled() bool
Determines whether the pipeline rasterizes primitives.
Discussion ¶
By default, this value is true, specifying that this pipeline rasterizes primitives. Set this property to false when you don’t provide a fragment shader function via function [FragmentFunctionDescriptor].
func (MTL4MeshRenderPipelineDescriptor) RequiredThreadsPerMeshThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) RequiredThreadsPerMeshThreadgroup() MTLSize
Controls the required number of mesh threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
Discussion ¶
This argument is optional, unless this pipeline uses [CooperativeTensors], in which case you are responsible for providing it.
When this value is set to non-zero, you are responsible for ensuring the parameter `threadsPerMeshThreadgroup` in any mesh dispatch draw calls that use this mesh render pipeline, such as [DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup], match it.
Setting this value to a size of 0 in every dimension disables this property.
func (MTL4MeshRenderPipelineDescriptor) RequiredThreadsPerObjectThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) RequiredThreadsPerObjectThreadgroup() MTLSize
Controls the required number of object threads-per-threadgroup when drawing with a mesh shader pipeline you create from this descriptor.
Discussion ¶
This argument is optional, unless this pipeline uses [CooperativeTensors], in which case you are responsible for providing it.
When this value is set to non-zero, you are responsible for ensuring the parameter `threadsPerObjectThreadgroup` in any mesh dispatch draw calls that use this mesh render pipeline, such as [DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup], match it.
Setting this value to a size of 0 in every dimension disables this property.
func (MTL4MeshRenderPipelineDescriptor) Reset ¶
func (m MTL4MeshRenderPipelineDescriptor) Reset()
Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4MeshRenderPipelineDescriptor/reset()
func (MTL4MeshRenderPipelineDescriptor) SetAlphaToCoverageState ¶
func (m MTL4MeshRenderPipelineDescriptor) SetAlphaToCoverageState(value MTL4AlphaToCoverageState)
func (MTL4MeshRenderPipelineDescriptor) SetAlphaToOneState ¶
func (m MTL4MeshRenderPipelineDescriptor) SetAlphaToOneState(value MTL4AlphaToOneState)
func (MTL4MeshRenderPipelineDescriptor) SetColorAttachmentMappingState ¶
func (m MTL4MeshRenderPipelineDescriptor) SetColorAttachmentMappingState(value MTL4LogicalToPhysicalColorAttachmentMappingState)
func (MTL4MeshRenderPipelineDescriptor) SetFragmentFunctionDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) SetFragmentFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4MeshRenderPipelineDescriptor) SetFragmentStaticLinkingDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) SetFragmentStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
func (MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadgroupsPerMeshGrid ¶
func (m MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadgroupsPerMeshGrid(value uint)
func (MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadsPerMeshThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadsPerMeshThreadgroup(value uint)
func (MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadsPerObjectThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) SetMaxTotalThreadsPerObjectThreadgroup(value uint)
func (MTL4MeshRenderPipelineDescriptor) SetMaxVertexAmplificationCount ¶
func (m MTL4MeshRenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
func (MTL4MeshRenderPipelineDescriptor) SetMeshFunctionDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) SetMeshFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4MeshRenderPipelineDescriptor) SetMeshStaticLinkingDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) SetMeshStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
func (MTL4MeshRenderPipelineDescriptor) SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTL4MeshRenderPipelineDescriptor) SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
func (MTL4MeshRenderPipelineDescriptor) SetObjectFunctionDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) SetObjectFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4MeshRenderPipelineDescriptor) SetObjectStaticLinkingDescriptor ¶
func (m MTL4MeshRenderPipelineDescriptor) SetObjectStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
func (MTL4MeshRenderPipelineDescriptor) SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTL4MeshRenderPipelineDescriptor) SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
func (MTL4MeshRenderPipelineDescriptor) SetPayloadMemoryLength ¶
func (m MTL4MeshRenderPipelineDescriptor) SetPayloadMemoryLength(value uint)
func (MTL4MeshRenderPipelineDescriptor) SetRasterSampleCount ¶
func (m MTL4MeshRenderPipelineDescriptor) SetRasterSampleCount(value uint)
func (MTL4MeshRenderPipelineDescriptor) SetRasterizationEnabled ¶
func (m MTL4MeshRenderPipelineDescriptor) SetRasterizationEnabled(value bool)
func (MTL4MeshRenderPipelineDescriptor) SetRequiredThreadsPerMeshThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) SetRequiredThreadsPerMeshThreadgroup(value MTLSize)
func (MTL4MeshRenderPipelineDescriptor) SetRequiredThreadsPerObjectThreadgroup ¶
func (m MTL4MeshRenderPipelineDescriptor) SetRequiredThreadsPerObjectThreadgroup(value MTLSize)
func (MTL4MeshRenderPipelineDescriptor) SetSupportFragmentBinaryLinking ¶
func (m MTL4MeshRenderPipelineDescriptor) SetSupportFragmentBinaryLinking(value bool)
func (MTL4MeshRenderPipelineDescriptor) SetSupportIndirectCommandBuffers ¶
func (m MTL4MeshRenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
func (MTL4MeshRenderPipelineDescriptor) SetSupportMeshBinaryLinking ¶
func (m MTL4MeshRenderPipelineDescriptor) SetSupportMeshBinaryLinking(value bool)
func (MTL4MeshRenderPipelineDescriptor) SetSupportObjectBinaryLinking ¶
func (m MTL4MeshRenderPipelineDescriptor) SetSupportObjectBinaryLinking(value bool)
func (MTL4MeshRenderPipelineDescriptor) SupportFragmentBinaryLinking ¶
func (m MTL4MeshRenderPipelineDescriptor) SupportFragmentBinaryLinking() bool
Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
func (MTL4MeshRenderPipelineDescriptor) SupportIndirectCommandBuffers ¶
func (m MTL4MeshRenderPipelineDescriptor) SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
Indicates whether the pipeline supports indirect command buffers.
func (MTL4MeshRenderPipelineDescriptor) SupportMeshBinaryLinking ¶
func (m MTL4MeshRenderPipelineDescriptor) SupportMeshBinaryLinking() bool
Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the mesh shader function’s callable functions list.
func (MTL4MeshRenderPipelineDescriptor) SupportObjectBinaryLinking ¶
func (m MTL4MeshRenderPipelineDescriptor) SupportObjectBinaryLinking() bool
Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the object shader function’s callable functions list.
type MTL4MeshRenderPipelineDescriptorClass ¶
type MTL4MeshRenderPipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4MeshRenderPipelineDescriptorClass ¶
func GetMTL4MeshRenderPipelineDescriptorClass() MTL4MeshRenderPipelineDescriptorClass
GetMTL4MeshRenderPipelineDescriptorClass returns the class object for MTL4MeshRenderPipelineDescriptor.
func (MTL4MeshRenderPipelineDescriptorClass) Alloc ¶
func (mc MTL4MeshRenderPipelineDescriptorClass) Alloc() MTL4MeshRenderPipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4NewBinaryFunctionCompletionHandler ¶
type MTL4NewBinaryFunctionCompletionHandler = func(MTL4BinaryFunction, foundation.NSError)
MTL4NewBinaryFunctionCompletionHandler is provides a signature for a callback block that Metal calls when the compiler finishes a build task for a binary function.
See: https://developer.apple.com/documentation/Metal/MTL4NewBinaryFunctionCompletionHandler
type MTL4NewMachineLearningPipelineStateCompletionHandler ¶
type MTL4NewMachineLearningPipelineStateCompletionHandler = func(MTL4MachineLearningPipelineState, foundation.NSError)
MTL4NewMachineLearningPipelineStateCompletionHandler is provides a signature for a callback block that Metal calls when the compiler finishes a build task for a machine learning pipeline state.
See: https://developer.apple.com/documentation/Metal/MTL4NewMachineLearningPipelineStateCompletionHandler
type MTL4PipelineDataSetSerializer ¶
type MTL4PipelineDataSetSerializer interface {
objectivec.IObject
// Serializes a pipeline data set to an archive.
//
// See: https://developer.apple.com/documentation/Metal/MTL4PipelineDataSetSerializer/serializeAsArchiveAndFlush(url:)
SerializeAsArchiveAndFlushToURLError(url foundation.INSURL) (bool, error)
// Serializes a serializer data set to a pipeline script as raw data.
//
// See: https://developer.apple.com/documentation/Metal/MTL4PipelineDataSetSerializer/serializeAsPipelinesScript()
SerializeAsPipelinesScriptWithError() (foundation.INSData, error)
}
A fast-addition container for collecting data during pipeline state creation.
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDataSetSerializer
type MTL4PipelineDataSetSerializerConfiguration ¶
type MTL4PipelineDataSetSerializerConfiguration int
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDataSetSerializerConfiguration
const ( // MTL4PipelineDataSetSerializerConfigurationCaptureBinaries: Enables serializing pipeline binary functions. MTL4PipelineDataSetSerializerConfigurationCaptureBinaries MTL4PipelineDataSetSerializerConfiguration = 2 // MTL4PipelineDataSetSerializerConfigurationCaptureDescriptors: Enables serializing pipeline scripts. MTL4PipelineDataSetSerializerConfigurationCaptureDescriptors MTL4PipelineDataSetSerializerConfiguration = 1 )
func (MTL4PipelineDataSetSerializerConfiguration) String ¶
func (e MTL4PipelineDataSetSerializerConfiguration) String() string
type MTL4PipelineDataSetSerializerDescriptor ¶
type MTL4PipelineDataSetSerializerDescriptor struct {
objectivec.Object
}
Groups together properties to create a pipeline data set serializer.
Instance Properties ¶
- MTL4PipelineDataSetSerializerDescriptor.Configuration: Specifies the configuration of the serialization process.
- MTL4PipelineDataSetSerializerDescriptor.SetConfiguration
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDataSetSerializerDescriptor
func MTL4PipelineDataSetSerializerDescriptorFromID ¶
func MTL4PipelineDataSetSerializerDescriptorFromID(id objc.ID) MTL4PipelineDataSetSerializerDescriptor
MTL4PipelineDataSetSerializerDescriptorFromID constructs a MTL4PipelineDataSetSerializerDescriptor from an objc.ID.
Groups together properties to create a pipeline data set serializer.
func NewMTL4PipelineDataSetSerializerDescriptor ¶
func NewMTL4PipelineDataSetSerializerDescriptor() MTL4PipelineDataSetSerializerDescriptor
NewMTL4PipelineDataSetSerializerDescriptor creates a new MTL4PipelineDataSetSerializerDescriptor instance.
func (MTL4PipelineDataSetSerializerDescriptor) Autorelease ¶
func (m MTL4PipelineDataSetSerializerDescriptor) Autorelease() MTL4PipelineDataSetSerializerDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4PipelineDataSetSerializerDescriptor) Configuration ¶
func (m MTL4PipelineDataSetSerializerDescriptor) Configuration() MTL4PipelineDataSetSerializerConfiguration
Specifies the configuration of the serialization process.
Discussion ¶
The configuration of the serialization process determines the mechanisms you use to serialize pipeline data sets.
When this configuration contains MTL4PipelineDataSetSerializerConfigurationCaptureDescriptors, use “ to serialize pipeline scripts.
If this option contains MTL4PipelineDataSetSerializerConfigurationCaptureBinaries, the serializer can additionally serialize to a binary archive by calling `:`.
func (MTL4PipelineDataSetSerializerDescriptor) SetConfiguration ¶
func (m MTL4PipelineDataSetSerializerDescriptor) SetConfiguration(value MTL4PipelineDataSetSerializerConfiguration)
type MTL4PipelineDataSetSerializerDescriptorClass ¶
type MTL4PipelineDataSetSerializerDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4PipelineDataSetSerializerDescriptorClass ¶
func GetMTL4PipelineDataSetSerializerDescriptorClass() MTL4PipelineDataSetSerializerDescriptorClass
GetMTL4PipelineDataSetSerializerDescriptorClass returns the class object for MTL4PipelineDataSetSerializerDescriptor.
func (MTL4PipelineDataSetSerializerDescriptorClass) Alloc ¶
func (mc MTL4PipelineDataSetSerializerDescriptorClass) Alloc() MTL4PipelineDataSetSerializerDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4PipelineDataSetSerializerObject ¶
type MTL4PipelineDataSetSerializerObject struct {
objectivec.Object
}
MTL4PipelineDataSetSerializerObject wraps an existing Objective-C object that conforms to the MTL4PipelineDataSetSerializer protocol.
func MTL4PipelineDataSetSerializerObjectFromID ¶
func MTL4PipelineDataSetSerializerObjectFromID(id objc.ID) MTL4PipelineDataSetSerializerObject
MTL4PipelineDataSetSerializerObjectFromID constructs a MTL4PipelineDataSetSerializerObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4PipelineDataSetSerializerObject) BaseObject ¶
func (o MTL4PipelineDataSetSerializerObject) BaseObject() objectivec.Object
func (MTL4PipelineDataSetSerializerObject) SerializeAsArchiveAndFlushToURLError ¶
func (o MTL4PipelineDataSetSerializerObject) SerializeAsArchiveAndFlushToURLError(url foundation.INSURL) (bool, error)
Serializes a pipeline data set to an archive.
url: The URL used to serialize the serializer data set as an archive to.
func (MTL4PipelineDataSetSerializerObject) SerializeAsPipelinesScriptWithError ¶
func (o MTL4PipelineDataSetSerializerObject) SerializeAsPipelinesScriptWithError() (foundation.INSData, error)
Serializes a serializer data set to a pipeline script as raw data.
Return Value ¶
An [NSData] instance containing the pipeline script.
type MTL4PipelineDescriptor ¶
type MTL4PipelineDescriptor struct {
objectivec.Object
}
Base type for descriptors you use for building pipeline state objects.
Instance Properties ¶
- MTL4PipelineDescriptor.Label: Assigns an optional string that uniquely identifies a pipeline descriptor.
- MTL4PipelineDescriptor.SetLabel
- MTL4PipelineDescriptor.Options: Provides compile-time options when you build the pipeline.
- MTL4PipelineDescriptor.SetOptions
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDescriptor
func MTL4PipelineDescriptorFromID ¶
func MTL4PipelineDescriptorFromID(id objc.ID) MTL4PipelineDescriptor
MTL4PipelineDescriptorFromID constructs a MTL4PipelineDescriptor from an objc.ID.
Base type for descriptors you use for building pipeline state objects.
func NewMTL4PipelineDescriptor ¶
func NewMTL4PipelineDescriptor() MTL4PipelineDescriptor
NewMTL4PipelineDescriptor creates a new MTL4PipelineDescriptor instance.
func (MTL4PipelineDescriptor) Autorelease ¶
func (m MTL4PipelineDescriptor) Autorelease() MTL4PipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4PipelineDescriptor) Init ¶
func (m MTL4PipelineDescriptor) Init() MTL4PipelineDescriptor
Init initializes the instance.
func (MTL4PipelineDescriptor) Label ¶
func (m MTL4PipelineDescriptor) Label() string
Assigns an optional string that uniquely identifies a pipeline descriptor.
Discussion ¶
After you provide this label, you can use it to look up a pipeline state object by name in a binary archive.
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDescriptor/label
func (MTL4PipelineDescriptor) Options ¶
func (m MTL4PipelineDescriptor) Options() IMTL4PipelineOptions
Provides compile-time options when you build the pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4PipelineDescriptor/options
func (MTL4PipelineDescriptor) SetLabel ¶
func (m MTL4PipelineDescriptor) SetLabel(value string)
func (MTL4PipelineDescriptor) SetOptions ¶
func (m MTL4PipelineDescriptor) SetOptions(value IMTL4PipelineOptions)
type MTL4PipelineDescriptorClass ¶
type MTL4PipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4PipelineDescriptorClass ¶
func GetMTL4PipelineDescriptorClass() MTL4PipelineDescriptorClass
GetMTL4PipelineDescriptorClass returns the class object for MTL4PipelineDescriptor.
func (MTL4PipelineDescriptorClass) Alloc ¶
func (mc MTL4PipelineDescriptorClass) Alloc() MTL4PipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4PipelineOptions ¶
type MTL4PipelineOptions struct {
objectivec.Object
}
Provides options controlling how to compile a pipeline state.
Overview ¶
You provide these options through the MTL4PipelineDescriptor class at compilation time.
Instance Properties ¶
- MTL4PipelineOptions.ShaderReflection: Controls whether to include Metal shader reflection in this pipeline.
- MTL4PipelineOptions.SetShaderReflection
- MTL4PipelineOptions.ShaderValidation: Controls whether to enable or disable Metal Shader Validation for the pipeline.
- MTL4PipelineOptions.SetShaderValidation
See: https://developer.apple.com/documentation/Metal/MTL4PipelineOptions
func MTL4PipelineOptionsFromID ¶
func MTL4PipelineOptionsFromID(id objc.ID) MTL4PipelineOptions
MTL4PipelineOptionsFromID constructs a MTL4PipelineOptions from an objc.ID.
Provides options controlling how to compile a pipeline state.
func NewMTL4PipelineOptions ¶
func NewMTL4PipelineOptions() MTL4PipelineOptions
NewMTL4PipelineOptions creates a new MTL4PipelineOptions instance.
func (MTL4PipelineOptions) Autorelease ¶
func (m MTL4PipelineOptions) Autorelease() MTL4PipelineOptions
Autorelease adds the receiver to the current autorelease pool.
func (MTL4PipelineOptions) Init ¶
func (m MTL4PipelineOptions) Init() MTL4PipelineOptions
Init initializes the instance.
func (MTL4PipelineOptions) SetShaderReflection ¶
func (m MTL4PipelineOptions) SetShaderReflection(value MTL4ShaderReflection)
func (MTL4PipelineOptions) SetShaderValidation ¶
func (m MTL4PipelineOptions) SetShaderValidation(value MTLShaderValidation)
func (MTL4PipelineOptions) ShaderReflection ¶
func (m MTL4PipelineOptions) ShaderReflection() MTL4ShaderReflection
Controls whether to include Metal shader reflection in this pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4PipelineOptions/shaderReflection
func (MTL4PipelineOptions) ShaderValidation ¶
func (m MTL4PipelineOptions) ShaderValidation() MTLShaderValidation
Controls whether to enable or disable Metal Shader Validation for the pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4PipelineOptions/shaderValidation
type MTL4PipelineOptionsClass ¶
type MTL4PipelineOptionsClass struct {
// contains filtered or unexported fields
}
func GetMTL4PipelineOptionsClass ¶
func GetMTL4PipelineOptionsClass() MTL4PipelineOptionsClass
GetMTL4PipelineOptionsClass returns the class object for MTL4PipelineOptions.
func (MTL4PipelineOptionsClass) Alloc ¶
func (mc MTL4PipelineOptionsClass) Alloc() MTL4PipelineOptions
Alloc allocates memory for a new instance of the class.
type MTL4PipelineStageDynamicLinkingDescriptor ¶
type MTL4PipelineStageDynamicLinkingDescriptor struct {
objectivec.Object
}
Groups together properties to drive the dynamic linking process of a pipeline stage.
Instance Properties ¶
- MTL4PipelineStageDynamicLinkingDescriptor.BinaryLinkedFunctions: Provides the array of binary functions to link.
- MTL4PipelineStageDynamicLinkingDescriptor.SetBinaryLinkedFunctions
- MTL4PipelineStageDynamicLinkingDescriptor.MaxCallStackDepth: Limits the maximum depth of the call stack for indirect function calls in the pipeline stage function.
- MTL4PipelineStageDynamicLinkingDescriptor.SetMaxCallStackDepth
- MTL4PipelineStageDynamicLinkingDescriptor.PreloadedLibraries: Provides an array of dynamic libraries the compiler loads when it builds the pipeline.
- MTL4PipelineStageDynamicLinkingDescriptor.SetPreloadedLibraries
See: https://developer.apple.com/documentation/Metal/MTL4PipelineStageDynamicLinkingDescriptor
func MTL4PipelineStageDynamicLinkingDescriptorFromID ¶
func MTL4PipelineStageDynamicLinkingDescriptorFromID(id objc.ID) MTL4PipelineStageDynamicLinkingDescriptor
MTL4PipelineStageDynamicLinkingDescriptorFromID constructs a MTL4PipelineStageDynamicLinkingDescriptor from an objc.ID.
Groups together properties to drive the dynamic linking process of a pipeline stage.
func NewMTL4PipelineStageDynamicLinkingDescriptor ¶
func NewMTL4PipelineStageDynamicLinkingDescriptor() MTL4PipelineStageDynamicLinkingDescriptor
NewMTL4PipelineStageDynamicLinkingDescriptor creates a new MTL4PipelineStageDynamicLinkingDescriptor instance.
func (MTL4PipelineStageDynamicLinkingDescriptor) Autorelease ¶
func (m MTL4PipelineStageDynamicLinkingDescriptor) Autorelease() MTL4PipelineStageDynamicLinkingDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4PipelineStageDynamicLinkingDescriptor) BinaryLinkedFunctions ¶
func (m MTL4PipelineStageDynamicLinkingDescriptor) BinaryLinkedFunctions() []objectivec.IObject
Provides the array of binary functions to link.
Discussion ¶
Binary functions are shader functions that you compile from Metal IR to machine code ahead of time using instances of MTL4Compiler.
func (MTL4PipelineStageDynamicLinkingDescriptor) MaxCallStackDepth ¶
func (m MTL4PipelineStageDynamicLinkingDescriptor) MaxCallStackDepth() uint
Limits the maximum depth of the call stack for indirect function calls in the pipeline stage function.
func (MTL4PipelineStageDynamicLinkingDescriptor) PreloadedLibraries ¶
func (m MTL4PipelineStageDynamicLinkingDescriptor) PreloadedLibraries() []objectivec.IObject
Provides an array of dynamic libraries the compiler loads when it builds the pipeline.
func (MTL4PipelineStageDynamicLinkingDescriptor) SetBinaryLinkedFunctions ¶
func (m MTL4PipelineStageDynamicLinkingDescriptor) SetBinaryLinkedFunctions(value []objectivec.IObject)
func (MTL4PipelineStageDynamicLinkingDescriptor) SetMaxCallStackDepth ¶
func (m MTL4PipelineStageDynamicLinkingDescriptor) SetMaxCallStackDepth(value uint)
func (MTL4PipelineStageDynamicLinkingDescriptor) SetPreloadedLibraries ¶
func (m MTL4PipelineStageDynamicLinkingDescriptor) SetPreloadedLibraries(value []objectivec.IObject)
type MTL4PipelineStageDynamicLinkingDescriptorClass ¶
type MTL4PipelineStageDynamicLinkingDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4PipelineStageDynamicLinkingDescriptorClass ¶
func GetMTL4PipelineStageDynamicLinkingDescriptorClass() MTL4PipelineStageDynamicLinkingDescriptorClass
GetMTL4PipelineStageDynamicLinkingDescriptorClass returns the class object for MTL4PipelineStageDynamicLinkingDescriptor.
func (MTL4PipelineStageDynamicLinkingDescriptorClass) Alloc ¶
func (mc MTL4PipelineStageDynamicLinkingDescriptorClass) Alloc() MTL4PipelineStageDynamicLinkingDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4PrimitiveAccelerationStructureDescriptor ¶
type MTL4PrimitiveAccelerationStructureDescriptor struct {
MTL4AccelerationStructureDescriptor
}
Descriptor for a primitive acceleration structure that directly references geometric shapes, such as triangles and bounding boxes.
Instance Properties ¶
- MTL4PrimitiveAccelerationStructureDescriptor.GeometryDescriptors: Associates the array of geometry descriptors that comprise this primitive acceleration structure.
- MTL4PrimitiveAccelerationStructureDescriptor.SetGeometryDescriptors
- MTL4PrimitiveAccelerationStructureDescriptor.MotionEndBorderMode: Configures the motion border mode.
- MTL4PrimitiveAccelerationStructureDescriptor.SetMotionEndBorderMode
- MTL4PrimitiveAccelerationStructureDescriptor.MotionEndTime: Configures the motion end time for this geometry.
- MTL4PrimitiveAccelerationStructureDescriptor.SetMotionEndTime
- MTL4PrimitiveAccelerationStructureDescriptor.MotionKeyframeCount: Sets the motion keyframe count.
- MTL4PrimitiveAccelerationStructureDescriptor.SetMotionKeyframeCount
- MTL4PrimitiveAccelerationStructureDescriptor.MotionStartBorderMode: Configures the behavior when the ray-tracing system samples the acceleration structure before the motion start time.
- MTL4PrimitiveAccelerationStructureDescriptor.SetMotionStartBorderMode
- MTL4PrimitiveAccelerationStructureDescriptor.MotionStartTime: Configures the motion start time for this geometry.
- MTL4PrimitiveAccelerationStructureDescriptor.SetMotionStartTime
See: https://developer.apple.com/documentation/Metal/MTL4PrimitiveAccelerationStructureDescriptor
func MTL4PrimitiveAccelerationStructureDescriptorFromID ¶
func MTL4PrimitiveAccelerationStructureDescriptorFromID(id objc.ID) MTL4PrimitiveAccelerationStructureDescriptor
MTL4PrimitiveAccelerationStructureDescriptorFromID constructs a MTL4PrimitiveAccelerationStructureDescriptor from an objc.ID.
Descriptor for a primitive acceleration structure that directly references geometric shapes, such as triangles and bounding boxes.
func NewMTL4PrimitiveAccelerationStructureDescriptor ¶
func NewMTL4PrimitiveAccelerationStructureDescriptor() MTL4PrimitiveAccelerationStructureDescriptor
NewMTL4PrimitiveAccelerationStructureDescriptor creates a new MTL4PrimitiveAccelerationStructureDescriptor instance.
func (MTL4PrimitiveAccelerationStructureDescriptor) Autorelease ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) Autorelease() MTL4PrimitiveAccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4PrimitiveAccelerationStructureDescriptor) GeometryDescriptors ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) GeometryDescriptors() []MTL4AccelerationStructureGeometryDescriptor
Associates the array of geometry descriptors that comprise this primitive acceleration structure.
Discussion ¶
If you enable keyframe motion by setting property [MotionKeyframeCount] to a value greater than `1`, then all geometry descriptors this array references need to be motion geometry descriptors and have a number of primitive buffers equals to [MotionKeyframeCount].
Example of motion geometry descriptors include: MTL4AccelerationStructureMotionTriangleGeometryDescriptor, MTL4AccelerationStructureMotionBoundingBoxGeometryDescriptor, MTL4AccelerationStructureMotionCurveGeometryDescriptor.
func (MTL4PrimitiveAccelerationStructureDescriptor) Init ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) Init() MTL4PrimitiveAccelerationStructureDescriptor
Init initializes the instance.
func (MTL4PrimitiveAccelerationStructureDescriptor) MotionEndBorderMode ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionEndBorderMode() MTLMotionBorderMode
Configures the motion border mode.
Discussion ¶
This property controls what happens if Metal samples the acceleration structure after [MotionEndTime].
Its default value is MTLMotionBorderModeClamp.
func (MTL4PrimitiveAccelerationStructureDescriptor) MotionEndTime ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionEndTime() float32
Configures the motion end time for this geometry.
Discussion ¶
The default value of this property is `1.0f`.
func (MTL4PrimitiveAccelerationStructureDescriptor) MotionKeyframeCount ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionKeyframeCount() uint
Sets the motion keyframe count.
Discussion ¶
This property’s default is `1`, indicating no motion.
func (MTL4PrimitiveAccelerationStructureDescriptor) MotionStartBorderMode ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionStartBorderMode() MTLMotionBorderMode
Configures the behavior when the ray-tracing system samples the acceleration structure before the motion start time.
Discussion ¶
Use this property to control the behavior when the ray-tracing system samples the acceleration structure at a time prior to the one you set for [MotionStartTime].
The default value of this property is MTLMotionBorderModeClamp.
func (MTL4PrimitiveAccelerationStructureDescriptor) MotionStartTime ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) MotionStartTime() float32
Configures the motion start time for this geometry.
Discussion ¶
The default value of this property is `0.0f`.
func (MTL4PrimitiveAccelerationStructureDescriptor) SetGeometryDescriptors ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) SetGeometryDescriptors(value []MTL4AccelerationStructureGeometryDescriptor)
func (MTL4PrimitiveAccelerationStructureDescriptor) SetMotionEndBorderMode ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionEndBorderMode(value MTLMotionBorderMode)
func (MTL4PrimitiveAccelerationStructureDescriptor) SetMotionEndTime ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionEndTime(value float32)
func (MTL4PrimitiveAccelerationStructureDescriptor) SetMotionKeyframeCount ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionKeyframeCount(value uint)
func (MTL4PrimitiveAccelerationStructureDescriptor) SetMotionStartBorderMode ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionStartBorderMode(value MTLMotionBorderMode)
func (MTL4PrimitiveAccelerationStructureDescriptor) SetMotionStartTime ¶
func (m MTL4PrimitiveAccelerationStructureDescriptor) SetMotionStartTime(value float32)
type MTL4PrimitiveAccelerationStructureDescriptorClass ¶
type MTL4PrimitiveAccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4PrimitiveAccelerationStructureDescriptorClass ¶
func GetMTL4PrimitiveAccelerationStructureDescriptorClass() MTL4PrimitiveAccelerationStructureDescriptorClass
GetMTL4PrimitiveAccelerationStructureDescriptorClass returns the class object for MTL4PrimitiveAccelerationStructureDescriptor.
func (MTL4PrimitiveAccelerationStructureDescriptorClass) Alloc ¶
func (mc MTL4PrimitiveAccelerationStructureDescriptorClass) Alloc() MTL4PrimitiveAccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4RenderCommandEncoder ¶
type MTL4RenderCommandEncoder interface {
objectivec.IObject
MTL4CommandEncoder
// Configures this encoder with a render pipeline state that applies to your subsequent draw commands.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setRenderPipelineState(_:)
SetRenderPipelineState(pipelineState MTLRenderPipelineState)
// Configures the store action for a color attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setColorStoreAction(_:index:)
SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
// Configures the store action for the depth attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthStoreAction(_:)
SetDepthStoreAction(storeAction MTLStoreAction)
// Configures the store action for the stencil attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setStencilStoreAction(_:)
SetStencilStoreAction(storeAction MTLStoreAction)
// Configures each pixel component value, including alpha, for the render pipeline’s constant blend color.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setBlendColor(red:green:blue:alpha:)
SetBlendColorRedGreenBlueAlpha(red float32, green float32, blue float32, alpha float32)
// Sets the mapping from logical shader color output to physical render pass color attachments.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setColorAttachmentMap(_:)
SetColorAttachmentMap(mapping IMTLLogicalToPhysicalColorAttachmentMap)
// Configures how subsequent draw commands rasterize triangle and triangle strip primitives.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setTriangleFillMode(_:)
SetTriangleFillMode(fillMode MTLTriangleFillMode)
// Configures the vertex winding order that determines which face of a geometric primitive is the front one.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setFrontFacing(_:)
SetFrontFacingWinding(frontFacingWinding MTLWinding)
// Controls whether Metal culls front facing primitives, back facing primitives, or culls no primitives at all.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setCullMode(_:)
SetCullMode(cullMode MTLCullMode)
// Configures this encoder with a depth stencil state that applies to your subsequent draw commands.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthStencilState(_:)
SetDepthStencilState(depthStencilState MTLDepthStencilState)
// Configures the adjustments a render pass applies to depth values from fragment shader functions by a scaling factor and bias.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthBias(_:slopeScale:clamp:)
SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
// Controls the behavior for fragments outside of the near or far planes.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthClipMode(_:)
SetDepthClipMode(depthClipMode MTLDepthClipMode)
// Configures this encoder with a reference value for stencil testing.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setStencilReferenceValue(_:)
SetStencilReferenceValue(referenceValue uint32)
// Configures the encoder with different stencil test reference values for front-facing and back-facing primitives.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setStencilReferenceValue(front:back:)
SetStencilFrontReferenceValueBackReferenceValue(frontReferenceValue uint32, backReferenceValue uint32)
// Sets the viewport which that transforms vertices from normalized device coordinates to window coordinates.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setViewport(_:)
SetViewport(viewport MTLViewport)
// Sets a scissor rectangle to discard fragments outside a specific area.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setScissorRect(_:)
SetScissorRect(rect MTLScissorRect)
// Configures a visibility test for Metal to run, and the destination for any results it generates.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setVisibilityResultMode(_:offset:)
SetVisibilityResultModeOffset(mode MTLVisibilityResultMode, offset uint)
// Configures the size of a threadgroup memory buffer for a threadgroup argument in the object shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setObjectThreadgroupMemoryLength(_:index:)
SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
// Configures the size of a threadgroup memory buffer for a threadgroup argument in the fragment and tile shader functions.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setThreadgroupMemoryLength(_:offset:index:)
SetThreadgroupMemoryLengthOffsetAtIndex(length uint, offset uint, index uint)
// Associates an argument table with a set of render stages.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setArgumentTable(_:stages:)
SetArgumentTableAtStages(argumentTable MTL4ArgumentTable, stages MTLRenderStages)
// Encodes a draw command that renders an instance of a geometric primitive.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawPrimitives(primitiveType:vertexStart:vertexCount:)
DrawPrimitivesVertexStartVertexCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint)
// Encodes a draw command that renders multiple instances of a geometric primitive.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawPrimitives(primitiveType:vertexStart:vertexCount:instanceCount:)
DrawPrimitivesVertexStartVertexCountInstanceCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint)
// Encodes a draw command that renders multiple instances of a geometric primitive, starting with a custom instance identification number.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawPrimitives(primitiveType:vertexStart:vertexCount:instanceCount:baseInstance:)
DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint, baseInstance uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawPrimitives(primitiveType:indirectBuffer:)
DrawPrimitivesIndirectBuffer(primitiveType MTLPrimitiveType, indirectBuffer MTLGPUAddress)
// Encodes a draw command that renders an instance of a geometric primitive with indexed vertices.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawIndexedPrimitives(primitiveType:indexCount:indexType:indexBuffer:indexBufferLength:)
DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLength(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawIndexedPrimitives(primitiveType:indexCount:indexType:indexBuffer:indexBufferLength:instanceCount:)
DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCount(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint, instanceCount uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices, starting with a custom vertex and instance.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawIndexedPrimitives(primitiveType:indexCount:indexType:indexBuffer:indexBufferLength:instanceCount:baseVertex:baseInstance:)
DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint, instanceCount uint, baseVertex int, baseInstance uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices and indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawIndexedPrimitives(primitiveType:indexType:indexBuffer:indexBufferLength:indirectBuffer:)
DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferLengthIndirectBuffer(primitiveType MTLPrimitiveType, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint, indirectBuffer MTLGPUAddress)
// Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threads.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawMeshThreads(threadsPerGrid:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threadgroups.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawMeshThreadgroups(threadgroupsPerGrid:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// Encodes a draw command that invokes a mesh shader and, optionally, an object shader with indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/drawMeshThreadgroups(indirectBuffer:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadgroupsWithIndirectBufferThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(indirectBuffer MTLGPUAddress, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// Encodes a command that invokes a tile shader function from the encoder’s current tile render pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/dispatchThreadsPerTile(_:)
DispatchThreadsPerTile(threadsPerTile MTLSize)
// Sets the width of a tile for this render pass.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/tileWidth
TileWidth() uint
// Sets the height of a tile for this render pass.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/tileHeight
TileHeight() uint
// Encodes a command that runs an indirect range of commands from an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/executeCommands(buffer:indirectBuffer:)
ExecuteCommandsInBufferIndirectBuffer(indirectCommandBuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLGPUAddress)
// Writes a GPU timestamp into the given [MTL4CounterHeap](<doc://com.apple.metal/documentation/Metal/MTL4CounterHeap>) at `index` after `stage` completes.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/writeTimestamp(granularity:after:counterHeap:index:)
WriteTimestampWithGranularityAfterStageIntoHeapAtIndex(granularity MTL4TimestampGranularity, stage MTLRenderStages, counterHeap MTL4CounterHeap, index uint)
// Encodes a command that runs a range of commands from an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/executeCommandsInBuffer:withRange:
ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
// Configures the minimum and maximum bounds for depth bounds testing.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthTestMinBound:maxBound:
SetDepthTestMinBoundMaxBound(minBound float32, maxBound float32)
// Sets an array of scissor rectangles for a fragment scissor test.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setScissorRects:count:
SetScissorRectsCount(scissorRects []MTLScissorRect, count uint)
// Sets the vertex amplification count and its view mapping for each amplification ID.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setVertexAmplificationCount:viewMappings:
SetVertexAmplificationCountViewMappings(count uint, viewMappings *MTLVertexAmplificationViewMapping)
// Sets an array of viewports to transform vertices from normalized device coordinates to window coordinates.
//
// See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setViewports:count:
SetViewportsCount(viewports []MTLViewport, count uint)
}
Encodes configuration and draw commands for a single render pass into a command buffer.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder
type MTL4RenderCommandEncoderObject ¶
type MTL4RenderCommandEncoderObject struct {
objectivec.Object
}
MTL4RenderCommandEncoderObject wraps an existing Objective-C object that conforms to the MTL4RenderCommandEncoder protocol.
func MTL4RenderCommandEncoderObjectFromID ¶
func MTL4RenderCommandEncoderObjectFromID(id objc.ID) MTL4RenderCommandEncoderObject
MTL4RenderCommandEncoderObjectFromID constructs a MTL4RenderCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTL4RenderCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions ¶
func (o MTL4RenderCommandEncoderObject) BarrierAfterEncoderStagesBeforeEncoderStagesVisibilityOptions(afterEncoderStages MTLStages, beforeEncoderStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes an intra-pass barrier.
afterEncoderStages: MTLStages mask that represents the stages of work to wait for. This argument only applies to subsequent work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeEncoderStages: MTLStages mask that represents the stages of work that wait. This argument only applies to work you encode in the current command encoder prior to this barrier. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the , corresponding to `beforeEncoderStages`, doesn’t begin until all prior commands in this command encoder, corresponding to `afterEncoderStages`, completes.
When calling this method, it’s your responsibility to ensure parameters `afterEncoderStages` and `beforeEncoderStages` contain a combination of MTLStages for which this encoder can encode commands. For example, for a MTL4ComputeCommandEncoder instance, you can provide any combination of [StageDispatch], [StageBlit] and [StageAccelerationStructure].
func (MTL4RenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions ¶
func (o MTL4RenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStagesVisibilityOptions(afterQueueStages MTLStages, beforeStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so encode the barrier as close to the command that consumes the resource as possible. Don’t use this method for synchronizing resource access within the same pass.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTL4RenderCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions ¶
func (o MTL4RenderCommandEncoderObject) BarrierAfterStagesBeforeQueueStagesVisibilityOptions(afterStages MTLStages, beforeQueueStages MTLStages, visibilityOptions MTL4VisibilityOptions)
Encodes a producer barrier on work committed to the same command queue.
afterStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in the current command encoder prior to this barrier command. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeQueueStages: MTLStages mask that represents the stages of work that need to wait. This argument applies to subsequent encoders and not to work in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
visibilityOptions: MTL4VisibilityOptions of the barrier, controlling cache flush behavior. // MTL4VisibilityOptions: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
Discussion ¶
This method encodes a barrier that guarantees that any work you encode using , corresponding to `beforeQueueStages`, don’t begin until all commands you previously encode in the current encoder (and prior encoders), corresponding to `afterStages`, complete.
When calling this method, you can pass any MTLStages to parameters `afterStages` and `beforeQueueStages`, even stages that don’t relate to the current or prior command encoders.
func (MTL4RenderCommandEncoderObject) BaseObject ¶
func (o MTL4RenderCommandEncoderObject) BaseObject() objectivec.Object
func (MTL4RenderCommandEncoderObject) CommandBuffer ¶
func (o MTL4RenderCommandEncoderObject) CommandBuffer() MTL4CommandBuffer
Returns the command buffer that is currently encoding commands.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/commandBuffer
func (MTL4RenderCommandEncoderObject) DispatchThreadsPerTile ¶
func (o MTL4RenderCommandEncoderObject) DispatchThreadsPerTile(threadsPerTile MTLSize)
Encodes a command that invokes a tile shader function from the encoder’s current tile render pipeline state.
threadsPerTile: A MTLSize instance that represents the number of threads the render pass uses per tile. Set the size’s [width] and [height] properties to values that are less than or equal to [TileWidth] and [TileHeight], respectively. Some GPU families only support square tile dispatches and require the same value for width and height. Set [depth] to `1`. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth [height]: https://developer.apple.com/documentation/Metal/MTLSize/height [width]: https://developer.apple.com/documentation/Metal/MTLSize/width
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/dispatchThreadsPerTile(_:)
func (MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLength ¶
func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLength(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint)
Encodes a draw command that renders an instance of a geometric primitive with indexed vertices.
primitiveType: A MTLPrimitiveType representing how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
indexCount: An integer that represents the number of vertices the command reads from `indexBuffer`.
indexType: A MTLIndexType instance that represents the index format. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: GPUAddress of a MTLBuffer instance that contains `indexCount` indices of `indexType` format. You are responsible for ensuring this address is aligned to 2 bytes if the `indexType` format is [IndexTypeUInt16], and aligned to 4 bytes if the format is [IndexTypeUInt32].
indexBufferLength: An integer that represents the length of `indexBuffer`, in bytes. You are responsible for ensuring this this size is a multiple of 2 if the `indexType` format is [IndexTypeUInt16], and a multiple of 4 if the format is [IndexTypeUInt32]. If this draw call causes Metal to read indices at or beyond the `indexBufferLength`, Metal continues to execute them assigning a value of `0` to the `vertex_id` attribute.
Discussion ¶
Use this method to perform indexed drawing, where an index buffer determines how Metal assembles primitives.
Metal imposes some restrictions on the index buffer’s address, which needs to be 2- or 4-byte aligned, and its length in bytes, which needs to be a multiple of 2 or 4, depending on whether the format of the index is [IndexTypeUInt16] or [IndexTypeUInt32].
Use an instance of MTLResidencySet to mark residency of the index buffer the `indexBuffer` parameter references.
func (MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCount ¶
func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCount(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint, instanceCount uint)
Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices.
primitiveType: A MTLPrimitiveType representing how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
indexCount: An integer that represents the number of vertices the command reads from `indexBuffer`.
indexType: A MTLIndexType instance that represents the index format. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: GPUAddress of a MTLBuffer instance that contains `indexCount` indices of `indexType` format. You are responsible for ensuring this address is aligned to 2 bytes if the `indexType` format is [IndexTypeUInt16], and aligned to 4 bytes if the format is [IndexTypeUInt32].
indexBufferLength: An integer that represents the length of `indexBuffer`, in bytes. You are responsible for ensuring this this size is a multiple of 2 if the `indexType` format is [IndexTypeUInt16], and a multiple of 4 if the format is [IndexTypeUInt32]. Metal disregards this value and assigns `0` to the `vertex_id` attribute for all primitives that require loading indices at a byte offset of `indexBufferLength` or greater.
instanceCount: An integer that represents the number of times the command draws `primitiveType` with `indexCount` vertices.
Discussion ¶
Use this method to perform instanced indexed drawing, where an index buffer determines how Metal assembles primitives.
The command assigns each drawing instance a unique `instance_id` value that increases from `0` through `(instanceCount - 1)`. Your shader can use this value to identify which instance the vertex belongs to.
Metal imposes some restrictions on the index buffer’s address, which needs to be 2- or 4-byte aligned, and its length in bytes, which needs to be a multiple of 2 or 4, depending on whether the format of the index is [IndexTypeUInt16] or [IndexTypeUInt32].
Use an instance of MTLResidencySet to mark residency of the index buffer the `indexBuffer` parameter references.
func (MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCountBaseVertexBaseInstance ¶
func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferLengthInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint, instanceCount uint, baseVertex int, baseInstance uint)
Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices, starting with a custom vertex and instance.
primitiveType: A MTLPrimitiveType representing how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
indexCount: An integer that represents the number of vertices the command reads from `indexBuffer`.
indexType: A MTLIndexType instance that represents the index format. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: GPUAddress of a MTLBuffer instance that contains `indexCount` indices of `indexType` format. You are responsible for ensuring this address is aligned to 2 bytes if the `indexType` format is [IndexTypeUInt16], and aligned to 4 bytes if the format is [IndexTypeUInt32].
indexBufferLength: An integer that represents the length of `indexBuffer`, in bytes. You are responsible for ensuring this this size is a multiple of 2 if the `indexType` format is [IndexTypeUInt16], and a multiple of 4 if the format is [IndexTypeUInt32]. If this draw call causes Metal to read indices at or beyond the `indexBufferLength`, Metal continues to execute them assigning a value of `0` to the `vertex_id` attribute.
instanceCount: An integer that represents the number of times the command draws `primitiveType` with `indexCount` vertices.
baseVertex: The lowest value the command passes to your vertex shader functions’s parameter with the `vertex_id` attribute. Metal disregards this value and assigns `0` to the `vertex_id` attribute for all primitives that require loading indices at a byte offset of `indexBufferLength` or greater.
baseInstance: The lowest value the command passes to your vertex shader’s parameter with the `instance_id` attribute.
Discussion ¶
Use this method to perform instanced indexed drawing, where an index buffer determines how Metal assembles primitives whilst customizing the base vertex and base instance value Metal passes to the vertex shader function.
The command assigns each drawing instance a unique `instance_id` value that increases from `baseInstance` through `(baseInstance + instanceCount - 1)`. Your shader can use this value to identify which instance the vertex belongs to.
Metal imposes some restrictions on the index buffer’s address, which needs to be 2- or 4-byte aligned, and its length in bytes, which needs to be a multiple of 2 or 4, depending on whether the format of the index is [IndexTypeUInt16] or [IndexTypeUInt32].
Use an instance of MTLResidencySet to mark residency of the index buffer the `indexBuffer` parameter references.
func (MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferLengthIndirectBuffer ¶
func (o MTL4RenderCommandEncoderObject) DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferLengthIndirectBuffer(primitiveType MTLPrimitiveType, indexType MTLIndexType, indexBuffer MTLGPUAddress, indexBufferLength uint, indirectBuffer MTLGPUAddress)
Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices and indirect arguments.
primitiveType: A MTLPrimitiveType representing how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
indexType: A MTLIndexType instance that represents the index format. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: GPUAddress of a MTLBuffer instance that contains `indexCount` indices of `indexType` format. You are responsible for ensuring this address is aligned to 2 bytes if the `indexType` format is [IndexTypeUInt16], and aligned to 4 bytes if the format is [IndexTypeUInt32].
indexBufferLength: An integer that represents the length of `indexBuffer`, in bytes. You are responsible for ensuring this this size is a multiple of 2 if the `indexType` format is [IndexTypeUInt16], and a multiple of 4 if the format is [IndexTypeUInt32]. If this draw call causes Metal to read indices at or beyond the `indexBufferLength`, Metal continues to execute them assigning a value of `0` to the `vertex_id` attribute.
indirectBuffer: GPUAddress of an MTLBuffer instance with data that matches the layout of the MTLDrawIndexedPrimitivesIndirectArguments structure. This address requires 4-byte alignment. // MTLDrawIndexedPrimitivesIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDrawIndexedPrimitivesIndirectArguments
Discussion ¶
When you use this function, Metal reads the parameters to the draw command from an MTLBuffer instance, allowing you to implement a GPU-driven workflow where a compute pipeline state determines the draw arguments.
Because this is an indexed draw call, Metal interprets the contents of the indirect buffer to match the layout of struct MTLDrawIndexedPrimitivesIndirectArguments, which includes `indexStart` and `indexCount` members, denoting a range within the index buffer you provide in the `indexBuffer` parameter.
The range of indices within the `indexBuffer` form the primitives Metal draws.
Metal imposes some restrictions on the index buffer’s address, which needs to be 2- or 4-byte aligned, and its length in bytes, which needs to be a multiple of 2 or 4, depending on whether the format of the index is [IndexTypeUInt16] or [IndexTypeUInt32].
Similarly, you are responsible for ensuring the indirect buffer’s address has 4-byte alignment.
Use an instance of MTLResidencySet to mark residency of the indirect buffer that the `indirectBuffer` parameter references, and of the index buffer the `indexBuffer` parameter references.
func (MTL4RenderCommandEncoderObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTL4RenderCommandEncoderObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threadgroups.
threadgroupsPerGrid: A MTLSize instance that represents the number of threadgroups for each grid dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerObjectThreadgroup: A MTLSize instance that represents the number of threads in an object shader threadgroup, if applicable. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerMeshThreadgroup: A MTLSize instance that represents the number of threads in a mesh shader threadgroup. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
func (MTL4RenderCommandEncoderObject) DrawMeshThreadgroupsWithIndirectBufferThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTL4RenderCommandEncoderObject) DrawMeshThreadgroupsWithIndirectBufferThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(indirectBuffer MTLGPUAddress, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
Encodes a draw command that invokes a mesh shader and, optionally, an object shader with indirect arguments.
indirectBuffer: GPUAddress of an MTLBuffer instance with data that matches the layout of the MTLDispatchThreadgroupsIndirectArguments structure. This address requires 4-byte alignment. // MTLDispatchThreadgroupsIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDispatchThreadgroupsIndirectArguments
threadsPerObjectThreadgroup: A MTLSize instance that represents the number of threads in an object shader threadgroup, if applicable. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerMeshThreadgroup: A MTLSize instance that represents the number of threads in a mesh shader threadgroup. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
Discussion ¶
This method enables you to determine the number of threadgroups per grid indirectly, in the GPU timeline. Metal expects this buffer’s contents to match the layout of structure MTLDispatchThreadgroupsIndirectArguments. You are responsible for ensuring the address of this buffer has 4-byte alignment.
Use an instance of MTLResidencySet to mark residency of the indirect buffer that the `indirectBuffer` parameter references.
func (MTL4RenderCommandEncoderObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTL4RenderCommandEncoderObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threads.
threadsPerGrid: A MTLSize instance that represents the number of threads for each grid dimension. For mesh shaders, the command rounds the value down to the nearest multiple of `threadsPerMeshThreadgroup` for each dimension. For object shaders, the value doesn’t need to be a multiple of `threadsPerObjectThreadgroup`. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerObjectThreadgroup: A MTLSize instance that represents the number of threads in an object shader threadgroup, if applicable. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerMeshThreadgroup: A MTLSize instance that represents the number of threads in a mesh shader threadgroup. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
func (MTL4RenderCommandEncoderObject) DrawPrimitivesIndirectBuffer ¶
func (o MTL4RenderCommandEncoderObject) DrawPrimitivesIndirectBuffer(primitiveType MTLPrimitiveType, indirectBuffer MTLGPUAddress)
Encodes a draw command that renders multiple instances of a geometric primitive with indirect arguments.
primitiveType: A MTLPrimitiveType representing how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
indirectBuffer: GPUAddress of a MTLBuffer instance with data that matches the layout of the MTLDrawPrimitivesIndirectArguments structure. You are responsible for ensuring that the alignment of this address is 4 bytes. // MTLDrawPrimitivesIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDrawPrimitivesIndirectArguments
Discussion ¶
When you use this function, Metal reads the parameters to the draw command from an MTLBuffer instance, allowing you to implement a GPU-driven workflow where a compute pipeline state determines the draw arguments.
You are responsible for ensuring that the address of the indirect buffer you provide to this method has 4-byte alignment.
Because this is a non-indexed draw call, Metal interprets the contents of the indirect buffer to match the layout of struct MTLDrawPrimitivesIndirectArguments.
Use an instance of MTLResidencySet to mark residency of the indirect buffer that the `indirectBuffer` parameter references.
func (MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCount ¶
func (o MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint)
Encodes a draw command that renders an instance of a geometric primitive.
primitiveType: A MTLPrimitiveType representing how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
vertexStart: The lowest value the command passes to your vertex shader function’s parameter with the `[[vertex_id]]` attribute.
vertexCount: An integer that represents the number of vertices of `primitiveType` the command draws.
Discussion ¶
This command assigns each vertex a unique `vertex_id` value that increases from `vertexStart` through `(vertexStart + vertexCount - 1)`.
Your vertex shader function can use this value to uniquely identify each vertex.
func (MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCount ¶
func (o MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint)
Encodes a draw command that renders multiple instances of a geometric primitive.
primitiveType: A MTLPrimitiveType represents how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
vertexStart: The lowest value the command passes to your vertex shader function’s parameter with the `vertex_id` attribute.
vertexCount: An integer that represents the number of vertices of `primitiveType` the command draws.
instanceCount: An integer that represents the number of times the command draws `primitiveType` primitives with `vertexCount` vertices.
Discussion ¶
The command assigns each vertex a unique `vertex_id` value within its drawing instance that increases from `vertexStart` through `(vertexStart + vertexCount - 1)`.
Additionally, the command assigns each drawing instance a unique `instance_id` value that increases from `0` through `(instanceCount - 1)`.
Your vertex shader can use the `vertex_id` value to uniquely identify each vertex in each drawing instance, and the `instance_id` value to identify which instance that vertex belongs to.
func (MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance ¶
func (o MTL4RenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint, baseInstance uint)
Encodes a draw command that renders multiple instances of a geometric primitive, starting with a custom instance identification number.
primitiveType: A MTLPrimitiveType representing how the command interprets vertex argument data. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
vertexStart: The lowest value the command passes to your vertex shader function’s parameter with the `vertex_id` attribute.
vertexCount: An integer that represents the number of vertices of `primitiveType` the command draws.
instanceCount: An integer that represents the number of times the command draws `primitiveType` with `vertexCount` vertices.
baseInstance: The lowest value the command passes to your vertex shader function’s parameter with the `instance_id` attribute.
Discussion ¶
The command assigns each vertex a unique `vertex_id` value within its drawing instance that increases from `vertexStart` through `(vertexStart + vertexCount - 1)`.
Additionally, the command assigns each drawing instance a unique `instance_id` value that increases from `baseInstance` through `(baseInstance + instanceCount - 1)`.
Your vertex shader can use the `vertex_id` value to uniquely identify each vertex in each drawing instance, and the `instance_id` value to identify which instance that vertex belongs to.
func (MTL4RenderCommandEncoderObject) EndEncoding ¶
func (o MTL4RenderCommandEncoderObject) EndEncoding()
Declares that all command generation from this encoder is complete.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/endEncoding()
func (MTL4RenderCommandEncoderObject) ExecuteCommandsInBufferIndirectBuffer ¶
func (o MTL4RenderCommandEncoderObject) ExecuteCommandsInBufferIndirectBuffer(indirectCommandBuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLGPUAddress)
Encodes a command that runs an indirect range of commands from an indirect command buffer.
indirectCommandBuffer: A MTLIndirectCommandBuffer instance that contains other commands the current command runs.
indirectRangeBuffer: GPUAddress of a MTLBuffer instance with data that matches the layout of the MTLIndirectCommandBufferExecutionRange structure. This address requires 4-byte alignment. // MTLIndirectCommandBufferExecutionRange: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferExecutionRange
Discussion ¶
Use this method to indicate to Metal the span of indices in the command buffer to execute indirectly via an MTLBuffer instance you provide in the `indirectRangeBuffer` parameter. This allows you to calculate the span of commands Metal executes in the GPU timeline, enabling GPU-driven workflows.
Metal requires that the contents of this buffer match the layout of struct MTLIndirectCommandBufferExecutionRange, which specifies a location and a length within the indirect command buffer. You are responsible for ensuring the address of this buffer has 4-byte alignment.
Use an instance of MTLResidencySet to mark residency of the indirect buffer that the `indirectRangeBuffer` parameter references.
func (MTL4RenderCommandEncoderObject) ExecuteCommandsInBufferWithRange ¶
func (o MTL4RenderCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
Encodes a command that runs a range of commands from an indirect command buffer.
indirectCommandBuffer: A MTLIndirectCommandBuffer instance containing other commands that the current command runs.
executionRange: A span of integers that represent the command entries in the buffer that the current command runs.
func (MTL4RenderCommandEncoderObject) InsertDebugSignpost ¶
func (o MTL4RenderCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the frame data to aid debugging.
string: The debug string to insert as a signpost.
Discussion ¶
Calling this method doesn’t change any behaviors, but can be useful for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/insertDebugSignpost(_:)
func (MTL4RenderCommandEncoderObject) Label ¶
func (o MTL4RenderCommandEncoderObject) Label() string
Provides an optional label to assign to the command encoder for debug purposes.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/label
func (MTL4RenderCommandEncoderObject) PopDebugGroup ¶
func (o MTL4RenderCommandEncoderObject) PopDebugGroup()
Pops the latest debug group string from this encoder’s stack of debug groups.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/popDebugGroup()
func (MTL4RenderCommandEncoderObject) PushDebugGroup ¶
func (o MTL4RenderCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a string onto this encoder’s stack of debug groups.
string: The debug string to push.
See: https://developer.apple.com/documentation/Metal/MTL4CommandEncoder/pushDebugGroup(_:)
func (MTL4RenderCommandEncoderObject) SetArgumentTableAtStages ¶
func (o MTL4RenderCommandEncoderObject) SetArgumentTableAtStages(argumentTable MTL4ArgumentTable, stages MTLRenderStages)
Associates an argument table with a set of render stages.
argumentTable: MTL4ArgumentTable to set.
stages: A MTLRenderStages bitmask that specifies the shader stages with visibility over the table. // MTLRenderStages: https://developer.apple.com/documentation/Metal/MTLRenderStages
Discussion ¶
Metal takes a snapshot of the resources in the argument table when you encode a draw, dispatch, or execute command. This snapshot becomes available to the `stages` you specify to this method.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setArgumentTable(_:stages:)
func (MTL4RenderCommandEncoderObject) SetBlendColorRedGreenBlueAlpha ¶
func (o MTL4RenderCommandEncoderObject) SetBlendColorRedGreenBlueAlpha(red float32, green float32, blue float32, alpha float32)
Configures each pixel component value, including alpha, for the render pipeline’s constant blend color.
red: A value for the red component for the blend color constant.
green: A value for the green component for the blend color constant.
blue: A value for the blue component for the blend color constant.
alpha: A value for the alpha component for the blend color constant.
func (MTL4RenderCommandEncoderObject) SetColorAttachmentMap ¶
func (o MTL4RenderCommandEncoderObject) SetColorAttachmentMap(mapping IMTLLogicalToPhysicalColorAttachmentMap)
Sets the mapping from logical shader color output to physical render pass color attachments.
mapping: Mapping from logical shader outputs to physical outputs.
Discussion ¶
Use this method to define how the physical color attachments you specify via [ColorAttachments] map to the logical color output the fragment shader writes to.
To use this feature, make sure to set [SupportColorAttachmentMapping] to true.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setColorAttachmentMap(_:)
func (MTL4RenderCommandEncoderObject) SetColorStoreActionAtIndex ¶
func (o MTL4RenderCommandEncoderObject) SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
Configures the store action for a color attachment.
storeAction: A store action for the color attachment that can’t be [StoreActionUnknown].
colorAttachmentIndex: The index of a color attachment.
func (MTL4RenderCommandEncoderObject) SetCullMode ¶
func (o MTL4RenderCommandEncoderObject) SetCullMode(cullMode MTLCullMode)
Controls whether Metal culls front facing primitives, back facing primitives, or culls no primitives at all.
cullMode: MTLCullMode to set. // MTLCullMode: https://developer.apple.com/documentation/Metal/MTLCullMode
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setCullMode(_:)
func (MTL4RenderCommandEncoderObject) SetDepthBiasSlopeScaleClamp ¶
func (o MTL4RenderCommandEncoderObject) SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
Configures the adjustments a render pass applies to depth values from fragment shader functions by a scaling factor and bias.
depthBias: A constant bias the render pipeline applies to all fragments.
slopeScale: A bias coefficient that scales with the depth of the primitive relative to the camera.
clamp: A value that limits the bias value the render pipeline can apply to a fragment. Pass a positive or negative value to limit the largest magnitude of a positive or negative bias, respectively. Set this value to `0` to disable bias clamping.
func (MTL4RenderCommandEncoderObject) SetDepthClipMode ¶
func (o MTL4RenderCommandEncoderObject) SetDepthClipMode(depthClipMode MTLDepthClipMode)
Controls the behavior for fragments outside of the near or far planes.
depthClipMode: MTLDepthClipMode to set. // MTLDepthClipMode: https://developer.apple.com/documentation/Metal/MTLDepthClipMode
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthClipMode(_:)
func (MTL4RenderCommandEncoderObject) SetDepthStencilState ¶
func (o MTL4RenderCommandEncoderObject) SetDepthStencilState(depthStencilState MTLDepthStencilState)
Configures this encoder with a depth stencil state that applies to your subsequent draw commands.
depthStencilState: The MTLDepthStencilState instance to set.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthStencilState(_:)
func (MTL4RenderCommandEncoderObject) SetDepthStoreAction ¶
func (o MTL4RenderCommandEncoderObject) SetDepthStoreAction(storeAction MTLStoreAction)
Configures the store action for the depth attachment.
storeAction: A store action for the depth attachment that can’t be [StoreActionUnknown].
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setDepthStoreAction(_:)
func (MTL4RenderCommandEncoderObject) SetDepthTestMinBoundMaxBound ¶
func (o MTL4RenderCommandEncoderObject) SetDepthTestMinBoundMaxBound(minBound float32, maxBound float32)
Configures the minimum and maximum bounds for depth bounds testing.
minBound: A minimum bound for depth testing, which discards fragments with a stored depth that is less than `minBound`.
maxBound: A maximum bound for depth testing, which discards fragments with a stored depth that is greater than `maxBound`.
Discussion ¶
The render command encoder disables depth bounds testing by default. The render command encoder also disables depth bounds testing when all of the following properties equal a specific value:
- The `minBound` property is equal to `0.0f`. - The `maxBound` property is equal to `1.0f`. Both `minBound` and `maxBound` need to be within `[0.0f, 1.0f]`, and `minBound` needs to be less than or equal to `maxBound`.
func (MTL4RenderCommandEncoderObject) SetFrontFacingWinding ¶
func (o MTL4RenderCommandEncoderObject) SetFrontFacingWinding(frontFacingWinding MTLWinding)
Configures the vertex winding order that determines which face of a geometric primitive is the front one.
frontFacingWinding: A MTLWinding value that determines which side of a primitive the render pipeline interprets as front facing. // MTLWinding: https://developer.apple.com/documentation/Metal/MTLWinding
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setFrontFacing(_:)
func (MTL4RenderCommandEncoderObject) SetLabel ¶
func (o MTL4RenderCommandEncoderObject) SetLabel(value string)
func (MTL4RenderCommandEncoderObject) SetObjectThreadgroupMemoryLengthAtIndex ¶
func (o MTL4RenderCommandEncoderObject) SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
Configures the size of a threadgroup memory buffer for a threadgroup argument in the object shader function.
length: The size of the threadgroup memory, in bytes.
index: An integer that corresponds to the index of the argument you annotate with attribute `[[threadgroup(index)]]` in the shader function.
func (MTL4RenderCommandEncoderObject) SetRenderPipelineState ¶
func (o MTL4RenderCommandEncoderObject) SetRenderPipelineState(pipelineState MTLRenderPipelineState)
Configures this encoder with a render pipeline state that applies to your subsequent draw commands.
pipelineState: A non-`nil` MTLRenderPipelineState instance.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setRenderPipelineState(_:)
func (MTL4RenderCommandEncoderObject) SetScissorRect ¶
func (o MTL4RenderCommandEncoderObject) SetScissorRect(rect MTLScissorRect)
Sets a scissor rectangle to discard fragments outside a specific area.
rect: MTLScissorRect rectangle to specify. This rectangle needs to lie completely within the current render attachment. // MTLScissorRect: https://developer.apple.com/documentation/Metal/MTLScissorRect
Discussion ¶
Metal performs a scissor test and discards all fragments outside of the scissor rect.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setScissorRect(_:)
func (MTL4RenderCommandEncoderObject) SetScissorRectsCount ¶
func (o MTL4RenderCommandEncoderObject) SetScissorRectsCount(scissorRects []MTLScissorRect, count uint)
Sets an array of scissor rectangles for a fragment scissor test.
scissorRects: Array of MTLScissorRect structures. // MTLScissorRect: https://developer.apple.com/documentation/Metal/MTLScissorRect
count: Number of MTLScissorRect structures in the array. // MTLScissorRect: https://developer.apple.com/documentation/Metal/MTLScissorRect
Discussion ¶
Metal uses the specific scissor rectangle corresponding to the index you specify via the `[[ viewport_array_index ]]` output attribute of the vertex shader function in the Metal Shading Language, discarding all fragments outside of the scissor rect.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setScissorRects:count:
func (MTL4RenderCommandEncoderObject) SetStencilFrontReferenceValueBackReferenceValue ¶
func (o MTL4RenderCommandEncoderObject) SetStencilFrontReferenceValueBackReferenceValue(frontReferenceValue uint32, backReferenceValue uint32)
Configures the encoder with different stencil test reference values for front-facing and back-facing primitives.
frontReferenceValue: A stencil test comparison value the render pipeline applies to front-facing primitives.
backReferenceValue: A stencil test comparison value the render pipeline applies to back-facing primitives.
Discussion ¶
The render pipeline applies `frontReferenceValue` to front-facing primitives and `backReferenceValue` to back-facing primitives.
func (MTL4RenderCommandEncoderObject) SetStencilReferenceValue ¶
func (o MTL4RenderCommandEncoderObject) SetStencilReferenceValue(referenceValue uint32)
Configures this encoder with a reference value for stencil testing.
referenceValue: A stencil test comparison value.
Discussion ¶
The render pipeline applies this reference value to both front-facing and back-facing primitives.
func (MTL4RenderCommandEncoderObject) SetStencilStoreAction ¶
func (o MTL4RenderCommandEncoderObject) SetStencilStoreAction(storeAction MTLStoreAction)
Configures the store action for the stencil attachment.
storeAction: A store action for the stencil attachment that can’t be [StoreActionUnknown].
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setStencilStoreAction(_:)
func (MTL4RenderCommandEncoderObject) SetThreadgroupMemoryLengthOffsetAtIndex ¶
func (o MTL4RenderCommandEncoderObject) SetThreadgroupMemoryLengthOffsetAtIndex(length uint, offset uint, index uint)
Configures the size of a threadgroup memory buffer for a threadgroup argument in the fragment and tile shader functions.
length: The size of the threadgroup memory, in bytes.
offset: An integer that represents the location, in bytes, from the start of the threadgroup memory buffer at `index` where the threadgroup memory begins.
index: An integer that corresponds to the index of the argument you annotate with attribute `[[threadgroup(index)]]` in the shader function.
func (MTL4RenderCommandEncoderObject) SetTriangleFillMode ¶
func (o MTL4RenderCommandEncoderObject) SetTriangleFillMode(fillMode MTLTriangleFillMode)
Configures how subsequent draw commands rasterize triangle and triangle strip primitives.
fillMode: MTLTriangleFillMode the render pass applies to draw commands that rasterize triangles or triangle strips. // MTLTriangleFillMode: https://developer.apple.com/documentation/Metal/MTLTriangleFillMode
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setTriangleFillMode(_:)
func (MTL4RenderCommandEncoderObject) SetVertexAmplificationCountViewMappings ¶
func (o MTL4RenderCommandEncoderObject) SetVertexAmplificationCountViewMappings(count uint, viewMappings *MTLVertexAmplificationViewMapping)
Sets the vertex amplification count and its view mapping for each amplification ID.
count: The number of outputs to create. The maximum value is `2`.
viewMappings: Array of MTLVertexAmplificationViewMapping instances. Each instance provides per-output offsets to a specific render target and viewport. // MTLVertexAmplificationViewMapping: https://developer.apple.com/documentation/Metal/MTLVertexAmplificationViewMapping
Discussion ¶
Each view mapping element describes how to route the corresponding amplification ID to a specific viewport and render target array index by using offsets from the base array index provided by the `[[ render_target_array_index ]]` and/or `[[ viewport_array_index ]]` output attributes in the vertex shader. This allows Metal to route each amplified vertex to a different `[[ render_target_array_index ]]` and `[[ viewport_array_index ]]`, even though you can’t directly amplify these attributes.
func (MTL4RenderCommandEncoderObject) SetViewport ¶
func (o MTL4RenderCommandEncoderObject) SetViewport(viewport MTLViewport)
Sets the viewport which that transforms vertices from normalized device coordinates to window coordinates.
viewport: MTLViewport to set. // MTLViewport: https://developer.apple.com/documentation/Metal/MTLViewport
Discussion ¶
Metal clips fragments that lie outside this viewport, and optionally clamps fragments outside of z-near/z-far range depending on the value you assign to [SetDepthClipMode].
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setViewport(_:)
func (MTL4RenderCommandEncoderObject) SetViewportsCount ¶
func (o MTL4RenderCommandEncoderObject) SetViewportsCount(viewports []MTLViewport, count uint)
Sets an array of viewports to transform vertices from normalized device coordinates to window coordinates.
viewports: Array of MTLViewport instances. // MTLViewport: https://developer.apple.com/documentation/Metal/MTLViewport
count: Number of MTLViewport instances in the array. // MTLViewport: https://developer.apple.com/documentation/Metal/MTLViewport
Discussion ¶
Metal clips fragments that lie outside of the viewport, and optionally clamps fragments outside of z-near/z-far range, depending on the value you assign to [SetDepthClipMode].
Metal selects the viewport to use from the `[[ viewport_array_index ]]` attribute you specify in the pipeline state’s vertex shader function in the Metal Shading Language.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/setViewports:count:
func (MTL4RenderCommandEncoderObject) SetVisibilityResultModeOffset ¶
func (o MTL4RenderCommandEncoderObject) SetVisibilityResultModeOffset(mode MTLVisibilityResultMode, offset uint)
Configures a visibility test for Metal to run, and the destination for any results it generates.
mode: A MTLVisibilityResultMode that configures which visibility test results the render pass saves to a buffer, or disables visibility testing. // MTLVisibilityResultMode: https://developer.apple.com/documentation/Metal/MTLVisibilityResultMode
offset: A location, in bytes, relative to the start of [VisibilityResultBuffer] The GPU stores the result of a visibility test at `offset`, which needs to be a multiple of `8`.
Discussion ¶
You use the `mode` parameter to enable or disable the visibility test, and determine if it produces a boolean response for passing fragments, or if it counts the number of fragments.
func (MTL4RenderCommandEncoderObject) TileHeight ¶
func (o MTL4RenderCommandEncoderObject) TileHeight() uint
Sets the height of a tile for this render pass.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/tileHeight
func (MTL4RenderCommandEncoderObject) TileWidth ¶
func (o MTL4RenderCommandEncoderObject) TileWidth() uint
Sets the width of a tile for this render pass.
See: https://developer.apple.com/documentation/Metal/MTL4RenderCommandEncoder/tileWidth
func (MTL4RenderCommandEncoderObject) UpdateFenceAfterEncoderStages ¶
func (o MTL4RenderCommandEncoderObject) UpdateFenceAfterEncoderStages(fence MTLFence, afterEncoderStages MTLStages)
Encodes a command that instructs the GPU to update a fence after one or more stages, which can unblock other passes waiting for the fence.
fence: A fence the pass updates after the stages in `afterEncoderStages` complete.
afterEncoderStages: The encoder stages that need to complete before the pass updates `fence`.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the pass to update `fence` after the stages you pass to the `afterEncoderStages` run all their memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
func (MTL4RenderCommandEncoderObject) WaitForFenceBeforeEncoderStages ¶
func (o MTL4RenderCommandEncoderObject) WaitForFenceBeforeEncoderStages(fence MTLFence, beforeEncoderStages MTLStages)
Encodes a command that instructs the GPU to pause before starting one or more stages of the pass until a pass updates a fence.
fence: A fence that the pass waits for before running the stages you pass to `beforeEncoderStages`.
beforeEncoderStages: The encoder stages that need to wait for another pass to update `fence` before they run.
Discussion ¶
You can synchronize memory operations of a pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the stages you pass to the `beforeEncoderStages` parameter. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeEncoderStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterEncoderStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
func (MTL4RenderCommandEncoderObject) WriteTimestampWithGranularityAfterStageIntoHeapAtIndex ¶
func (o MTL4RenderCommandEncoderObject) WriteTimestampWithGranularityAfterStageIntoHeapAtIndex(granularity MTL4TimestampGranularity, stage MTLRenderStages, counterHeap MTL4CounterHeap, index uint)
Writes a GPU timestamp into the given MTL4CounterHeap at `index` after `stage` completes.
granularity: A MTL4TimestampGranularity hint. // MTL4TimestampGranularity: https://developer.apple.com/documentation/Metal/MTL4TimestampGranularity
stage: MTLRenderStages that need to complete before Metal writes the timestamp. This may also include later stages that are related, for example [RenderStageMesh] may include [RenderStageVertex]. // MTLRenderStages: https://developer.apple.com/documentation/Metal/MTLRenderStages
counterHeap: MTL4CounterHeap into which Metal writes timestamps.
index: The index value into which Metal writes this timestamp.
Discussion ¶
This command only guarantees all draws prior to this command are complete when Metal writes the timestamp into the counter heap you provide in the `counterHeap` parameter. The timestamp may also include subsequent operations.
If you call this method before any draw calls, Metal writes a timestamp before the stage you specify in the `stage` parameter begins.
type MTL4RenderEncoderOptions ¶
type MTL4RenderEncoderOptions int
See: https://developer.apple.com/documentation/Metal/MTL4RenderEncoderOptions
const ( // MTL4RenderEncoderOptionNone: Declares that this render pass doesn’t suspend nor resume. MTL4RenderEncoderOptionNone MTL4RenderEncoderOptions = 0 // MTL4RenderEncoderOptionResuming: Configures the render pass to as . MTL4RenderEncoderOptionResuming MTL4RenderEncoderOptions = 2 // MTL4RenderEncoderOptionSuspending: Configures the render pass as . MTL4RenderEncoderOptionSuspending MTL4RenderEncoderOptions = 1 )
func (MTL4RenderEncoderOptions) String ¶
func (e MTL4RenderEncoderOptions) String() string
type MTL4RenderPassDescriptor ¶
type MTL4RenderPassDescriptor struct {
objectivec.Object
}
Describes a render pass.
Overview ¶
You use render pass descriptors to create instances of MTL4RenderCommandEncoder and encode draw commands into instances of MTL4CommandBuffer.
To create render command encoders, you typically call [RenderCommandEncoderWithDescriptor]. The [RenderCommandEncoderWithDescriptorOptions] variant of this method allows you to specify additional options to encode a render pass in parallel from multiple CPU cores by creating and render passes.
Instance Properties ¶
- MTL4RenderPassDescriptor.ColorAttachments: Accesses the array of state information for render attachments that store color data.
- MTL4RenderPassDescriptor.DefaultRasterSampleCount: Sets the default raster sample count for the render pass when it references no attachments.
- MTL4RenderPassDescriptor.SetDefaultRasterSampleCount
- MTL4RenderPassDescriptor.DepthAttachment: Accesses state information for a render attachment that stores depth data.
- MTL4RenderPassDescriptor.SetDepthAttachment
- MTL4RenderPassDescriptor.ImageblockSampleLength: Assigns the per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
- MTL4RenderPassDescriptor.SetImageblockSampleLength
- MTL4RenderPassDescriptor.RasterizationRateMap: Assigns an optional variable rasterization rate map that Metal uses in the render pass.
- MTL4RenderPassDescriptor.SetRasterizationRateMap
- MTL4RenderPassDescriptor.RenderTargetArrayLength: Assigns the number of layers that all attachments this descriptor references have.
- MTL4RenderPassDescriptor.SetRenderTargetArrayLength
- MTL4RenderPassDescriptor.RenderTargetHeight: Sets the height, in pixels, to which Metal constrains the render target.
- MTL4RenderPassDescriptor.SetRenderTargetHeight
- MTL4RenderPassDescriptor.RenderTargetWidth: Sets the width, in pixels, to which Metal constrains the render target.
- MTL4RenderPassDescriptor.SetRenderTargetWidth
- MTL4RenderPassDescriptor.SamplePositions: Configures the custom sample positions to use in MSAA rendering.
- MTL4RenderPassDescriptor.SetSamplePositions
- MTL4RenderPassDescriptor.StencilAttachment: Accesses state information for a render attachment that stores stencil data.
- MTL4RenderPassDescriptor.SetStencilAttachment
- MTL4RenderPassDescriptor.SupportColorAttachmentMapping: Controls if the render pass supports color attachment mapping.
- MTL4RenderPassDescriptor.SetSupportColorAttachmentMapping
- MTL4RenderPassDescriptor.ThreadgroupMemoryLength: Assigns the per-tile size, in bytes, of the persistent threadgroup memory allocation of this render pass.
- MTL4RenderPassDescriptor.SetThreadgroupMemoryLength
- MTL4RenderPassDescriptor.TileHeight: The height of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
- MTL4RenderPassDescriptor.SetTileHeight
- MTL4RenderPassDescriptor.TileWidth: The width of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
- MTL4RenderPassDescriptor.SetTileWidth
- MTL4RenderPassDescriptor.VisibilityResultBuffer: Configures a buffer into which Metal writes counts of fragments (pixels) passing the depth and stencil tests.
- MTL4RenderPassDescriptor.SetVisibilityResultBuffer
- MTL4RenderPassDescriptor.VisibilityResultType: Determines if Metal accumulates visibility results between render encoders or resets them.
- MTL4RenderPassDescriptor.SetVisibilityResultType
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor
func MTL4RenderPassDescriptorFromID ¶
func MTL4RenderPassDescriptorFromID(id objc.ID) MTL4RenderPassDescriptor
MTL4RenderPassDescriptorFromID constructs a MTL4RenderPassDescriptor from an objc.ID.
Describes a render pass.
func NewMTL4RenderPassDescriptor ¶
func NewMTL4RenderPassDescriptor() MTL4RenderPassDescriptor
NewMTL4RenderPassDescriptor creates a new MTL4RenderPassDescriptor instance.
func (MTL4RenderPassDescriptor) Autorelease ¶
func (m MTL4RenderPassDescriptor) Autorelease() MTL4RenderPassDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4RenderPassDescriptor) ColorAttachments ¶
func (m MTL4RenderPassDescriptor) ColorAttachments() IMTLRenderPassColorAttachmentDescriptorArray
Accesses the array of state information for render attachments that store color data.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/colorAttachments
func (MTL4RenderPassDescriptor) DefaultRasterSampleCount ¶
func (m MTL4RenderPassDescriptor) DefaultRasterSampleCount() uint
Sets the default raster sample count for the render pass when it references no attachments.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/defaultRasterSampleCount
func (MTL4RenderPassDescriptor) DepthAttachment ¶
func (m MTL4RenderPassDescriptor) DepthAttachment() IMTLRenderPassDepthAttachmentDescriptor
Accesses state information for a render attachment that stores depth data.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/depthAttachment
func (MTL4RenderPassDescriptor) GetSamplePositionsCount ¶
func (m MTL4RenderPassDescriptor) GetSamplePositionsCount(positions []MTLSamplePosition, count uint) uint
Retrieves the previously-configured custom sample positions.
positions: The destination array where Metal stores MTLSamplePosition instances. // MTLSamplePosition: https://developer.apple.com/documentation/Metal/MTLSamplePosition
count: Number of MTLSamplePosition instances in the array. This array needs to be large enough to store all sample positions. // MTLSamplePosition: https://developer.apple.com/documentation/Metal/MTLSamplePosition
Return Value ¶
The number of previously-configured custom sample positions.
Discussion ¶
This method stores the app’s last set custom sample positions into an output array. Metal only modifies the array when the `count` parameter consists of a length sufficient to store the number of sample positions.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/getSamplePositions:count:
func (MTL4RenderPassDescriptor) ImageblockSampleLength ¶
func (m MTL4RenderPassDescriptor) ImageblockSampleLength() uint
Assigns the per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/imageblockSampleLength
func (MTL4RenderPassDescriptor) Init ¶
func (m MTL4RenderPassDescriptor) Init() MTL4RenderPassDescriptor
Init initializes the instance.
func (MTL4RenderPassDescriptor) RasterizationRateMap ¶
func (m MTL4RenderPassDescriptor) RasterizationRateMap() MTLRasterizationRateMap
Assigns an optional variable rasterization rate map that Metal uses in the render pass.
Discussion ¶
Enabling variable rasterization rate allows Metal to decrease the rasterization rate, typically in unimportant regions of color attachments, to accelerate processing.
When set to `nil`, the default, Metal doesn’t use variable rasterization rate.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/rasterizationRateMap
func (MTL4RenderPassDescriptor) RenderTargetArrayLength ¶
func (m MTL4RenderPassDescriptor) RenderTargetArrayLength() uint
Assigns the number of layers that all attachments this descriptor references have.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/renderTargetArrayLength
func (MTL4RenderPassDescriptor) RenderTargetHeight ¶
func (m MTL4RenderPassDescriptor) RenderTargetHeight() uint
Sets the height, in pixels, to which Metal constrains the render target.
Discussion ¶
When this value is non-zero, you need to assign it to be smaller than or equal to the minimum height of all attachments.
The default value of this property is `0`.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/renderTargetHeight
func (MTL4RenderPassDescriptor) RenderTargetWidth ¶
func (m MTL4RenderPassDescriptor) RenderTargetWidth() uint
Sets the width, in pixels, to which Metal constrains the render target.
Discussion ¶
When this value is non-zero, you need to assign it to be smaller than or equal to the minimum width of all attachments.
The default value of this property is `0`.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/renderTargetWidth
func (MTL4RenderPassDescriptor) SamplePositions ¶
func (m MTL4RenderPassDescriptor) SamplePositions() MTLSamplePosition
Configures the custom sample positions to use in MSAA rendering.
See: https://developer.apple.com/documentation/metal/mtl4renderpassdescriptor/samplepositions
func (MTL4RenderPassDescriptor) SetDefaultRasterSampleCount ¶
func (m MTL4RenderPassDescriptor) SetDefaultRasterSampleCount(value uint)
func (MTL4RenderPassDescriptor) SetDepthAttachment ¶
func (m MTL4RenderPassDescriptor) SetDepthAttachment(value IMTLRenderPassDepthAttachmentDescriptor)
func (MTL4RenderPassDescriptor) SetImageblockSampleLength ¶
func (m MTL4RenderPassDescriptor) SetImageblockSampleLength(value uint)
func (MTL4RenderPassDescriptor) SetRasterizationRateMap ¶
func (m MTL4RenderPassDescriptor) SetRasterizationRateMap(value MTLRasterizationRateMap)
func (MTL4RenderPassDescriptor) SetRenderTargetArrayLength ¶
func (m MTL4RenderPassDescriptor) SetRenderTargetArrayLength(value uint)
func (MTL4RenderPassDescriptor) SetRenderTargetHeight ¶
func (m MTL4RenderPassDescriptor) SetRenderTargetHeight(value uint)
func (MTL4RenderPassDescriptor) SetRenderTargetWidth ¶
func (m MTL4RenderPassDescriptor) SetRenderTargetWidth(value uint)
func (MTL4RenderPassDescriptor) SetSamplePositions ¶
func (m MTL4RenderPassDescriptor) SetSamplePositions(value MTLSamplePosition)
func (MTL4RenderPassDescriptor) SetSamplePositionsCount ¶
func (m MTL4RenderPassDescriptor) SetSamplePositionsCount(positions []MTLSamplePosition, count uint)
Configures the custom sample positions to use in MSAA rendering.
positions: Array of MTLSamplePosition instances. // MTLSamplePosition: https://developer.apple.com/documentation/Metal/MTLSamplePosition
count: Number of MTLSamplePosition instances in the array. This value needs to be a valid sample count, or `0` to disable custom sample positions. // MTLSamplePosition: https://developer.apple.com/documentation/Metal/MTLSamplePosition
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/setSamplePositions:count:
func (MTL4RenderPassDescriptor) SetStencilAttachment ¶
func (m MTL4RenderPassDescriptor) SetStencilAttachment(value IMTLRenderPassStencilAttachmentDescriptor)
func (MTL4RenderPassDescriptor) SetSupportColorAttachmentMapping ¶
func (m MTL4RenderPassDescriptor) SetSupportColorAttachmentMapping(value bool)
func (MTL4RenderPassDescriptor) SetThreadgroupMemoryLength ¶
func (m MTL4RenderPassDescriptor) SetThreadgroupMemoryLength(value uint)
func (MTL4RenderPassDescriptor) SetTileHeight ¶
func (m MTL4RenderPassDescriptor) SetTileHeight(value uint)
func (MTL4RenderPassDescriptor) SetTileWidth ¶
func (m MTL4RenderPassDescriptor) SetTileWidth(value uint)
func (MTL4RenderPassDescriptor) SetVisibilityResultBuffer ¶
func (m MTL4RenderPassDescriptor) SetVisibilityResultBuffer(value MTLBuffer)
func (MTL4RenderPassDescriptor) SetVisibilityResultType ¶
func (m MTL4RenderPassDescriptor) SetVisibilityResultType(value MTLVisibilityResultType)
func (MTL4RenderPassDescriptor) StencilAttachment ¶
func (m MTL4RenderPassDescriptor) StencilAttachment() IMTLRenderPassStencilAttachmentDescriptor
Accesses state information for a render attachment that stores stencil data.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/stencilAttachment
func (MTL4RenderPassDescriptor) SupportColorAttachmentMapping ¶
func (m MTL4RenderPassDescriptor) SupportColorAttachmentMapping() bool
Controls if the render pass supports color attachment mapping.
func (MTL4RenderPassDescriptor) ThreadgroupMemoryLength ¶
func (m MTL4RenderPassDescriptor) ThreadgroupMemoryLength() uint
Assigns the per-tile size, in bytes, of the persistent threadgroup memory allocation of this render pass.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/threadgroupMemoryLength
func (MTL4RenderPassDescriptor) TileHeight ¶
func (m MTL4RenderPassDescriptor) TileHeight() uint
The height of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
Discussion ¶
For tile-based rendering, Metal divides each render attachment into smaller regions, or . The property’s default is `0`, which tells Metal to select a size that fits in tile memory.
See Tailor your apps for Apple GPUs and tile-based deferred rendering for more information about tiles, tile memory, and deferred rendering.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/tileHeight
func (MTL4RenderPassDescriptor) TileWidth ¶
func (m MTL4RenderPassDescriptor) TileWidth() uint
The width of the tiles, in pixels, a render pass you create with this descriptor applies to its attachments.
Discussion ¶
For tile-based rendering, Metal divides each render attachment into smaller regions, or . The property’s default is `0`, which tells Metal to select a size that fits in tile memory.
See Tailor your apps for Apple GPUs and tile-based deferred rendering for more information about tiles, tile memory, and deferred rendering.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/tileWidth
func (MTL4RenderPassDescriptor) VisibilityResultBuffer ¶
func (m MTL4RenderPassDescriptor) VisibilityResultBuffer() MTLBuffer
Configures a buffer into which Metal writes counts of fragments (pixels) passing the depth and stencil tests.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/visibilityResultBuffer
func (MTL4RenderPassDescriptor) VisibilityResultType ¶
func (m MTL4RenderPassDescriptor) VisibilityResultType() MTLVisibilityResultType
Determines if Metal accumulates visibility results between render encoders or resets them.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPassDescriptor/visibilityResultType
type MTL4RenderPassDescriptorClass ¶
type MTL4RenderPassDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4RenderPassDescriptorClass ¶
func GetMTL4RenderPassDescriptorClass() MTL4RenderPassDescriptorClass
GetMTL4RenderPassDescriptorClass returns the class object for MTL4RenderPassDescriptor.
func (MTL4RenderPassDescriptorClass) Alloc ¶
func (mc MTL4RenderPassDescriptorClass) Alloc() MTL4RenderPassDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4RenderPipelineBinaryFunctionsDescriptor ¶
type MTL4RenderPipelineBinaryFunctionsDescriptor struct {
objectivec.Object
}
Allows you to specify additional binary functions to link to each stage of a render pipeline.
Instance Properties ¶
- MTL4RenderPipelineBinaryFunctionsDescriptor.FragmentAdditionalBinaryFunctions: Provides an array of binary functions representing additional binary fragment shader functions.
- MTL4RenderPipelineBinaryFunctionsDescriptor.SetFragmentAdditionalBinaryFunctions
- MTL4RenderPipelineBinaryFunctionsDescriptor.MeshAdditionalBinaryFunctions: Provides an array of binary functions representing additional binary mesh shader functions.
- MTL4RenderPipelineBinaryFunctionsDescriptor.SetMeshAdditionalBinaryFunctions
- MTL4RenderPipelineBinaryFunctionsDescriptor.ObjectAdditionalBinaryFunctions: Provides an array of binary functions representing additional binary object shader functions.
- MTL4RenderPipelineBinaryFunctionsDescriptor.SetObjectAdditionalBinaryFunctions
- MTL4RenderPipelineBinaryFunctionsDescriptor.TileAdditionalBinaryFunctions: Provides an array of binary functions representing additional binary tile shader functions.
- MTL4RenderPipelineBinaryFunctionsDescriptor.SetTileAdditionalBinaryFunctions
- MTL4RenderPipelineBinaryFunctionsDescriptor.VertexAdditionalBinaryFunctions: Provides an array of binary functions representing additional binary vertex shader functions.
- MTL4RenderPipelineBinaryFunctionsDescriptor.SetVertexAdditionalBinaryFunctions
Instance Methods ¶
- MTL4RenderPipelineBinaryFunctionsDescriptor.Reset: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineBinaryFunctionsDescriptor
func MTL4RenderPipelineBinaryFunctionsDescriptorFromID ¶
func MTL4RenderPipelineBinaryFunctionsDescriptorFromID(id objc.ID) MTL4RenderPipelineBinaryFunctionsDescriptor
MTL4RenderPipelineBinaryFunctionsDescriptorFromID constructs a MTL4RenderPipelineBinaryFunctionsDescriptor from an objc.ID.
Allows you to specify additional binary functions to link to each stage of a render pipeline.
func NewMTL4RenderPipelineBinaryFunctionsDescriptor ¶
func NewMTL4RenderPipelineBinaryFunctionsDescriptor() MTL4RenderPipelineBinaryFunctionsDescriptor
NewMTL4RenderPipelineBinaryFunctionsDescriptor creates a new MTL4RenderPipelineBinaryFunctionsDescriptor instance.
func (MTL4RenderPipelineBinaryFunctionsDescriptor) Autorelease ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) Autorelease() MTL4RenderPipelineBinaryFunctionsDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4RenderPipelineBinaryFunctionsDescriptor) FragmentAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) FragmentAdditionalBinaryFunctions() []objectivec.IObject
Provides an array of binary functions representing additional binary fragment shader functions.
func (MTL4RenderPipelineBinaryFunctionsDescriptor) Init ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) Init() MTL4RenderPipelineBinaryFunctionsDescriptor
Init initializes the instance.
func (MTL4RenderPipelineBinaryFunctionsDescriptor) MeshAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) MeshAdditionalBinaryFunctions() []objectivec.IObject
Provides an array of binary functions representing additional binary mesh shader functions.
func (MTL4RenderPipelineBinaryFunctionsDescriptor) ObjectAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) ObjectAdditionalBinaryFunctions() []objectivec.IObject
Provides an array of binary functions representing additional binary object shader functions.
func (MTL4RenderPipelineBinaryFunctionsDescriptor) Reset ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) Reset()
Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineBinaryFunctionsDescriptor/reset()
func (MTL4RenderPipelineBinaryFunctionsDescriptor) SetFragmentAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetFragmentAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTL4RenderPipelineBinaryFunctionsDescriptor) SetMeshAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetMeshAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTL4RenderPipelineBinaryFunctionsDescriptor) SetObjectAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetObjectAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTL4RenderPipelineBinaryFunctionsDescriptor) SetTileAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetTileAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTL4RenderPipelineBinaryFunctionsDescriptor) SetVertexAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) SetVertexAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTL4RenderPipelineBinaryFunctionsDescriptor) TileAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) TileAdditionalBinaryFunctions() []objectivec.IObject
Provides an array of binary functions representing additional binary tile shader functions.
func (MTL4RenderPipelineBinaryFunctionsDescriptor) VertexAdditionalBinaryFunctions ¶
func (m MTL4RenderPipelineBinaryFunctionsDescriptor) VertexAdditionalBinaryFunctions() []objectivec.IObject
Provides an array of binary functions representing additional binary vertex shader functions.
type MTL4RenderPipelineBinaryFunctionsDescriptorClass ¶
type MTL4RenderPipelineBinaryFunctionsDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4RenderPipelineBinaryFunctionsDescriptorClass ¶
func GetMTL4RenderPipelineBinaryFunctionsDescriptorClass() MTL4RenderPipelineBinaryFunctionsDescriptorClass
GetMTL4RenderPipelineBinaryFunctionsDescriptorClass returns the class object for MTL4RenderPipelineBinaryFunctionsDescriptor.
func (MTL4RenderPipelineBinaryFunctionsDescriptorClass) Alloc ¶
func (mc MTL4RenderPipelineBinaryFunctionsDescriptorClass) Alloc() MTL4RenderPipelineBinaryFunctionsDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4RenderPipelineColorAttachmentDescriptor ¶
type MTL4RenderPipelineColorAttachmentDescriptor struct {
objectivec.Object
}
Instance Properties ¶
- MTL4RenderPipelineColorAttachmentDescriptor.AlphaBlendOperation: Configures the alpha blending operation.
- MTL4RenderPipelineColorAttachmentDescriptor.SetAlphaBlendOperation
- MTL4RenderPipelineColorAttachmentDescriptor.BlendingState: Configure the blend state for color attachments the pipeline state uses.
- MTL4RenderPipelineColorAttachmentDescriptor.SetBlendingState
- MTL4RenderPipelineColorAttachmentDescriptor.DestinationAlphaBlendFactor: Configures the destination-alpha blend factor.
- MTL4RenderPipelineColorAttachmentDescriptor.SetDestinationAlphaBlendFactor
- MTL4RenderPipelineColorAttachmentDescriptor.DestinationRGBBlendFactor: Configures the destination RGB blend factor.
- MTL4RenderPipelineColorAttachmentDescriptor.SetDestinationRGBBlendFactor
- MTL4RenderPipelineColorAttachmentDescriptor.PixelFormat: Configures the pixel format.
- MTL4RenderPipelineColorAttachmentDescriptor.SetPixelFormat
- MTL4RenderPipelineColorAttachmentDescriptor.RgbBlendOperation: Configures the RGB blend operation.
- MTL4RenderPipelineColorAttachmentDescriptor.SetRgbBlendOperation
- MTL4RenderPipelineColorAttachmentDescriptor.SourceAlphaBlendFactor: Configures the source-alpha blend factor.
- MTL4RenderPipelineColorAttachmentDescriptor.SetSourceAlphaBlendFactor
- MTL4RenderPipelineColorAttachmentDescriptor.SourceRGBBlendFactor: Configures the source RGB blend factor.
- MTL4RenderPipelineColorAttachmentDescriptor.SetSourceRGBBlendFactor
- MTL4RenderPipelineColorAttachmentDescriptor.WriteMask: Configures the color write mask.
- MTL4RenderPipelineColorAttachmentDescriptor.SetWriteMask
Instance Methods ¶
- MTL4RenderPipelineColorAttachmentDescriptor.Reset: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineColorAttachmentDescriptor
func MTL4RenderPipelineColorAttachmentDescriptorFromID ¶
func MTL4RenderPipelineColorAttachmentDescriptorFromID(id objc.ID) MTL4RenderPipelineColorAttachmentDescriptor
MTL4RenderPipelineColorAttachmentDescriptorFromID constructs a MTL4RenderPipelineColorAttachmentDescriptor from an objc.ID.
func NewMTL4RenderPipelineColorAttachmentDescriptor ¶
func NewMTL4RenderPipelineColorAttachmentDescriptor() MTL4RenderPipelineColorAttachmentDescriptor
NewMTL4RenderPipelineColorAttachmentDescriptor creates a new MTL4RenderPipelineColorAttachmentDescriptor instance.
func (MTL4RenderPipelineColorAttachmentDescriptor) AlphaBlendOperation ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) AlphaBlendOperation() MTLBlendOperation
Configures the alpha blending operation.
Discussion ¶
This property defaults to MTLBlendOperationAdd.
func (MTL4RenderPipelineColorAttachmentDescriptor) Autorelease ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) Autorelease() MTL4RenderPipelineColorAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4RenderPipelineColorAttachmentDescriptor) BlendingState ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) BlendingState() MTL4BlendState
Configure the blend state for color attachments the pipeline state uses.
Discussion ¶
This property’s default value is MTL4BlendStateDisabled.
func (MTL4RenderPipelineColorAttachmentDescriptor) DestinationAlphaBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) DestinationAlphaBlendFactor() MTLBlendFactor
Configures the destination-alpha blend factor.
Discussion ¶
This property defaults to MTLBlendFactorZero.
func (MTL4RenderPipelineColorAttachmentDescriptor) DestinationRGBBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) DestinationRGBBlendFactor() MTLBlendFactor
Configures the destination RGB blend factor.
Discussion ¶
This property defaults to MTLBlendFactorZero.
func (MTL4RenderPipelineColorAttachmentDescriptor) Init ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) Init() MTL4RenderPipelineColorAttachmentDescriptor
Init initializes the instance.
func (MTL4RenderPipelineColorAttachmentDescriptor) PixelFormat ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) PixelFormat() MTLPixelFormat
Configures the pixel format.
Discussion ¶
This property defaults to MTLPixelFormatInvalid.
func (MTL4RenderPipelineColorAttachmentDescriptor) Reset ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) Reset()
Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineColorAttachmentDescriptor/reset()
func (MTL4RenderPipelineColorAttachmentDescriptor) RgbBlendOperation ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) RgbBlendOperation() MTLBlendOperation
Configures the RGB blend operation.
Discussion ¶
This property defaults to MTLBlendOperationAdd.
func (MTL4RenderPipelineColorAttachmentDescriptor) SetAlphaBlendOperation ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetAlphaBlendOperation(value MTLBlendOperation)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetBlendingState ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetBlendingState(value MTL4BlendState)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetDestinationAlphaBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetDestinationAlphaBlendFactor(value MTLBlendFactor)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetDestinationRGBBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetDestinationRGBBlendFactor(value MTLBlendFactor)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetPixelFormat ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetPixelFormat(value MTLPixelFormat)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetRgbBlendOperation ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetRgbBlendOperation(value MTLBlendOperation)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetSourceAlphaBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetSourceAlphaBlendFactor(value MTLBlendFactor)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetSourceRGBBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetSourceRGBBlendFactor(value MTLBlendFactor)
func (MTL4RenderPipelineColorAttachmentDescriptor) SetWriteMask ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SetWriteMask(value MTLColorWriteMask)
func (MTL4RenderPipelineColorAttachmentDescriptor) SourceAlphaBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SourceAlphaBlendFactor() MTLBlendFactor
Configures the source-alpha blend factor.
Discussion ¶
This property defaults to MTLBlendFactorOne.
func (MTL4RenderPipelineColorAttachmentDescriptor) SourceRGBBlendFactor ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) SourceRGBBlendFactor() MTLBlendFactor
Configures the source RGB blend factor.
Discussion ¶
This property defaults to MTLBlendFactorOne.
func (MTL4RenderPipelineColorAttachmentDescriptor) WriteMask ¶
func (m MTL4RenderPipelineColorAttachmentDescriptor) WriteMask() MTLColorWriteMask
Configures the color write mask.
Discussion ¶
This property defaults to MTLColorWriteMaskAll.
type MTL4RenderPipelineColorAttachmentDescriptorArray ¶
type MTL4RenderPipelineColorAttachmentDescriptorArray struct {
objectivec.Object
}
An array of color attachment descriptions for a render pipeline.
Instance Methods ¶
- MTL4RenderPipelineColorAttachmentDescriptorArray.Reset: Resets the elements of the descriptor array
Subscripts ¶
- MTL4RenderPipelineColorAttachmentDescriptorArray.ObjectAtIndexedSubscript: Accesses a color attachment at a specific index.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineColorAttachmentDescriptorArray
func MTL4RenderPipelineColorAttachmentDescriptorArrayFromID ¶
func MTL4RenderPipelineColorAttachmentDescriptorArrayFromID(id objc.ID) MTL4RenderPipelineColorAttachmentDescriptorArray
MTL4RenderPipelineColorAttachmentDescriptorArrayFromID constructs a MTL4RenderPipelineColorAttachmentDescriptorArray from an objc.ID.
An array of color attachment descriptions for a render pipeline.
func NewMTL4RenderPipelineColorAttachmentDescriptorArray ¶
func NewMTL4RenderPipelineColorAttachmentDescriptorArray() MTL4RenderPipelineColorAttachmentDescriptorArray
NewMTL4RenderPipelineColorAttachmentDescriptorArray creates a new MTL4RenderPipelineColorAttachmentDescriptorArray instance.
func (MTL4RenderPipelineColorAttachmentDescriptorArray) Autorelease ¶
func (m MTL4RenderPipelineColorAttachmentDescriptorArray) Autorelease() MTL4RenderPipelineColorAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTL4RenderPipelineColorAttachmentDescriptorArray) Init ¶
func (m MTL4RenderPipelineColorAttachmentDescriptorArray) Init() MTL4RenderPipelineColorAttachmentDescriptorArray
Init initializes the instance.
func (MTL4RenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (m MTL4RenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTL4RenderPipelineColorAttachmentDescriptor
Accesses a color attachment at a specific index.
attachmentIndex: Index of the attachment to access.
func (MTL4RenderPipelineColorAttachmentDescriptorArray) Reset ¶
func (m MTL4RenderPipelineColorAttachmentDescriptorArray) Reset()
Resets the elements of the descriptor array
func (MTL4RenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (m MTL4RenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTL4RenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
Sets an attachment at an index.
attachment: The descriptor of the attachment to set.
attachmentIndex: The index of the attachment within the array.
Discussion ¶
This function offers ‘copy’ semantics.
You can safely set the color attachment at any legal index to nil. This has the effect of resetting that attachment descriptor’s state to its default values.
type MTL4RenderPipelineColorAttachmentDescriptorArrayClass ¶
type MTL4RenderPipelineColorAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTL4RenderPipelineColorAttachmentDescriptorArrayClass ¶
func GetMTL4RenderPipelineColorAttachmentDescriptorArrayClass() MTL4RenderPipelineColorAttachmentDescriptorArrayClass
GetMTL4RenderPipelineColorAttachmentDescriptorArrayClass returns the class object for MTL4RenderPipelineColorAttachmentDescriptorArray.
func (MTL4RenderPipelineColorAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTL4RenderPipelineColorAttachmentDescriptorArrayClass) Alloc() MTL4RenderPipelineColorAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTL4RenderPipelineColorAttachmentDescriptorClass ¶
type MTL4RenderPipelineColorAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4RenderPipelineColorAttachmentDescriptorClass ¶
func GetMTL4RenderPipelineColorAttachmentDescriptorClass() MTL4RenderPipelineColorAttachmentDescriptorClass
GetMTL4RenderPipelineColorAttachmentDescriptorClass returns the class object for MTL4RenderPipelineColorAttachmentDescriptor.
func (MTL4RenderPipelineColorAttachmentDescriptorClass) Alloc ¶
func (mc MTL4RenderPipelineColorAttachmentDescriptorClass) Alloc() MTL4RenderPipelineColorAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4RenderPipelineDescriptor ¶
type MTL4RenderPipelineDescriptor struct {
MTL4PipelineDescriptor
}
Groups together properties to create a render pipeline state object.
Overview ¶
Compared to MTLRenderPipelineDescriptor, this interface doesn’t offer a mechanism to hint to Metal mutability of vertex and fragment buffers. Additionally, using this descriptor, you don’t specify binary archives.
Instance Properties ¶
- MTL4RenderPipelineDescriptor.AlphaToCoverageState: Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
- MTL4RenderPipelineDescriptor.SetAlphaToCoverageState
- MTL4RenderPipelineDescriptor.AlphaToOneState: Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
- MTL4RenderPipelineDescriptor.SetAlphaToOneState
- MTL4RenderPipelineDescriptor.ColorAttachmentMappingState: Configures a logical-to-physical rendering remap state.
- MTL4RenderPipelineDescriptor.SetColorAttachmentMappingState
- MTL4RenderPipelineDescriptor.ColorAttachments: Accesses an array containing descriptions of the color attachments this pipeline writes to.
- MTL4RenderPipelineDescriptor.FragmentFunctionDescriptor: Assigns the shader function that this pipeline executes for each fragment.
- MTL4RenderPipelineDescriptor.SetFragmentFunctionDescriptor
- MTL4RenderPipelineDescriptor.FragmentStaticLinkingDescriptor: Provides static linking information for the fragment stage of the render pipeline.
- MTL4RenderPipelineDescriptor.SetFragmentStaticLinkingDescriptor
- MTL4RenderPipelineDescriptor.InputPrimitiveTopology: Assigns type of primitive topology this pipeline renders.
- MTL4RenderPipelineDescriptor.SetInputPrimitiveTopology
- MTL4RenderPipelineDescriptor.RasterizationEnabled: Determines whether the pipeline rasterizes primitives.
- MTL4RenderPipelineDescriptor.SetRasterizationEnabled
- MTL4RenderPipelineDescriptor.MaxVertexAmplificationCount: Determines the maximum value that can you can pass as the pipeline’s amplification count.
- MTL4RenderPipelineDescriptor.SetMaxVertexAmplificationCount
- MTL4RenderPipelineDescriptor.RasterSampleCount: Controls the number of samples this pipeline applies for each fragment.
- MTL4RenderPipelineDescriptor.SetRasterSampleCount
- MTL4RenderPipelineDescriptor.SupportFragmentBinaryLinking: Indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
- MTL4RenderPipelineDescriptor.SetSupportFragmentBinaryLinking
- MTL4RenderPipelineDescriptor.SupportIndirectCommandBuffers: Indicates whether the pipeline supports indirect command buffers.
- MTL4RenderPipelineDescriptor.SetSupportIndirectCommandBuffers
- MTL4RenderPipelineDescriptor.SupportVertexBinaryLinking: Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the vertex shader function’s callable functions list.
- MTL4RenderPipelineDescriptor.SetSupportVertexBinaryLinking
- MTL4RenderPipelineDescriptor.VertexDescriptor: Configures an optional vertex descriptor for the vertex input.
- MTL4RenderPipelineDescriptor.SetVertexDescriptor
- MTL4RenderPipelineDescriptor.VertexFunctionDescriptor: Assigns the shader function that this pipeline executes for each vertex.
- MTL4RenderPipelineDescriptor.SetVertexFunctionDescriptor
- MTL4RenderPipelineDescriptor.VertexStaticLinkingDescriptor: Provides static linking information for the vertex stage of the render pipeline.
- MTL4RenderPipelineDescriptor.SetVertexStaticLinkingDescriptor
Instance Methods ¶
- MTL4RenderPipelineDescriptor.Reset: Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor
func MTL4RenderPipelineDescriptorFromID ¶
func MTL4RenderPipelineDescriptorFromID(id objc.ID) MTL4RenderPipelineDescriptor
MTL4RenderPipelineDescriptorFromID constructs a MTL4RenderPipelineDescriptor from an objc.ID.
Groups together properties to create a render pipeline state object.
func NewMTL4RenderPipelineDescriptor ¶
func NewMTL4RenderPipelineDescriptor() MTL4RenderPipelineDescriptor
NewMTL4RenderPipelineDescriptor creates a new MTL4RenderPipelineDescriptor instance.
func (MTL4RenderPipelineDescriptor) AlphaToCoverageState ¶
func (m MTL4RenderPipelineDescriptor) AlphaToCoverageState() MTL4AlphaToCoverageState
Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/alphaToCoverageState
func (MTL4RenderPipelineDescriptor) AlphaToOneState ¶
func (m MTL4RenderPipelineDescriptor) AlphaToOneState() MTL4AlphaToOneState
Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/alphaToOneState
func (MTL4RenderPipelineDescriptor) Autorelease ¶
func (m MTL4RenderPipelineDescriptor) Autorelease() MTL4RenderPipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4RenderPipelineDescriptor) ColorAttachmentMappingState ¶
func (m MTL4RenderPipelineDescriptor) ColorAttachmentMappingState() MTL4LogicalToPhysicalColorAttachmentMappingState
Configures a logical-to-physical rendering remap state.
Discussion ¶
Use this property to assign how a MTL4RenderCommandEncoder instance maps the output of your fragment shader to physical color attachments.
func (MTL4RenderPipelineDescriptor) ColorAttachments ¶
func (m MTL4RenderPipelineDescriptor) ColorAttachments() IMTL4RenderPipelineColorAttachmentDescriptorArray
Accesses an array containing descriptions of the color attachments this pipeline writes to.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/colorAttachments
func (MTL4RenderPipelineDescriptor) FragmentFunctionDescriptor ¶
func (m MTL4RenderPipelineDescriptor) FragmentFunctionDescriptor() IMTL4FunctionDescriptor
Assigns the shader function that this pipeline executes for each fragment.
Discussion ¶
When you don’t specify a fragment function, you need to disable rasterization by setting property [RasterizationEnabled] to false.
func (MTL4RenderPipelineDescriptor) FragmentStaticLinkingDescriptor ¶
func (m MTL4RenderPipelineDescriptor) FragmentStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
Provides static linking information for the fragment stage of the render pipeline.
Discussion ¶
Use this property to link extra shader functions to the fragment stage of the render pipeline.
func (MTL4RenderPipelineDescriptor) Init ¶
func (m MTL4RenderPipelineDescriptor) Init() MTL4RenderPipelineDescriptor
Init initializes the instance.
func (MTL4RenderPipelineDescriptor) InputPrimitiveTopology ¶
func (m MTL4RenderPipelineDescriptor) InputPrimitiveTopology() MTLPrimitiveTopologyClass
Assigns type of primitive topology this pipeline renders.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/inputPrimitiveTopology
func (MTL4RenderPipelineDescriptor) MaxVertexAmplificationCount ¶
func (m MTL4RenderPipelineDescriptor) MaxVertexAmplificationCount() uint
Determines the maximum value that can you can pass as the pipeline’s amplification count.
Discussion ¶
This property controls the maximum count you pass to [SetVertexAmplificationCountViewMappings] when using vertex amplification with this pipeline.
func (MTL4RenderPipelineDescriptor) RasterSampleCount ¶
func (m MTL4RenderPipelineDescriptor) RasterSampleCount() uint
Controls the number of samples this pipeline applies for each fragment.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/rasterSampleCount
func (MTL4RenderPipelineDescriptor) RasterizationEnabled ¶
func (m MTL4RenderPipelineDescriptor) RasterizationEnabled() bool
Determines whether the pipeline rasterizes primitives.
Discussion ¶
By default, this value is true, specifying that this pipeline rasterizes primitives. Set this property to false when you don’t provide a fragment shader function via function [FragmentFunctionDescriptor].
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/isRasterizationEnabled
func (MTL4RenderPipelineDescriptor) Reset ¶
func (m MTL4RenderPipelineDescriptor) Reset()
Resets this descriptor to its default state.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/reset()
func (MTL4RenderPipelineDescriptor) SetAlphaToCoverageState ¶
func (m MTL4RenderPipelineDescriptor) SetAlphaToCoverageState(value MTL4AlphaToCoverageState)
func (MTL4RenderPipelineDescriptor) SetAlphaToOneState ¶
func (m MTL4RenderPipelineDescriptor) SetAlphaToOneState(value MTL4AlphaToOneState)
func (MTL4RenderPipelineDescriptor) SetColorAttachmentMappingState ¶
func (m MTL4RenderPipelineDescriptor) SetColorAttachmentMappingState(value MTL4LogicalToPhysicalColorAttachmentMappingState)
func (MTL4RenderPipelineDescriptor) SetFragmentFunctionDescriptor ¶
func (m MTL4RenderPipelineDescriptor) SetFragmentFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4RenderPipelineDescriptor) SetFragmentStaticLinkingDescriptor ¶
func (m MTL4RenderPipelineDescriptor) SetFragmentStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
func (MTL4RenderPipelineDescriptor) SetInputPrimitiveTopology ¶
func (m MTL4RenderPipelineDescriptor) SetInputPrimitiveTopology(value MTLPrimitiveTopologyClass)
func (MTL4RenderPipelineDescriptor) SetMaxVertexAmplificationCount ¶
func (m MTL4RenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
func (MTL4RenderPipelineDescriptor) SetRasterSampleCount ¶
func (m MTL4RenderPipelineDescriptor) SetRasterSampleCount(value uint)
func (MTL4RenderPipelineDescriptor) SetRasterizationEnabled ¶
func (m MTL4RenderPipelineDescriptor) SetRasterizationEnabled(value bool)
func (MTL4RenderPipelineDescriptor) SetSupportFragmentBinaryLinking ¶
func (m MTL4RenderPipelineDescriptor) SetSupportFragmentBinaryLinking(value bool)
func (MTL4RenderPipelineDescriptor) SetSupportIndirectCommandBuffers ¶
func (m MTL4RenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value MTL4IndirectCommandBufferSupportState)
func (MTL4RenderPipelineDescriptor) SetSupportVertexBinaryLinking ¶
func (m MTL4RenderPipelineDescriptor) SetSupportVertexBinaryLinking(value bool)
func (MTL4RenderPipelineDescriptor) SetVertexDescriptor ¶
func (m MTL4RenderPipelineDescriptor) SetVertexDescriptor(value IMTLVertexDescriptor)
func (MTL4RenderPipelineDescriptor) SetVertexFunctionDescriptor ¶
func (m MTL4RenderPipelineDescriptor) SetVertexFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4RenderPipelineDescriptor) SetVertexStaticLinkingDescriptor ¶
func (m MTL4RenderPipelineDescriptor) SetVertexStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
func (MTL4RenderPipelineDescriptor) SupportFragmentBinaryLinking ¶
func (m MTL4RenderPipelineDescriptor) SupportFragmentBinaryLinking() bool
Indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader function’s callable functions list.
func (MTL4RenderPipelineDescriptor) SupportIndirectCommandBuffers ¶
func (m MTL4RenderPipelineDescriptor) SupportIndirectCommandBuffers() MTL4IndirectCommandBufferSupportState
Indicates whether the pipeline supports indirect command buffers.
func (MTL4RenderPipelineDescriptor) SupportVertexBinaryLinking ¶
func (m MTL4RenderPipelineDescriptor) SupportVertexBinaryLinking() bool
Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the vertex shader function’s callable functions list.
func (MTL4RenderPipelineDescriptor) VertexDescriptor ¶
func (m MTL4RenderPipelineDescriptor) VertexDescriptor() IMTLVertexDescriptor
Configures an optional vertex descriptor for the vertex input.
Discussion ¶
A vertex descriptor specifies the layout of your vertex data, allowing your vertex shaders to access the content in your vertex arrays via the `[[stage_in]]` attribute in Metal Shading Language.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDescriptor/vertexDescriptor
func (MTL4RenderPipelineDescriptor) VertexFunctionDescriptor ¶
func (m MTL4RenderPipelineDescriptor) VertexFunctionDescriptor() IMTL4FunctionDescriptor
Assigns the shader function that this pipeline executes for each vertex.
func (MTL4RenderPipelineDescriptor) VertexStaticLinkingDescriptor ¶
func (m MTL4RenderPipelineDescriptor) VertexStaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
Provides static linking information for the vertex stage of the render pipeline.
Discussion ¶
Use this property to link extra shader functions to the vertex stage of the render pipeline.
type MTL4RenderPipelineDescriptorClass ¶
type MTL4RenderPipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4RenderPipelineDescriptorClass ¶
func GetMTL4RenderPipelineDescriptorClass() MTL4RenderPipelineDescriptorClass
GetMTL4RenderPipelineDescriptorClass returns the class object for MTL4RenderPipelineDescriptor.
func (MTL4RenderPipelineDescriptorClass) Alloc ¶
func (mc MTL4RenderPipelineDescriptorClass) Alloc() MTL4RenderPipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4RenderPipelineDynamicLinkingDescriptor ¶
type MTL4RenderPipelineDynamicLinkingDescriptor struct {
objectivec.Object
}
Groups together properties that provide linking properties for render pipelines.
Instance Properties ¶
- MTL4RenderPipelineDynamicLinkingDescriptor.FragmentLinkingDescriptor: Controls properties for linking the fragment stage of the render pipeline.
- MTL4RenderPipelineDynamicLinkingDescriptor.MeshLinkingDescriptor: Controls properties for linking the mesh stage of the render pipeline.
- MTL4RenderPipelineDynamicLinkingDescriptor.ObjectLinkingDescriptor: Controls properties for link the object stage of the render pipeline.
- MTL4RenderPipelineDynamicLinkingDescriptor.TileLinkingDescriptor: Controls properties for linking the tile stage of the render pipeline.
- MTL4RenderPipelineDynamicLinkingDescriptor.VertexLinkingDescriptor: Controls properties for linking the vertex stage of the render pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4RenderPipelineDynamicLinkingDescriptor
func MTL4RenderPipelineDynamicLinkingDescriptorFromID ¶
func MTL4RenderPipelineDynamicLinkingDescriptorFromID(id objc.ID) MTL4RenderPipelineDynamicLinkingDescriptor
MTL4RenderPipelineDynamicLinkingDescriptorFromID constructs a MTL4RenderPipelineDynamicLinkingDescriptor from an objc.ID.
Groups together properties that provide linking properties for render pipelines.
func NewMTL4RenderPipelineDynamicLinkingDescriptor ¶
func NewMTL4RenderPipelineDynamicLinkingDescriptor() MTL4RenderPipelineDynamicLinkingDescriptor
NewMTL4RenderPipelineDynamicLinkingDescriptor creates a new MTL4RenderPipelineDynamicLinkingDescriptor instance.
func (MTL4RenderPipelineDynamicLinkingDescriptor) Autorelease ¶
func (m MTL4RenderPipelineDynamicLinkingDescriptor) Autorelease() MTL4RenderPipelineDynamicLinkingDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4RenderPipelineDynamicLinkingDescriptor) FragmentLinkingDescriptor ¶
func (m MTL4RenderPipelineDynamicLinkingDescriptor) FragmentLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
Controls properties for linking the fragment stage of the render pipeline.
func (MTL4RenderPipelineDynamicLinkingDescriptor) Init ¶
func (m MTL4RenderPipelineDynamicLinkingDescriptor) Init() MTL4RenderPipelineDynamicLinkingDescriptor
Init initializes the instance.
func (MTL4RenderPipelineDynamicLinkingDescriptor) MeshLinkingDescriptor ¶
func (m MTL4RenderPipelineDynamicLinkingDescriptor) MeshLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
Controls properties for linking the mesh stage of the render pipeline.
func (MTL4RenderPipelineDynamicLinkingDescriptor) ObjectLinkingDescriptor ¶
func (m MTL4RenderPipelineDynamicLinkingDescriptor) ObjectLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
Controls properties for link the object stage of the render pipeline.
func (MTL4RenderPipelineDynamicLinkingDescriptor) TileLinkingDescriptor ¶
func (m MTL4RenderPipelineDynamicLinkingDescriptor) TileLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
Controls properties for linking the tile stage of the render pipeline.
func (MTL4RenderPipelineDynamicLinkingDescriptor) VertexLinkingDescriptor ¶
func (m MTL4RenderPipelineDynamicLinkingDescriptor) VertexLinkingDescriptor() IMTL4PipelineStageDynamicLinkingDescriptor
Controls properties for linking the vertex stage of the render pipeline.
type MTL4RenderPipelineDynamicLinkingDescriptorClass ¶
type MTL4RenderPipelineDynamicLinkingDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4RenderPipelineDynamicLinkingDescriptorClass ¶
func GetMTL4RenderPipelineDynamicLinkingDescriptorClass() MTL4RenderPipelineDynamicLinkingDescriptorClass
GetMTL4RenderPipelineDynamicLinkingDescriptorClass returns the class object for MTL4RenderPipelineDynamicLinkingDescriptor.
func (MTL4RenderPipelineDynamicLinkingDescriptorClass) Alloc ¶
func (mc MTL4RenderPipelineDynamicLinkingDescriptorClass) Alloc() MTL4RenderPipelineDynamicLinkingDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4ShaderReflection ¶
type MTL4ShaderReflection int
See: https://developer.apple.com/documentation/Metal/MTL4ShaderReflection
const ( // MTL4ShaderReflectionBindingInfo: Requests reflection information for bindings. MTL4ShaderReflectionBindingInfo MTL4ShaderReflection = 1 // MTL4ShaderReflectionBufferTypeInfo: Requests reflection information for buffer types. MTL4ShaderReflectionBufferTypeInfo MTL4ShaderReflection = 2 // MTL4ShaderReflectionNone: Requests no information. MTL4ShaderReflectionNone MTL4ShaderReflection = 0 )
func (MTL4ShaderReflection) String ¶
func (e MTL4ShaderReflection) String() string
type MTL4SpecializedFunctionDescriptor ¶
type MTL4SpecializedFunctionDescriptor struct {
MTL4FunctionDescriptor
}
Groups together properties to configure and create a specialized function by passing it to a factory method.
Overview ¶
You can pass an instance of this class to any methods that accept a MTL4FunctionDescriptor parameter to provide extra configuration, such as function constants or a name.
Instance Properties ¶
- MTL4SpecializedFunctionDescriptor.ConstantValues: Configures optional function constant values to associate with the function.
- MTL4SpecializedFunctionDescriptor.SetConstantValues
- MTL4SpecializedFunctionDescriptor.FunctionDescriptor: Provides a descriptor that corresponds to a base function that the specialization applies to.
- MTL4SpecializedFunctionDescriptor.SetFunctionDescriptor
- MTL4SpecializedFunctionDescriptor.SpecializedName: Assigns an optional name to the specialized function.
- MTL4SpecializedFunctionDescriptor.SetSpecializedName
See: https://developer.apple.com/documentation/Metal/MTL4SpecializedFunctionDescriptor
func MTL4SpecializedFunctionDescriptorFromID ¶
func MTL4SpecializedFunctionDescriptorFromID(id objc.ID) MTL4SpecializedFunctionDescriptor
MTL4SpecializedFunctionDescriptorFromID constructs a MTL4SpecializedFunctionDescriptor from an objc.ID.
Groups together properties to configure and create a specialized function by passing it to a factory method.
func NewMTL4SpecializedFunctionDescriptor ¶
func NewMTL4SpecializedFunctionDescriptor() MTL4SpecializedFunctionDescriptor
NewMTL4SpecializedFunctionDescriptor creates a new MTL4SpecializedFunctionDescriptor instance.
func (MTL4SpecializedFunctionDescriptor) Autorelease ¶
func (m MTL4SpecializedFunctionDescriptor) Autorelease() MTL4SpecializedFunctionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4SpecializedFunctionDescriptor) ConstantValues ¶
func (m MTL4SpecializedFunctionDescriptor) ConstantValues() IMTLFunctionConstantValues
Configures optional function constant values to associate with the function.
See: https://developer.apple.com/documentation/Metal/MTL4SpecializedFunctionDescriptor/constantValues
func (MTL4SpecializedFunctionDescriptor) FunctionDescriptor ¶
func (m MTL4SpecializedFunctionDescriptor) FunctionDescriptor() IMTL4FunctionDescriptor
Provides a descriptor that corresponds to a base function that the specialization applies to.
See: https://developer.apple.com/documentation/Metal/MTL4SpecializedFunctionDescriptor/functionDescriptor
func (MTL4SpecializedFunctionDescriptor) Init ¶
func (m MTL4SpecializedFunctionDescriptor) Init() MTL4SpecializedFunctionDescriptor
Init initializes the instance.
func (MTL4SpecializedFunctionDescriptor) SetConstantValues ¶
func (m MTL4SpecializedFunctionDescriptor) SetConstantValues(value IMTLFunctionConstantValues)
func (MTL4SpecializedFunctionDescriptor) SetFunctionDescriptor ¶
func (m MTL4SpecializedFunctionDescriptor) SetFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4SpecializedFunctionDescriptor) SetSpecializedName ¶
func (m MTL4SpecializedFunctionDescriptor) SetSpecializedName(value string)
func (MTL4SpecializedFunctionDescriptor) SpecializedName ¶
func (m MTL4SpecializedFunctionDescriptor) SpecializedName() string
Assigns an optional name to the specialized function.
See: https://developer.apple.com/documentation/Metal/MTL4SpecializedFunctionDescriptor/specializedName
type MTL4SpecializedFunctionDescriptorClass ¶
type MTL4SpecializedFunctionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4SpecializedFunctionDescriptorClass ¶
func GetMTL4SpecializedFunctionDescriptorClass() MTL4SpecializedFunctionDescriptorClass
GetMTL4SpecializedFunctionDescriptorClass returns the class object for MTL4SpecializedFunctionDescriptor.
func (MTL4SpecializedFunctionDescriptorClass) Alloc ¶
func (mc MTL4SpecializedFunctionDescriptorClass) Alloc() MTL4SpecializedFunctionDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4StaticLinkingDescriptor ¶
type MTL4StaticLinkingDescriptor struct {
objectivec.Object
}
Groups together properties to drive a static linking process.
Instance Properties ¶
- MTL4StaticLinkingDescriptor.FunctionDescriptors: Provides an array of functions to link at the Metal IR level.
- MTL4StaticLinkingDescriptor.SetFunctionDescriptors
- MTL4StaticLinkingDescriptor.Groups: Assigns groups of functions to match call-site attributes in shader code.
- MTL4StaticLinkingDescriptor.SetGroups
- MTL4StaticLinkingDescriptor.PrivateFunctionDescriptors: Provides an array of private functions to link at the Metal IR level.
- MTL4StaticLinkingDescriptor.SetPrivateFunctionDescriptors
See: https://developer.apple.com/documentation/Metal/MTL4StaticLinkingDescriptor
func MTL4StaticLinkingDescriptorFromID ¶
func MTL4StaticLinkingDescriptorFromID(id objc.ID) MTL4StaticLinkingDescriptor
MTL4StaticLinkingDescriptorFromID constructs a MTL4StaticLinkingDescriptor from an objc.ID.
Groups together properties to drive a static linking process.
func NewMTL4StaticLinkingDescriptor ¶
func NewMTL4StaticLinkingDescriptor() MTL4StaticLinkingDescriptor
NewMTL4StaticLinkingDescriptor creates a new MTL4StaticLinkingDescriptor instance.
func (MTL4StaticLinkingDescriptor) Autorelease ¶
func (m MTL4StaticLinkingDescriptor) Autorelease() MTL4StaticLinkingDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4StaticLinkingDescriptor) FunctionDescriptors ¶
func (m MTL4StaticLinkingDescriptor) FunctionDescriptors() []MTL4FunctionDescriptor
Provides an array of functions to link at the Metal IR level.
See: https://developer.apple.com/documentation/Metal/MTL4StaticLinkingDescriptor/functionDescriptors
func (MTL4StaticLinkingDescriptor) Groups ¶
func (m MTL4StaticLinkingDescriptor) Groups() foundation.INSDictionary
Assigns groups of functions to match call-site attributes in shader code.
Discussion ¶
Function groups help the compiler reduce the number of candidate functions it needs to evaluate for shader function calls, potentially increasing runtime performance.
See: https://developer.apple.com/documentation/Metal/MTL4StaticLinkingDescriptor/groups
func (MTL4StaticLinkingDescriptor) Init ¶
func (m MTL4StaticLinkingDescriptor) Init() MTL4StaticLinkingDescriptor
Init initializes the instance.
func (MTL4StaticLinkingDescriptor) PrivateFunctionDescriptors ¶
func (m MTL4StaticLinkingDescriptor) PrivateFunctionDescriptors() []MTL4FunctionDescriptor
Provides an array of private functions to link at the Metal IR level.
Discussion ¶
You specify private functions to link separately from [FunctionDescriptors] because pipelines don’t export private functions as MTLFunctionHandle instances.
func (MTL4StaticLinkingDescriptor) SetFunctionDescriptors ¶
func (m MTL4StaticLinkingDescriptor) SetFunctionDescriptors(value []MTL4FunctionDescriptor)
func (MTL4StaticLinkingDescriptor) SetGroups ¶
func (m MTL4StaticLinkingDescriptor) SetGroups(value foundation.INSDictionary)
func (MTL4StaticLinkingDescriptor) SetPrivateFunctionDescriptors ¶
func (m MTL4StaticLinkingDescriptor) SetPrivateFunctionDescriptors(value []MTL4FunctionDescriptor)
type MTL4StaticLinkingDescriptorClass ¶
type MTL4StaticLinkingDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4StaticLinkingDescriptorClass ¶
func GetMTL4StaticLinkingDescriptorClass() MTL4StaticLinkingDescriptorClass
GetMTL4StaticLinkingDescriptorClass returns the class object for MTL4StaticLinkingDescriptor.
func (MTL4StaticLinkingDescriptorClass) Alloc ¶
func (mc MTL4StaticLinkingDescriptorClass) Alloc() MTL4StaticLinkingDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4StitchedFunctionDescriptor ¶
type MTL4StitchedFunctionDescriptor struct {
MTL4FunctionDescriptor
}
Groups together properties that describe a shader function suitable for stitching.
Instance Properties ¶
- MTL4StitchedFunctionDescriptor.FunctionDescriptors: Configures an array of function descriptors with references to functions that contribute to the stitching process.
- MTL4StitchedFunctionDescriptor.SetFunctionDescriptors
- MTL4StitchedFunctionDescriptor.FunctionGraph: Sets the graph representing how to stitch functions together.
- MTL4StitchedFunctionDescriptor.SetFunctionGraph
See: https://developer.apple.com/documentation/Metal/MTL4StitchedFunctionDescriptor
func MTL4StitchedFunctionDescriptorFromID ¶
func MTL4StitchedFunctionDescriptorFromID(id objc.ID) MTL4StitchedFunctionDescriptor
MTL4StitchedFunctionDescriptorFromID constructs a MTL4StitchedFunctionDescriptor from an objc.ID.
Groups together properties that describe a shader function suitable for stitching.
func NewMTL4StitchedFunctionDescriptor ¶
func NewMTL4StitchedFunctionDescriptor() MTL4StitchedFunctionDescriptor
NewMTL4StitchedFunctionDescriptor creates a new MTL4StitchedFunctionDescriptor instance.
func (MTL4StitchedFunctionDescriptor) Autorelease ¶
func (m MTL4StitchedFunctionDescriptor) Autorelease() MTL4StitchedFunctionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4StitchedFunctionDescriptor) FunctionDescriptors ¶
func (m MTL4StitchedFunctionDescriptor) FunctionDescriptors() []MTL4FunctionDescriptor
Configures an array of function descriptors with references to functions that contribute to the stitching process.
See: https://developer.apple.com/documentation/Metal/MTL4StitchedFunctionDescriptor/functionDescriptors
func (MTL4StitchedFunctionDescriptor) FunctionGraph ¶
func (m MTL4StitchedFunctionDescriptor) FunctionGraph() IMTLFunctionStitchingGraph
Sets the graph representing how to stitch functions together.
See: https://developer.apple.com/documentation/Metal/MTL4StitchedFunctionDescriptor/functionGraph
func (MTL4StitchedFunctionDescriptor) Init ¶
func (m MTL4StitchedFunctionDescriptor) Init() MTL4StitchedFunctionDescriptor
Init initializes the instance.
func (MTL4StitchedFunctionDescriptor) SetFunctionDescriptors ¶
func (m MTL4StitchedFunctionDescriptor) SetFunctionDescriptors(value []MTL4FunctionDescriptor)
func (MTL4StitchedFunctionDescriptor) SetFunctionGraph ¶
func (m MTL4StitchedFunctionDescriptor) SetFunctionGraph(value IMTLFunctionStitchingGraph)
type MTL4StitchedFunctionDescriptorClass ¶
type MTL4StitchedFunctionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4StitchedFunctionDescriptorClass ¶
func GetMTL4StitchedFunctionDescriptorClass() MTL4StitchedFunctionDescriptorClass
GetMTL4StitchedFunctionDescriptorClass returns the class object for MTL4StitchedFunctionDescriptor.
func (MTL4StitchedFunctionDescriptorClass) Alloc ¶
func (mc MTL4StitchedFunctionDescriptorClass) Alloc() MTL4StitchedFunctionDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4TileRenderPipelineDescriptor ¶
type MTL4TileRenderPipelineDescriptor struct {
MTL4PipelineDescriptor
}
Groups together properties you use to create a tile render pipeline state object.
Instance Properties ¶
- MTL4TileRenderPipelineDescriptor.ColorAttachments: Access an array of descriptors that configure the properties of each color attachment in the tile render pipeline.
- MTL4TileRenderPipelineDescriptor.MaxTotalThreadsPerThreadgroup: Sets the maximum number of threads that the GPU can execute simultaneously within a single threadgroup in the tile render pipeline.
- MTL4TileRenderPipelineDescriptor.SetMaxTotalThreadsPerThreadgroup
- MTL4TileRenderPipelineDescriptor.RasterSampleCount: Configures the number of samples per pixel used for multisampling.
- MTL4TileRenderPipelineDescriptor.SetRasterSampleCount
- MTL4TileRenderPipelineDescriptor.RequiredThreadsPerThreadgroup: Sets the required number of threads per threadgroup for tile dispatches.
- MTL4TileRenderPipelineDescriptor.SetRequiredThreadsPerThreadgroup
- MTL4TileRenderPipelineDescriptor.StaticLinkingDescriptor: Configures an object that contains information about functions to link to the tile render pipeline when Metal builds it.
- MTL4TileRenderPipelineDescriptor.SetStaticLinkingDescriptor
- MTL4TileRenderPipelineDescriptor.SupportBinaryLinking: Indicates whether the pipeline supports linking binary functions.
- MTL4TileRenderPipelineDescriptor.SetSupportBinaryLinking
- MTL4TileRenderPipelineDescriptor.ThreadgroupSizeMatchesTileSize: Indicating whether the size of the threadgroup matches the size of a tile in the render pipeline.
- MTL4TileRenderPipelineDescriptor.SetThreadgroupSizeMatchesTileSize
- MTL4TileRenderPipelineDescriptor.TileFunctionDescriptor: Configures the tile function that the render pipeline executes for each tile in the tile shader stage.
- MTL4TileRenderPipelineDescriptor.SetTileFunctionDescriptor
Instance Methods ¶
- MTL4TileRenderPipelineDescriptor.Reset: Resets the descriptor to the default state.
See: https://developer.apple.com/documentation/Metal/MTL4TileRenderPipelineDescriptor
func MTL4TileRenderPipelineDescriptorFromID ¶
func MTL4TileRenderPipelineDescriptorFromID(id objc.ID) MTL4TileRenderPipelineDescriptor
MTL4TileRenderPipelineDescriptorFromID constructs a MTL4TileRenderPipelineDescriptor from an objc.ID.
Groups together properties you use to create a tile render pipeline state object.
func NewMTL4TileRenderPipelineDescriptor ¶
func NewMTL4TileRenderPipelineDescriptor() MTL4TileRenderPipelineDescriptor
NewMTL4TileRenderPipelineDescriptor creates a new MTL4TileRenderPipelineDescriptor instance.
func (MTL4TileRenderPipelineDescriptor) Autorelease ¶
func (m MTL4TileRenderPipelineDescriptor) Autorelease() MTL4TileRenderPipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTL4TileRenderPipelineDescriptor) ColorAttachments ¶
func (m MTL4TileRenderPipelineDescriptor) ColorAttachments() IMTLTileRenderPipelineColorAttachmentDescriptorArray
Access an array of descriptors that configure the properties of each color attachment in the tile render pipeline.
See: https://developer.apple.com/documentation/Metal/MTL4TileRenderPipelineDescriptor/colorAttachments
func (MTL4TileRenderPipelineDescriptor) Init ¶
func (m MTL4TileRenderPipelineDescriptor) Init() MTL4TileRenderPipelineDescriptor
Init initializes the instance.
func (MTL4TileRenderPipelineDescriptor) MaxTotalThreadsPerThreadgroup ¶
func (m MTL4TileRenderPipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
Sets the maximum number of threads that the GPU can execute simultaneously within a single threadgroup in the tile render pipeline.
func (MTL4TileRenderPipelineDescriptor) RasterSampleCount ¶
func (m MTL4TileRenderPipelineDescriptor) RasterSampleCount() uint
Configures the number of samples per pixel used for multisampling.
See: https://developer.apple.com/documentation/Metal/MTL4TileRenderPipelineDescriptor/rasterSampleCount
func (MTL4TileRenderPipelineDescriptor) RequiredThreadsPerThreadgroup ¶
func (m MTL4TileRenderPipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
Sets the required number of threads per threadgroup for tile dispatches.
Discussion ¶
This value is typically optional, except in the cases where the tile function that [TileFunctionDescriptor] references uses [CooperativeTensors]. In this case, you need to provide a non-zero value to this property.
Additionally, when you set this value, the `threadsPerTile` argument of any tile dispatch needs to match it.
Setting this value to a size of 0 in every dimension disables this property.
func (MTL4TileRenderPipelineDescriptor) Reset ¶
func (m MTL4TileRenderPipelineDescriptor) Reset()
Resets the descriptor to the default state.
See: https://developer.apple.com/documentation/Metal/MTL4TileRenderPipelineDescriptor/reset()
func (MTL4TileRenderPipelineDescriptor) SetMaxTotalThreadsPerThreadgroup ¶
func (m MTL4TileRenderPipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
func (MTL4TileRenderPipelineDescriptor) SetRasterSampleCount ¶
func (m MTL4TileRenderPipelineDescriptor) SetRasterSampleCount(value uint)
func (MTL4TileRenderPipelineDescriptor) SetRequiredThreadsPerThreadgroup ¶
func (m MTL4TileRenderPipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
func (MTL4TileRenderPipelineDescriptor) SetStaticLinkingDescriptor ¶
func (m MTL4TileRenderPipelineDescriptor) SetStaticLinkingDescriptor(value IMTL4StaticLinkingDescriptor)
func (MTL4TileRenderPipelineDescriptor) SetSupportBinaryLinking ¶
func (m MTL4TileRenderPipelineDescriptor) SetSupportBinaryLinking(value bool)
func (MTL4TileRenderPipelineDescriptor) SetThreadgroupSizeMatchesTileSize ¶
func (m MTL4TileRenderPipelineDescriptor) SetThreadgroupSizeMatchesTileSize(value bool)
func (MTL4TileRenderPipelineDescriptor) SetTileFunctionDescriptor ¶
func (m MTL4TileRenderPipelineDescriptor) SetTileFunctionDescriptor(value IMTL4FunctionDescriptor)
func (MTL4TileRenderPipelineDescriptor) StaticLinkingDescriptor ¶
func (m MTL4TileRenderPipelineDescriptor) StaticLinkingDescriptor() IMTL4StaticLinkingDescriptor
Configures an object that contains information about functions to link to the tile render pipeline when Metal builds it.
func (MTL4TileRenderPipelineDescriptor) SupportBinaryLinking ¶
func (m MTL4TileRenderPipelineDescriptor) SupportBinaryLinking() bool
Indicates whether the pipeline supports linking binary functions.
func (MTL4TileRenderPipelineDescriptor) ThreadgroupSizeMatchesTileSize ¶
func (m MTL4TileRenderPipelineDescriptor) ThreadgroupSizeMatchesTileSize() bool
Indicating whether the size of the threadgroup matches the size of a tile in the render pipeline.
func (MTL4TileRenderPipelineDescriptor) TileFunctionDescriptor ¶
func (m MTL4TileRenderPipelineDescriptor) TileFunctionDescriptor() IMTL4FunctionDescriptor
Configures the tile function that the render pipeline executes for each tile in the tile shader stage.
type MTL4TileRenderPipelineDescriptorClass ¶
type MTL4TileRenderPipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTL4TileRenderPipelineDescriptorClass ¶
func GetMTL4TileRenderPipelineDescriptorClass() MTL4TileRenderPipelineDescriptorClass
GetMTL4TileRenderPipelineDescriptorClass returns the class object for MTL4TileRenderPipelineDescriptor.
func (MTL4TileRenderPipelineDescriptorClass) Alloc ¶
func (mc MTL4TileRenderPipelineDescriptorClass) Alloc() MTL4TileRenderPipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTL4TimestampGranularity ¶
type MTL4TimestampGranularity int
See: https://developer.apple.com/documentation/Metal/MTL4TimestampGranularity
const ( // MTL4TimestampGranularityPrecise: A timestamp as precise as possible. MTL4TimestampGranularityPrecise MTL4TimestampGranularity = 1 // MTL4TimestampGranularityRelaxed: A minimally-invasive timestamp which may be less precise. MTL4TimestampGranularityRelaxed MTL4TimestampGranularity = 0 )
func (MTL4TimestampGranularity) String ¶
func (e MTL4TimestampGranularity) String() string
type MTL4TimestampHeapEntry ¶
type MTL4TimestampHeapEntry struct {
Timestamp uint64
}
MTL4TimestampHeapEntry - Represents a timestamp data entry in a counter heap of type MTL4CounterHeapTypeTimestamp.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTL4TimestampHeapEntry
type MTL4UpdateSparseBufferMappingOperation ¶
type MTL4UpdateSparseBufferMappingOperation struct {
BufferRange foundation.NSRange // The range in the buffer, in tiles.
HeapOffset uint // The starting offset in the heap, in tiles.
Mode MTLSparseTextureMappingMode // The mode of the mapping operation to perform.
}
MTL4UpdateSparseBufferMappingOperation - Groups together arguments for an operation to update a sparse buffer mapping.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTL4UpdateSparseBufferMappingOperation
type MTL4UpdateSparseTextureMappingOperation ¶
type MTL4UpdateSparseTextureMappingOperation struct {
HeapOffset uint // The starting offset in the heap, in tiles.
Mode MTLSparseTextureMappingMode // The mode of the mapping operation to perform.
TextureLevel uint // The index of the mipmap level in the texture to update.
TextureRegion MTLRegion // The region in the texture to update, in tiles.
TextureSlice uint // The index of the array slice in the texture to update.
}
MTL4UpdateSparseTextureMappingOperation - Groups together arguments for an operation to update a sparse texture mapping.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTL4UpdateSparseTextureMappingOperation
type MTL4VisibilityOptions ¶
type MTL4VisibilityOptions int
See: https://developer.apple.com/documentation/Metal/MTL4VisibilityOptions
const ( // MTL4VisibilityOptionDevice: Flushes caches to the GPU (device) memory coherence point. MTL4VisibilityOptionDevice MTL4VisibilityOptions = 1 // MTL4VisibilityOptionNone: Don’t flush caches. MTL4VisibilityOptionNone MTL4VisibilityOptions = 0 // MTL4VisibilityOptionResourceAlias: Flushes caches to ensure that aliased virtual addresses are memory consistent. MTL4VisibilityOptionResourceAlias MTL4VisibilityOptions = 2 )
func (MTL4VisibilityOptions) String ¶
func (e MTL4VisibilityOptions) String() string
type MTLAccelerationStructure ¶
type MTLAccelerationStructure interface {
objectivec.IObject
MTLAllocation
MTLResource
// The size of the acceleration structure’s memory allocation, in bytes.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructure/size
Size() uint
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructure/gpuResourceID
GpuResourceID() MTLResourceID
}
A collection of model data for GPU-accelerated intersection of rays with the model.
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructure
type MTLAccelerationStructureBoundingBoxGeometryDescriptor ¶
type MTLAccelerationStructureBoundingBoxGeometryDescriptor struct {
MTLAccelerationStructureGeometryDescriptor
}
A description of a list of bounding boxes to turn into an acceleration structure.
Specifying the number of bounding boxes ¶
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxCount: The number of bounding boxes in the bounding box buffer.
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxCount
Specifying bounding boxes data ¶
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxBuffer: A buffer that contains an array of bounding box structures.
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxBuffer
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxBufferOffset: The offset, in bytes, to the first bounding box in the buffer.
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxBufferOffset
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.BoundingBoxStride: The stride, in bytes, between bounding boxes in the buffer.
- MTLAccelerationStructureBoundingBoxGeometryDescriptor.SetBoundingBoxStride
func MTLAccelerationStructureBoundingBoxGeometryDescriptorFromID ¶
func MTLAccelerationStructureBoundingBoxGeometryDescriptorFromID(id objc.ID) MTLAccelerationStructureBoundingBoxGeometryDescriptor
MTLAccelerationStructureBoundingBoxGeometryDescriptorFromID constructs a MTLAccelerationStructureBoundingBoxGeometryDescriptor from an objc.ID.
A description of a list of bounding boxes to turn into an acceleration structure.
func NewMTLAccelerationStructureBoundingBoxGeometryDescriptor ¶
func NewMTLAccelerationStructureBoundingBoxGeometryDescriptor() MTLAccelerationStructureBoundingBoxGeometryDescriptor
NewMTLAccelerationStructureBoundingBoxGeometryDescriptor creates a new MTLAccelerationStructureBoundingBoxGeometryDescriptor instance.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) Autorelease ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) Autorelease() MTLAccelerationStructureBoundingBoxGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBuffer ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBuffer() MTLBuffer
A buffer that contains an array of bounding box structures.
Discussion ¶
The buffer contains an array of MTLAxisAlignedBoundingBox structures, one for each bounding box in the geometry.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBufferOffset ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxBufferOffset() uint
The offset, in bytes, to the first bounding box in the buffer.
Discussion ¶
The offset needs be a multiple of [BoundingBoxStride], and you need to align it to the platform’s buffer offset alignment.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxCount ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
The number of bounding boxes in the bounding box buffer.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxStride ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
The stride, in bytes, between bounding boxes in the buffer.
Discussion ¶
The stride needs be at least 24 bytes, and be a multiple of 4 bytes. The default value is 24 bytes.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) Init ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) Init() MTLAccelerationStructureBoundingBoxGeometryDescriptor
Init initializes the instance.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBuffer ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBuffer(value MTLBuffer)
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBufferOffset ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxBufferOffset(value uint)
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxCount ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
func (MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxStride ¶
func (a MTLAccelerationStructureBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
type MTLAccelerationStructureBoundingBoxGeometryDescriptorClass ¶
type MTLAccelerationStructureBoundingBoxGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureBoundingBoxGeometryDescriptorClass ¶
func GetMTLAccelerationStructureBoundingBoxGeometryDescriptorClass() MTLAccelerationStructureBoundingBoxGeometryDescriptorClass
GetMTLAccelerationStructureBoundingBoxGeometryDescriptorClass returns the class object for MTLAccelerationStructureBoundingBoxGeometryDescriptor.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureBoundingBoxGeometryDescriptorClass) Alloc() MTLAccelerationStructureBoundingBoxGeometryDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLAccelerationStructureBoundingBoxGeometryDescriptorClass) Descriptor ¶
func (_MTLAccelerationStructureBoundingBoxGeometryDescriptorClass MTLAccelerationStructureBoundingBoxGeometryDescriptorClass) Descriptor() MTLAccelerationStructureBoundingBoxGeometryDescriptor
Creates a new bounding box descriptor.
type MTLAccelerationStructureCommandEncoder ¶
type MTLAccelerationStructureCommandEncoder interface {
objectivec.IObject
MTLCommandEncoder
// Encodes a command to build a new acceleration structure.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/build(accelerationStructure:descriptor:scratchBuffer:scratchBufferOffset:)
BuildAccelerationStructureDescriptorScratchBufferScratchBufferOffset(accelerationStructure MTLAccelerationStructure, descriptor IMTLAccelerationStructureDescriptor, scratchBuffer MTLBuffer, scratchBufferOffset uint)
// Encodes a command to copy the data from one acceleration structure to another.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/copy(sourceAccelerationStructure:destinationAccelerationStructure:)
CopyAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
// Encodes a command to calculate the compacted size of an acceleration structure.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/writeCompactedSize(accelerationStructure:buffer:offset:)
WriteCompactedAccelerationStructureSizeToBufferOffset(accelerationStructure MTLAccelerationStructure, buffer MTLBuffer, offset uint)
// Encodes a command to calculate the compacted size of an acceleration structure, taking into account the size of the output data.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/writeCompactedSize(accelerationStructure:buffer:offset:sizeDataType:)
WriteCompactedAccelerationStructureSizeToBufferOffsetSizeDataType(accelerationStructure MTLAccelerationStructure, buffer MTLBuffer, offset uint, sizeDataType MTLDataType)
// Encodes a command to compact an acceleration structure’s data and copy it into a different acceleration structure.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/copyAndCompact(sourceAccelerationStructure:destinationAccelerationStructure:)
CopyAndCompactAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
// Updates an acceleration structure with new geometry or instance data.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/refit(sourceAccelerationStructure:descriptor:destinationAccelerationStructure:scratchBuffer:scratchBufferOffset:)
RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffset(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTLAccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTLBuffer, scratchBufferOffset uint)
// Updates an acceleration structure with new geometry or instance data, with options that control the refitting process.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/refit(sourceAccelerationStructure:descriptor:destinationAccelerationStructure:scratchBuffer:scratchBufferOffset:options:)
RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffsetOptions(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTLAccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTLBuffer, scratchBufferOffset uint, options MTLAccelerationStructureRefitOptions)
// Encodes a command that instructs the GPU to update a fence after the acceleration structure pass completes.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/updateFence(_:)
UpdateFence(fence MTLFence)
// Encodes a command that instructs the GPU to pause the acceleration structure pass until another pass updates a fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/waitForFence(_:)
WaitForFence(fence MTLFence)
// Makes the resources contained in the specified heap available to the acceleration structure pass.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/useHeap(_:)
UseHeap(heap MTLHeap)
// Makes a resource available to the acceleration structure pass.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/useResource(_:usage:)
UseResourceUsage(resource MTLResource, usage MTLResourceUsage)
// Encodes a command to sample hardware counters at this point in the acceleration structure pass and store the samples into a counter sample buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/sampleCounters(sampleBuffer:sampleIndex:barrier:)
SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
// Specifies that an array of heaps containing resources in an argument buffer can be safely used by the acceleration structure pass.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/useHeaps:count:
UseHeapsCount(heaps []MTLHeap, count uint)
// Specifies that an array of resources in an argument buffer can be safely used by the acceleration structure pass.
//
// See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/useResources:count:usage:
UseResourcesCountUsage(resources []MTLResource, count uint, usage MTLResourceUsage)
}
Encodes commands that build and refit acceleration structures for a single pass.
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder
type MTLAccelerationStructureCommandEncoderObject ¶
type MTLAccelerationStructureCommandEncoderObject struct {
objectivec.Object
}
MTLAccelerationStructureCommandEncoderObject wraps an existing Objective-C object that conforms to the MTLAccelerationStructureCommandEncoder protocol.
func MTLAccelerationStructureCommandEncoderObjectFromID ¶
func MTLAccelerationStructureCommandEncoderObjectFromID(id objc.ID) MTLAccelerationStructureCommandEncoderObject
MTLAccelerationStructureCommandEncoderObjectFromID constructs a MTLAccelerationStructureCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLAccelerationStructureCommandEncoderObject) BarrierAfterQueueStagesBeforeStages ¶
func (o MTLAccelerationStructureCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTLAccelerationStructureCommandEncoderObject) BaseObject ¶
func (o MTLAccelerationStructureCommandEncoderObject) BaseObject() objectivec.Object
func (MTLAccelerationStructureCommandEncoderObject) BuildAccelerationStructureDescriptorScratchBufferScratchBufferOffset ¶
func (o MTLAccelerationStructureCommandEncoderObject) BuildAccelerationStructureDescriptorScratchBufferScratchBufferOffset(accelerationStructure MTLAccelerationStructure, descriptor IMTLAccelerationStructureDescriptor, scratchBuffer MTLBuffer, scratchBufferOffset uint)
Encodes a command to build a new acceleration structure.
accelerationStructure: The acceleration structure to build into.
descriptor: A description of the new acceleration structure.
scratchBuffer: A buffer used to hold data while building the acceleration structure.
scratchBufferOffset: An offset, in, bytes, in the scratch buffer where the scratch memory starts.
Discussion ¶
The destination acceleration structure and the scratch buffer needs enough space in memory to hold the acceleration structure data. Call the [AccelerationStructureSizesWithDescriptor] method on the Metal device object to get the required space.
The resulting acceleration structure contains references to any other acceleration structures referenced by the descriptor, but not any other underlying buffer data. As part of creating the structure, the GPU overwrites data in the scratch buffer.
By default, Metal automatically synchronizes GPU access to the acceleration structure and any resources contained in the acceleration descriptor. For example, you can use a single encoder to build multiple geometry acceleration structures and then build the instanced structure that uses them. Similarly, you can use the acceleration structure in an encoder scheduled after this encoder.
If you are using untracked resources, you are responsible for synchronizing access to any untracked resources, including the acceleration structure. For example, you could use one encoder to build the geometry acceleration structures and update a fence, and a second encoder that waits on the fence and builds the instance acceleration structure.
func (MTLAccelerationStructureCommandEncoderObject) CopyAccelerationStructureToAccelerationStructure ¶
func (o MTLAccelerationStructureCommandEncoderObject) CopyAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
Encodes a command to copy the data from one acceleration structure to another.
sourceAccelerationStructure: The source acceleration structure.
destinationAccelerationStructure: The destination acceleration structure.
Discussion ¶
The destination acceleration structure needs to be at least as large as the source acceleration structure, unless you’re compacting the source acceleration structure. In that case, the destination acceleration structure needs be at least as large as the compact size of the source acceleration structure.
If the source acceleration structure contains references to other acceleration structures, the copy of the acceleration structure also refers to the same child structures.
func (MTLAccelerationStructureCommandEncoderObject) CopyAndCompactAccelerationStructureToAccelerationStructure ¶
func (o MTLAccelerationStructureCommandEncoderObject) CopyAndCompactAccelerationStructureToAccelerationStructure(sourceAccelerationStructure MTLAccelerationStructure, destinationAccelerationStructure MTLAccelerationStructure)
Encodes a command to compact an acceleration structure’s data and copy it into a different acceleration structure.
sourceAccelerationStructure: The source acceleration structure.
destinationAccelerationStructure: The destination acceleration structure.
Discussion ¶
The source and destination acceleration structures can’t overlap in memory. The destination acceleration structure needs to be at least as large as the compact size of the source acceleration structure, which you obtain by using the [WriteCompactedAccelerationStructureSizeToBufferOffset] method.
If the source acceleration structure contains references to other acceleration structures, the copy of the acceleration structure refers to the same child structures.
func (MTLAccelerationStructureCommandEncoderObject) Device ¶
func (o MTLAccelerationStructureCommandEncoderObject) Device() MTLDevice
The Metal device from which the command encoder was created.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
func (MTLAccelerationStructureCommandEncoderObject) EndEncoding ¶
func (o MTLAccelerationStructureCommandEncoderObject) EndEncoding()
Declares that all command generation from the encoder is completed.
Discussion ¶
After `endEncoding` is called, the command encoder has no further use. You cannot encode any other commands with this encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
func (MTLAccelerationStructureCommandEncoderObject) InsertDebugSignpost ¶
func (o MTLAccelerationStructureCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the captured frame data.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
func (MTLAccelerationStructureCommandEncoderObject) Label ¶
func (o MTLAccelerationStructureCommandEncoderObject) Label() string
A string that labels the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
func (MTLAccelerationStructureCommandEncoderObject) PopDebugGroup ¶
func (o MTLAccelerationStructureCommandEncoderObject) PopDebugGroup()
Pops the latest string off of a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
func (MTLAccelerationStructureCommandEncoderObject) PushDebugGroup ¶
func (o MTLAccelerationStructureCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a specific string onto a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
func (MTLAccelerationStructureCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffset ¶
func (o MTLAccelerationStructureCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffset(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTLAccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTLBuffer, scratchBufferOffset uint)
Updates an acceleration structure with new geometry or instance data.
sourceAccelerationStructure: The source acceleration structure.
descriptor: A description of the updated acceleration structure.
destinationAccelerationStructure: The destination to write the new acceleration structure to. Pass the same acceleration structure or `nil` to refit the structure in place.
scratchBuffer: A buffer used to hold data while building the acceleration structure. Pass `nil` if [refitScratchBufferSize] returns zero. // [refitScratchBufferSize]: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureSizes/refitScratchBufferSize
scratchBufferOffset: An offset, in bytes, in the scratch buffer where the scratch memory starts.
Discussion ¶
Use refitting to update an acceleration structure when you make small changes to the underlying geometry. Refitting performs much faster than rebuilding an acceleration structure from scratch. However, ray-tracing performance may degrade, based on how many changes you make to the geometry data.
You can’t use refitting to add or remove geometry in the acceleration structure.
If the source and destination acceleration structures aren’t the same, they can’t overlap in memory. The destination acceleration structure and the scratch buffer need to have enough space in memory to hold the acceleration structure data. Get the minimum amount of space it needs by calling the [AccelerationStructureSizesWithDescriptor] method of the Metal device instance. If you’re compacting the source structure, the destination needs to be at least as large as the compact size of the source acceleration structure.
func (MTLAccelerationStructureCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffsetOptions ¶
func (o MTLAccelerationStructureCommandEncoderObject) RefitAccelerationStructureDescriptorDestinationScratchBufferScratchBufferOffsetOptions(sourceAccelerationStructure MTLAccelerationStructure, descriptor IMTLAccelerationStructureDescriptor, destinationAccelerationStructure MTLAccelerationStructure, scratchBuffer MTLBuffer, scratchBufferOffset uint, options MTLAccelerationStructureRefitOptions)
Updates an acceleration structure with new geometry or instance data, with options that control the refitting process.
sourceAccelerationStructure: The source acceleration structure.
descriptor: A description of the updated acceleration structure.
destinationAccelerationStructure: The destination to write the new acceleration structure to. Pass the same acceleration structure or `nil` to refit the structure in place.
scratchBuffer: A buffer used to hold data while building the acceleration structure. Pass `nil` if [refitScratchBufferSize] returns zero. // [refitScratchBufferSize]: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureSizes/refitScratchBufferSize
scratchBufferOffset: An offset, in bytes, in the scratch buffer where the scratch memory starts.
options: Options that control the refitting process.
Discussion ¶
Use refitting to update an acceleration structure when you make small changes to the underlying geometry. Refitting performs much faster than rebuilding an acceleration structure from scratch. However, ray-tracing performance may degrade, based on how many changes you make to the geometry data.
You can’t use refitting to add or remove geometry in the acceleration structure.
If the source and destination acceleration structures are not the same, they need to avoid overlapping in memory. The destination acceleration structure and the scratch buffer need to have enough space in memory to hold the acceleration structure data. Call the [AccelerationStructureSizesWithDescriptor] method on the Metal device object to get the required space. If you compact the source structure, the destination needs to be at least as large as the compacted size of the source acceleration structure.
func (MTLAccelerationStructureCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier ¶
func (o MTLAccelerationStructureCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
Encodes a command to sample hardware counters at this point in the acceleration structure pass and store the samples into a counter sample buffer.
sampleBuffer: The sample buffer to sample into.
sampleIndex: The index in the counter buffer to write the sample.
barrier: A Boolean value that states whether to insert a barrier before taking the sample.
Discussion ¶
Inserting a barrier ensures that any work you encoded with this encoder is complete before the GPU samples the hardware counters. If you don’t insert a barrier, the GPU can sample the counters concurrently with other commands encoded by this encoder. Using a barrier leads to more repeatable counter results but can negatively impact performance.
Regardless of whether you set a barrier, the GPU doesn’t isolate the sampling from work encoded by other encoders.
func (MTLAccelerationStructureCommandEncoderObject) SetLabel ¶
func (o MTLAccelerationStructureCommandEncoderObject) SetLabel(value string)
func (MTLAccelerationStructureCommandEncoderObject) UpdateFence ¶
func (o MTLAccelerationStructureCommandEncoderObject) UpdateFence(fence MTLFence)
Encodes a command that instructs the GPU to update a fence after the acceleration structure pass completes.
fence: A fence the pass updates after it completes.
Discussion ¶
You can synchronize memory operations of an acceleration structure pass that access resources with an MTLFence. This method instructs the pass to update `fence` after it runs all its memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding an acceleration structure pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFence] method before encoding commands that need to wait for other passes. - Call the [UpdateFence] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
func (MTLAccelerationStructureCommandEncoderObject) UseHeap ¶
func (o MTLAccelerationStructureCommandEncoderObject) UseHeap(heap MTLHeap)
Makes the resources contained in the specified heap available to the acceleration structure pass.
heap: A heap that contains resources within an argument buffer.
Discussion ¶
This method makes all the resources in the heap resident for the duration of a compute pass and ensures that they’re in a format compatible with the compute function.
Call this method before issuing any dispatch calls that may access the resources in the heap.
You can only read or sample resources in the specified heap. This method ignores render targets (textures that specify a [TextureUsageRenderTarget] usage option) and writable textures (textures that specify a [TextureUsageShaderWrite] usage option) within the heap. To use these resources, you need to call the [UseResourceUsage] method instead.
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCommandEncoder/useHeap(_:)
func (MTLAccelerationStructureCommandEncoderObject) UseHeapsCount ¶
func (o MTLAccelerationStructureCommandEncoderObject) UseHeapsCount(heaps []MTLHeap, count uint)
Specifies that an array of heaps containing resources in an argument buffer can be safely used by the acceleration structure pass.
heaps: An array of heaps that contains resources within an argument buffer.
count: The number of heaps in the array.
Discussion ¶
This method makes all the resources in the array of heaps resident for the duration of a compute pass and ensures that they’re in a format compatible with the compute function.
Call this method before issuing any dispatch calls that may access the resources in the array of heaps.
Resources within the specified array of heaps can only be read or sampled from. This method ignores render targets (textures that specify a [TextureUsageRenderTarget] usage option) and writable textures (textures that specify a [TextureUsageShaderWrite] usage option) within the array of heaps. To use these resources, you need to call the [UseResourceUsage] method instead.
func (MTLAccelerationStructureCommandEncoderObject) UseResourceUsage ¶
func (o MTLAccelerationStructureCommandEncoderObject) UseResourceUsage(resource MTLResource, usage MTLResourceUsage)
Makes a resource available to the acceleration structure pass.
resource: A specific resource within an argument buffer.
usage: The options that describe how the compute function uses the resource.
Discussion ¶
This method makes the resource resident for the duration of a compute pass and ensures that it’s in a format compatible with the compute function.
Call this method before issuing any dispatch calls that may access the resource. Calling this method again, or calling [UseHeap], overwrites any previously specified usage options for future dispatch calls within the same compute command encoder.
func (MTLAccelerationStructureCommandEncoderObject) UseResourcesCountUsage ¶
func (o MTLAccelerationStructureCommandEncoderObject) UseResourcesCountUsage(resources []MTLResource, count uint, usage MTLResourceUsage)
Specifies that an array of resources in an argument buffer can be safely used by the acceleration structure pass.
resources: An array of resources within an argument buffer.
count: The number of resource elements in `resources`.
usage: Options that indicate how a GPU function accesses each resource in `resources`.
Discussion ¶
This method makes the array of resources resident for the duration of a compute pass and ensures that it’s in a format compatible with the compute function.
Call this method before issuing any dispatch calls that may access the array of resources. Calling this method again, or calling [UseHeap], overwrites any previously specified usage options for future dispatch calls within the same compute command encoder.
func (MTLAccelerationStructureCommandEncoderObject) WaitForFence ¶
func (o MTLAccelerationStructureCommandEncoderObject) WaitForFence(fence MTLFence)
Encodes a command that instructs the GPU to pause the acceleration structure pass until another pass updates a fence.
fence: A fence that the pass waits for before it runs any of its commands.
Discussion ¶
You can synchronize memory operations of an acceleration structure pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the acceleration structure pass. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding an acceleration structure pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFence] method before encoding commands that need to wait for other passes. - Call the [UpdateFence] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
func (MTLAccelerationStructureCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBufferOffset ¶
func (o MTLAccelerationStructureCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBufferOffset(accelerationStructure MTLAccelerationStructure, buffer MTLBuffer, offset uint)
Encodes a command to calculate the compacted size of an acceleration structure.
accelerationStructure: The acceleration structure to measure.
buffer: The buffer to write the size into.
offset: An offset, in bytes, where the GPU should write the result.
Discussion ¶
The GPU writes the compacted size to the buffer as a 32-bit unsigned integer representing the compacted size in bytes. The compacted size may be smaller than the source acceleration structure.
To compact an acceleration structure, encode a command to get the minimum size. After the command completes, read the size from the buffer and allocate a new acceleration structure with at least that much storage. Then create another encoder and call the [CopyAndCompactAccelerationStructureToAccelerationStructure] method to copy it into the new structure.
func (MTLAccelerationStructureCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBufferOffsetSizeDataType ¶
func (o MTLAccelerationStructureCommandEncoderObject) WriteCompactedAccelerationStructureSizeToBufferOffsetSizeDataType(accelerationStructure MTLAccelerationStructure, buffer MTLBuffer, offset uint, sizeDataType MTLDataType)
Encodes a command to calculate the compacted size of an acceleration structure, taking into account the size of the output data.
accelerationStructure: The acceleration structure to measure.
buffer: The buffer to write the size into.
offset: An offset, in bytes, where the GPU should write the result.
sizeDataType: The data type of the resulting data.
Discussion ¶
The GPU writes the compacted size to the buffer, in bytes, using the `sizeDataType` parameter to determine the size of the output data. The compacted size may be smaller than the source acceleration structure.
To compact an acceleration structure, encode a command to get the minimum size. After the command completes, read the size from the buffer and allocate a new acceleration structure with at least that much storage. Then create another encoder and call the [CopyAndCompactAccelerationStructureToAccelerationStructure] method to copy it into the new structure.
type MTLAccelerationStructureCurveGeometryDescriptor ¶
type MTLAccelerationStructureCurveGeometryDescriptor struct {
MTLAccelerationStructureGeometryDescriptor
}
A descriptor you configure with curve geometry for building acceleration structures.
Instance Properties ¶
- MTLAccelerationStructureCurveGeometryDescriptor.ControlPointBuffer: A buffer that contains curve control points.
- MTLAccelerationStructureCurveGeometryDescriptor.SetControlPointBuffer
- MTLAccelerationStructureCurveGeometryDescriptor.ControlPointBufferOffset: The offset, in bytes, to the control point data in the buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetControlPointBufferOffset
- MTLAccelerationStructureCurveGeometryDescriptor.ControlPointCount: The number of control points in the control point buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetControlPointCount
- MTLAccelerationStructureCurveGeometryDescriptor.ControlPointFormat: The format of the control points in the buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetControlPointFormat
- MTLAccelerationStructureCurveGeometryDescriptor.ControlPointStride: The stride, in bytes, between control points in the buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetControlPointStride
- MTLAccelerationStructureCurveGeometryDescriptor.CurveBasis: The basis function for the curve geometry.
- MTLAccelerationStructureCurveGeometryDescriptor.SetCurveBasis
- MTLAccelerationStructureCurveGeometryDescriptor.CurveEndCaps: An end-cap type for the curves in the geometry.
- MTLAccelerationStructureCurveGeometryDescriptor.SetCurveEndCaps
- MTLAccelerationStructureCurveGeometryDescriptor.CurveType: A curve type for curves in the geometry.
- MTLAccelerationStructureCurveGeometryDescriptor.SetCurveType
- MTLAccelerationStructureCurveGeometryDescriptor.IndexBuffer: A buffer that contains references to control points in the control point buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetIndexBuffer
- MTLAccelerationStructureCurveGeometryDescriptor.IndexBufferOffset: The offset, in bytes, to the index data in the buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetIndexBufferOffset
- MTLAccelerationStructureCurveGeometryDescriptor.IndexType: The size of each index in the index buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetIndexType
- MTLAccelerationStructureCurveGeometryDescriptor.RadiusBuffer: A buffer that contains the curve radius for each control point.
- MTLAccelerationStructureCurveGeometryDescriptor.SetRadiusBuffer
- MTLAccelerationStructureCurveGeometryDescriptor.RadiusBufferOffset: The offset, in bytes, to the radius data in the buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetRadiusBufferOffset
- MTLAccelerationStructureCurveGeometryDescriptor.RadiusFormat: The format of each radius in the radius buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetRadiusFormat
- MTLAccelerationStructureCurveGeometryDescriptor.RadiusStride: The stride, in bytes, between the radius elements in the radius buffer.
- MTLAccelerationStructureCurveGeometryDescriptor.SetRadiusStride
- MTLAccelerationStructureCurveGeometryDescriptor.SegmentControlPointCount: The number of control points in each curve segment.
- MTLAccelerationStructureCurveGeometryDescriptor.SetSegmentControlPointCount
- MTLAccelerationStructureCurveGeometryDescriptor.SegmentCount: The number of curve segments in each curve of the geometry.
- MTLAccelerationStructureCurveGeometryDescriptor.SetSegmentCount
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureCurveGeometryDescriptor
func MTLAccelerationStructureCurveGeometryDescriptorFromID ¶
func MTLAccelerationStructureCurveGeometryDescriptorFromID(id objc.ID) MTLAccelerationStructureCurveGeometryDescriptor
MTLAccelerationStructureCurveGeometryDescriptorFromID constructs a MTLAccelerationStructureCurveGeometryDescriptor from an objc.ID.
A descriptor you configure with curve geometry for building acceleration structures.
func NewMTLAccelerationStructureCurveGeometryDescriptor ¶
func NewMTLAccelerationStructureCurveGeometryDescriptor() MTLAccelerationStructureCurveGeometryDescriptor
NewMTLAccelerationStructureCurveGeometryDescriptor creates a new MTLAccelerationStructureCurveGeometryDescriptor instance.
func (MTLAccelerationStructureCurveGeometryDescriptor) Autorelease ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) Autorelease() MTLAccelerationStructureCurveGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureCurveGeometryDescriptor) ControlPointBuffer ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointBuffer() MTLBuffer
A buffer that contains curve control points.
Discussion ¶
You provide control points in the format that matches the [ControlPointFormat] property. This property needs to have a non-nil value when you build an acceleration structure.
func (MTLAccelerationStructureCurveGeometryDescriptor) ControlPointBufferOffset ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointBufferOffset() uint
The offset, in bytes, to the control point data in the buffer.
Discussion ¶
The offset needs to be a multiple of the format element size you configure with the [ControlPointFormat] property. You also need to align the offset to the platform’s buffer alignment requirement.
func (MTLAccelerationStructureCurveGeometryDescriptor) ControlPointCount ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointCount() uint
The number of control points in the control point buffer.
func (MTLAccelerationStructureCurveGeometryDescriptor) ControlPointFormat ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
The format of the control points in the buffer.
Discussion ¶
The default value is [AttributeFormatFloat3].
func (MTLAccelerationStructureCurveGeometryDescriptor) ControlPointStride ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) ControlPointStride() uint
The stride, in bytes, between control points in the buffer.
Discussion ¶
The stride needs to be a multiple of the format element size you configure with the [ControlPointFormat] property, and at least the format’s size. The default value is `0`, which indicates that the control point elements in the buffer have zero bytes of padding between them.
func (MTLAccelerationStructureCurveGeometryDescriptor) CurveBasis ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
The basis function for the curve geometry.
Discussion ¶
The default value is [CurveBasisBSpline].
func (MTLAccelerationStructureCurveGeometryDescriptor) CurveEndCaps ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
An end-cap type for the curves in the geometry.
Discussion ¶
The default value is [CurveEndCapsNone].
func (MTLAccelerationStructureCurveGeometryDescriptor) CurveType ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) CurveType() MTLCurveType
A curve type for curves in the geometry.
Discussion ¶
The default value is [CurveTypeRound].
func (MTLAccelerationStructureCurveGeometryDescriptor) IndexBuffer ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) IndexBuffer() MTLBuffer
A buffer that contains references to control points in the control point buffer.
Discussion ¶
This property needs to have a non-nil value when you build an acceleration structure.
func (MTLAccelerationStructureCurveGeometryDescriptor) IndexBufferOffset ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) IndexBufferOffset() uint
The offset, in bytes, to the index data in the buffer.
Discussion ¶
The offset needs to be a multiple of the index data type you configure with the [IndexType] property. You also need to align the offset to both the index type’s size and the platform’s buffer alignment requirement.
func (MTLAccelerationStructureCurveGeometryDescriptor) IndexType ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) IndexType() MTLIndexType
The size of each index in the index buffer.
Discussion ¶
Set this property to a value that reflects the size of the indices in the [IndexBuffer] property, such as [IndexTypeUInt16] or [IndexTypeUInt32].
func (MTLAccelerationStructureCurveGeometryDescriptor) Init ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) Init() MTLAccelerationStructureCurveGeometryDescriptor
Init initializes the instance.
func (MTLAccelerationStructureCurveGeometryDescriptor) RadiusBuffer ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusBuffer() MTLBuffer
A buffer that contains the curve radius for each control point.
Discussion ¶
The buffer contains values that are greater than or equal to `0.0` in the format you configure with the [RadiusFormat] property. This property needs to have a non-nil value when you build an acceleration structure.
func (MTLAccelerationStructureCurveGeometryDescriptor) RadiusBufferOffset ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusBufferOffset() uint
The offset, in bytes, to the radius data in the buffer.
Discussion ¶
The offset needs to be a multiple of the radius format you configure with the [RadiusFormat] property. You also need to align the offset to both the radius format’s size and the platform’s buffer alignment requirement.
func (MTLAccelerationStructureCurveGeometryDescriptor) RadiusFormat ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
The format of each radius in the radius buffer.
Discussion ¶
The property’s default value is [AttributeFormatFloat].
func (MTLAccelerationStructureCurveGeometryDescriptor) RadiusStride ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) RadiusStride() uint
The stride, in bytes, between the radius elements in the radius buffer.
Discussion ¶
The stride needs to be a multiple of the radius format size you configure with the [RadiusFormat] property. The default value is `0`, which indicates that the radius elements in the buffer have zero bytes of padding between them.
func (MTLAccelerationStructureCurveGeometryDescriptor) SegmentControlPointCount ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SegmentControlPointCount() uint
The number of control points in each curve segment.
Discussion ¶
This value can be `2`, `3`, or `4`.
func (MTLAccelerationStructureCurveGeometryDescriptor) SegmentCount ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SegmentCount() uint
The number of curve segments in each curve of the geometry.
func (MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointBuffer ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointBuffer(value MTLBuffer)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointBufferOffset ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointBufferOffset(value uint)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointCount ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointCount(value uint)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointFormat ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointStride ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetControlPointStride(value uint)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetCurveBasis ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetCurveEndCaps ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetCurveType ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetIndexBuffer ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetIndexBufferOffset ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetIndexBufferOffset(value uint)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetIndexType ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusBuffer ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusBuffer(value MTLBuffer)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusBufferOffset ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusBufferOffset(value uint)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusFormat ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusStride ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetRadiusStride(value uint)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetSegmentControlPointCount ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
func (MTLAccelerationStructureCurveGeometryDescriptor) SetSegmentCount ¶
func (a MTLAccelerationStructureCurveGeometryDescriptor) SetSegmentCount(value uint)
type MTLAccelerationStructureCurveGeometryDescriptorClass ¶
type MTLAccelerationStructureCurveGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureCurveGeometryDescriptorClass ¶
func GetMTLAccelerationStructureCurveGeometryDescriptorClass() MTLAccelerationStructureCurveGeometryDescriptorClass
GetMTLAccelerationStructureCurveGeometryDescriptorClass returns the class object for MTLAccelerationStructureCurveGeometryDescriptor.
func (MTLAccelerationStructureCurveGeometryDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureCurveGeometryDescriptorClass) Alloc() MTLAccelerationStructureCurveGeometryDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLAccelerationStructureCurveGeometryDescriptorClass) Descriptor ¶
func (_MTLAccelerationStructureCurveGeometryDescriptorClass MTLAccelerationStructureCurveGeometryDescriptorClass) Descriptor() MTLAccelerationStructureCurveGeometryDescriptor
Creates a curve geometry descriptor.
type MTLAccelerationStructureDescriptor ¶
type MTLAccelerationStructureDescriptor struct {
objectivec.Object
}
A base class for classes that define the configuration for a new acceleration structure.
Overview ¶
This is the base class for other acceleration structure descriptors. Don’t use this class directly. Use one of the derived classes instead, as MTLAccelerationStructure describes.
Specifying usage options ¶
- MTLAccelerationStructureDescriptor.Usage: The options that describe how you intend to use the acceleration structure.
- MTLAccelerationStructureDescriptor.SetUsage
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureDescriptor
func MTLAccelerationStructureDescriptorFromID ¶
func MTLAccelerationStructureDescriptorFromID(id objc.ID) MTLAccelerationStructureDescriptor
MTLAccelerationStructureDescriptorFromID constructs a MTLAccelerationStructureDescriptor from an objc.ID.
A base class for classes that define the configuration for a new acceleration structure.
func NewMTLAccelerationStructureDescriptor ¶
func NewMTLAccelerationStructureDescriptor() MTLAccelerationStructureDescriptor
NewMTLAccelerationStructureDescriptor creates a new MTLAccelerationStructureDescriptor instance.
func (MTLAccelerationStructureDescriptor) Autorelease ¶
func (a MTLAccelerationStructureDescriptor) Autorelease() MTLAccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureDescriptor) Init ¶
func (a MTLAccelerationStructureDescriptor) Init() MTLAccelerationStructureDescriptor
Init initializes the instance.
func (MTLAccelerationStructureDescriptor) SetUsage ¶
func (a MTLAccelerationStructureDescriptor) SetUsage(value MTLAccelerationStructureUsage)
func (MTLAccelerationStructureDescriptor) Usage ¶
func (a MTLAccelerationStructureDescriptor) Usage() MTLAccelerationStructureUsage
The options that describe how you intend to use the acceleration structure.
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureDescriptor/usage
type MTLAccelerationStructureDescriptorClass ¶
type MTLAccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureDescriptorClass ¶
func GetMTLAccelerationStructureDescriptorClass() MTLAccelerationStructureDescriptorClass
GetMTLAccelerationStructureDescriptorClass returns the class object for MTLAccelerationStructureDescriptor.
func (MTLAccelerationStructureDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureDescriptorClass) Alloc() MTLAccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
type MTLAccelerationStructureGeometryDescriptor ¶
type MTLAccelerationStructureGeometryDescriptor struct {
objectivec.Object
}
A base class for descriptors that contain geometry data to convert into a ray-tracing acceleration structure.
Overview ¶
Don’t use this base class directly. Use one of the derived classes instead, as MTLAccelerationStructure describes.
Specifying base geometry properties ¶
- MTLAccelerationStructureGeometryDescriptor.Label: A label for the geometry structure, suitable for debugging.
- MTLAccelerationStructureGeometryDescriptor.SetLabel
- MTLAccelerationStructureGeometryDescriptor.IntersectionFunctionTableOffset: An index into the intersection table for determining which intersection function Metal calls when it intersects a ray with the acceleration structure.
- MTLAccelerationStructureGeometryDescriptor.SetIntersectionFunctionTableOffset
- MTLAccelerationStructureGeometryDescriptor.Opaque: A Boolean value that determines whether the geometry data in the acceleration structure needs to skip triangle-intersection tests.
- MTLAccelerationStructureGeometryDescriptor.SetOpaque
- MTLAccelerationStructureGeometryDescriptor.AllowDuplicateIntersectionFunctionInvocation: A Boolean value that indicates whether Metal calls the ray-intersection test more than once per primitive on the structure.
- MTLAccelerationStructureGeometryDescriptor.SetAllowDuplicateIntersectionFunctionInvocation
Instance Properties ¶
- MTLAccelerationStructureGeometryDescriptor.PrimitiveDataBuffer
- MTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataBuffer
- MTLAccelerationStructureGeometryDescriptor.PrimitiveDataBufferOffset
- MTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataBufferOffset
- MTLAccelerationStructureGeometryDescriptor.PrimitiveDataElementSize
- MTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataElementSize
- MTLAccelerationStructureGeometryDescriptor.PrimitiveDataStride
- MTLAccelerationStructureGeometryDescriptor.SetPrimitiveDataStride
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureGeometryDescriptor
func MTLAccelerationStructureGeometryDescriptorFromID ¶
func MTLAccelerationStructureGeometryDescriptorFromID(id objc.ID) MTLAccelerationStructureGeometryDescriptor
MTLAccelerationStructureGeometryDescriptorFromID constructs a MTLAccelerationStructureGeometryDescriptor from an objc.ID.
A base class for descriptors that contain geometry data to convert into a ray-tracing acceleration structure.
func NewMTLAccelerationStructureGeometryDescriptor ¶
func NewMTLAccelerationStructureGeometryDescriptor() MTLAccelerationStructureGeometryDescriptor
NewMTLAccelerationStructureGeometryDescriptor creates a new MTLAccelerationStructureGeometryDescriptor instance.
func (MTLAccelerationStructureGeometryDescriptor) AllowDuplicateIntersectionFunctionInvocation ¶
func (a MTLAccelerationStructureGeometryDescriptor) AllowDuplicateIntersectionFunctionInvocation() bool
A Boolean value that indicates whether Metal calls the ray-intersection test more than once per primitive on the structure.
func (MTLAccelerationStructureGeometryDescriptor) Autorelease ¶
func (a MTLAccelerationStructureGeometryDescriptor) Autorelease() MTLAccelerationStructureGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureGeometryDescriptor) Init ¶
func (a MTLAccelerationStructureGeometryDescriptor) Init() MTLAccelerationStructureGeometryDescriptor
Init initializes the instance.
func (MTLAccelerationStructureGeometryDescriptor) IntersectionFunctionTableOffset ¶
func (a MTLAccelerationStructureGeometryDescriptor) IntersectionFunctionTableOffset() uint
An index into the intersection table for determining which intersection function Metal calls when it intersects a ray with the acceleration structure.
func (MTLAccelerationStructureGeometryDescriptor) Label ¶
func (a MTLAccelerationStructureGeometryDescriptor) Label() string
A label for the geometry structure, suitable for debugging.
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureGeometryDescriptor/label
func (MTLAccelerationStructureGeometryDescriptor) Opaque ¶
func (a MTLAccelerationStructureGeometryDescriptor) Opaque() bool
A Boolean value that determines whether the geometry data in the acceleration structure needs to skip triangle-intersection tests.
Discussion ¶
By default, after Metal finds an intersection between a ray and a primitive, it runs your specified intersection function to determine whether the ray actually hit the primitive. If you specify that triangle geometry is opaque, Metal skips the intersection function and processes any intersection as a hit.
If you are using bounding box geometry, Metal calls your intersection function, passing a Boolean value that indicates that the bounding box that the ray intersected with is opaque.
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureGeometryDescriptor/opaque
func (MTLAccelerationStructureGeometryDescriptor) PrimitiveDataBuffer ¶
func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataBuffer() MTLBuffer
func (MTLAccelerationStructureGeometryDescriptor) PrimitiveDataBufferOffset ¶
func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataBufferOffset() uint
func (MTLAccelerationStructureGeometryDescriptor) PrimitiveDataElementSize ¶
func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataElementSize() uint
func (MTLAccelerationStructureGeometryDescriptor) PrimitiveDataStride ¶
func (a MTLAccelerationStructureGeometryDescriptor) PrimitiveDataStride() uint
func (MTLAccelerationStructureGeometryDescriptor) SetAllowDuplicateIntersectionFunctionInvocation ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetAllowDuplicateIntersectionFunctionInvocation(value bool)
func (MTLAccelerationStructureGeometryDescriptor) SetIntersectionFunctionTableOffset ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetIntersectionFunctionTableOffset(value uint)
func (MTLAccelerationStructureGeometryDescriptor) SetLabel ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetLabel(value string)
func (MTLAccelerationStructureGeometryDescriptor) SetOpaque ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetOpaque(value bool)
func (MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataBuffer ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataBuffer(value MTLBuffer)
func (MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataBufferOffset ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataBufferOffset(value uint)
func (MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataElementSize ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataElementSize(value uint)
func (MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataStride ¶
func (a MTLAccelerationStructureGeometryDescriptor) SetPrimitiveDataStride(value uint)
type MTLAccelerationStructureGeometryDescriptorClass ¶
type MTLAccelerationStructureGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureGeometryDescriptorClass ¶
func GetMTLAccelerationStructureGeometryDescriptorClass() MTLAccelerationStructureGeometryDescriptorClass
GetMTLAccelerationStructureGeometryDescriptorClass returns the class object for MTLAccelerationStructureGeometryDescriptor.
func (MTLAccelerationStructureGeometryDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureGeometryDescriptorClass) Alloc() MTLAccelerationStructureGeometryDescriptor
Alloc allocates memory for a new instance of the class.
type MTLAccelerationStructureInstanceDescriptor ¶
type MTLAccelerationStructureInstanceDescriptor struct {
AccelerationStructureIndex uint32 // The index of the acceleration structure to use for the instance.
TransformationMatrix MTLPackedFloat4x3 // The transform for placing and orienting the instance in the scene.
IntersectionFunctionTableOffset uint32 // An offset for determining which function in the intersection function table Metal needs to call when testing a ray against the instance.
Options MTLAccelerationStructureInstanceOptions // The options for the instance.
Mask uint32 // A mask to use for the instance when testing a ray against the geometry.
}
MTLAccelerationStructureInstanceDescriptor - A description of an instance in an instanced geometry acceleration structure.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureInstanceDescriptor
type MTLAccelerationStructureInstanceDescriptorType ¶
type MTLAccelerationStructureInstanceDescriptorType int
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureInstanceDescriptorType
const ( // MTLAccelerationStructureInstanceDescriptorTypeDefault: An option specifying that the instance uses the default characteristics. MTLAccelerationStructureInstanceDescriptorTypeDefault MTLAccelerationStructureInstanceDescriptorType = 0 // MTLAccelerationStructureInstanceDescriptorTypeIndirect: An option that enables an instance descriptor memory layout the GPU can populate. MTLAccelerationStructureInstanceDescriptorTypeIndirect MTLAccelerationStructureInstanceDescriptorType = 3 // MTLAccelerationStructureInstanceDescriptorTypeIndirectMotion: An option specifying that the instance contains motion data, and enables using an instance descriptor memory layout that the GPU can populate. MTLAccelerationStructureInstanceDescriptorTypeIndirectMotion MTLAccelerationStructureInstanceDescriptorType = 4 // MTLAccelerationStructureInstanceDescriptorTypeMotion: An option specifying that the instance contains motion data. MTLAccelerationStructureInstanceDescriptorTypeMotion MTLAccelerationStructureInstanceDescriptorType = 2 // MTLAccelerationStructureInstanceDescriptorTypeUserID: An option specifying that the instance contains a user identifier. MTLAccelerationStructureInstanceDescriptorTypeUserID MTLAccelerationStructureInstanceDescriptorType = 1 )
func (MTLAccelerationStructureInstanceDescriptorType) String ¶
func (e MTLAccelerationStructureInstanceDescriptorType) String() string
type MTLAccelerationStructureInstanceOptions ¶
type MTLAccelerationStructureInstanceOptions int
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureInstanceOptions
const ( // MTLAccelerationStructureInstanceOptionDisableTriangleCulling: An option that turns off culling for this instance if ray intersector has culling enabled. MTLAccelerationStructureInstanceOptionDisableTriangleCulling MTLAccelerationStructureInstanceOptions = 1 // MTLAccelerationStructureInstanceOptionNonOpaque: Specifies that intersectors should treat the instance as non-opaque. MTLAccelerationStructureInstanceOptionNonOpaque MTLAccelerationStructureInstanceOptions = 8 // MTLAccelerationStructureInstanceOptionNone: Specifies the default behavior for resulting acceleration structure. MTLAccelerationStructureInstanceOptionNone MTLAccelerationStructureInstanceOptions = 0 // MTLAccelerationStructureInstanceOptionOpaque: Specifies that intersectors should treat the instance as opaque. MTLAccelerationStructureInstanceOptionOpaque MTLAccelerationStructureInstanceOptions = 4 // MTLAccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise: Specifies that the instance specifies front facing triangles in counter-clockwise order. MTLAccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise MTLAccelerationStructureInstanceOptions = 2 )
func (MTLAccelerationStructureInstanceOptions) String ¶
func (e MTLAccelerationStructureInstanceOptions) String() string
type MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor ¶
type MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor struct {
MTLAccelerationStructureGeometryDescriptor
}
A description of a list of bounding boxes, as motion keyframe data, to turn into an acceleration structure.
Specifying the number of bounding boxes ¶
- MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxCount: The number of bounding boxes in each bounding box buffer.
- MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxCount
Specifying bounding boxes data ¶
- MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxBuffers: A array of motion keyframes, each containing bounding box data.
- MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxBuffers
- MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.BoundingBoxStride: The stride, in bytes, between bounding boxes in each buffer.
- MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.SetBoundingBoxStride
func MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorFromID ¶
func MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorFromID(id objc.ID) MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorFromID constructs a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor from an objc.ID.
A description of a list of bounding boxes, as motion keyframe data, to turn into an acceleration structure.
func NewMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor ¶
func NewMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
NewMTLAccelerationStructureMotionBoundingBoxGeometryDescriptor creates a new MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor instance.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) Autorelease ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) Autorelease() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxBuffers ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxBuffers() []MTLMotionKeyframeData
A array of motion keyframes, each containing bounding box data.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxCount ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxCount() uint
The number of bounding boxes in each bounding box buffer.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxStride ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) BoundingBoxStride() uint
The stride, in bytes, between bounding boxes in each buffer.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) Init ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) Init() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
Init initializes the instance.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxBuffers ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxBuffers(value []MTLMotionKeyframeData)
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxCount ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxCount(value uint)
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxStride ¶
func (a MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor) SetBoundingBoxStride(value uint)
type MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass ¶
type MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass ¶
func GetMTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass
GetMTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass returns the class object for MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Alloc() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Descriptor ¶
func (_MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass MTLAccelerationStructureMotionBoundingBoxGeometryDescriptorClass) Descriptor() MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor
Creates a new bounding box descriptor.
type MTLAccelerationStructureMotionCurveGeometryDescriptor ¶
type MTLAccelerationStructureMotionCurveGeometryDescriptor struct {
MTLAccelerationStructureGeometryDescriptor
}
Instance Properties ¶
- MTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointBuffers
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointBuffers
- MTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointCount
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointCount
- MTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointFormat
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointFormat
- MTLAccelerationStructureMotionCurveGeometryDescriptor.ControlPointStride
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetControlPointStride
- MTLAccelerationStructureMotionCurveGeometryDescriptor.CurveBasis
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetCurveBasis
- MTLAccelerationStructureMotionCurveGeometryDescriptor.CurveEndCaps
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetCurveEndCaps
- MTLAccelerationStructureMotionCurveGeometryDescriptor.CurveType
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetCurveType
- MTLAccelerationStructureMotionCurveGeometryDescriptor.IndexBuffer
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetIndexBuffer
- MTLAccelerationStructureMotionCurveGeometryDescriptor.IndexBufferOffset
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetIndexBufferOffset
- MTLAccelerationStructureMotionCurveGeometryDescriptor.IndexType
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetIndexType
- MTLAccelerationStructureMotionCurveGeometryDescriptor.RadiusBuffers
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetRadiusBuffers
- MTLAccelerationStructureMotionCurveGeometryDescriptor.RadiusFormat
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetRadiusFormat
- MTLAccelerationStructureMotionCurveGeometryDescriptor.RadiusStride
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetRadiusStride
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SegmentControlPointCount
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetSegmentControlPointCount
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SegmentCount
- MTLAccelerationStructureMotionCurveGeometryDescriptor.SetSegmentCount
func MTLAccelerationStructureMotionCurveGeometryDescriptorFromID ¶
func MTLAccelerationStructureMotionCurveGeometryDescriptorFromID(id objc.ID) MTLAccelerationStructureMotionCurveGeometryDescriptor
MTLAccelerationStructureMotionCurveGeometryDescriptorFromID constructs a MTLAccelerationStructureMotionCurveGeometryDescriptor from an objc.ID.
func NewMTLAccelerationStructureMotionCurveGeometryDescriptor ¶
func NewMTLAccelerationStructureMotionCurveGeometryDescriptor() MTLAccelerationStructureMotionCurveGeometryDescriptor
NewMTLAccelerationStructureMotionCurveGeometryDescriptor creates a new MTLAccelerationStructureMotionCurveGeometryDescriptor instance.
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) Autorelease ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) Autorelease() MTLAccelerationStructureMotionCurveGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointBuffers ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointBuffers() []MTLMotionKeyframeData
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointCount ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointCount() uint
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointFormat ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointFormat() MTLAttributeFormat
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointStride ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) ControlPointStride() uint
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveBasis ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveBasis() MTLCurveBasis
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveEndCaps ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveEndCaps() MTLCurveEndCaps
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveType ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) CurveType() MTLCurveType
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexBuffer ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexBuffer() MTLBuffer
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexBufferOffset ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexBufferOffset() uint
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexType ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) IndexType() MTLIndexType
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) Init ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) Init() MTLAccelerationStructureMotionCurveGeometryDescriptor
Init initializes the instance.
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusBuffers ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusBuffers() []MTLMotionKeyframeData
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusFormat ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusFormat() MTLAttributeFormat
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusStride ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) RadiusStride() uint
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SegmentControlPointCount ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SegmentControlPointCount() uint
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SegmentCount ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SegmentCount() uint
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointBuffers ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointBuffers(value []MTLMotionKeyframeData)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointCount ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointCount(value uint)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointFormat ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointFormat(value MTLAttributeFormat)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointStride ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetControlPointStride(value uint)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveBasis ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveBasis(value MTLCurveBasis)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveEndCaps ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveEndCaps(value MTLCurveEndCaps)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveType ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetCurveType(value MTLCurveType)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexBuffer ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexBufferOffset ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexBufferOffset(value uint)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexType ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusBuffers ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusBuffers(value []MTLMotionKeyframeData)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusFormat ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusFormat(value MTLAttributeFormat)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusStride ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetRadiusStride(value uint)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetSegmentControlPointCount ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetSegmentControlPointCount(value uint)
func (MTLAccelerationStructureMotionCurveGeometryDescriptor) SetSegmentCount ¶
func (a MTLAccelerationStructureMotionCurveGeometryDescriptor) SetSegmentCount(value uint)
type MTLAccelerationStructureMotionCurveGeometryDescriptorClass ¶
type MTLAccelerationStructureMotionCurveGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureMotionCurveGeometryDescriptorClass ¶
func GetMTLAccelerationStructureMotionCurveGeometryDescriptorClass() MTLAccelerationStructureMotionCurveGeometryDescriptorClass
GetMTLAccelerationStructureMotionCurveGeometryDescriptorClass returns the class object for MTLAccelerationStructureMotionCurveGeometryDescriptor.
func (MTLAccelerationStructureMotionCurveGeometryDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureMotionCurveGeometryDescriptorClass) Alloc() MTLAccelerationStructureMotionCurveGeometryDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLAccelerationStructureMotionCurveGeometryDescriptorClass) Descriptor ¶
func (_MTLAccelerationStructureMotionCurveGeometryDescriptorClass MTLAccelerationStructureMotionCurveGeometryDescriptorClass) Descriptor() MTLAccelerationStructureMotionCurveGeometryDescriptor
type MTLAccelerationStructureMotionInstanceDescriptor ¶
type MTLAccelerationStructureMotionInstanceDescriptor struct {
AccelerationStructureIndex uint32 // The index of an acceleration structure which applies to the next acceleration-structure motion instance you create with the descriptor.
MotionStartTime float32 // A starting time for the range of motion that the key-frame data represents.
MotionEndTime float32 // An ending time for the range of motion that the key-frame data represents.
MotionStartBorderMode MTLMotionBorderMode // A behavior that configures how a motion instance handles timestamps before a starting time.
MotionEndBorderMode MTLMotionBorderMode // A behavior that configures how a motion instance handles timestamps after an ending time.
MotionTransformsStartIndex uint32 // The index of motion data that represents the first key-frame motion data, which applies to the next acceleration-structure motion instance you create with the descriptor.
MotionTransformsCount uint32 // The number of motion data key-frames, which applies to the next acceleration-structure motion instance you create with the descriptor.
IntersectionFunctionTableOffset uint32 // An offset into the intersection-function table for ray tracing, which applies to the next acceleration-structure motion instance you create with the descriptor.
Options MTLAccelerationStructureInstanceOptions // An option set which applies to the next acceleration structure motion-instance you create with the descriptor.
Mask uint32 // A mask for testing ray-tracing rays with a scene’s geometry, which applies to the next acceleration-structure motion instance you create with the descriptor.
UserID uint32 // An unique identifier, which applies to the next acceleration-structure motion instance you create with the descriptor.
}
MTLAccelerationStructureMotionInstanceDescriptor - A description of an instance in an instanced geometry acceleration structure, with the instance including a user identifier and motion data for the instance.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureMotionInstanceDescriptor
type MTLAccelerationStructureMotionTriangleGeometryDescriptor ¶
type MTLAccelerationStructureMotionTriangleGeometryDescriptor struct {
MTLAccelerationStructureGeometryDescriptor
}
A description of a list of triangle primitives, as motion keyframe data, to turn into an acceleration structure.
Specifying the number of triangles ¶
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.TriangleCount: The number of triangles in the buffers.
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTriangleCount
Specifying index data ¶
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.IndexBuffer: A buffer that contains indices for the vertices that compose the triangle list.
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetIndexBuffer
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.IndexType: The data type of indices in the index buffer.
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetIndexType
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.IndexBufferOffset: The offset, in bytes, to the first index in the buffer.
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetIndexBufferOffset
Specifying vertex data ¶
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.VertexBuffers: An array of motion keyframes, each containing triangle data.
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetVertexBuffers
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.VertexStride: The stride, in bytes, between vertices in each vertex buffer.
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetVertexStride
Instance Properties ¶
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixBuffer
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixBuffer
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixBufferOffset
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixBufferOffset
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.TransformationMatrixLayout
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetTransformationMatrixLayout
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.VertexFormat
- MTLAccelerationStructureMotionTriangleGeometryDescriptor.SetVertexFormat
func MTLAccelerationStructureMotionTriangleGeometryDescriptorFromID ¶
func MTLAccelerationStructureMotionTriangleGeometryDescriptorFromID(id objc.ID) MTLAccelerationStructureMotionTriangleGeometryDescriptor
MTLAccelerationStructureMotionTriangleGeometryDescriptorFromID constructs a MTLAccelerationStructureMotionTriangleGeometryDescriptor from an objc.ID.
A description of a list of triangle primitives, as motion keyframe data, to turn into an acceleration structure.
func NewMTLAccelerationStructureMotionTriangleGeometryDescriptor ¶
func NewMTLAccelerationStructureMotionTriangleGeometryDescriptor() MTLAccelerationStructureMotionTriangleGeometryDescriptor
NewMTLAccelerationStructureMotionTriangleGeometryDescriptor creates a new MTLAccelerationStructureMotionTriangleGeometryDescriptor instance.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) Autorelease ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) Autorelease() MTLAccelerationStructureMotionTriangleGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexBuffer ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexBuffer() MTLBuffer
A buffer that contains indices for the vertices that compose the triangle list.
Discussion ¶
This property can be `nil`, in which case the vertex data defines the triangle list implicitly. You need to store indices in a packed data format.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexBufferOffset ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexBufferOffset() uint
The offset, in bytes, to the first index in the buffer.
Discussion ¶
Specify an offset that is a multiple of the index data type size and a multiple of the platform’s buffer offset alignment.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexType ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) IndexType() MTLIndexType
The data type of indices in the index buffer.
Discussion ¶
The index type needs to be [IndexTypeUInt16] or [IndexTypeUInt32]. The default is [IndexTypeUInt32].
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) Init ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) Init() MTLAccelerationStructureMotionTriangleGeometryDescriptor
Init initializes the instance.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBuffer ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBufferOffset ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexBufferOffset(value uint)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexType ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBuffer ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTLBuffer)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBufferOffset ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixBufferOffset(value uint)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixLayout ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTriangleCount ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetTriangleCount(value uint)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexBuffers ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexBuffers(value []MTLMotionKeyframeData)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexFormat ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexStride ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) SetVertexStride(value uint)
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBuffer ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBuffer() MTLBuffer
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBufferOffset ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixBufferOffset() uint
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixLayout ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) TriangleCount ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) TriangleCount() uint
The number of triangles in the buffers.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexBuffers ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexBuffers() []MTLMotionKeyframeData
An array of motion keyframes, each containing triangle data.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexFormat ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
func (MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexStride ¶
func (a MTLAccelerationStructureMotionTriangleGeometryDescriptor) VertexStride() uint
The stride, in bytes, between vertices in each vertex buffer.
type MTLAccelerationStructureMotionTriangleGeometryDescriptorClass ¶
type MTLAccelerationStructureMotionTriangleGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureMotionTriangleGeometryDescriptorClass ¶
func GetMTLAccelerationStructureMotionTriangleGeometryDescriptorClass() MTLAccelerationStructureMotionTriangleGeometryDescriptorClass
GetMTLAccelerationStructureMotionTriangleGeometryDescriptorClass returns the class object for MTLAccelerationStructureMotionTriangleGeometryDescriptor.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureMotionTriangleGeometryDescriptorClass) Alloc() MTLAccelerationStructureMotionTriangleGeometryDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLAccelerationStructureMotionTriangleGeometryDescriptorClass) Descriptor ¶
func (_MTLAccelerationStructureMotionTriangleGeometryDescriptorClass MTLAccelerationStructureMotionTriangleGeometryDescriptorClass) Descriptor() MTLAccelerationStructureMotionTriangleGeometryDescriptor
Creates a new triangle descriptor.
type MTLAccelerationStructureObject ¶
type MTLAccelerationStructureObject struct {
objectivec.Object
}
MTLAccelerationStructureObject wraps an existing Objective-C object that conforms to the MTLAccelerationStructure protocol.
func MTLAccelerationStructureObjectFromID ¶
func MTLAccelerationStructureObjectFromID(id objc.ID) MTLAccelerationStructureObject
MTLAccelerationStructureObjectFromID constructs a MTLAccelerationStructureObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLAccelerationStructureObject) AllocatedSize ¶
func (o MTLAccelerationStructureObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLAccelerationStructureObject) BaseObject ¶
func (o MTLAccelerationStructureObject) BaseObject() objectivec.Object
func (MTLAccelerationStructureObject) CpuCacheMode ¶
func (o MTLAccelerationStructureObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLAccelerationStructureObject) Device ¶
func (o MTLAccelerationStructureObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLAccelerationStructureObject) GpuResourceID ¶
func (o MTLAccelerationStructureObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructure/gpuResourceID
func (MTLAccelerationStructureObject) HazardTrackingMode ¶
func (o MTLAccelerationStructureObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLAccelerationStructureObject) Heap ¶
func (o MTLAccelerationStructureObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLAccelerationStructureObject) HeapOffset ¶
func (o MTLAccelerationStructureObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLAccelerationStructureObject) IsAliasable ¶
func (o MTLAccelerationStructureObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLAccelerationStructureObject) Label ¶
func (o MTLAccelerationStructureObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLAccelerationStructureObject) MakeAliasable ¶
func (o MTLAccelerationStructureObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLAccelerationStructureObject) ResourceOptions ¶
func (o MTLAccelerationStructureObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLAccelerationStructureObject) SetLabel ¶
func (o MTLAccelerationStructureObject) SetLabel(value string)
func (MTLAccelerationStructureObject) SetOwnerWithIdentity ¶
func (o MTLAccelerationStructureObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLAccelerationStructureObject) SetPurgeableState ¶
func (o MTLAccelerationStructureObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLAccelerationStructureObject) Size ¶
func (o MTLAccelerationStructureObject) Size() uint
The size of the acceleration structure’s memory allocation, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructure/size
func (MTLAccelerationStructureObject) StorageMode ¶
func (o MTLAccelerationStructureObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
type MTLAccelerationStructurePassDescriptor ¶
type MTLAccelerationStructurePassDescriptor struct {
objectivec.Object
}
Instance Properties ¶
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructurePassDescriptor
func MTLAccelerationStructurePassDescriptorFromID ¶
func MTLAccelerationStructurePassDescriptorFromID(id objc.ID) MTLAccelerationStructurePassDescriptor
MTLAccelerationStructurePassDescriptorFromID constructs a MTLAccelerationStructurePassDescriptor from an objc.ID.
func NewMTLAccelerationStructurePassDescriptor ¶
func NewMTLAccelerationStructurePassDescriptor() MTLAccelerationStructurePassDescriptor
NewMTLAccelerationStructurePassDescriptor creates a new MTLAccelerationStructurePassDescriptor instance.
func (MTLAccelerationStructurePassDescriptor) Autorelease ¶
func (a MTLAccelerationStructurePassDescriptor) Autorelease() MTLAccelerationStructurePassDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructurePassDescriptor) SampleBufferAttachments ¶
func (a MTLAccelerationStructurePassDescriptor) SampleBufferAttachments() IMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
type MTLAccelerationStructurePassDescriptorClass ¶
type MTLAccelerationStructurePassDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructurePassDescriptorClass ¶
func GetMTLAccelerationStructurePassDescriptorClass() MTLAccelerationStructurePassDescriptorClass
GetMTLAccelerationStructurePassDescriptorClass returns the class object for MTLAccelerationStructurePassDescriptor.
func (MTLAccelerationStructurePassDescriptorClass) AccelerationStructurePassDescriptor ¶
func (_MTLAccelerationStructurePassDescriptorClass MTLAccelerationStructurePassDescriptorClass) AccelerationStructurePassDescriptor() MTLAccelerationStructurePassDescriptor
func (MTLAccelerationStructurePassDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructurePassDescriptorClass) Alloc() MTLAccelerationStructurePassDescriptor
Alloc allocates memory for a new instance of the class.
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptor ¶
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptor struct {
objectivec.Object
}
Instance Properties ¶
- MTLAccelerationStructurePassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex
- MTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex
- MTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SampleBuffer: A specialized memory buffer that the GPU uses to store its counter data during the acceleration structure pass.
- MTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SetSampleBuffer
- MTLAccelerationStructurePassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex
- MTLAccelerationStructurePassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex
func MTLAccelerationStructurePassSampleBufferAttachmentDescriptorFromID ¶
func MTLAccelerationStructurePassSampleBufferAttachmentDescriptorFromID(id objc.ID) MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
MTLAccelerationStructurePassSampleBufferAttachmentDescriptorFromID constructs a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor from an objc.ID.
func NewMTLAccelerationStructurePassSampleBufferAttachmentDescriptor ¶
func NewMTLAccelerationStructurePassSampleBufferAttachmentDescriptor() MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
NewMTLAccelerationStructurePassSampleBufferAttachmentDescriptor creates a new MTLAccelerationStructurePassSampleBufferAttachmentDescriptor instance.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) Autorelease ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) Autorelease() MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) Init ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) Init() MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
Init initializes the instance.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SampleBuffer ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
A specialized memory buffer that the GPU uses to store its counter data during the acceleration structure pass.
Discussion ¶
The property defaults to `nil`, which means the GPU doesn’t save any GPU counter information during the acceleration structure pass. See Creating a counter sample buffer to store a GPU’s counter data during a pass and Sampling GPU data into counter sample buffers for more information.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetSampleBuffer ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray ¶
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray struct {
objectivec.Object
}
Subscripts ¶
func MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayFromID ¶
func MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayFromID(id objc.ID) MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayFromID constructs a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray from an objc.ID.
func NewMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray ¶
func NewMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
NewMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray creates a new MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray instance.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) Autorelease ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) Autorelease() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) Init ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) Init() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
Init initializes the instance.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (a MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLAccelerationStructurePassSampleBufferAttachmentDescriptor, attachmentIndex uint)
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass ¶
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass ¶
func GetMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass
GetMTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass returns the class object for MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArrayClass) Alloc() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass ¶
type MTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass ¶
func GetMTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass() MTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass
GetMTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass returns the class object for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor.
func (MTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructurePassSampleBufferAttachmentDescriptorClass) Alloc() MTLAccelerationStructurePassSampleBufferAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLAccelerationStructureRefitOptions ¶
type MTLAccelerationStructureRefitOptions int
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureRefitOptions
const ( MTLAccelerationStructureRefitOptionPerPrimitiveData MTLAccelerationStructureRefitOptions = 2 MTLAccelerationStructureRefitOptionVertexData MTLAccelerationStructureRefitOptions = 1 )
func (MTLAccelerationStructureRefitOptions) String ¶
func (e MTLAccelerationStructureRefitOptions) String() string
type MTLAccelerationStructureSizes ¶
type MTLAccelerationStructureSizes struct {
AccelerationStructureSize uint // The size of the acceleration structure, in bytes.
BuildScratchBufferSize uint // The amount of scratch memory, in bytes, the GPU devices needs to build the acceleration structure.
RefitScratchBufferSize uint // The amount of scratch memory, in bytes, the GPU device needs to refit the acceleration structure.
}
MTLAccelerationStructureSizes - The expected sizes for a ray-tracing acceleration structure.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureSizes
type MTLAccelerationStructureTriangleGeometryDescriptor ¶
type MTLAccelerationStructureTriangleGeometryDescriptor struct {
MTLAccelerationStructureGeometryDescriptor
}
A description of a list of triangle primitives to turn into an acceleration structure.
Configuring the number of triangles ¶
- MTLAccelerationStructureTriangleGeometryDescriptor.TriangleCount: The number of triangles in the buffers.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetTriangleCount
Configuring index data ¶
- MTLAccelerationStructureTriangleGeometryDescriptor.IndexType: The data type of indices in the index buffer.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetIndexType
- MTLAccelerationStructureTriangleGeometryDescriptor.IndexBuffer: A buffer that contains indices for the vertices that compose the triangle list.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetIndexBuffer
- MTLAccelerationStructureTriangleGeometryDescriptor.IndexBufferOffset: The offset, in bytes, to the first index in the buffer.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetIndexBufferOffset
Configuring vertex data ¶
- MTLAccelerationStructureTriangleGeometryDescriptor.VertexFormat: The format of each vertex position in the vertex buffer property.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetVertexFormat
- MTLAccelerationStructureTriangleGeometryDescriptor.VertexBuffer: A buffer that contains vertex data.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetVertexBuffer
- MTLAccelerationStructureTriangleGeometryDescriptor.VertexBufferOffset: The offset, in bytes, for the first vertex in the vertex buffer.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetVertexBufferOffset
- MTLAccelerationStructureTriangleGeometryDescriptor.VertexStride: The stride, in bytes, between vertices in the vertex buffer.
- MTLAccelerationStructureTriangleGeometryDescriptor.SetVertexStride
Configuring transformation data ¶
- MTLAccelerationStructureTriangleGeometryDescriptor.TransformationMatrixLayout
- MTLAccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixLayout
- MTLAccelerationStructureTriangleGeometryDescriptor.TransformationMatrixBuffer
- MTLAccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixBuffer
- MTLAccelerationStructureTriangleGeometryDescriptor.TransformationMatrixBufferOffset
- MTLAccelerationStructureTriangleGeometryDescriptor.SetTransformationMatrixBufferOffset
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureTriangleGeometryDescriptor
func MTLAccelerationStructureTriangleGeometryDescriptorFromID ¶
func MTLAccelerationStructureTriangleGeometryDescriptorFromID(id objc.ID) MTLAccelerationStructureTriangleGeometryDescriptor
MTLAccelerationStructureTriangleGeometryDescriptorFromID constructs a MTLAccelerationStructureTriangleGeometryDescriptor from an objc.ID.
A description of a list of triangle primitives to turn into an acceleration structure.
func NewMTLAccelerationStructureTriangleGeometryDescriptor ¶
func NewMTLAccelerationStructureTriangleGeometryDescriptor() MTLAccelerationStructureTriangleGeometryDescriptor
NewMTLAccelerationStructureTriangleGeometryDescriptor creates a new MTLAccelerationStructureTriangleGeometryDescriptor instance.
func (MTLAccelerationStructureTriangleGeometryDescriptor) Autorelease ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) Autorelease() MTLAccelerationStructureTriangleGeometryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAccelerationStructureTriangleGeometryDescriptor) IndexBuffer ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) IndexBuffer() MTLBuffer
A buffer that contains indices for the vertices that compose the triangle list.
Discussion ¶
This property can be `nil`, in which case the vertex data defines the triangle list implicitly. You need to store indices in a packed data format.
func (MTLAccelerationStructureTriangleGeometryDescriptor) IndexBufferOffset ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) IndexBufferOffset() uint
The offset, in bytes, to the first index in the buffer.
Discussion ¶
Specify an offset that is a multiple of the index data type size and a multiple of the platform’s buffer offset alignment.
func (MTLAccelerationStructureTriangleGeometryDescriptor) IndexType ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) IndexType() MTLIndexType
The data type of indices in the index buffer.
Discussion ¶
The index type needs to be [IndexTypeUInt16] or [IndexTypeUInt32]. The default is [IndexTypeUInt32].
func (MTLAccelerationStructureTriangleGeometryDescriptor) Init ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) Init() MTLAccelerationStructureTriangleGeometryDescriptor
Init initializes the instance.
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexBuffer ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexBuffer(value MTLBuffer)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexBufferOffset ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexBufferOffset(value uint)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexType ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetIndexType(value MTLIndexType)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBuffer ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBuffer(value MTLBuffer)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBufferOffset ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixBufferOffset(value uint)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixLayout ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTransformationMatrixLayout(value MTLMatrixLayout)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetTriangleCount ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetTriangleCount(value uint)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexBuffer ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexBuffer(value MTLBuffer)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexBufferOffset ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexBufferOffset(value uint)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexFormat ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexFormat(value MTLAttributeFormat)
func (MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexStride ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) SetVertexStride(value uint)
func (MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBuffer ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBuffer() MTLBuffer
func (MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBufferOffset ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixBufferOffset() uint
func (MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixLayout ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) TransformationMatrixLayout() MTLMatrixLayout
func (MTLAccelerationStructureTriangleGeometryDescriptor) TriangleCount ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) TriangleCount() uint
The number of triangles in the buffers.
Discussion ¶
If the triangle descriptor contains an index buffer, then the index buffer needs to provide indices for this many triangles. If the triangle descriptor doesn’t provide an index buffer, then the vertex buffer provides 3 vertices for each triangle.
func (MTLAccelerationStructureTriangleGeometryDescriptor) VertexBuffer ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexBuffer() MTLBuffer
A buffer that contains vertex data.
Discussion ¶
The [VertexFormat] property defines the format of each vertex position in the buffer. You need to set a vertex buffer before creating the acceleration structure.
func (MTLAccelerationStructureTriangleGeometryDescriptor) VertexBufferOffset ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexBufferOffset() uint
The offset, in bytes, for the first vertex in the vertex buffer.
Discussion ¶
The vertex needs to be a multiple of the vertex stride and be a multiple of 4 bytes. The default value is `0`.
func (MTLAccelerationStructureTriangleGeometryDescriptor) VertexFormat ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexFormat() MTLAttributeFormat
The format of each vertex position in the vertex buffer property.
Discussion ¶
Set this property to a value that represents the pixel format of the data you assign to the [VertexBuffer] property. The property’s default is [AttributeFormatFloat3].
func (MTLAccelerationStructureTriangleGeometryDescriptor) VertexStride ¶
func (a MTLAccelerationStructureTriangleGeometryDescriptor) VertexStride() uint
The stride, in bytes, between vertices in the vertex buffer.
Discussion ¶
The stride needs to be at least 12 bytes and needs to be a multiple of 4 bytes. The default value is 12 bytes.
type MTLAccelerationStructureTriangleGeometryDescriptorClass ¶
type MTLAccelerationStructureTriangleGeometryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAccelerationStructureTriangleGeometryDescriptorClass ¶
func GetMTLAccelerationStructureTriangleGeometryDescriptorClass() MTLAccelerationStructureTriangleGeometryDescriptorClass
GetMTLAccelerationStructureTriangleGeometryDescriptorClass returns the class object for MTLAccelerationStructureTriangleGeometryDescriptor.
func (MTLAccelerationStructureTriangleGeometryDescriptorClass) Alloc ¶
func (mc MTLAccelerationStructureTriangleGeometryDescriptorClass) Alloc() MTLAccelerationStructureTriangleGeometryDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLAccelerationStructureTriangleGeometryDescriptorClass) Descriptor ¶
func (_MTLAccelerationStructureTriangleGeometryDescriptorClass MTLAccelerationStructureTriangleGeometryDescriptorClass) Descriptor() MTLAccelerationStructureTriangleGeometryDescriptor
Creates a new triangle descriptor.
type MTLAccelerationStructureUsage ¶
type MTLAccelerationStructureUsage int
See: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureUsage
const ( // MTLAccelerationStructureUsageExtendedLimits: An option that increases an acceleration structure’s storage capacity. MTLAccelerationStructureUsageExtendedLimits MTLAccelerationStructureUsage = 4 // MTLAccelerationStructureUsageMinimizeMemory: An option that instructs Metal to prioritize building an acceleration structure that needs less memory. MTLAccelerationStructureUsageMinimizeMemory MTLAccelerationStructureUsage = 32 // MTLAccelerationStructureUsageNone: A sentinel value the represents an empty set of options, which is the default behavior for building new acceleration structures. MTLAccelerationStructureUsageNone MTLAccelerationStructureUsage = 0 // MTLAccelerationStructureUsagePreferFastBuild: An option that instructs Metal to build an acceleration structure quickly. MTLAccelerationStructureUsagePreferFastBuild MTLAccelerationStructureUsage = 2 // MTLAccelerationStructureUsagePreferFastIntersection: An option that instructs Metal to prioritize building an acceleration structure with better intersection performance. MTLAccelerationStructureUsagePreferFastIntersection MTLAccelerationStructureUsage = 16 // MTLAccelerationStructureUsageRefit: An option that lets you update an acceleration structure after creating it. MTLAccelerationStructureUsageRefit MTLAccelerationStructureUsage = 1 )
func (MTLAccelerationStructureUsage) String ¶
func (e MTLAccelerationStructureUsage) String() string
type MTLAccelerationStructureUserIDInstanceDescriptor ¶
type MTLAccelerationStructureUserIDInstanceDescriptor struct {
AccelerationStructureIndex uint32 // The index of the acceleration structure to use for the instance.
TransformationMatrix MTLPackedFloat4x3 // The transform for placing and orienting the instance in the scene.
IntersectionFunctionTableOffset uint32 // An offset for determining which function in the intersection function table Metal calls when testing a ray against the instance.
Options MTLAccelerationStructureInstanceOptions // The options for the instance.
Mask uint32 // A mask to use for the instance when testing a ray against the geometry.
UserID uint32 // The user identifier for the instance.
}
MTLAccelerationStructureUserIDInstanceDescriptor - A description of an instance in an instanced geometry acceleration structure, with the instance including a user identifier for the instance.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLAccelerationStructureUserIDInstanceDescriptor
type MTLAllocation ¶
type MTLAllocation interface {
objectivec.IObject
// The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
AllocatedSize() uint
}
A memory allocation from a Metal GPU device, such as a memory heap, texture, or data buffer.
See: https://developer.apple.com/documentation/Metal/MTLAllocation
type MTLAllocationObject ¶
type MTLAllocationObject struct {
objectivec.Object
}
MTLAllocationObject wraps an existing Objective-C object that conforms to the MTLAllocation protocol.
func MTLAllocationObjectFromID ¶
func MTLAllocationObjectFromID(id objc.ID) MTLAllocationObject
MTLAllocationObjectFromID constructs a MTLAllocationObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLAllocationObject) AllocatedSize ¶
func (o MTLAllocationObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLAllocationObject) BaseObject ¶
func (o MTLAllocationObject) BaseObject() objectivec.Object
type MTLArchitecture ¶
type MTLArchitecture struct {
objectivec.Object
}
A class that contains the architectural details of a GPU device.
Inspecting a GPU device’s architecture details ¶
- MTLArchitecture.Name: The name of a GPU device’s architecture.
See: https://developer.apple.com/documentation/Metal/MTLArchitecture
func MTLArchitectureFromID ¶
func MTLArchitectureFromID(id objc.ID) MTLArchitecture
MTLArchitectureFromID constructs a MTLArchitecture from an objc.ID.
A class that contains the architectural details of a GPU device.
func NewMTLArchitecture ¶
func NewMTLArchitecture() MTLArchitecture
NewMTLArchitecture creates a new MTLArchitecture instance.
func (MTLArchitecture) Architecture ¶
func (a MTLArchitecture) Architecture() IMTLArchitecture
The architectural details of the GPU device.
See: https://developer.apple.com/documentation/metal/mtldevice/architecture
func (MTLArchitecture) Autorelease ¶
func (a MTLArchitecture) Autorelease() MTLArchitecture
Autorelease adds the receiver to the current autorelease pool.
func (MTLArchitecture) Init ¶
func (a MTLArchitecture) Init() MTLArchitecture
Init initializes the instance.
func (MTLArchitecture) IsHeadless ¶
func (a MTLArchitecture) IsHeadless() bool
A Boolean value that indicates whether a GPU device doesn’t have a connection to a display.
See: https://developer.apple.com/documentation/metal/mtldevice/isheadless
func (MTLArchitecture) IsLowPower ¶
func (a MTLArchitecture) IsLowPower() bool
A Boolean value that indicates whether the GPU lowers its performance to conserve energy.
See: https://developer.apple.com/documentation/metal/mtldevice/islowpower
func (MTLArchitecture) IsRemovable ¶
func (a MTLArchitecture) IsRemovable() bool
A Boolean value that indicates whether the GPU is removable.
See: https://developer.apple.com/documentation/metal/mtldevice/isremovable
func (MTLArchitecture) Location ¶
func (a MTLArchitecture) Location() MTLDeviceLocation
The physical location of the GPU relative to the system.
See: https://developer.apple.com/documentation/metal/mtldevice/location
func (MTLArchitecture) LocationNumber ¶
func (a MTLArchitecture) LocationNumber() int
A specific GPU position based on its general location.
See: https://developer.apple.com/documentation/metal/mtldevice/locationnumber
func (MTLArchitecture) Name ¶
func (a MTLArchitecture) Name() string
The name of a GPU device’s architecture.
Discussion ¶
The property’s value is equivalent to the output from the `metal-arch` command line tool on the same system.
Apps can use this property’s value to make decisions at runtime. For example, an app could retrieve a GPU-specific file from its developer’s content delivery network (CDN), such as a shader library or binary archive. See Shader libraries and Shader library and archive creation for more information.
See: https://developer.apple.com/documentation/Metal/MTLArchitecture/name
func (MTLArchitecture) PeerCount ¶
func (a MTLArchitecture) PeerCount() uint32
The total number of GPUs in the peer group, if applicable.
See: https://developer.apple.com/documentation/metal/mtldevice/peercount
func (MTLArchitecture) PeerGroupID ¶
func (a MTLArchitecture) PeerGroupID() uint64
The peer group ID the GPU belongs to, if applicable.
See: https://developer.apple.com/documentation/metal/mtldevice/peergroupid
func (MTLArchitecture) PeerIndex ¶
func (a MTLArchitecture) PeerIndex() uint32
The unique identifier for a GPU in a peer group.
See: https://developer.apple.com/documentation/metal/mtldevice/peerindex
func (MTLArchitecture) RegistryID ¶
func (a MTLArchitecture) RegistryID() uint64
The GPU device’s registry identifier.
See: https://developer.apple.com/documentation/metal/mtldevice/registryid
func (MTLArchitecture) SetArchitecture ¶
func (a MTLArchitecture) SetArchitecture(value IMTLArchitecture)
func (MTLArchitecture) SetIsHeadless ¶
func (a MTLArchitecture) SetIsHeadless(value bool)
func (MTLArchitecture) SetIsLowPower ¶
func (a MTLArchitecture) SetIsLowPower(value bool)
func (MTLArchitecture) SetIsRemovable ¶
func (a MTLArchitecture) SetIsRemovable(value bool)
func (MTLArchitecture) SetLocation ¶
func (a MTLArchitecture) SetLocation(value MTLDeviceLocation)
func (MTLArchitecture) SetLocationNumber ¶
func (a MTLArchitecture) SetLocationNumber(value int)
func (MTLArchitecture) SetPeerCount ¶
func (a MTLArchitecture) SetPeerCount(value uint32)
func (MTLArchitecture) SetPeerGroupID ¶
func (a MTLArchitecture) SetPeerGroupID(value uint64)
func (MTLArchitecture) SetPeerIndex ¶
func (a MTLArchitecture) SetPeerIndex(value uint32)
func (MTLArchitecture) SetRegistryID ¶
func (a MTLArchitecture) SetRegistryID(value uint64)
type MTLArchitectureClass ¶
type MTLArchitectureClass struct {
// contains filtered or unexported fields
}
func GetMTLArchitectureClass ¶
func GetMTLArchitectureClass() MTLArchitectureClass
GetMTLArchitectureClass returns the class object for MTLArchitecture.
func (MTLArchitectureClass) Alloc ¶
func (mc MTLArchitectureClass) Alloc() MTLArchitecture
Alloc allocates memory for a new instance of the class.
type MTLArgumentAccess
deprecated
MTLArgumentAccess is function access restrictions to argument data in the shading language code.
Deprecated: Deprecated since macOS 14.0.
See: https://developer.apple.com/documentation/Metal/MTLArgumentAccess
type MTLArgumentBuffersTier ¶
type MTLArgumentBuffersTier int
See: https://developer.apple.com/documentation/Metal/MTLArgumentBuffersTier
const ( // MTLArgumentBuffersTier1: Support for tier 1 argument buffers. MTLArgumentBuffersTier1 MTLArgumentBuffersTier = 0 // MTLArgumentBuffersTier2: Support for tier 2 argument buffers. MTLArgumentBuffersTier2 MTLArgumentBuffersTier = 1 )
func (MTLArgumentBuffersTier) String ¶
func (e MTLArgumentBuffersTier) String() string
type MTLArgumentDescriptor ¶
type MTLArgumentDescriptor struct {
objectivec.Object
}
A representation of an argument within an argument buffer.
Overview ¶
This descriptor can represent arguments within flat structures only. It can represent arrays of allowed argument buffer data types, but it cannot represent arguments within nested structures. Argument buffers with simple, flat structures can be represented by an array of MTLArgumentDescriptor instances. You can then use this array to create an MTLArgumentEncoder instance by calling the [NewArgumentEncoderWithArguments] method. Argument buffers with complex, nested structures need to define their structure in Metal shading language code, which can then be directly assigned to a specific buffer index of a function. You can then use this buffer index to call the [NewArgumentEncoderWithBufferIndex] method and create an MTLArgumentEncoder instance.
Setting the descriptor’s properties ¶
- MTLArgumentDescriptor.DataType: The data type of the argument.
- MTLArgumentDescriptor.SetDataType
- MTLArgumentDescriptor.Index: The index ID of the argument.
- MTLArgumentDescriptor.SetIndex
- MTLArgumentDescriptor.Access: The access permissions of the argument.
- MTLArgumentDescriptor.SetAccess
- MTLArgumentDescriptor.ArrayLength: The length of an array argument.
- MTLArgumentDescriptor.SetArrayLength
- MTLArgumentDescriptor.ConstantBlockAlignment: The alignment of the constant block.
- MTLArgumentDescriptor.SetConstantBlockAlignment
- MTLArgumentDescriptor.TextureType: The texture type of a texture argument.
- MTLArgumentDescriptor.SetTextureType
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor
func MTLArgumentDescriptorFromID ¶
func MTLArgumentDescriptorFromID(id objc.ID) MTLArgumentDescriptor
MTLArgumentDescriptorFromID constructs a MTLArgumentDescriptor from an objc.ID.
A representation of an argument within an argument buffer.
func NewMTLArgumentDescriptor ¶
func NewMTLArgumentDescriptor() MTLArgumentDescriptor
NewMTLArgumentDescriptor creates a new MTLArgumentDescriptor instance.
func (MTLArgumentDescriptor) Access ¶
func (a MTLArgumentDescriptor) Access() MTLBindingAccess
The access permissions of the argument.
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor/access
func (MTLArgumentDescriptor) ArrayLength ¶
func (a MTLArgumentDescriptor) ArrayLength() uint
The length of an array argument.
Discussion ¶
For a nonarray argument, this value needs to be `0`.
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor/arrayLength
func (MTLArgumentDescriptor) Autorelease ¶
func (a MTLArgumentDescriptor) Autorelease() MTLArgumentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLArgumentDescriptor) ConstantBlockAlignment ¶
func (a MTLArgumentDescriptor) ConstantBlockAlignment() uint
The alignment of the constant block.
Discussion ¶
If set, this property forces the constant block to be aligned to the specified value. It should be set on the first constant only, and is valid only if a corresponding explicit `alignas` specifier is applied to the constant in the Metal shader language.
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor/constantBlockAlignment
func (MTLArgumentDescriptor) DataType ¶
func (a MTLArgumentDescriptor) DataType() MTLDataType
The data type of the argument.
Discussion ¶
For a constant data argument, this value needs to match the binary format of the data stored in the buffer for that argument. For other parameter types, such as textures or samplers, specify the appropriate constant. See MTLDataType for possible values.
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor/dataType
func (MTLArgumentDescriptor) Index ¶
func (a MTLArgumentDescriptor) Index() uint
The index ID of the argument.
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor/index
func (MTLArgumentDescriptor) Init ¶
func (a MTLArgumentDescriptor) Init() MTLArgumentDescriptor
Init initializes the instance.
func (MTLArgumentDescriptor) MTLAttributeStrideStatic ¶
func (a MTLArgumentDescriptor) MTLAttributeStrideStatic() int
See: https://developer.apple.com/documentation/metal/mtlattributestridestatic
func (MTLArgumentDescriptor) SetAccess ¶
func (a MTLArgumentDescriptor) SetAccess(value MTLBindingAccess)
func (MTLArgumentDescriptor) SetArrayLength ¶
func (a MTLArgumentDescriptor) SetArrayLength(value uint)
func (MTLArgumentDescriptor) SetConstantBlockAlignment ¶
func (a MTLArgumentDescriptor) SetConstantBlockAlignment(value uint)
func (MTLArgumentDescriptor) SetDataType ¶
func (a MTLArgumentDescriptor) SetDataType(value MTLDataType)
func (MTLArgumentDescriptor) SetIndex ¶
func (a MTLArgumentDescriptor) SetIndex(value uint)
func (MTLArgumentDescriptor) SetTextureType ¶
func (a MTLArgumentDescriptor) SetTextureType(value MTLTextureType)
func (MTLArgumentDescriptor) TextureType ¶
func (a MTLArgumentDescriptor) TextureType() MTLTextureType
The texture type of a texture argument.
Discussion ¶
For a nontexture argument, this value is ignored.
See: https://developer.apple.com/documentation/Metal/MTLArgumentDescriptor/textureType
type MTLArgumentDescriptorClass ¶
type MTLArgumentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLArgumentDescriptorClass ¶
func GetMTLArgumentDescriptorClass() MTLArgumentDescriptorClass
GetMTLArgumentDescriptorClass returns the class object for MTLArgumentDescriptor.
func (MTLArgumentDescriptorClass) Alloc ¶
func (mc MTLArgumentDescriptorClass) Alloc() MTLArgumentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLArgumentEncoder ¶
type MTLArgumentEncoder interface {
objectivec.IObject
// Specifies the position in a buffer where the encoder writes argument data.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setArgumentBuffer(_:offset:)
SetArgumentBufferOffset(argumentBuffer MTLBuffer, offset uint)
// Specifies an array element within a buffer where the encoder writes argument data.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setArgumentBuffer(_:startOffset:arrayElement:)
SetArgumentBufferStartOffsetArrayElement(argumentBuffer MTLBuffer, startOffset uint, arrayElement uint)
// The number of bytes required to store the encoded resources of an argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/encodedLength
EncodedLength() uint
// Encodes a reference to a buffer into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setBuffer(_:offset:index:)
SetBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
// Encodes a reference to a texture into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setTexture(_:index:)
SetTextureAtIndex(texture MTLTexture, index uint)
// Encodes a sampler into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setSamplerState(_:index:)
SetSamplerStateAtIndex(sampler MTLSamplerState, index uint)
// Encodes a reference to a render pipeline state into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setRenderPipelineState(_:index:)
SetRenderPipelineStateAtIndex(pipeline MTLRenderPipelineState, index uint)
// Encodes a reference to a compute pipeline state into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setComputePipelineState(_:index:)
SetComputePipelineStateAtIndex(pipeline MTLComputePipelineState, index uint)
// Returns a pointer to an inline, constant-data argument within the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/constantData(at:)
ConstantDataAtIndex(index uint) unsafe.Pointer
// Encodes a reference to an indirect command buffer into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setIndirectCommandBuffer(_:index:)
SetIndirectCommandBufferAtIndex(indirectCommandBuffer MTLIndirectCommandBuffer, index uint)
// Encodes a reference to an acceleration structure into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setAccelerationStructure(_:index:)
SetAccelerationStructureAtIndex(accelerationStructure MTLAccelerationStructure, index uint)
// Encodes a reference to a visible-function table into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setVisibleFunctionTable(_:index:)
SetVisibleFunctionTableAtIndex(visibleFunctionTable MTLVisibleFunctionTable, index uint)
// Encodes a reference to a ray-tracing intersection-function table into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setIntersectionFunctionTable(_:index:)
SetIntersectionFunctionTableAtIndex(intersectionFunctionTable MTLIntersectionFunctionTable, index uint)
// Creates a new argument encoder for a nested argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/makeArgumentEncoderForBuffer(atIndex:)
NewArgumentEncoderForBufferAtIndex(index uint) MTLArgumentEncoder
// The alignment, in bytes, required for storing the encoded resources of an argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/alignment
Alignment() uint
// A string that identifies the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/label
Label() string
// The device object that created the argument encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/device
Device() MTLDevice
// SetDepthStencilStateAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setDepthStencilState(_:index:)
SetDepthStencilStateAtIndex(depthStencilState MTLDepthStencilState, index uint)
// Encodes references to an array of buffers into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setBuffers:offsets:withRange:
SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Encodes references to an array of compute pipeline states into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setComputePipelineStates:withRange:
SetComputePipelineStatesWithRange(pipelines []MTLComputePipelineState, range_ foundation.NSRange)
// SetDepthStencilStatesWithRange protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setDepthStencilStates:withRange:
SetDepthStencilStatesWithRange(depthStencilStates []MTLDepthStencilState, range_ foundation.NSRange)
// Encodes an array of indirect command buffers into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setIndirectCommandBuffers:withRange:
SetIndirectCommandBuffersWithRange(buffers []MTLIndirectCommandBuffer, range_ foundation.NSRange)
// Encodes references to an array of ray-tracing intersection-function tables into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setIntersectionFunctionTables:withRange:
SetIntersectionFunctionTablesWithRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
// Encodes references to an array of render pipeline states into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setRenderPipelineStates:withRange:
SetRenderPipelineStatesWithRange(pipelines []MTLRenderPipelineState, range_ foundation.NSRange)
// Encodes an array of samplers into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setSamplerStates:withRange:
SetSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
// Encodes references to an array of textures into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setTextures:withRange:
SetTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
// Encodes references to an array of visible function tables into the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setVisibleFunctionTables:withRange:
SetVisibleFunctionTablesWithRange(visibleFunctionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
// A string that identifies the argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/label
SetLabel(value string)
}
An interface you can use to encode argument data into an argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder
type MTLArgumentEncoderObject ¶
type MTLArgumentEncoderObject struct {
objectivec.Object
}
MTLArgumentEncoderObject wraps an existing Objective-C object that conforms to the MTLArgumentEncoder protocol.
func MTLArgumentEncoderObjectFromID ¶
func MTLArgumentEncoderObjectFromID(id objc.ID) MTLArgumentEncoderObject
MTLArgumentEncoderObjectFromID constructs a MTLArgumentEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLArgumentEncoderObject) Alignment ¶
func (o MTLArgumentEncoderObject) Alignment() uint
The alignment, in bytes, required for storing the encoded resources of an argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/alignment
func (MTLArgumentEncoderObject) BaseObject ¶
func (o MTLArgumentEncoderObject) BaseObject() objectivec.Object
func (MTLArgumentEncoderObject) ConstantDataAtIndex ¶
func (o MTLArgumentEncoderObject) ConstantDataAtIndex(index uint) unsafe.Pointer
Returns a pointer to an inline, constant-data argument within the argument buffer.
index: The index of an inline, constant-data argument within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
Return Value ¶
A pointer to the location in the buffer to which you should write the constant data.
Discussion ¶
Constants declared contiguously in the Metal shading language (in an array or structure) are contiguous in memory. You can encode contiguous ranges of inlined constant data through a pointer to the first constant.
To encode inlined constant data into the argument buffer, perform a memory copy operation from your data’s source pointer to the returned destination pointer.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/constantData(at:)
func (MTLArgumentEncoderObject) Device ¶
func (o MTLArgumentEncoderObject) Device() MTLDevice
The device object that created the argument encoder.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/device
func (MTLArgumentEncoderObject) EncodedLength ¶
func (o MTLArgumentEncoderObject) EncodedLength() uint
The number of bytes required to store the encoded resources of an argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/encodedLength
func (MTLArgumentEncoderObject) Label ¶
func (o MTLArgumentEncoderObject) Label() string
A string that identifies the argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/label
func (MTLArgumentEncoderObject) NewArgumentEncoderForBufferAtIndex ¶
func (o MTLArgumentEncoderObject) NewArgumentEncoderForBufferAtIndex(index uint) MTLArgumentEncoder
Creates a new argument encoder for a nested argument buffer.
index: The index of a nested argument-buffer within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
Return Value ¶
An argument encoder targeting the nested argument buffer.
Discussion ¶
If an argument buffer contains nested argument buffers in its structure, then each nested argument buffer needs to use its own MTLArgumentEncoder object to encode its individual resources.
func (MTLArgumentEncoderObject) SetAccelerationStructureAtIndex ¶
func (o MTLArgumentEncoderObject) SetAccelerationStructureAtIndex(accelerationStructure MTLAccelerationStructure, index uint)
Encodes a reference to an acceleration structure into the argument buffer.
accelerationStructure: An acceleration structure the method encodes.
index: The index of an acceleration structure within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
func (MTLArgumentEncoderObject) SetArgumentBufferOffset ¶
func (o MTLArgumentEncoderObject) SetArgumentBufferOffset(argumentBuffer MTLBuffer, offset uint)
Specifies the position in a buffer where the encoder writes argument data.
argumentBuffer: The destination buffer that represents an argument buffer.
offset: The byte offset of the buffer.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setArgumentBuffer(_:offset:)
func (MTLArgumentEncoderObject) SetArgumentBufferStartOffsetArrayElement ¶
func (o MTLArgumentEncoderObject) SetArgumentBufferStartOffsetArrayElement(argumentBuffer MTLBuffer, startOffset uint, arrayElement uint)
Specifies an array element within a buffer where the encoder writes argument data.
argumentBuffer: The destination buffer that represents an argument buffer.
startOffset: The starting byte offset of the buffer data.
arrayElement: The desired element of the argument buffer array targeted by encoding.
func (MTLArgumentEncoderObject) SetBufferOffsetAtIndex ¶
func (o MTLArgumentEncoderObject) SetBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
Encodes a reference to a buffer into the argument buffer.
buffer: A buffer the method encodes.
offset: A byte offset for `buffer`.
index: The index of a buffer within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setBuffer(_:offset:index:)
func (MTLArgumentEncoderObject) SetBuffersOffsetsWithRange ¶
func (o MTLArgumentEncoderObject) SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Encodes references to an array of buffers into the argument buffer.
buffers: An array of buffers the method encodes.
offsets: An array of byte offsets for each element in `buffers`.
range: A range of indices within the argument buffer for each element in `buffers`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setBuffers:offsets:withRange:
func (MTLArgumentEncoderObject) SetComputePipelineStateAtIndex ¶
func (o MTLArgumentEncoderObject) SetComputePipelineStateAtIndex(pipeline MTLComputePipelineState, index uint)
Encodes a reference to a compute pipeline state into the argument buffer.
pipeline: A pipeline state the method encodes.
index: The index of a pipeline state within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setComputePipelineState(_:index:)
func (MTLArgumentEncoderObject) SetComputePipelineStatesWithRange ¶
func (o MTLArgumentEncoderObject) SetComputePipelineStatesWithRange(pipelines []MTLComputePipelineState, range_ foundation.NSRange)
Encodes references to an array of compute pipeline states into the argument buffer.
pipelines: An array of pipeline states the method encodes.
range: A range of indices within the argument buffer for each element in `pipelines`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
func (MTLArgumentEncoderObject) SetDepthStencilStateAtIndex ¶
func (o MTLArgumentEncoderObject) SetDepthStencilStateAtIndex(depthStencilState MTLDepthStencilState, index uint)
Discussion ¶
Sets a depth stencil state at a given bind point index ¶
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setDepthStencilState(_:index:)
func (MTLArgumentEncoderObject) SetDepthStencilStatesWithRange ¶
func (o MTLArgumentEncoderObject) SetDepthStencilStatesWithRange(depthStencilStates []MTLDepthStencilState, range_ foundation.NSRange)
Discussion ¶
Sets an array of depth stencil states at a given buffer index range ¶
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setDepthStencilStates:withRange:
func (MTLArgumentEncoderObject) SetIndirectCommandBufferAtIndex ¶
func (o MTLArgumentEncoderObject) SetIndirectCommandBufferAtIndex(indirectCommandBuffer MTLIndirectCommandBuffer, index uint)
Encodes a reference to an indirect command buffer into the argument buffer.
indirectCommandBuffer: An indirect command-buffer the method encodes.
index: The index of an inline, constant-data argument within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
func (MTLArgumentEncoderObject) SetIndirectCommandBuffersWithRange ¶
func (o MTLArgumentEncoderObject) SetIndirectCommandBuffersWithRange(buffers []MTLIndirectCommandBuffer, range_ foundation.NSRange)
Encodes an array of indirect command buffers into the argument buffer.
buffers: An array of indirect command buffers the method encodes.
range: A range of indices within the argument buffer for each element in `buffers`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
func (MTLArgumentEncoderObject) SetIntersectionFunctionTableAtIndex ¶
func (o MTLArgumentEncoderObject) SetIntersectionFunctionTableAtIndex(intersectionFunctionTable MTLIntersectionFunctionTable, index uint)
Encodes a reference to a ray-tracing intersection-function table into the argument buffer.
intersectionFunctionTable: An intersection-function table the method encodes.
index: An index of an intersection-function table within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
func (MTLArgumentEncoderObject) SetIntersectionFunctionTablesWithRange ¶
func (o MTLArgumentEncoderObject) SetIntersectionFunctionTablesWithRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
Encodes references to an array of ray-tracing intersection-function tables into the argument buffer.
intersectionFunctionTables: An array of intersection-function tables the method encodes.
range: A range of indices within the argument buffer for each element in `intersectionFunctionTables`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
func (MTLArgumentEncoderObject) SetLabel ¶
func (o MTLArgumentEncoderObject) SetLabel(value string)
func (MTLArgumentEncoderObject) SetRenderPipelineStateAtIndex ¶
func (o MTLArgumentEncoderObject) SetRenderPipelineStateAtIndex(pipeline MTLRenderPipelineState, index uint)
Encodes a reference to a render pipeline state into the argument buffer.
pipeline: A pipeline state the method encodes.
index: The index of a pipeline state within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setRenderPipelineState(_:index:)
func (MTLArgumentEncoderObject) SetRenderPipelineStatesWithRange ¶
func (o MTLArgumentEncoderObject) SetRenderPipelineStatesWithRange(pipelines []MTLRenderPipelineState, range_ foundation.NSRange)
Encodes references to an array of render pipeline states into the argument buffer.
pipelines: An array of pipeline states the method encodes.
range: A range of indices within the argument buffer for each element in `pipelines`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setRenderPipelineStates:withRange:
func (MTLArgumentEncoderObject) SetSamplerStateAtIndex ¶
func (o MTLArgumentEncoderObject) SetSamplerStateAtIndex(sampler MTLSamplerState, index uint)
Encodes a sampler into the argument buffer.
sampler: A sampler the method encodes.
index: The index of a sampler within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setSamplerState(_:index:)
func (MTLArgumentEncoderObject) SetSamplerStatesWithRange ¶
func (o MTLArgumentEncoderObject) SetSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
Encodes an array of samplers into the argument buffer.
samplers: An array of samplers the method encodes.
range: A range of indices within the argument buffer for each element in `samplers`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setSamplerStates:withRange:
func (MTLArgumentEncoderObject) SetTextureAtIndex ¶
func (o MTLArgumentEncoderObject) SetTextureAtIndex(texture MTLTexture, index uint)
Encodes a reference to a texture into the argument buffer.
texture: A texture the method encodes.
index: The index of a texture within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setTexture(_:index:)
func (MTLArgumentEncoderObject) SetTexturesWithRange ¶
func (o MTLArgumentEncoderObject) SetTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
Encodes references to an array of textures into the argument buffer.
textures: An array of textures the method encodes.
range: A range of indices within the argument buffer for each element in `textures`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setTextures:withRange:
func (MTLArgumentEncoderObject) SetVisibleFunctionTableAtIndex ¶
func (o MTLArgumentEncoderObject) SetVisibleFunctionTableAtIndex(visibleFunctionTable MTLVisibleFunctionTable, index uint)
Encodes a reference to a visible-function table into the argument buffer.
visibleFunctionTable: A visible-function table the method encodes.
index: The index of a visible-function table within the argument buffer. The value corresponds to either the index ID of a declaration in Metal Shading Language (MSL) or the [Index] property of an MTLArgumentDescriptor instance.
See: https://developer.apple.com/documentation/Metal/MTLArgumentEncoder/setVisibleFunctionTable(_:index:)
func (MTLArgumentEncoderObject) SetVisibleFunctionTablesWithRange ¶
func (o MTLArgumentEncoderObject) SetVisibleFunctionTablesWithRange(visibleFunctionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
Encodes references to an array of visible function tables into the argument buffer.
visibleFunctionTables: An array of visible-function tables the method encodes.
range: A range of indices within the argument buffer for each element in `visibleFunctionTables`. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the [Index] property of MTLArgumentDescriptor instances.
type MTLArgumentType ¶
type MTLArgumentType int
See: https://developer.apple.com/documentation/Metal/MTLArgumentType
const ( // Deprecated. MTLArgumentTypeBuffer MTLArgumentType = 0 // Deprecated. MTLArgumentTypeImageblock MTLArgumentType = 17 // Deprecated. MTLArgumentTypeImageblockData MTLArgumentType = 16 // Deprecated. MTLArgumentTypeInstanceAccelerationStructure MTLArgumentType = 26 // Deprecated. MTLArgumentTypeIntersectionFunctionTable MTLArgumentType = 27 // Deprecated. MTLArgumentTypePrimitiveAccelerationStructure MTLArgumentType = 25 // Deprecated. MTLArgumentTypeSampler MTLArgumentType = 3 // Deprecated. MTLArgumentTypeTexture MTLArgumentType = 2 // Deprecated. MTLArgumentTypeThreadgroupMemory MTLArgumentType = 1 // Deprecated. MTLArgumentTypeVisibleFunctionTable MTLArgumentType = 24 )
func (MTLArgumentType) String ¶
func (e MTLArgumentType) String() string
type MTLArrayType ¶
type MTLArrayType struct {
MTLType
}
A description of an array.
Overview ¶
An MTLArrayType instance provides details about an array parameter. Don’t create MTLArrayType instances directly; other reflection instances contain properties to determine if a parameter is an array and to obtain the MTLArrayType instance that describes the array.
Describing the array elements ¶
- MTLArrayType.ArrayLength: The number of elements in the array.
- MTLArrayType.ElementType: The data type of the array’s elements.
- MTLArrayType.Stride: The stride between array elements, in bytes.
- MTLArrayType.ArgumentIndexStride: The stride, in bytes, between argument indices.
Obtaining details for complex array elements ¶
- MTLArrayType.ElementArrayType: Provides a description of the underlying type when an array holds other arrays as its elements.
- MTLArrayType.ElementStructType: Provides a description of the underlying struct type when an array holds structs as its elements.
- MTLArrayType.ElementPointerType: Provides a description of the underlying pointer type when an array holds pointers as its elements.
- MTLArrayType.ElementTextureReferenceType: Provides a description of the underlying texture type when an array holds textures as its elements.
Instance Methods ¶
- MTLArrayType.ElementTensorReferenceType: Provides a description of the underlying tensor type when this array holds tensors as its elements.
See: https://developer.apple.com/documentation/Metal/MTLArrayType
func MTLArrayTypeFromID ¶
func MTLArrayTypeFromID(id objc.ID) MTLArrayType
MTLArrayTypeFromID constructs a MTLArrayType from an objc.ID.
A description of an array.
func NewMTLArrayType ¶
func NewMTLArrayType() MTLArrayType
NewMTLArrayType creates a new MTLArrayType instance.
func (MTLArrayType) ArgumentIndexStride ¶
func (a MTLArrayType) ArgumentIndexStride() uint
The stride, in bytes, between argument indices.
See: https://developer.apple.com/documentation/Metal/MTLArrayType/argumentIndexStride
func (MTLArrayType) ArrayLength ¶
func (a MTLArrayType) ArrayLength() uint
The number of elements in the array.
See: https://developer.apple.com/documentation/Metal/MTLArrayType/arrayLength
func (MTLArrayType) Autorelease ¶
func (a MTLArrayType) Autorelease() MTLArrayType
Autorelease adds the receiver to the current autorelease pool.
func (MTLArrayType) ElementArrayType ¶
func (a MTLArrayType) ElementArrayType() IMTLArrayType
Provides a description of the underlying type when an array holds other arrays as its elements.
Return Value ¶
Returns an object that describes an array. If the array elements aren’t arrays, this method returns `nil`.
Discussion ¶
Use this method if [ElementType] is [DataTypeArray].
See: https://developer.apple.com/documentation/Metal/MTLArrayType/element()
func (MTLArrayType) ElementPointerType ¶
func (a MTLArrayType) ElementPointerType() IMTLPointerType
Provides a description of the underlying pointer type when an array holds pointers as its elements.
Return Value ¶
An object that describes the pointer. If the array elements aren’t pointers, this method returns `nil`.
Discussion ¶
Use this method if [ElementType] is [DataTypePointer].
See: https://developer.apple.com/documentation/Metal/MTLArrayType/elementPointerType()
func (MTLArrayType) ElementStructType ¶
func (a MTLArrayType) ElementStructType() IMTLStructType
Provides a description of the underlying struct type when an array holds structs as its elements.
Return Value ¶
An object that describes the struct. If the array elements aren’t structs, this method returns `nil`.
Discussion ¶
Use this method if [ElementType] is [DataTypeStruct].
See: https://developer.apple.com/documentation/Metal/MTLArrayType/elementStructType()
func (MTLArrayType) ElementTensorReferenceType ¶
func (a MTLArrayType) ElementTensorReferenceType() IMTLTensorReferenceType
Provides a description of the underlying tensor type when this array holds tensors as its elements.
Return Value ¶
A description of the tensor type that this array holds, or `nil` if this struct member doesn’t hold a tensor.
See: https://developer.apple.com/documentation/Metal/MTLArrayType/elementTensorReferenceType()
func (MTLArrayType) ElementTextureReferenceType ¶
func (a MTLArrayType) ElementTextureReferenceType() IMTLTextureReferenceType
Provides a description of the underlying texture type when an array holds textures as its elements.
Return Value ¶
An object that describes the texture. If the array elements aren’t textures, this method returns `nil`.
Discussion ¶
Use this method if [ElementType] is [DataTypeTexture].
See: https://developer.apple.com/documentation/Metal/MTLArrayType/elementTextureReferenceType()
func (MTLArrayType) ElementType ¶
func (a MTLArrayType) ElementType() MTLDataType
The data type of the array’s elements.
Discussion ¶
For information on possible values, see MTLDataType.
See: https://developer.apple.com/documentation/Metal/MTLArrayType/elementType
func (MTLArrayType) Stride ¶
func (a MTLArrayType) Stride() uint
The stride between array elements, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLArrayType/stride
type MTLArrayTypeClass ¶
type MTLArrayTypeClass struct {
// contains filtered or unexported fields
}
func GetMTLArrayTypeClass ¶
func GetMTLArrayTypeClass() MTLArrayTypeClass
GetMTLArrayTypeClass returns the class object for MTLArrayType.
func (MTLArrayTypeClass) Alloc ¶
func (mc MTLArrayTypeClass) Alloc() MTLArrayType
Alloc allocates memory for a new instance of the class.
type MTLAttribute ¶
type MTLAttribute struct {
objectivec.Object
}
An object that describes an attribute defined in the stage-in argument for a shader.
Reading an attribute’s properties ¶
- MTLAttribute.Name: The name of the attribute.
- MTLAttribute.AttributeIndex: The index of the attribute, as declared in Metal shader source code.
- MTLAttribute.AttributeType: The data type for the attribute, as declared in Metal shader source code.
- MTLAttribute.Active: A Boolean value that indicates whether the attribute is active.
- MTLAttribute.PatchControlPointData: A Boolean value that indicates whether the attribute represents control point data.
- MTLAttribute.PatchData: A Boolean value that indicates whether the attribute represents tessellation patch data.
See: https://developer.apple.com/documentation/Metal/MTLAttribute
func MTLAttributeFromID ¶
func MTLAttributeFromID(id objc.ID) MTLAttribute
MTLAttributeFromID constructs a MTLAttribute from an objc.ID.
An object that describes an attribute defined in the stage-in argument for a shader.
func NewMTLAttribute ¶
func NewMTLAttribute() MTLAttribute
NewMTLAttribute creates a new MTLAttribute instance.
func (MTLAttribute) Active ¶
func (a MTLAttribute) Active() bool
A Boolean value that indicates whether the attribute is active.
See: https://developer.apple.com/documentation/Metal/MTLAttribute/isActive
func (MTLAttribute) AttributeIndex ¶
func (a MTLAttribute) AttributeIndex() uint
The index of the attribute, as declared in Metal shader source code.
See: https://developer.apple.com/documentation/Metal/MTLAttribute/attributeIndex
func (MTLAttribute) AttributeType ¶
func (a MTLAttribute) AttributeType() MTLDataType
The data type for the attribute, as declared in Metal shader source code.
See: https://developer.apple.com/documentation/Metal/MTLAttribute/attributeType
func (MTLAttribute) Autorelease ¶
func (a MTLAttribute) Autorelease() MTLAttribute
Autorelease adds the receiver to the current autorelease pool.
func (MTLAttribute) Name ¶
func (a MTLAttribute) Name() string
The name of the attribute.
See: https://developer.apple.com/documentation/Metal/MTLAttribute/name
func (MTLAttribute) PatchControlPointData ¶
func (a MTLAttribute) PatchControlPointData() bool
A Boolean value that indicates whether the attribute represents control point data.
See: https://developer.apple.com/documentation/Metal/MTLAttribute/isPatchControlPointData
func (MTLAttribute) PatchData ¶
func (a MTLAttribute) PatchData() bool
A Boolean value that indicates whether the attribute represents tessellation patch data.
See: https://developer.apple.com/documentation/Metal/MTLAttribute/isPatchData
type MTLAttributeClass ¶
type MTLAttributeClass struct {
// contains filtered or unexported fields
}
func GetMTLAttributeClass ¶
func GetMTLAttributeClass() MTLAttributeClass
GetMTLAttributeClass returns the class object for MTLAttribute.
func (MTLAttributeClass) Alloc ¶
func (mc MTLAttributeClass) Alloc() MTLAttribute
Alloc allocates memory for a new instance of the class.
type MTLAttributeDescriptor ¶
type MTLAttributeDescriptor struct {
objectivec.Object
}
A descriptor of an argument’s format and where its data is in memory.
Overview ¶
Attribute descriptors are part of an MTLVertexDescriptor or MTLStageInputOutputDescriptor instance to provide layout information about a function’s arguments. Each descriptor is for a single argument, containing information about the attached data, offset and stride, and data type.
Defining attribute location ¶
- MTLAttributeDescriptor.BufferIndex: The index in the buffer argument table for the buffer that contains the data for this attribute.
- MTLAttributeDescriptor.SetBufferIndex
- MTLAttributeDescriptor.Offset: The offset, in bytes, from the start of the buffer containing the attribute data to the start of the data itself.
- MTLAttributeDescriptor.SetOffset
- MTLAttributeDescriptor.Format: The format of the attribute’s data.
- MTLAttributeDescriptor.SetFormat
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptor
func MTLAttributeDescriptorFromID ¶
func MTLAttributeDescriptorFromID(id objc.ID) MTLAttributeDescriptor
MTLAttributeDescriptorFromID constructs a MTLAttributeDescriptor from an objc.ID.
A descriptor of an argument’s format and where its data is in memory.
func NewMTLAttributeDescriptor ¶
func NewMTLAttributeDescriptor() MTLAttributeDescriptor
NewMTLAttributeDescriptor creates a new MTLAttributeDescriptor instance.
func (MTLAttributeDescriptor) Autorelease ¶
func (a MTLAttributeDescriptor) Autorelease() MTLAttributeDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLAttributeDescriptor) BufferIndex ¶
func (a MTLAttributeDescriptor) BufferIndex() uint
The index in the buffer argument table for the buffer that contains the data for this attribute.
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptor/bufferIndex
func (MTLAttributeDescriptor) Format ¶
func (a MTLAttributeDescriptor) Format() MTLAttributeFormat
The format of the attribute’s data.
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptor/format
func (MTLAttributeDescriptor) Init ¶
func (a MTLAttributeDescriptor) Init() MTLAttributeDescriptor
Init initializes the instance.
func (MTLAttributeDescriptor) Offset ¶
func (a MTLAttributeDescriptor) Offset() uint
The offset, in bytes, from the start of the buffer containing the attribute data to the start of the data itself.
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptor/offset
func (MTLAttributeDescriptor) SetBufferIndex ¶
func (a MTLAttributeDescriptor) SetBufferIndex(value uint)
func (MTLAttributeDescriptor) SetFormat ¶
func (a MTLAttributeDescriptor) SetFormat(value MTLAttributeFormat)
func (MTLAttributeDescriptor) SetOffset ¶
func (a MTLAttributeDescriptor) SetOffset(value uint)
func (MTLAttributeDescriptor) SetStageInputDescriptor ¶
func (a MTLAttributeDescriptor) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
func (MTLAttributeDescriptor) StageInputDescriptor ¶
func (a MTLAttributeDescriptor) StageInputDescriptor() IMTLStageInputOutputDescriptor
The organization of input and output data for the next kernel call.
See: https://developer.apple.com/documentation/metal/mtlcomputepipelinedescriptor/stageinputdescriptor
type MTLAttributeDescriptorArray ¶
type MTLAttributeDescriptorArray struct {
objectivec.Object
}
An array of attribute descriptor objects.
Overview ¶
An MTLAttributeDescriptorArray defines the data format and index binding for the attribute argument table, using MTLAttributeDescriptor instances.
Accessing attribute state objects ¶
- MTLAttributeDescriptorArray.ObjectAtIndexedSubscript: Returns the state of the specified attribute.
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptorArray
func MTLAttributeDescriptorArrayFromID ¶
func MTLAttributeDescriptorArrayFromID(id objc.ID) MTLAttributeDescriptorArray
MTLAttributeDescriptorArrayFromID constructs a MTLAttributeDescriptorArray from an objc.ID.
An array of attribute descriptor objects.
func NewMTLAttributeDescriptorArray ¶
func NewMTLAttributeDescriptorArray() MTLAttributeDescriptorArray
NewMTLAttributeDescriptorArray creates a new MTLAttributeDescriptorArray instance.
func (MTLAttributeDescriptorArray) Autorelease ¶
func (a MTLAttributeDescriptorArray) Autorelease() MTLAttributeDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLAttributeDescriptorArray) Init ¶
func (a MTLAttributeDescriptorArray) Init() MTLAttributeDescriptorArray
Init initializes the instance.
func (MTLAttributeDescriptorArray) ObjectAtIndexedSubscript ¶
func (a MTLAttributeDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLAttributeDescriptor
Returns the state of the specified attribute.
index: A specified index in the argument table bindings.
Return Value ¶
The attribute descriptor for data bound at this index.
See: https://developer.apple.com/documentation/Metal/MTLAttributeDescriptorArray/subscript(_:)
func (MTLAttributeDescriptorArray) SetObjectAtIndexedSubscript ¶
func (a MTLAttributeDescriptorArray) SetObjectAtIndexedSubscript(attributeDesc IMTLAttributeDescriptor, index uint)
Sets state for the specified attribute.
attributeDesc: A descriptor that contains attribute state.
index: A specified index in the array of vertex attribute states.
func (MTLAttributeDescriptorArray) SetStageInputDescriptor ¶
func (a MTLAttributeDescriptorArray) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
func (MTLAttributeDescriptorArray) StageInputDescriptor ¶
func (a MTLAttributeDescriptorArray) StageInputDescriptor() IMTLStageInputOutputDescriptor
The organization of input and output data for the next kernel call.
See: https://developer.apple.com/documentation/metal/mtlcomputepipelinedescriptor/stageinputdescriptor
type MTLAttributeDescriptorArrayClass ¶
type MTLAttributeDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLAttributeDescriptorArrayClass ¶
func GetMTLAttributeDescriptorArrayClass() MTLAttributeDescriptorArrayClass
GetMTLAttributeDescriptorArrayClass returns the class object for MTLAttributeDescriptorArray.
func (MTLAttributeDescriptorArrayClass) Alloc ¶
func (mc MTLAttributeDescriptorArrayClass) Alloc() MTLAttributeDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLAttributeDescriptorClass ¶
type MTLAttributeDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLAttributeDescriptorClass ¶
func GetMTLAttributeDescriptorClass() MTLAttributeDescriptorClass
GetMTLAttributeDescriptorClass returns the class object for MTLAttributeDescriptor.
func (MTLAttributeDescriptorClass) Alloc ¶
func (mc MTLAttributeDescriptorClass) Alloc() MTLAttributeDescriptor
Alloc allocates memory for a new instance of the class.
type MTLAttributeFormat ¶
type MTLAttributeFormat int
See: https://developer.apple.com/documentation/Metal/MTLAttributeFormat
const ( // MTLAttributeFormatChar: An 8-bit, signed integer value. MTLAttributeFormatChar MTLAttributeFormat = 46 // MTLAttributeFormatChar2: A two-component vector with 8-bit, signed integer values. MTLAttributeFormatChar2 MTLAttributeFormat = 4 // MTLAttributeFormatChar2Normalized: A two-component vector with 8-bit, normalized, signed integer values. MTLAttributeFormatChar2Normalized MTLAttributeFormat = 10 // MTLAttributeFormatChar3: A three-component vector with 8-bit, signed integer values. MTLAttributeFormatChar3 MTLAttributeFormat = 5 // MTLAttributeFormatChar3Normalized: A three-component vector with 8-bit, normalized, signed integer values. MTLAttributeFormatChar3Normalized MTLAttributeFormat = 11 // MTLAttributeFormatChar4: A four-component vector with 8-bit, signed integer values. MTLAttributeFormatChar4 MTLAttributeFormat = 6 // MTLAttributeFormatChar4Normalized: A four-component vector with 8-bit, normalized, signed integer values. MTLAttributeFormatChar4Normalized MTLAttributeFormat = 12 // MTLAttributeFormatCharNormalized: An 8-bit, normalized, signed integer value. MTLAttributeFormatCharNormalized MTLAttributeFormat = 48 // MTLAttributeFormatFloat: A 32-bit floating-point value. MTLAttributeFormatFloat MTLAttributeFormat = 28 // MTLAttributeFormatFloat2: A two-component vector with 32-bit floating-point values. MTLAttributeFormatFloat2 MTLAttributeFormat = 29 // MTLAttributeFormatFloat3: A three-component vector with 32-bit floating-point values. MTLAttributeFormatFloat3 MTLAttributeFormat = 30 // MTLAttributeFormatFloat4: A four-component vector with 32-bit floating-point values. MTLAttributeFormatFloat4 MTLAttributeFormat = 31 // MTLAttributeFormatFloatRG11B10: One packed 32-bit value representing pixel data containing 11-bit float red and green channels, and a 10-bit float blue channel. MTLAttributeFormatFloatRG11B10 MTLAttributeFormat = 54 // MTLAttributeFormatFloatRGB9E5: One packed 32-bit value representing pixel data containing 9-bit float red, green, and blue channels, and a 5-bit float shared exponent channel. MTLAttributeFormatFloatRGB9E5 MTLAttributeFormat = 55 // MTLAttributeFormatHalf: A 16-bit floating-point value. MTLAttributeFormatHalf MTLAttributeFormat = 53 // MTLAttributeFormatHalf2: A two-component vector with 16-bit floating-point values. MTLAttributeFormatHalf2 MTLAttributeFormat = 25 // MTLAttributeFormatHalf3: A three-component vector with 16-bit floating-point values. MTLAttributeFormatHalf3 MTLAttributeFormat = 26 // MTLAttributeFormatHalf4: A four-component vector with 16-bit floating-point values. MTLAttributeFormatHalf4 MTLAttributeFormat = 27 // MTLAttributeFormatInt: A 32-bit, signed integer value. MTLAttributeFormatInt MTLAttributeFormat = 32 // MTLAttributeFormatInt1010102Normalized: One packed 32-bit value with four normalized signed two’s complement integer values, arranged as 10 bits, 10 bits, 10 bits, and 2 bits. MTLAttributeFormatInt1010102Normalized MTLAttributeFormat = 40 // MTLAttributeFormatInt2: A two-component vector with 32-bit, signed integer values. MTLAttributeFormatInt2 MTLAttributeFormat = 33 // MTLAttributeFormatInt3: A three-component vector with 32-bit, signed integer values. MTLAttributeFormatInt3 MTLAttributeFormat = 34 // MTLAttributeFormatInt4: A four-component vector with 32-bit, signed integer values. MTLAttributeFormatInt4 MTLAttributeFormat = 35 // MTLAttributeFormatInvalid: A sentinel value that represents an invalid attribute format. MTLAttributeFormatInvalid MTLAttributeFormat = 0 // MTLAttributeFormatShort: A 16-bit, signed integer value. MTLAttributeFormatShort MTLAttributeFormat = 50 // MTLAttributeFormatShort2: A two-component vector with 16-bit, signed integer values. MTLAttributeFormatShort2 MTLAttributeFormat = 16 // MTLAttributeFormatShort2Normalized: A two-component vector with 16-bit, normalized, signed integer values. MTLAttributeFormatShort2Normalized MTLAttributeFormat = 22 // MTLAttributeFormatShort3: A three-component vector with 16-bit, signed integer values. MTLAttributeFormatShort3 MTLAttributeFormat = 17 // MTLAttributeFormatShort3Normalized: A three-component vector with 16-bit, normalized, signed integer values. MTLAttributeFormatShort3Normalized MTLAttributeFormat = 23 // MTLAttributeFormatShort4: A four-component vector with 16-bit, signed integer values. MTLAttributeFormatShort4 MTLAttributeFormat = 18 // MTLAttributeFormatShort4Normalized: A four-component vector with 16-bit, normalized, signed integer values. MTLAttributeFormatShort4Normalized MTLAttributeFormat = 24 // MTLAttributeFormatShortNormalized: A 16-bit, normalized, signed integer value. MTLAttributeFormatShortNormalized MTLAttributeFormat = 52 // MTLAttributeFormatUChar: An 8-bit, unsigned integer value. MTLAttributeFormatUChar MTLAttributeFormat = 45 // MTLAttributeFormatUChar2: A two-component vector with 8-bit, unsigned integer values. MTLAttributeFormatUChar2 MTLAttributeFormat = 1 // MTLAttributeFormatUChar2Normalized: A two-component vector with 8-bit, normalized, unsigned integer values. MTLAttributeFormatUChar2Normalized MTLAttributeFormat = 7 // MTLAttributeFormatUChar3: A three-component vector with 8-bit, unsigned integer values. MTLAttributeFormatUChar3 MTLAttributeFormat = 2 // MTLAttributeFormatUChar3Normalized: A three-component vector with 8-bit, normalized, unsigned integer values. MTLAttributeFormatUChar3Normalized MTLAttributeFormat = 8 // MTLAttributeFormatUChar4: A four-component vector with 8-bit, unsigned integer values. MTLAttributeFormatUChar4 MTLAttributeFormat = 3 // MTLAttributeFormatUChar4Normalized: A four-component vector with 8-bit, normalized, unsigned integer values. MTLAttributeFormatUChar4Normalized MTLAttributeFormat = 9 // MTLAttributeFormatUChar4Normalized_BGRA: Four unsigned normalized 8-bit values, arranged as blue, green, red, and alpha components. MTLAttributeFormatUChar4Normalized_BGRA MTLAttributeFormat = 42 // MTLAttributeFormatUCharNormalized: An 8-bit, normalized, unsigned integer value. MTLAttributeFormatUCharNormalized MTLAttributeFormat = 47 // MTLAttributeFormatUInt: A 32-bit, unsigned integer value. MTLAttributeFormatUInt MTLAttributeFormat = 36 // MTLAttributeFormatUInt1010102Normalized: One packed 32-bit value with four normalized unsigned integer values, arranged as 10 bits, 10 bits, 10 bits, and 2 bits. MTLAttributeFormatUInt1010102Normalized MTLAttributeFormat = 41 // MTLAttributeFormatUInt2: A two-component vector with 32-bit, unsigned integer values. MTLAttributeFormatUInt2 MTLAttributeFormat = 37 // MTLAttributeFormatUInt3: A three-component vector with 32-bit, unsigned integer values. MTLAttributeFormatUInt3 MTLAttributeFormat = 38 // MTLAttributeFormatUInt4: A four-component vector with 32-bit, unsigned integer values. MTLAttributeFormatUInt4 MTLAttributeFormat = 39 // MTLAttributeFormatUShort: A 16-bit, unsigned integer value. MTLAttributeFormatUShort MTLAttributeFormat = 49 // MTLAttributeFormatUShort2: A two-component vector with 16-bit, unsigned integer values. MTLAttributeFormatUShort2 MTLAttributeFormat = 13 // MTLAttributeFormatUShort2Normalized: Two unsigned normalized 16-bit values MTLAttributeFormatUShort2Normalized MTLAttributeFormat = 19 // MTLAttributeFormatUShort3: A three-component vector with 16-bit, unsigned integer values. MTLAttributeFormatUShort3 MTLAttributeFormat = 14 // MTLAttributeFormatUShort3Normalized: A three-component vector with 16-bit, normalized, unsigned integer values. MTLAttributeFormatUShort3Normalized MTLAttributeFormat = 20 // MTLAttributeFormatUShort4: A four-component vector with 16-bit, unsigned integer values. MTLAttributeFormatUShort4 MTLAttributeFormat = 15 // MTLAttributeFormatUShort4Normalized: A four-component vector with 16-bit, normalized, unsigned integer values. MTLAttributeFormatUShort4Normalized MTLAttributeFormat = 21 // MTLAttributeFormatUShortNormalized: A 16-bit, normalized, unsigned integer value. MTLAttributeFormatUShortNormalized MTLAttributeFormat = 51 )
func (MTLAttributeFormat) String ¶
func (e MTLAttributeFormat) String() string
type MTLAutoreleasedComputePipelineReflection ¶
type MTLAutoreleasedComputePipelineReflection = *MTLComputePipelineReflection
MTLAutoreleasedComputePipelineReflection is a convenience type alias for an autoreleased compute pipeline reflection object.
See: https://developer.apple.com/documentation/Metal/MTLAutoreleasedComputePipelineReflection
type MTLAutoreleasedRenderPipelineReflection ¶
type MTLAutoreleasedRenderPipelineReflection = *MTLRenderPipelineReflection
MTLAutoreleasedRenderPipelineReflection is a convenience type alias for an autoreleased pipeline reflection instance.
See: https://developer.apple.com/documentation/Metal/MTLAutoreleasedRenderPipelineReflection
type MTLAxisAlignedBoundingBox ¶
type MTLAxisAlignedBoundingBox struct {
Min MTLPackedFloat3
Max MTLPackedFloat3
}
MTLAxisAlignedBoundingBox - The bounds for an axis-aligned bounding box.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLAxisAlignedBoundingBox-c.struct
type MTLBarrierScope ¶
type MTLBarrierScope int
See: https://developer.apple.com/documentation/Metal/MTLBarrierScope
const ( // MTLBarrierScopeBuffers: The barrier affects any buffer objects. MTLBarrierScopeBuffers MTLBarrierScope = 1 // MTLBarrierScopeRenderTargets: The barrier affects any render targets. MTLBarrierScopeRenderTargets MTLBarrierScope = 4 // MTLBarrierScopeTextures: The barrier affects textures. MTLBarrierScopeTextures MTLBarrierScope = 2 )
func (MTLBarrierScope) String ¶
func (e MTLBarrierScope) String() string
type MTLBinaryArchive ¶
type MTLBinaryArchive interface {
objectivec.IObject
// The Metal device object that created the binary archive.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/device
Device() MTLDevice
// A string that identifies the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/label
Label() string
// Adds a description of a compute pipeline to the archive.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addComputePipelineFunctions(descriptor:)
AddComputePipelineFunctionsWithDescriptorError(descriptor IMTLComputePipelineDescriptor) (bool, error)
// Adds a description of a render pipeline to the archive.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addRenderPipelineFunctions(descriptor:)
AddRenderPipelineFunctionsWithDescriptorError(descriptor IMTLRenderPipelineDescriptor) (bool, error)
// Adds a description of a tile renderer pipeline to the archive.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addTileRenderPipelineFunctions(descriptor:)
AddTileRenderPipelineFunctionsWithDescriptorError(descriptor IMTLTileRenderPipelineDescriptor) (bool, error)
// Adds a description of a function to the archive.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addFunction(descriptor:library:)
AddFunctionWithDescriptorLibraryError(descriptor IMTLFunctionDescriptor, library MTLLibrary) (bool, error)
// Writes the contents of the archive to a file.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/serialize(to:)
SerializeToURLError(url foundation.INSURL) (bool, error)
// AddLibraryWithDescriptorError protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addLibrary(descriptor:)
AddLibraryWithDescriptorError(descriptor IMTLStitchedLibraryDescriptor) (bool, error)
// AddMeshRenderPipelineFunctionsWithDescriptorError protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addMeshRenderPipelineFunctions(descriptor:)
AddMeshRenderPipelineFunctionsWithDescriptorError(descriptor IMTLMeshRenderPipelineDescriptor) (bool, error)
// A string that identifies the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/label
SetLabel(value string)
}
A container for pipeline state descriptors and their associated compiled shader code.
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive
type MTLBinaryArchiveDescriptor ¶
type MTLBinaryArchiveDescriptor struct {
objectivec.Object
}
A description of a binary shader archive that you want to create.
Choosing an archive file ¶
- MTLBinaryArchiveDescriptor.Url: A URL to a Metal binary archive file.
- MTLBinaryArchiveDescriptor.SetUrl
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchiveDescriptor
func MTLBinaryArchiveDescriptorFromID ¶
func MTLBinaryArchiveDescriptorFromID(id objc.ID) MTLBinaryArchiveDescriptor
MTLBinaryArchiveDescriptorFromID constructs a MTLBinaryArchiveDescriptor from an objc.ID.
A description of a binary shader archive that you want to create.
func NewMTLBinaryArchiveDescriptor ¶
func NewMTLBinaryArchiveDescriptor() MTLBinaryArchiveDescriptor
NewMTLBinaryArchiveDescriptor creates a new MTLBinaryArchiveDescriptor instance.
func (MTLBinaryArchiveDescriptor) Autorelease ¶
func (b MTLBinaryArchiveDescriptor) Autorelease() MTLBinaryArchiveDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLBinaryArchiveDescriptor) Init ¶
func (b MTLBinaryArchiveDescriptor) Init() MTLBinaryArchiveDescriptor
Init initializes the instance.
func (MTLBinaryArchiveDescriptor) MTLBinaryArchiveDomain ¶
func (b MTLBinaryArchiveDescriptor) MTLBinaryArchiveDomain() string
The domain for Metal binary archive errors.
See: https://developer.apple.com/documentation/metal/mtlbinaryarchivedomain
func (MTLBinaryArchiveDescriptor) SetUrl ¶
func (b MTLBinaryArchiveDescriptor) SetUrl(value foundation.INSURL)
func (MTLBinaryArchiveDescriptor) Url ¶
func (b MTLBinaryArchiveDescriptor) Url() foundation.INSURL
A URL to a Metal binary archive file.
Discussion ¶
You can use this method to load a binary archive you created with an MTLBinaryArchive instance’s [SerializeToURLError] method.
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchiveDescriptor/url
type MTLBinaryArchiveDescriptorClass ¶
type MTLBinaryArchiveDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLBinaryArchiveDescriptorClass ¶
func GetMTLBinaryArchiveDescriptorClass() MTLBinaryArchiveDescriptorClass
GetMTLBinaryArchiveDescriptorClass returns the class object for MTLBinaryArchiveDescriptor.
func (MTLBinaryArchiveDescriptorClass) Alloc ¶
func (mc MTLBinaryArchiveDescriptorClass) Alloc() MTLBinaryArchiveDescriptor
Alloc allocates memory for a new instance of the class.
type MTLBinaryArchiveError ¶
type MTLBinaryArchiveError int
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code
const ( // MTLBinaryArchiveErrorCompilationFailure: An error code that indicates the archive’s inability to compile its contents, typically when serializing it to a URL. MTLBinaryArchiveErrorCompilationFailure MTLBinaryArchiveError = 3 // MTLBinaryArchiveErrorInternalError: An error code that indicates the Metal framework has an internal problem. MTLBinaryArchiveErrorInternalError MTLBinaryArchiveError = 4 // MTLBinaryArchiveErrorInvalidFile: An error code that indicates an app is using an invalid reference to an archive file, typically related to a URL. MTLBinaryArchiveErrorInvalidFile MTLBinaryArchiveError = 1 // MTLBinaryArchiveErrorNone: An error code that represents the absence of any problems. MTLBinaryArchiveErrorNone MTLBinaryArchiveError = 0 // MTLBinaryArchiveErrorUnexpectedElement: An error code that indicates a problem with a configuration, typically in a descriptor or an archive’s inability to add linked functions. MTLBinaryArchiveErrorUnexpectedElement MTLBinaryArchiveError = 2 )
func (MTLBinaryArchiveError) String ¶
func (e MTLBinaryArchiveError) String() string
type MTLBinaryArchiveObject ¶
type MTLBinaryArchiveObject struct {
objectivec.Object
}
MTLBinaryArchiveObject wraps an existing Objective-C object that conforms to the MTLBinaryArchive protocol.
func MTLBinaryArchiveObjectFromID ¶
func MTLBinaryArchiveObjectFromID(id objc.ID) MTLBinaryArchiveObject
MTLBinaryArchiveObjectFromID constructs a MTLBinaryArchiveObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLBinaryArchiveObject) AddComputePipelineFunctionsWithDescriptorError ¶
func (o MTLBinaryArchiveObject) AddComputePipelineFunctionsWithDescriptorError(descriptor IMTLComputePipelineDescriptor) (bool, error)
Adds a description of a compute pipeline to the archive.
descriptor: A description of the compute pipeline to archive.
func (MTLBinaryArchiveObject) AddFunctionWithDescriptorLibraryError ¶
func (o MTLBinaryArchiveObject) AddFunctionWithDescriptorLibraryError(descriptor IMTLFunctionDescriptor, library MTLLibrary) (bool, error)
Adds a description of a function to the archive.
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addFunction(descriptor:library:)
func (MTLBinaryArchiveObject) AddLibraryWithDescriptorError ¶
func (o MTLBinaryArchiveObject) AddLibraryWithDescriptorError(descriptor IMTLStitchedLibraryDescriptor) (bool, error)
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/addLibrary(descriptor:)
func (MTLBinaryArchiveObject) AddMeshRenderPipelineFunctionsWithDescriptorError ¶
func (o MTLBinaryArchiveObject) AddMeshRenderPipelineFunctionsWithDescriptorError(descriptor IMTLMeshRenderPipelineDescriptor) (bool, error)
func (MTLBinaryArchiveObject) AddRenderPipelineFunctionsWithDescriptorError ¶
func (o MTLBinaryArchiveObject) AddRenderPipelineFunctionsWithDescriptorError(descriptor IMTLRenderPipelineDescriptor) (bool, error)
Adds a description of a render pipeline to the archive.
descriptor: A description of the render pipeline to archive.
func (MTLBinaryArchiveObject) AddTileRenderPipelineFunctionsWithDescriptorError ¶
func (o MTLBinaryArchiveObject) AddTileRenderPipelineFunctionsWithDescriptorError(descriptor IMTLTileRenderPipelineDescriptor) (bool, error)
Adds a description of a tile renderer pipeline to the archive.
descriptor: A description of the tile renderer pipeline to archive.
func (MTLBinaryArchiveObject) BaseObject ¶
func (o MTLBinaryArchiveObject) BaseObject() objectivec.Object
func (MTLBinaryArchiveObject) Device ¶
func (o MTLBinaryArchiveObject) Device() MTLDevice
The Metal device object that created the binary archive.
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/device
func (MTLBinaryArchiveObject) Label ¶
func (o MTLBinaryArchiveObject) Label() string
A string that identifies the library.
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/label
func (MTLBinaryArchiveObject) SerializeToURLError ¶
func (o MTLBinaryArchiveObject) SerializeToURLError(url foundation.INSURL) (bool, error)
Writes the contents of the archive to a file.
url: The URL for the destination file.
Discussion ¶
The destination folder needs to exist when you call this method.
See: https://developer.apple.com/documentation/Metal/MTLBinaryArchive/serialize(to:)
func (MTLBinaryArchiveObject) SetLabel ¶
func (o MTLBinaryArchiveObject) SetLabel(value string)
type MTLBinding ¶
type MTLBinding interface {
objectivec.IObject
// Access protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinding/access
Access() MTLBindingAccess
// Index protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinding/index
Index() uint
// Argument protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinding/isArgument
IsArgument() bool
// Used protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinding/isUsed
IsUsed() bool
// Name protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinding/name
Name() string
// Type protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBinding/type
Type() MTLBindingType
}
MTLBinding protocol.
See: https://developer.apple.com/documentation/Metal/MTLBinding
type MTLBindingAccess ¶
type MTLBindingAccess int
See: https://developer.apple.com/documentation/Metal/MTLBindingAccess
const ( MTLBindingAccessReadOnly MTLBindingAccess = 0 MTLBindingAccessReadWrite MTLBindingAccess = 1 MTLBindingAccessWriteOnly MTLBindingAccess = 2 // Deprecated. MTLArgumentAccessReadOnly MTLBindingAccess = 0 // Deprecated. MTLArgumentAccessReadWrite MTLBindingAccess = 1 // Deprecated. MTLArgumentAccessWriteOnly MTLBindingAccess = 2 )
func (MTLBindingAccess) String ¶
func (e MTLBindingAccess) String() string
type MTLBindingObject ¶
type MTLBindingObject struct {
objectivec.Object
}
MTLBindingObject wraps an existing Objective-C object that conforms to the MTLBinding protocol.
func MTLBindingObjectFromID ¶
func MTLBindingObjectFromID(id objc.ID) MTLBindingObject
MTLBindingObjectFromID constructs a MTLBindingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLBindingObject) Access ¶
func (o MTLBindingObject) Access() MTLBindingAccess
See: https://developer.apple.com/documentation/Metal/MTLBinding/access
func (MTLBindingObject) BaseObject ¶
func (o MTLBindingObject) BaseObject() objectivec.Object
func (MTLBindingObject) Index ¶
func (o MTLBindingObject) Index() uint
See: https://developer.apple.com/documentation/Metal/MTLBinding/index
func (MTLBindingObject) IsArgument ¶
func (o MTLBindingObject) IsArgument() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isArgument
func (MTLBindingObject) IsUsed ¶
func (o MTLBindingObject) IsUsed() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isUsed
func (MTLBindingObject) Name ¶
func (o MTLBindingObject) Name() string
See: https://developer.apple.com/documentation/Metal/MTLBinding/name
func (MTLBindingObject) Type ¶
func (o MTLBindingObject) Type() MTLBindingType
See: https://developer.apple.com/documentation/Metal/MTLBinding/type
type MTLBindingType ¶
type MTLBindingType int
See: https://developer.apple.com/documentation/Metal/MTLBindingType
const ( MTLBindingTypeBuffer MTLBindingType = 0 MTLBindingTypeImageblock MTLBindingType = 17 MTLBindingTypeImageblockData MTLBindingType = 16 MTLBindingTypeInstanceAccelerationStructure MTLBindingType = 26 MTLBindingTypeIntersectionFunctionTable MTLBindingType = 27 MTLBindingTypeObjectPayload MTLBindingType = 34 MTLBindingTypePrimitiveAccelerationStructure MTLBindingType = 25 MTLBindingTypeSampler MTLBindingType = 3 MTLBindingTypeTensor MTLBindingType = 37 MTLBindingTypeTexture MTLBindingType = 2 MTLBindingTypeThreadgroupMemory MTLBindingType = 1 MTLBindingTypeVisibleFunctionTable MTLBindingType = 24 )
func (MTLBindingType) String ¶
func (e MTLBindingType) String() string
type MTLBlendFactor ¶
type MTLBlendFactor int
See: https://developer.apple.com/documentation/Metal/MTLBlendFactor
const ( // MTLBlendFactorBlendAlpha: Blend factor of alpha value. MTLBlendFactorBlendAlpha MTLBlendFactor = 13 // MTLBlendFactorBlendColor: A blend factor that applies the blend color’s red, green, and blue components. MTLBlendFactorBlendColor MTLBlendFactor = 11 // MTLBlendFactorDestinationAlpha: Blend factor of destination alpha. MTLBlendFactorDestinationAlpha MTLBlendFactor = 8 // MTLBlendFactorDestinationColor: Blend factor of destination values. MTLBlendFactorDestinationColor MTLBlendFactor = 6 // MTLBlendFactorOne: Blend factor of one. MTLBlendFactorOne MTLBlendFactor = 1 // MTLBlendFactorOneMinusBlendAlpha: Blend factor of one minus alpha value. MTLBlendFactorOneMinusBlendAlpha MTLBlendFactor = 14 // MTLBlendFactorOneMinusBlendColor: A blend factor that applies one minus the blend color’s red, green, and blue components. MTLBlendFactorOneMinusBlendColor MTLBlendFactor = 12 // MTLBlendFactorOneMinusDestinationAlpha: Blend factor of one minus destination alpha. MTLBlendFactorOneMinusDestinationAlpha MTLBlendFactor = 9 // MTLBlendFactorOneMinusDestinationColor: Blend factor of one minus destination values. MTLBlendFactorOneMinusDestinationColor MTLBlendFactor = 7 // MTLBlendFactorOneMinusSource1Alpha: Blend factor of one minus source alpha. MTLBlendFactorOneMinusSource1Alpha MTLBlendFactor = 18 // MTLBlendFactorOneMinusSource1Color: Blend factor of one minus source values. MTLBlendFactorOneMinusSource1Color MTLBlendFactor = 16 // MTLBlendFactorOneMinusSourceAlpha: Blend factor of one minus source alpha. MTLBlendFactorOneMinusSourceAlpha MTLBlendFactor = 5 // MTLBlendFactorOneMinusSourceColor: Blend factor of one minus source values. MTLBlendFactorOneMinusSourceColor MTLBlendFactor = 3 // MTLBlendFactorSource1Alpha: Blend factor of source alpha. MTLBlendFactorSource1Alpha MTLBlendFactor = 17 // MTLBlendFactorSource1Color: Blend factor of source values. MTLBlendFactorSource1Color MTLBlendFactor = 15 // MTLBlendFactorSourceAlpha: Blend factor of source alpha. MTLBlendFactorSourceAlpha MTLBlendFactor = 4 // MTLBlendFactorSourceAlphaSaturated: Blend factor of the minimum of either source alpha or one minus destination alpha. MTLBlendFactorSourceAlphaSaturated MTLBlendFactor = 10 // MTLBlendFactorSourceColor: Blend factor of source values. MTLBlendFactorSourceColor MTLBlendFactor = 2 // MTLBlendFactorUnspecialized: Defers assigning the blend factor. MTLBlendFactorUnspecialized MTLBlendFactor = 19 // MTLBlendFactorZero: Blend factor of zero. MTLBlendFactorZero MTLBlendFactor = 0 )
func (MTLBlendFactor) String ¶
func (e MTLBlendFactor) String() string
type MTLBlendOperation ¶
type MTLBlendOperation int
See: https://developer.apple.com/documentation/Metal/MTLBlendOperation
const ( // MTLBlendOperationAdd: Add portions of both source and destination pixel values. MTLBlendOperationAdd MTLBlendOperation = 0 // MTLBlendOperationMax: Maximum of the source and destination pixel values. MTLBlendOperationMax MTLBlendOperation = 4 // MTLBlendOperationMin: Minimum of the source and destination pixel values. MTLBlendOperationMin MTLBlendOperation = 3 // MTLBlendOperationReverseSubtract: Subtract a portion of the source values from a portion of the destination pixel values. MTLBlendOperationReverseSubtract MTLBlendOperation = 2 // MTLBlendOperationSubtract: Subtract a portion of the destination pixel values from a portion of the source. MTLBlendOperationSubtract MTLBlendOperation = 1 // MTLBlendOperationUnspecialized: Defers assigning the blend operation. MTLBlendOperationUnspecialized MTLBlendOperation = 5 )
func (MTLBlendOperation) String ¶
func (e MTLBlendOperation) String() string
type MTLBlitCommandEncoder ¶
type MTLBlitCommandEncoder interface {
objectivec.IObject
MTLCommandEncoder
// Encodes a command that generates mipmaps for a texture from the base mipmap level up to the highest mipmap level.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/generateMipmaps(for:)
GenerateMipmapsForTexture(texture MTLTexture)
// Encodes a command that copies data from one buffer into another.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceOffset:to:destinationOffset:size:)
CopyFromBufferSourceOffsetToBufferDestinationOffsetSize(sourceBuffer MTLBuffer, sourceOffset uint, destinationBuffer MTLBuffer, destinationOffset uint, size uint)
// Encodes a command that copies data from one texture to another.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:to:)
CopyFromTextureToTexture(sourceTexture MTLTexture, destinationTexture MTLTexture)
// Encodes a command that copies slices of a texture to another texture’s slices.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceSlice:sourceLevel:to:destinationSlice:destinationLevel:sliceCount:levelCount:)
CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, sliceCount uint, levelCount uint)
// Encodes a command that copies image data from a texture’s slice into another slice.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceSlice:sourceLevel:sourceOrigin:sourceSize:to:destinationSlice:destinationLevel:destinationOrigin:)
CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
// Encodes a command to copy data from a slice of one tensor into a slice of another tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceOrigin:sourceDimensions:to:destinationOrigin:destinationDimensions:)
CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions(sourceTensor MTLTensor, sourceOrigin IMTLTensorExtents, sourceDimensions IMTLTensorExtents, destinationTensor MTLTensor, destinationOrigin IMTLTensorExtents, destinationDimensions IMTLTensorExtents)
// Encodes a command to copy image data from a source buffer into a destination texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:to:destinationSlice:destinationLevel:destinationOrigin:)
CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
// Encodes a command to copy image data from a source buffer into a destination texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:to:destinationSlice:destinationLevel:destinationOrigin:options:)
CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin, options MTLBlitOption)
// Encodes a command that copies image data from a texture slice to a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceSlice:sourceLevel:sourceOrigin:sourceSize:to:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:)
CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint)
// Encodes a command that copies image data from a texture slice to a buffer, and provides options for special texture formats.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceSlice:sourceLevel:sourceOrigin:sourceSize:to:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options:)
CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint, options MTLBlitOption)
// Encodes a command that improves the performance of GPU memory operations with a texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/optimizeContentsForGPUAccess(texture:)
OptimizeContentsForGPUAccess(texture MTLTexture)
// Encodes a command that improves the performance of GPU memory operations with a specific portion of a texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/optimizeContentsForGPUAccess(texture:slice:level:)
OptimizeContentsForGPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
// Encodes a command that improves the performance of CPU memory operations with a texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/optimizeContentsForCPUAccess(texture:)
OptimizeContentsForCPUAccess(texture MTLTexture)
// Encodes a command that improves the performance of CPU memory operations with a specific portion of a texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/optimizeContentsForCPUAccess(texture:slice:level:)
OptimizeContentsForCPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
// Encodes a command that synchronizes the CPU’s copy of a managed resource, such as a buffer or texture, so that it matches the GPU’s copy.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/synchronize(resource:)
SynchronizeResource(resource MTLResource)
// Encodes a command that synchronizes a part of the CPU’s copy of a texture so that it matches the GPU’s copy.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/synchronize(texture:slice:level:)
SynchronizeTextureSliceLevel(texture MTLTexture, slice uint, level uint)
// Encodes a command that instructs the GPU to pause the blit pass until another pass updates a fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/waitForFence(_:)
WaitForFence(fence MTLFence)
// Encodes a command that instructs the GPU to update a fence after the blit pass completes.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/updateFence(_:)
UpdateFence(fence MTLFence)
// Encodes a command that samples the GPU’s hardware counters during a blit pass and stores the data in a counter sample buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/sampleCounters(sampleBuffer:sampleIndex:barrier:)
SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
// Encodes a command that retrieves a sparse texture’s access data for a specific region, mipmap level, and slice.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/getTextureAccessCounters(_:region:mipLevel:slice:resetCounters:countersBuffer:countersBufferOffset:)
GetTextureAccessCountersRegionMipLevelSliceResetCountersCountersBufferCountersBufferOffset(texture MTLTexture, region MTLRegion, mipLevel uint, slice uint, resetCounters bool, countersBuffer MTLBuffer, countersBufferOffset uint)
// Encodes a command that resets a sparse texture’s access data for a specific region, mipmap level, and slice.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/resetTextureAccessCounters(_:region:mipLevel:slice:)
ResetTextureAccessCountersRegionMipLevelSlice(texture MTLTexture, region MTLRegion, mipLevel uint, slice uint)
// Encodes a command that copies commands from one indirect command buffer into another.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copyIndirectCommandBuffer:sourceRange:destination:destinationIndex:
CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex(source MTLIndirectCommandBuffer, sourceRange foundation.NSRange, destination MTLIndirectCommandBuffer, destinationIndex uint)
// Encodes a command that fills a buffer with a constant value for each byte.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/fillBuffer:range:value:
FillBufferRangeValue(buffer MTLBuffer, range_ foundation.NSRange, value uint8)
// Encodes a command that can improve the performance of a range of commands within an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/optimizeIndirectCommandBuffer:withRange:
OptimizeIndirectCommandBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
// Encodes a command that resets a range of commands in an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/resetCommandsInBuffer:withRange:
ResetCommandsInBufferWithRange(buffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
// Encodes a command that resolves the data from the samples in a sample counter buffer and stores the results into a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/resolveCounters:inRange:destinationBuffer:destinationOffset:
ResolveCountersInRangeDestinationBufferDestinationOffset(sampleBuffer MTLCounterSampleBuffer, range_ foundation.NSRange, destinationBuffer MTLBuffer, destinationOffset uint)
}
Encodes commands that copy and modify resources for a single blit pass.
See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder
type MTLBlitCommandEncoderObject ¶
type MTLBlitCommandEncoderObject struct {
objectivec.Object
}
MTLBlitCommandEncoderObject wraps an existing Objective-C object that conforms to the MTLBlitCommandEncoder protocol.
func MTLBlitCommandEncoderObjectFromID ¶
func MTLBlitCommandEncoderObjectFromID(id objc.ID) MTLBlitCommandEncoderObject
MTLBlitCommandEncoderObjectFromID constructs a MTLBlitCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLBlitCommandEncoderObject) BarrierAfterQueueStagesBeforeStages ¶
func (o MTLBlitCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTLBlitCommandEncoderObject) BaseObject ¶
func (o MTLBlitCommandEncoderObject) BaseObject() objectivec.Object
func (MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin ¶
func (o MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
Encodes a command to copy image data from a source buffer into a destination texture.
sourceBuffer: A buffer the command copies data from.
sourceOffset: A byte offset within `sourceBuffer` that the command copies from, which needs to be a multiple of the destination texture’s pixel size, in bytes.
sourceBytesPerRow: The number of bytes between adjacent rows of pixels in the source buffer’s memory, which needs to be:
- A multiple of the source texture’s pixel size, in bytes - Less than or equal to the product of the destination texture’s pixel size, in bytes, and the largest pixel width the destination texture’s type allows
If `destinationTexture` uses a compressed pixel format, set `sourceBytesPerRow` to the number of bytes between the starts of two row blocks.
sourceBytesPerImage: The number of bytes between each 2D image of a 3D texture. This value needs to be a multiple of the source texture’s pixel size, in bytes.
Set this value to `0` for 2D textures, which means `sourceSize.`[depth] is equal to `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
sourceSize: An MTLSize instance, which can represent a 3D region, that instructs the command how many pixels to copy to `destinationTexture`, starting at `destinationOrigin`.
Assign `1` to each dimension that’s not relevant to `destinationTexture`. For example:
- If the destination texture is a 2D texture, set the size’s [depth] property to `1`. - If the destination texture is a 1D texture, set the size’s [height] and [depth] properties to `1`.
If `destinationTexture` uses a compressed pixel format, set `sourceSize` to a multiple of the pixel format’s block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth [height]: https://developer.apple.com/documentation/Metal/MTLSize/height
destinationTexture: A texture with an [IsFramebufferOnly] property value of [false] that the command copies data to. // [false]: https://developer.apple.com/documentation/Swift/false
destinationSlice: A slice within `destinationTexture`.
For textures that use a combined depth/stencil pixel format, call the [CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions] method instead. Configure that method’s `options` parameter appropriately.
destinationLevel: A mipmap level within `destinationTexture`.
destinationOrigin: A location within `destinationTexture` that the command begins copying data to.
Assign `0` to each dimension that’s not relevant to `destinationTexture`. For example:
- If the destination texture is a 2D texture, set the origin’s [z] property to `0`. - If the destination texture is a 1D texture, set the origin’s [y] and [z] properties to `0`. // [y]: https://developer.apple.com/documentation/Metal/MTLOrigin/y [z]: https://developer.apple.com/documentation/Metal/MTLOrigin/z
Discussion ¶
This method is the equivalent of passing an empty OptionSet to the `options` parameter of [CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions]. In Swift, pass `[]` to represent an empty option set, and in Objective-C, pass [BlitOptionNone].
func (MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions ¶
func (o MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOriginOptions(sourceBuffer MTLBuffer, sourceOffset uint, sourceBytesPerRow uint, sourceBytesPerImage uint, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin, options MTLBlitOption)
Encodes a command to copy image data from a source buffer into a destination texture.
sourceBuffer: A buffer the command copies data from.
sourceOffset: A byte offset within `sourceBuffer` that the command copies from, which needs to be a multiple of the destination texture’s pixel size, in bytes.
sourceBytesPerRow: The number of bytes between adjacent rows of pixels in the source buffer’s memory, which needs to be:
- A multiple of the source texture’s pixel size, in bytes - Less than or equal to the product of the destination texture’s pixel size, in bytes, and the largest pixel width the destination texture’s type allows
If `destinationTexture` uses a compressed pixel format, set `sourceBytesPerRow` to the number of bytes between the starts of two row blocks.
sourceBytesPerImage: The number of bytes between each 2D image of a 3D texture. This value needs to be a multiple of the source texture’s pixel size, in bytes.
Set this value to `0` for 2D textures, which means `sourceSize.`[depth] is equal to `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
sourceSize: An MTLSize instance, which can represent a 3D region, that instructs the command how many pixels to copy to `destinationTexture`, starting at `destinationOrigin`.
Assign `1` to each dimension that’s not relevant to `destinationTexture`. For example:
- If the destination texture is a 2D texture, set the size’s [depth] property to `1`. - If the destination texture is a 1D texture, set the size’s [height] and [depth] properties to `1`.
If `destinationTexture` uses a compressed pixel format, set `sourceSize` to a multiple of the pixel format’s block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth [height]: https://developer.apple.com/documentation/Metal/MTLSize/height
destinationTexture: A texture with an [IsFramebufferOnly] property value of [false] that the command copies data to. // [false]: https://developer.apple.com/documentation/Swift/false
destinationSlice: A slice within `destinationTexture`.
For textures that use a combined depth/stencil pixel format, configure the `options` parameter appropriately.
destinationLevel: A mipmap level within `destinationTexture`.
destinationOrigin: A location within `destinationTexture` that the command begins copying data to.
Assign `0` to each dimension that’s not relevant to `destinationTexture`. For example:
- If the destination texture is a 2D texture, set the origin’s [z] property to `0`. - If the destination texture is a 1D texture, set the origin’s [y] and [z] properties to `0`. // [y]: https://developer.apple.com/documentation/Metal/MTLOrigin/y [z]: https://developer.apple.com/documentation/Metal/MTLOrigin/z
options: An option set that applies to textures with applicable pixel formats, such as combined depth/stencil or PVRTC formats.
If the texture’s pixel format is a combined depth/stencil format, set `options` to either [BlitOptionDepthFromDepthStencil] or [BlitOptionStencilFromDepthStencil], but not both.
If the texture’s pixel format is a PVRTC format, set `options` to [BlitOptionRowLinearPVRTC].
Discussion ¶
Passing an empty OptionSet to the `options` parameter is the equivalent of calling [CopyFromBufferSourceOffsetSourceBytesPerRowSourceBytesPerImageSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin]. In Swift, pass `[]` to represent an empty option set, and in Objective-C, pass [BlitOptionNone].
func (MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetToBufferDestinationOffsetSize ¶
func (o MTLBlitCommandEncoderObject) CopyFromBufferSourceOffsetToBufferDestinationOffsetSize(sourceBuffer MTLBuffer, sourceOffset uint, destinationBuffer MTLBuffer, destinationOffset uint, size uint)
Encodes a command that copies data from one buffer into another.
sourceBuffer: A buffer the command copies data from.
sourceOffset: A byte offset within `sourceBuffer` the command copies from. In macOS, `sourceOffset` needs to be a multiple of `4`, but can be any value in iOS and tvOS.
destinationBuffer: The destination buffer for the copy operation.
destinationOffset: A byte offset within `destinationBuffer` the command copies to. In macOS, `destinationOffset` needs to be a multiple of `4`, but can be any value in iOS and tvOS.
size: The number of bytes the command copies from `sourceBuffer` to `destinationBuffer`. In macOS, `size` needs to be a multiple of `4`, but can be any value in iOS and tvOS.
Discussion ¶
You can pass the same buffer to the `sourceBuffer` and `destinationBuffer` parameters if `size` is less than the distance between `sourceOffset` and `destinationOffset`.
func (MTLBlitCommandEncoderObject) CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions ¶
func (o MTLBlitCommandEncoderObject) CopyFromTensorSourceOriginSourceDimensionsToTensorDestinationOriginDestinationDimensions(sourceTensor MTLTensor, sourceOrigin IMTLTensorExtents, sourceDimensions IMTLTensorExtents, destinationTensor MTLTensor, destinationOrigin IMTLTensorExtents, destinationDimensions IMTLTensorExtents)
Encodes a command to copy data from a slice of one tensor into a slice of another tensor.
sourceTensor: A tensor instance that this command copies data from.
sourceOrigin: An array of offsets, in elements, to the first element of the slice of `sourceTensor` that this command copies data from.
sourceDimensions: An array of sizes, in elements, of the slice `sourceTensor` that this command copies data from.
destinationTensor: A tensor instance that this command copies data to.
destinationOrigin: An array of offsets, in elements, to the first element of the slice of `destinationTensor` that this command copies data to.
destinationDimensions: An array of sizes, in elements, of the slice of `destinationTensor` that this command copies data to.
Discussion ¶
This command applies reshapes if `sourceTensor` and `destinationTensor` are not aliasable.
func (MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage ¶
func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint)
Encodes a command that copies image data from a texture slice to a buffer.
sourceTexture: A texture with an [IsFramebufferOnly] property value of [false] that the command copies data from. // [false]: https://developer.apple.com/documentation/Swift/false
sourceSlice: A slice within `sourceTexture`.
For textures that use a combined depth/stencil pixel format, call the [CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions] method instead. Configure that method’s `options` parameter appropriately.
sourceLevel: A mipmap level within `sourceTexture`.
sourceOrigin: A location within `sourceTexture` that the command begins copying data from.
Assign `0` to each dimension that’s not relevant to `sourceTexture`. For example:
- If the source texture is a 2D texture, set the origin’s [z] property to `0`. - If the source texture is a 1D texture, set the origin’s [y] and [z] properties to `0`. // [y]: https://developer.apple.com/documentation/Metal/MTLOrigin/y [z]: https://developer.apple.com/documentation/Metal/MTLOrigin/z
sourceSize: An MTLSize instance, which can represent a 3D region, that instructs the command how many pixels to copy from `sourceTexture`, starting at `sourceOrigin`.
Assign `1` to each dimension that’s not relevant to `sourceTexture`. For example:
- If the source texture is a 2D texture, set the size’s [depth] property to `1`. - If the source texture is a 1D texture, set the size’s [height] and [depth] properties to `1`.
If `sourceTexture` uses a compressed pixel format, set `sourceSize` to a multiple of the pixel format’s block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth [height]: https://developer.apple.com/documentation/Metal/MTLSize/height
destinationBuffer: A buffer the command copies data to.
destinationOffset: A byte offset within `destinationBuffer` the command copies to, which needs to be a multiple of the source texture’s pixel size, in bytes.
destinationBytesPerRow: The number of bytes between adjacent rows of pixels in the destination buffer’s memory, which needs to be:
- A multiple of the source texture’s pixel size, in bytes - Less than or equal to the product of the source texture’s pixel size, in bytes, and the largest pixel width the source texture’s type allows
If `sourceTexture` uses a compressed pixel format, set `destinationBytesPerRow` to the number of bytes between the starts of two row blocks.
destinationBytesPerImage: The number of bytes between each 2D image of a 3D texture. This value needs to be a multiple of the source texture’s pixel size, in bytes.
Set this value to `0` for 2D textures, which means `sourceSize.`[depth] is equal to `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
Discussion ¶
This method is the equivalent of passing an empty OptionSet to the `options` parameter of [CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions]. In Swift, pass `[]` to represent an empty option set, and in Objective-C, pass [BlitOptionNone].
func (MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions ¶
func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImageOptions(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationBuffer MTLBuffer, destinationOffset uint, destinationBytesPerRow uint, destinationBytesPerImage uint, options MTLBlitOption)
Encodes a command that copies image data from a texture slice to a buffer, and provides options for special texture formats.
sourceTexture: A texture with an [IsFramebufferOnly] property value of [false] that the command copies data from. // [false]: https://developer.apple.com/documentation/Swift/false
sourceSlice: A slice within `sourceTexture`.
For textures that use a combined depth/stencil pixel format, configure the `options` parameter appropriately.
sourceLevel: A mipmap level within `sourceTexture`.
sourceOrigin: A location within `sourceTexture` that the command begins copying data from.
Assign `0` to each dimension that’s not relevant to `sourceTexture`. For example:
- If the source texture is a 2D texture, set the origin’s [z] property to `0`. - If the source texture is a 1D texture, set the origin’s [y] and [z] properties to `0`. // [y]: https://developer.apple.com/documentation/Metal/MTLOrigin/y [z]: https://developer.apple.com/documentation/Metal/MTLOrigin/z
sourceSize: An MTLSize instance, which can represent a 3D region, that instructs the command how many pixels to copy from `sourceTexture`, starting at `sourceOrigin`.
Assign `1` to each dimension that’s not relevant to `sourceTexture`. For example:
- If the source texture is a 2D texture, set the size’s [depth] property to `1`. - If the source texture is a 1D texture, set the size’s [height] and [depth] properties to `1`.
If `sourceTexture` uses a compressed pixel format, set `sourceSize` to a multiple of the pixel format’s block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth [height]: https://developer.apple.com/documentation/Metal/MTLSize/height
destinationBuffer: A buffer the command copies data to.
destinationOffset: A byte offset within `destinationBuffer` the command copies to, which needs to be a multiple of the source texture’s pixel size, in bytes.
destinationBytesPerRow: The number of bytes between adjacent rows of pixels in the destination buffer’s memory, which needs to be:
- A multiple of the source texture’s pixel size, in bytes - Less than or equal to the product of the source texture’s pixel size, in bytes, and the largest pixel width the source texture’s type allows
If `sourceTexture` uses a compressed pixel format, set `destinationBytesPerRow` to the number of bytes between the starts of two row blocks.
destinationBytesPerImage: The number of bytes between each 2D image of a 3D texture. This value needs to be a multiple of the source texture’s pixel size, in bytes.
Set this value to `0` for 2D textures, which means `sourceSize.`[depth] is equal to `1`. // [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth
options: An option set that applies to textures with applicable pixel formats, such as combined depth/stencil or PVRTC formats.
If the texture’s pixel format is a combined depth/stencil format, set `options` to either [BlitOptionDepthFromDepthStencil] or [BlitOptionStencilFromDepthStencil], but not both.
If the texture’s pixel format is a PVRTC format, set `options` to [BlitOptionRowLinearPVRTC].
Discussion ¶
Passing an empty OptionSet to the `options` parameter is the equivalent of calling [CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToBufferDestinationOffsetDestinationBytesPerRowDestinationBytesPerImage]. In Swift, pass `[]` to represent an empty option set, and in Objective-C, pass [BlitOptionNone].
func (MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin ¶
func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
Encodes a command that copies image data from a texture’s slice into another slice.
sourceTexture: A texture with an [IsFramebufferOnly] property value of [false] that the command copies data from.
For a texture that uses a compressed pixel format, align the copy region (`sourceOrigin` and `sourceSize`) to the pixel format’s block size. // [false]: https://developer.apple.com/documentation/Swift/false
sourceSlice: A slice within `sourceTexture`.
sourceLevel: A mipmap level within `sourceTexture`.
sourceOrigin: A location within `sourceTexture` that the command begins copying data from.
Assign `0` to each dimension that’s not relevant to `sourceTexture`. For example:
- If the source texture is a 2D texture, set the origin’s [z] property to `0`. - If the source texture is a 1D texture, set the origin’s [y] and [z] properties to `0`. // [y]: https://developer.apple.com/documentation/Metal/MTLOrigin/y [z]: https://developer.apple.com/documentation/Metal/MTLOrigin/z
sourceSize: An MTLSize instance, which can represent a 3D region, that instructs the command how many pixels to copy from `sourceTexture`, starting at `sourceOrigin`.
Assign `1` to each dimension that’s not relevant to `sourceTexture`. For example:
- If the source texture is a 2D texture, set the size’s [depth] property to `1`. - If the source texture is a 1D texture, set the size’s [height] and [depth] properties to `1`.
If `sourceTexture` uses a compressed pixel format, set `sourceSize` to a multiple of the pixel format’s block size. If the block extends outside the bounds of the texture, clamp `sourceSize` to the edge of the texture. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth [height]: https://developer.apple.com/documentation/Metal/MTLSize/height
destinationTexture: A texture the command copies data to that has the following configuration:
- The [IsFramebufferOnly] property value is [false]. - The pixel format is the same as `sourceTexture`. - The sample count is the same as `sourceTexture`.
For a texture that uses a compressed pixel format, align the copy region (`destinationOrigin`) to the pixel format’s block size. // [false]: https://developer.apple.com/documentation/Swift/false
destinationSlice: A slice within `destinationTexture`.
destinationLevel: A mipmap level within `destinationTexture`.
destinationOrigin: A location within `destinationTexture` that the command begins copying data to.
Assign `0` to each dimension that’s not relevant to `destinationTexture`. For example:
- If the destination texture is a 2D texture, set the origin’s [z] property to `0`. - If the destination texture is a 1D texture, set the origin’s [y] and [z] properties to `0`. // [y]: https://developer.apple.com/documentation/Metal/MTLOrigin/y [z]: https://developer.apple.com/documentation/Metal/MTLOrigin/z
Discussion ¶
For textures that use a PVRTC pixel format, you can use this method to copy the entire texture, but not a subregion of the texture.
func (MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount ¶
func (o MTLBlitCommandEncoderObject) CopyFromTextureSourceSliceSourceLevelToTextureDestinationSliceDestinationLevelSliceCountLevelCount(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, sliceCount uint, levelCount uint)
Encodes a command that copies slices of a texture to another texture’s slices.
sourceTexture: A texture the command copies data from.
sourceSlice: A slice within `sourceTexture` the command uses as a starting point to copy data from.
Set this to `0` if `sourceTexture` isn’t a texture array or a cube texture.
sourceLevel: A mipmap level within `sourceTexture`.
destinationTexture: Another texture the command copies the data to that has the same pixel format and sample count as `sourceTexture`.
destinationSlice: A slice within `destinationTexture` the command uses as its starting point for coping data.
Set this to `0` if `destinationTexture` isn’t a texture array or a cube texture.
destinationLevel: A mipmap level within `destinationTexture` that has the same size as the source texture’s `sourceLevel` mipmap.
sliceCount: The number of slices the command copies so that it satisfies these conditions:
- The sum of `sourceLevel` and `sourceSlice` doesn’t exceed the number of slices in `sourceTexture`. - The sum of `destinationLevel` and `destinationSlice` doesn’t exceed the number of slices in `destinationTexture`.
levelCount: The number of mipmap levels the command copies so that it satisfies these conditions:
- The sum of `levelCount` and `sourceLevel` doesn’t exceed the number of mipmap levels in `sourceTexture`. - The sum of `levelCount` and `destinationLevel` doesn’t exceed the number of mipmap levels in `destinationTexture`.
func (MTLBlitCommandEncoderObject) CopyFromTextureToTexture ¶
func (o MTLBlitCommandEncoderObject) CopyFromTextureToTexture(sourceTexture MTLTexture, destinationTexture MTLTexture)
Encodes a command that copies data from one texture to another.
sourceTexture: A texture the command copies data from.
destinationTexture: Another texture the command copies the data to that has the same pixel format and sample count as `sourceTexture`.
Discussion ¶
The textures can be different sizes as long as the larger texture has a mipmap level that’s the same size as the smaller texture’s level `0` mipmap.
The command copies all identical mipmap sizes. If both textures are arrays, the command copies as many texture slices (array elements) as possible.
See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/copy(from:to:)
func (MTLBlitCommandEncoderObject) CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex ¶
func (o MTLBlitCommandEncoderObject) CopyIndirectCommandBufferSourceRangeDestinationDestinationIndex(source MTLIndirectCommandBuffer, sourceRange foundation.NSRange, destination MTLIndirectCommandBuffer, destinationIndex uint)
Encodes a command that copies commands from one indirect command buffer into another.
source: An indirect command buffer the command copies from.
sourceRange: The range of commands in the source buffer to copy. The source range needs to start on a valid execution point.
destination: Another indirect command buffer the command copies to.
destinationIndex: An index in `destination` where the command copies content from `source` to. The destination index needs to be a valid execution point with enough remaining space in `destination` to accommodate `sourceRange.Count()` indices.
Discussion ¶
You can copy commands from one indirect command buffer to another, but only a compatible one. You can create compatible indirect command buffers by passing MTLIndirectCommandBufferDescriptor instances with the same configuration to the [NewIndirectCommandBufferWithDescriptorMaxCommandCountOptions] method of MTLDevice.
func (MTLBlitCommandEncoderObject) Device ¶
func (o MTLBlitCommandEncoderObject) Device() MTLDevice
The Metal device from which the command encoder was created.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
func (MTLBlitCommandEncoderObject) EndEncoding ¶
func (o MTLBlitCommandEncoderObject) EndEncoding()
Declares that all command generation from the encoder is completed.
Discussion ¶
After `endEncoding` is called, the command encoder has no further use. You cannot encode any other commands with this encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
func (MTLBlitCommandEncoderObject) FillBufferRangeValue ¶
func (o MTLBlitCommandEncoderObject) FillBufferRangeValue(buffer MTLBuffer, range_ foundation.NSRange, value uint8)
Encodes a command that fills a buffer with a constant value for each byte.
buffer: A buffer instance the command assigns each byte in `range` to `value`.
range: A range of bytes within the `buffer` the command assigns `value` to. The range’s [count] property needs to be greater than `0`. The range’s [count], [lowerBound], and [upperBound] properties need to be a multiple of `4` in macOS, but can be any value in iOS and tvOS. // [count]: https://developer.apple.com/documentation/Swift/Collection/count [lowerBound]: https://developer.apple.com/documentation/Swift/Range/lowerBound [upperBound]: https://developer.apple.com/documentation/Swift/Range/upperBound
value: The value to write to each byte.
See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/fillBuffer:range:value:
func (MTLBlitCommandEncoderObject) GenerateMipmapsForTexture ¶
func (o MTLBlitCommandEncoderObject) GenerateMipmapsForTexture(texture MTLTexture)
Encodes a command that generates mipmaps for a texture from the base mipmap level up to the highest mipmap level.
texture: A texture instance the command generates mipmaps for that has:
- A [MipmapLevelCount] property that’s greater than `1` - A [PixelFormat] that’s color-renderable and color-filterable
Discussion ¶
The command generates with scaled images for all levels up to the highest mipmap level.
See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/generateMipmaps(for:)
func (MTLBlitCommandEncoderObject) GetTextureAccessCountersRegionMipLevelSliceResetCountersCountersBufferCountersBufferOffset ¶
func (o MTLBlitCommandEncoderObject) GetTextureAccessCountersRegionMipLevelSliceResetCountersCountersBufferCountersBufferOffset(texture MTLTexture, region MTLRegion, mipLevel uint, slice uint, resetCounters bool, countersBuffer MTLBuffer, countersBufferOffset uint)
Encodes a command that retrieves a sparse texture’s access data for a specific region, mipmap level, and slice.
texture: A sparse texture instance.
region: A region within the sparse texture’s `mipLevel`, in sparse tile coordinates.
mipLevel: A mipmap level within the sparse texture.
slice: A slice within the sparse texture.
resetCounters: A Boolean value that indicates whether the command resets the counters after it completes.
countersBuffer: A destination buffer where the command stores the sparse texture’s access counter data.
countersBufferOffset: A starting offset, in bytes, within `countersBuffer` where the command writes the first byte of the sparse texture’s access counter data.
Discussion ¶
The GPU returns a counter for each sparse tile in the region you specify. Each counter is a uint32_t in row-major order. Provide space in the buffer for each counter you request.
When the GPU samples a texture and fails to find data in its internal caches, the GPU increments the access counter for the sparse tile. The GPU then attempts to fetch a new cache line from device memory that contains those pixels.
The counter doesn’t track memory operations to data that’s already in the GPU’s caches. You can ignore differences in cache line sizes or pixel formats because the GPU driver normalizes the access counts. Each count represents the number of pixels the GPU fetches into memory.
func (MTLBlitCommandEncoderObject) InsertDebugSignpost ¶
func (o MTLBlitCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the captured frame data.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
func (MTLBlitCommandEncoderObject) Label ¶
func (o MTLBlitCommandEncoderObject) Label() string
A string that labels the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
func (MTLBlitCommandEncoderObject) OptimizeContentsForCPUAccess ¶
func (o MTLBlitCommandEncoderObject) OptimizeContentsForCPUAccess(texture MTLTexture)
Encodes a command that improves the performance of CPU memory operations with a texture.
texture: A texture the command optimizes.
Discussion ¶
This command can reduce the time it takes the CPU to access a texture. Apps typically run the command for:
- Textures the CPU accesses for an extended period of time - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged]
When a blit pass runs this command, the GPU only applies lossless changes to the texture’s underlying data.
func (MTLBlitCommandEncoderObject) OptimizeContentsForCPUAccessSliceLevel ¶
func (o MTLBlitCommandEncoderObject) OptimizeContentsForCPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
Encodes a command that improves the performance of CPU memory operations with a specific portion of a texture.
texture: A texture the command optimizes.
slice: A slice within `texture`.
level: A mipmap level within `texture`.
Discussion ¶
This command can reduce the time it takes the CPU to access a texture. Apps typically run the command for:
- Textures the CPU accesses for an extended period of time - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged]
When a blit pass runs this command, the GPU only applies lossless changes to the texture’s underlying data.
func (MTLBlitCommandEncoderObject) OptimizeContentsForGPUAccess ¶
func (o MTLBlitCommandEncoderObject) OptimizeContentsForGPUAccess(texture MTLTexture)
Encodes a command that improves the performance of GPU memory operations with a texture.
texture: A texture the command optimizes.
Discussion ¶
This command can reduce the time it takes the GPU to access a texture. Apps typically run the command for:
- Textures the GPU accesses for an extended period of time - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged]
When a blit pass runs this command, the GPU only applies lossless changes to the texture’s underlying data.
func (MTLBlitCommandEncoderObject) OptimizeContentsForGPUAccessSliceLevel ¶
func (o MTLBlitCommandEncoderObject) OptimizeContentsForGPUAccessSliceLevel(texture MTLTexture, slice uint, level uint)
Encodes a command that improves the performance of GPU memory operations with a specific portion of a texture.
texture: A texture the command optimizes.
slice: A slice within `texture`.
level: A mipmap level within `texture`.
Discussion ¶
This command can reduce the time it takes the GPU to access a texture. Apps typically run the command for:
- Textures the GPU accesses for an extended period of time - Textures with a [StorageMode] property that’s [StorageModeShared] or [StorageModeManaged]
When a blit pass runs this command, the GPU only applies lossless changes to the texture’s underlying data.
func (MTLBlitCommandEncoderObject) OptimizeIndirectCommandBufferWithRange ¶
func (o MTLBlitCommandEncoderObject) OptimizeIndirectCommandBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
Encodes a command that can improve the performance of a range of commands within an indirect command buffer.
indirectCommandBuffer: An indirect command buffer the command optimizes.
range: A range of commands within `indirectCommandBuffer`.
Discussion ¶
This command can reduce the time it takes the GPU to run the commands within an indirect command buffer by removing its redundancies. For example, an indirect command buffer may have empty commands or commands that duplicate identical state. Redundancies like these can come from multiple compute functions that encode commands in parallel, which can sometimes reset commands or configure identical states multiple times.
You can’t run any commands that start or end at an index within that range, or that cross into another optimized range. However, you can reuse the range you optimize by resetting it and then encoding new commands to it.
func (MTLBlitCommandEncoderObject) PopDebugGroup ¶
func (o MTLBlitCommandEncoderObject) PopDebugGroup()
Pops the latest string off of a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
func (MTLBlitCommandEncoderObject) PushDebugGroup ¶
func (o MTLBlitCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a specific string onto a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
func (MTLBlitCommandEncoderObject) ResetCommandsInBufferWithRange ¶
func (o MTLBlitCommandEncoderObject) ResetCommandsInBufferWithRange(buffer MTLIndirectCommandBuffer, range_ foundation.NSRange)
Encodes a command that resets a range of commands in an indirect command buffer.
buffer: An indirect command buffer the command resets.
range: A range of commands within `buffer`.
func (MTLBlitCommandEncoderObject) ResetTextureAccessCountersRegionMipLevelSlice ¶
func (o MTLBlitCommandEncoderObject) ResetTextureAccessCountersRegionMipLevelSlice(texture MTLTexture, region MTLRegion, mipLevel uint, slice uint)
Encodes a command that resets a sparse texture’s access data for a specific region, mipmap level, and slice.
texture: A sparse texture instance.
region: A region within the sparse texture’s `mipLevel`, in sparse tile coordinates.
mipLevel: A mipmap level within the sparse texture.
slice: A slice within the sparse texture.
func (MTLBlitCommandEncoderObject) ResolveCountersInRangeDestinationBufferDestinationOffset ¶
func (o MTLBlitCommandEncoderObject) ResolveCountersInRangeDestinationBufferDestinationOffset(sampleBuffer MTLCounterSampleBuffer, range_ foundation.NSRange, destinationBuffer MTLBuffer, destinationOffset uint)
Encodes a command that resolves the data from the samples in a sample counter buffer and stores the results into a buffer.
sampleBuffer: A counter sample buffer source that contains the sample data.
range: A range that indicates which of the buffer’s samples the command resolves.
destinationBuffer: A destination buffer where the command stores the data it resolves.
destinationOffset: A starting offset, in bytes, within `destinationBuffer` where the blit pass writes the first byte of the data it resolves.
Discussion ¶
For an example of how and when to use this method, see Converting a GPU’s counter data into a readable format.
func (MTLBlitCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier ¶
func (o MTLBlitCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
Encodes a command that samples the GPU’s hardware counters during a blit pass and stores the data in a counter sample buffer.
sampleBuffer: A counter sample buffer where the command stores the sample data.
sampleIndex: A location within `sampleBuffer` where the command stores the sample data.
barrier: A Boolean value that indicates whether the command inserts a barrier before taking the sample.
Discussion ¶
Inserting a barrier ensures that any work you encode with this encoder is complete before the GPU samples the hardware counters. If you don’t insert a barrier, the GPU can sample the counters concurrently with other commands you encode with this encoder. Using a barrier can help the counter results be more predictable and repeatable, but it may adversely affect your app’s runtime performance.
func (MTLBlitCommandEncoderObject) SetLabel ¶
func (o MTLBlitCommandEncoderObject) SetLabel(value string)
func (MTLBlitCommandEncoderObject) SynchronizeResource ¶
func (o MTLBlitCommandEncoderObject) SynchronizeResource(resource MTLResource)
Encodes a command that synchronizes the CPU’s copy of a managed resource, such as a buffer or texture, so that it matches the GPU’s copy.
resource: An MTLResource instance — such as an MTLBuffer or MTLTexture — with a [StorageMode] property that’s equal to [StorageModeManaged].
Discussion ¶
This method ensures the CPU can correctly read all the changes a GPU makes to a resource that uses the managed storage mode. For the resources you create with [StorageModeManaged], the CPU and GPU each have a copy of that resource. As the GPU modifies its copy, the CPU’s copy remains unchanged until you synchronize with a command, such as this one.
The CPU can access the updated content from its copy of the resources after the synchronization command completes.
See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/synchronize(resource:)
func (MTLBlitCommandEncoderObject) SynchronizeTextureSliceLevel ¶
func (o MTLBlitCommandEncoderObject) SynchronizeTextureSliceLevel(texture MTLTexture, slice uint, level uint)
Encodes a command that synchronizes a part of the CPU’s copy of a texture so that it matches the GPU’s copy.
texture: An MTLTexture instance with a [StorageMode] property that’s equal to [StorageModeManaged].
slice: A slice within `texture`.
level: A mipmap level within `texture`.
Discussion ¶
This method ensures the CPU can correctly read the changes a GPU makes to a slice of a texture that uses the managed storage mode. For the resources you create with [StorageModeManaged], the CPU and GPU each have a copy of that resource. As the GPU modifies its copy, the CPU’s copy remains unchanged until you synchronize with a command, such as this one.
The CPU can access the updated content from its copy of the texture after the synchronization command completes.
func (MTLBlitCommandEncoderObject) UpdateFence ¶
func (o MTLBlitCommandEncoderObject) UpdateFence(fence MTLFence)
Encodes a command that instructs the GPU to update a fence after the blit pass completes.
fence: A fence the pass updates after it completes.
Discussion ¶
You can synchronize memory operations of a blit pass that access resources with an MTLFence. This method instructs the pass to update `fence` after it runs all its memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a blit pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFence] method before encoding commands that need to wait for other passes. - Call the [UpdateFence] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/updateFence(_:)
func (MTLBlitCommandEncoderObject) WaitForFence ¶
func (o MTLBlitCommandEncoderObject) WaitForFence(fence MTLFence)
Encodes a command that instructs the GPU to pause the blit pass until another pass updates a fence.
fence: A fence that the pass waits for before it runs any of its commands.
Discussion ¶
You can synchronize memory operations of a blit pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the blit pass. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a blit pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFence] method before encoding commands that need to wait for other passes. - Call the [UpdateFence] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
See: https://developer.apple.com/documentation/Metal/MTLBlitCommandEncoder/waitForFence(_:)
type MTLBlitOption ¶
type MTLBlitOption int
See: https://developer.apple.com/documentation/Metal/MTLBlitOption
const ( // MTLBlitOptionDepthFromDepthStencil: A blit option that copies the depth portion of a combined depth and stencil texture to or from a buffer. MTLBlitOptionDepthFromDepthStencil MTLBlitOption = 1 // MTLBlitOptionNone: A blit option that clears other blit options, which removes any optional behavior for a blit operation. MTLBlitOptionNone MTLBlitOption = 0 // MTLBlitOptionRowLinearPVRTC: A blit option that copies PVRTC data between a texture and a buffer. MTLBlitOptionRowLinearPVRTC MTLBlitOption = 4 // MTLBlitOptionStencilFromDepthStencil: A blit option that copies the stencil portion of a combined depth and stencil texture to or from a buffer. MTLBlitOptionStencilFromDepthStencil MTLBlitOption = 2 )
func (MTLBlitOption) String ¶
func (e MTLBlitOption) String() string
type MTLBlitPassDescriptor ¶
type MTLBlitPassDescriptor struct {
objectivec.Object
}
A configuration you create to customize a blit command encoder, which affects the runtime behavior of the blit pass you encode with it.
Overview ¶
You can customize an encoder for a blit pass by creating and configuring an MTLBlitPassDescriptor instance and passing it to [BlitCommandEncoderWithDescriptor].
Configuring sample buffer attachment descriptors for a blit pass ¶
- MTLBlitPassDescriptor.SampleBufferAttachments: An array of counter sample buffer attachments that you configure for a blit pass.
See: https://developer.apple.com/documentation/Metal/MTLBlitPassDescriptor
func MTLBlitPassDescriptorFromID ¶
func MTLBlitPassDescriptorFromID(id objc.ID) MTLBlitPassDescriptor
MTLBlitPassDescriptorFromID constructs a MTLBlitPassDescriptor from an objc.ID.
A configuration you create to customize a blit command encoder, which affects the runtime behavior of the blit pass you encode with it.
func NewMTLBlitPassDescriptor ¶
func NewMTLBlitPassDescriptor() MTLBlitPassDescriptor
NewMTLBlitPassDescriptor creates a new MTLBlitPassDescriptor instance.
func (MTLBlitPassDescriptor) Autorelease ¶
func (b MTLBlitPassDescriptor) Autorelease() MTLBlitPassDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLBlitPassDescriptor) Init ¶
func (b MTLBlitPassDescriptor) Init() MTLBlitPassDescriptor
Init initializes the instance.
func (MTLBlitPassDescriptor) SampleBufferAttachments ¶
func (b MTLBlitPassDescriptor) SampleBufferAttachments() IMTLBlitPassSampleBufferAttachmentDescriptorArray
An array of counter sample buffer attachments that you configure for a blit pass.
Discussion ¶
See Sampling GPU data into counter sample buffers for more context about configuring this property. That article is one of a series of articles in GPU counters and counter sample buffers.
See: https://developer.apple.com/documentation/Metal/MTLBlitPassDescriptor/sampleBufferAttachments
type MTLBlitPassDescriptorClass ¶
type MTLBlitPassDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLBlitPassDescriptorClass ¶
func GetMTLBlitPassDescriptorClass() MTLBlitPassDescriptorClass
GetMTLBlitPassDescriptorClass returns the class object for MTLBlitPassDescriptor.
func (MTLBlitPassDescriptorClass) Alloc ¶
func (mc MTLBlitPassDescriptorClass) Alloc() MTLBlitPassDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLBlitPassDescriptorClass) BlitPassDescriptor ¶
func (_MTLBlitPassDescriptorClass MTLBlitPassDescriptorClass) BlitPassDescriptor() MTLBlitPassDescriptor
Creates a new blit pass descriptor with a default configuration.
See: https://developer.apple.com/documentation/Metal/MTLBlitPassDescriptor/blitPassDescriptor
type MTLBlitPassSampleBufferAttachmentDescriptor ¶
type MTLBlitPassSampleBufferAttachmentDescriptor struct {
objectivec.Object
}
A configuration that instructs the GPU where to store counter data from the beginning and end of a blit pass.
Overview ¶
See Sampling GPU data into counter sample buffers for more context about configuring instances of this type. That article is one of a series of articles in GPU counters and counter sample buffers.
Configuring the sample buffer attachment ¶
- MTLBlitPassSampleBufferAttachmentDescriptor.SampleBuffer: A specialized memory buffer that the GPU uses to store its counter data during the blit pass.
- MTLBlitPassSampleBufferAttachmentDescriptor.SetSampleBuffer
- MTLBlitPassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex: An index within a counter sample buffer that tells the GPU where to store counter data from the start of a blit pass.
- MTLBlitPassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex
- MTLBlitPassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex: An index within a counter sample buffer that tells the GPU where to store counter data from the end of a blit pass.
- MTLBlitPassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex
See: https://developer.apple.com/documentation/Metal/MTLBlitPassSampleBufferAttachmentDescriptor
func MTLBlitPassSampleBufferAttachmentDescriptorFromID ¶
func MTLBlitPassSampleBufferAttachmentDescriptorFromID(id objc.ID) MTLBlitPassSampleBufferAttachmentDescriptor
MTLBlitPassSampleBufferAttachmentDescriptorFromID constructs a MTLBlitPassSampleBufferAttachmentDescriptor from an objc.ID.
A configuration that instructs the GPU where to store counter data from the beginning and end of a blit pass.
func NewMTLBlitPassSampleBufferAttachmentDescriptor ¶
func NewMTLBlitPassSampleBufferAttachmentDescriptor() MTLBlitPassSampleBufferAttachmentDescriptor
NewMTLBlitPassSampleBufferAttachmentDescriptor creates a new MTLBlitPassSampleBufferAttachmentDescriptor instance.
func (MTLBlitPassSampleBufferAttachmentDescriptor) Autorelease ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) Autorelease() MTLBlitPassSampleBufferAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLBlitPassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
An index within a counter sample buffer that tells the GPU where to store counter data from the end of a blit pass.
Discussion ¶
This property indicates where the GPU stores the counter data within an MTLCounterSampleBuffer instance that it samples at the end of a blit pass.
You can tell the GPU to skip sampling at the end of the blit pass by assigning MTLCounterDontSample to this property.
func (MTLBlitPassSampleBufferAttachmentDescriptor) Init ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) Init() MTLBlitPassSampleBufferAttachmentDescriptor
Init initializes the instance.
func (MTLBlitPassSampleBufferAttachmentDescriptor) SampleBuffer ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
A specialized memory buffer that the GPU uses to store its counter data during the blit pass.
Discussion ¶
The property defaults to `nil`, which means the GPU doesn’t save any GPU counter information during the blit pass. For more information, see Creating a counter sample buffer to store a GPU’s counter data during a pass and Sampling GPU data into counter sample buffers.
func (MTLBlitPassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
func (MTLBlitPassSampleBufferAttachmentDescriptor) SetSampleBuffer ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
func (MTLBlitPassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
func (MTLBlitPassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
An index within a counter sample buffer that tells the GPU where to store counter data from the start of a blit pass.
Discussion ¶
This property indicates where the GPU stores the counter data within an MTLCounterSampleBuffer instance that it samples at the beginning of a blit pass.
You can tell the GPU to skip sampling at the start of the blit pass by assigning MTLCounterDontSample to this property.
type MTLBlitPassSampleBufferAttachmentDescriptorArray ¶
type MTLBlitPassSampleBufferAttachmentDescriptorArray struct {
objectivec.Object
}
A container that stores an array of sample buffer attachments for a blit pass.
Overview ¶
The number of elements in the array is at least the number of elements in an MTLDevice instance’s counterSets property.
Accessing a sample buffer attachment descriptor ¶
- MTLBlitPassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript: Accesses one of the array’s blit pass sample buffer attachment descriptor instances.
See: https://developer.apple.com/documentation/Metal/MTLBlitPassSampleBufferAttachmentDescriptorArray
func MTLBlitPassSampleBufferAttachmentDescriptorArrayFromID ¶
func MTLBlitPassSampleBufferAttachmentDescriptorArrayFromID(id objc.ID) MTLBlitPassSampleBufferAttachmentDescriptorArray
MTLBlitPassSampleBufferAttachmentDescriptorArrayFromID constructs a MTLBlitPassSampleBufferAttachmentDescriptorArray from an objc.ID.
A container that stores an array of sample buffer attachments for a blit pass.
func NewMTLBlitPassSampleBufferAttachmentDescriptorArray ¶
func NewMTLBlitPassSampleBufferAttachmentDescriptorArray() MTLBlitPassSampleBufferAttachmentDescriptorArray
NewMTLBlitPassSampleBufferAttachmentDescriptorArray creates a new MTLBlitPassSampleBufferAttachmentDescriptorArray instance.
func (MTLBlitPassSampleBufferAttachmentDescriptorArray) Autorelease ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) Autorelease() MTLBlitPassSampleBufferAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLBlitPassSampleBufferAttachmentDescriptorArray) CounterSets ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) CounterSets() MTLCounterSet
The counter sets supported by the device object.
See: https://developer.apple.com/documentation/metal/mtldevice/countersets
func (MTLBlitPassSampleBufferAttachmentDescriptorArray) Init ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) Init() MTLBlitPassSampleBufferAttachmentDescriptorArray
Init initializes the instance.
func (MTLBlitPassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLBlitPassSampleBufferAttachmentDescriptor
Accesses one of the array’s blit pass sample buffer attachment descriptor instances.
attachmentIndex: An index of one of the array’s MTLBlitPassSampleBufferAttachmentDescriptor instances.
func (MTLBlitPassSampleBufferAttachmentDescriptorArray) SetCounterSets ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) SetCounterSets(value MTLCounterSet)
func (MTLBlitPassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (b MTLBlitPassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLBlitPassSampleBufferAttachmentDescriptor, attachmentIndex uint)
Copies the properties of a blit pass sample buffer attachment descriptor instance to the properties of one of the array’s instances.
attachment: An MTLBlitPassSampleBufferAttachmentDescriptor instance that the method assigns its properties values to the properties of the array’s instance at `attachmentIndex`.
You can reset the property configuration of the array’s instance at `attachmentIndex` to its default values by passing `nil`.
attachmentIndex: An index into the array’s copies of attachment descriptor instances.
Discussion ¶
The array has at ¶
type MTLBlitPassSampleBufferAttachmentDescriptorArrayClass ¶
type MTLBlitPassSampleBufferAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLBlitPassSampleBufferAttachmentDescriptorArrayClass ¶
func GetMTLBlitPassSampleBufferAttachmentDescriptorArrayClass() MTLBlitPassSampleBufferAttachmentDescriptorArrayClass
GetMTLBlitPassSampleBufferAttachmentDescriptorArrayClass returns the class object for MTLBlitPassSampleBufferAttachmentDescriptorArray.
func (MTLBlitPassSampleBufferAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLBlitPassSampleBufferAttachmentDescriptorArrayClass) Alloc() MTLBlitPassSampleBufferAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLBlitPassSampleBufferAttachmentDescriptorClass ¶
type MTLBlitPassSampleBufferAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLBlitPassSampleBufferAttachmentDescriptorClass ¶
func GetMTLBlitPassSampleBufferAttachmentDescriptorClass() MTLBlitPassSampleBufferAttachmentDescriptorClass
GetMTLBlitPassSampleBufferAttachmentDescriptorClass returns the class object for MTLBlitPassSampleBufferAttachmentDescriptor.
func (MTLBlitPassSampleBufferAttachmentDescriptorClass) Alloc ¶
func (mc MTLBlitPassSampleBufferAttachmentDescriptorClass) Alloc() MTLBlitPassSampleBufferAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLBuffer ¶
type MTLBuffer interface {
objectivec.IObject
MTLAllocation
MTLResource
// Creates a texture that shares its storage with the buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/makeTexture(descriptor:offset:bytesPerRow:)
NewTextureWithDescriptorOffsetBytesPerRow(descriptor IMTLTextureDescriptor, offset uint, bytesPerRow uint) MTLTexture
// Gets the system address of the buffer’s storage allocation.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/contents()
Contents() unsafe.Pointer
// Removes all debug marker strings from the buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/removeAllDebugMarkers()
RemoveAllDebugMarkers()
// The logical size of the buffer, in bytes.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/length
Length() uint
// Creates a remote view of the buffer for another GPU in the same peer group.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/makeRemoteBufferView(_:)
NewRemoteBufferViewForDevice(device MTLDevice) MTLBuffer
// The buffer on another GPU that the buffer was created from, if any.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/remoteStorageBuffer
RemoteStorageBuffer() MTLBuffer
// GpuAddress protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/gpuAddress
GpuAddress() MTLGPUAddress
// SparseBufferTier protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/sparseBufferTier
SparseBufferTier() MTLBufferSparseTier
// Creates a tensor that shares storage with this buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/makeTensor(descriptor:offset:)
NewTensorWithDescriptorOffsetError(descriptor IMTLTensorDescriptor, offset uint) (MTLTensor, error)
// Adds a debug marker string to a specific buffer range.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/addDebugMarker:range:
AddDebugMarkerRange(marker string, range_ foundation.NSRange)
// Informs the GPU that the CPU has modified a section of the buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLBuffer/didModifyRange:
DidModifyRange(range_ foundation.NSRange)
}
A resource that stores data in a format defined by your app.
See: https://developer.apple.com/documentation/Metal/MTLBuffer
type MTLBufferBinding ¶
type MTLBufferBinding interface {
objectivec.IObject
MTLBinding
// BufferAlignment protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferAlignment
BufferAlignment() uint
// BufferDataSize protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferDataSize
BufferDataSize() uint
// BufferDataType protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferDataType
BufferDataType() MTLDataType
// BufferPointerType protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferPointerType
BufferPointerType() IMTLPointerType
// BufferStructType protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferStructType
BufferStructType() IMTLStructType
}
MTLBufferBinding protocol.
See: https://developer.apple.com/documentation/Metal/MTLBufferBinding
type MTLBufferBindingObject ¶
type MTLBufferBindingObject struct {
objectivec.Object
}
MTLBufferBindingObject wraps an existing Objective-C object that conforms to the MTLBufferBinding protocol.
func MTLBufferBindingObjectFromID ¶
func MTLBufferBindingObjectFromID(id objc.ID) MTLBufferBindingObject
MTLBufferBindingObjectFromID constructs a MTLBufferBindingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLBufferBindingObject) Access ¶
func (o MTLBufferBindingObject) Access() MTLBindingAccess
See: https://developer.apple.com/documentation/Metal/MTLBinding/access
func (MTLBufferBindingObject) BaseObject ¶
func (o MTLBufferBindingObject) BaseObject() objectivec.Object
func (MTLBufferBindingObject) BufferAlignment ¶
func (o MTLBufferBindingObject) BufferAlignment() uint
See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferAlignment
func (MTLBufferBindingObject) BufferDataSize ¶
func (o MTLBufferBindingObject) BufferDataSize() uint
See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferDataSize
func (MTLBufferBindingObject) BufferDataType ¶
func (o MTLBufferBindingObject) BufferDataType() MTLDataType
See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferDataType
func (MTLBufferBindingObject) BufferPointerType ¶
func (o MTLBufferBindingObject) BufferPointerType() IMTLPointerType
See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferPointerType
func (MTLBufferBindingObject) BufferStructType ¶
func (o MTLBufferBindingObject) BufferStructType() IMTLStructType
See: https://developer.apple.com/documentation/Metal/MTLBufferBinding/bufferStructType
func (MTLBufferBindingObject) Index ¶
func (o MTLBufferBindingObject) Index() uint
See: https://developer.apple.com/documentation/Metal/MTLBinding/index
func (MTLBufferBindingObject) IsArgument ¶
func (o MTLBufferBindingObject) IsArgument() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isArgument
func (MTLBufferBindingObject) IsUsed ¶
func (o MTLBufferBindingObject) IsUsed() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isUsed
func (MTLBufferBindingObject) Name ¶
func (o MTLBufferBindingObject) Name() string
See: https://developer.apple.com/documentation/Metal/MTLBinding/name
func (MTLBufferBindingObject) Type ¶
func (o MTLBufferBindingObject) Type() MTLBindingType
See: https://developer.apple.com/documentation/Metal/MTLBinding/type
type MTLBufferLayoutDescriptor ¶
type MTLBufferLayoutDescriptor struct {
objectivec.Object
}
A description of how a compute function fetches input data for an attribute.
Describing fetch behavior ¶
- MTLBufferLayoutDescriptor.Stride: The number of bytes from one buffer entry to the next.
- MTLBufferLayoutDescriptor.SetStride
- MTLBufferLayoutDescriptor.StepFunction: Determines how and when compute functions fetch data.
- MTLBufferLayoutDescriptor.SetStepFunction
- MTLBufferLayoutDescriptor.StepRate: How frequently the step function should load data.
- MTLBufferLayoutDescriptor.SetStepRate
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptor
func MTLBufferLayoutDescriptorFromID ¶
func MTLBufferLayoutDescriptorFromID(id objc.ID) MTLBufferLayoutDescriptor
MTLBufferLayoutDescriptorFromID constructs a MTLBufferLayoutDescriptor from an objc.ID.
A description of how a compute function fetches input data for an attribute.
func NewMTLBufferLayoutDescriptor ¶
func NewMTLBufferLayoutDescriptor() MTLBufferLayoutDescriptor
NewMTLBufferLayoutDescriptor creates a new MTLBufferLayoutDescriptor instance.
func (MTLBufferLayoutDescriptor) Autorelease ¶
func (b MTLBufferLayoutDescriptor) Autorelease() MTLBufferLayoutDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLBufferLayoutDescriptor) Init ¶
func (b MTLBufferLayoutDescriptor) Init() MTLBufferLayoutDescriptor
Init initializes the instance.
func (MTLBufferLayoutDescriptor) SetStageInputDescriptor ¶
func (b MTLBufferLayoutDescriptor) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
func (MTLBufferLayoutDescriptor) SetStepFunction ¶
func (b MTLBufferLayoutDescriptor) SetStepFunction(value MTLStepFunction)
func (MTLBufferLayoutDescriptor) SetStepRate ¶
func (b MTLBufferLayoutDescriptor) SetStepRate(value uint)
func (MTLBufferLayoutDescriptor) SetStride ¶
func (b MTLBufferLayoutDescriptor) SetStride(value uint)
func (MTLBufferLayoutDescriptor) StageInputDescriptor ¶
func (b MTLBufferLayoutDescriptor) StageInputDescriptor() IMTLStageInputOutputDescriptor
The organization of input and output data for the next kernel call.
See: https://developer.apple.com/documentation/metal/mtlcomputepipelinedescriptor/stageinputdescriptor
func (MTLBufferLayoutDescriptor) StepFunction ¶
func (b MTLBufferLayoutDescriptor) StepFunction() MTLStepFunction
Determines how and when compute functions fetch data.
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptor/stepFunction
func (MTLBufferLayoutDescriptor) StepRate ¶
func (b MTLBufferLayoutDescriptor) StepRate() uint
How frequently the step function should load data.
Discussion ¶
The interpretation of this value depends on the setting of `stepFunction`.
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptor/stepRate
func (MTLBufferLayoutDescriptor) Stride ¶
func (b MTLBufferLayoutDescriptor) Stride() uint
The number of bytes from one buffer entry to the next.
Discussion ¶
The default value is `1`. See Metal feature set tables (PDF) for `stride` alignment restrictions on GPU architectures.
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptor/stride
type MTLBufferLayoutDescriptorArray ¶
type MTLBufferLayoutDescriptorArray struct {
objectivec.Object
}
An array of buffer layout descriptor objects.
Overview ¶
An MTLBufferLayoutDescriptorArray defines the data layout and loading for compute data, using MTLBufferLayoutDescriptor instances.
Array accessors ¶
- MTLBufferLayoutDescriptorArray.ObjectAtIndexedSubscript: Returns the state of the specified buffer layout.
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptorArray
func MTLBufferLayoutDescriptorArrayFromID ¶
func MTLBufferLayoutDescriptorArrayFromID(id objc.ID) MTLBufferLayoutDescriptorArray
MTLBufferLayoutDescriptorArrayFromID constructs a MTLBufferLayoutDescriptorArray from an objc.ID.
An array of buffer layout descriptor objects.
func NewMTLBufferLayoutDescriptorArray ¶
func NewMTLBufferLayoutDescriptorArray() MTLBufferLayoutDescriptorArray
NewMTLBufferLayoutDescriptorArray creates a new MTLBufferLayoutDescriptorArray instance.
func (MTLBufferLayoutDescriptorArray) Autorelease ¶
func (b MTLBufferLayoutDescriptorArray) Autorelease() MTLBufferLayoutDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLBufferLayoutDescriptorArray) Init ¶
func (b MTLBufferLayoutDescriptorArray) Init() MTLBufferLayoutDescriptorArray
Init initializes the instance.
func (MTLBufferLayoutDescriptorArray) ObjectAtIndexedSubscript ¶
func (b MTLBufferLayoutDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLBufferLayoutDescriptor
Returns the state of the specified buffer layout.
index: A specified index in the array of buffer layouts.
Return Value ¶
The buffer layout descriptor for the buffer bound to the given attribute table index.
See: https://developer.apple.com/documentation/Metal/MTLBufferLayoutDescriptorArray/subscript(_:)
func (MTLBufferLayoutDescriptorArray) SetObjectAtIndexedSubscript ¶
func (b MTLBufferLayoutDescriptorArray) SetObjectAtIndexedSubscript(bufferDesc IMTLBufferLayoutDescriptor, index uint)
Sets the state of the specified buffer layout.
bufferDesc: A descriptor that contains buffer layout state.
index: An index in the array of buffer layouts.
func (MTLBufferLayoutDescriptorArray) SetStageInputDescriptor ¶
func (b MTLBufferLayoutDescriptorArray) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
func (MTLBufferLayoutDescriptorArray) StageInputDescriptor ¶
func (b MTLBufferLayoutDescriptorArray) StageInputDescriptor() IMTLStageInputOutputDescriptor
The organization of input and output data for the next kernel call.
See: https://developer.apple.com/documentation/metal/mtlcomputepipelinedescriptor/stageinputdescriptor
type MTLBufferLayoutDescriptorArrayClass ¶
type MTLBufferLayoutDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLBufferLayoutDescriptorArrayClass ¶
func GetMTLBufferLayoutDescriptorArrayClass() MTLBufferLayoutDescriptorArrayClass
GetMTLBufferLayoutDescriptorArrayClass returns the class object for MTLBufferLayoutDescriptorArray.
func (MTLBufferLayoutDescriptorArrayClass) Alloc ¶
func (mc MTLBufferLayoutDescriptorArrayClass) Alloc() MTLBufferLayoutDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLBufferLayoutDescriptorClass ¶
type MTLBufferLayoutDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLBufferLayoutDescriptorClass ¶
func GetMTLBufferLayoutDescriptorClass() MTLBufferLayoutDescriptorClass
GetMTLBufferLayoutDescriptorClass returns the class object for MTLBufferLayoutDescriptor.
func (MTLBufferLayoutDescriptorClass) Alloc ¶
func (mc MTLBufferLayoutDescriptorClass) Alloc() MTLBufferLayoutDescriptor
Alloc allocates memory for a new instance of the class.
type MTLBufferObject ¶
type MTLBufferObject struct {
objectivec.Object
}
MTLBufferObject wraps an existing Objective-C object that conforms to the MTLBuffer protocol.
func MTLBufferObjectFromID ¶
func MTLBufferObjectFromID(id objc.ID) MTLBufferObject
MTLBufferObjectFromID constructs a MTLBufferObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLBufferObject) AddDebugMarkerRange ¶
func (o MTLBufferObject) AddDebugMarkerRange(marker string, range_ foundation.NSRange)
Adds a debug marker string to a specific buffer range.
marker: A string that identifies the marked buffer range.
range: The range of bytes that you want to identify.
See: https://developer.apple.com/documentation/Metal/MTLBuffer/addDebugMarker:range:
func (MTLBufferObject) AllocatedSize ¶
func (o MTLBufferObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLBufferObject) BaseObject ¶
func (o MTLBufferObject) BaseObject() objectivec.Object
func (MTLBufferObject) Contents ¶
func (o MTLBufferObject) Contents() unsafe.Pointer
Gets the system address of the buffer’s storage allocation.
Return Value ¶
A pointer to the shared copy of the buffer data, or [NULL] for buffers allocated with a private resource storage mode ([StorageModePrivate]).
Discussion ¶
Private resources aren’t CPU-accessible.
See: https://developer.apple.com/documentation/Metal/MTLBuffer/contents()
func (MTLBufferObject) CpuCacheMode ¶
func (o MTLBufferObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLBufferObject) Device ¶
func (o MTLBufferObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLBufferObject) DidModifyRange ¶
func (o MTLBufferObject) DidModifyRange(range_ foundation.NSRange)
Informs the GPU that the CPU has modified a section of the buffer.
range: The range of bytes that were modified.
Discussion ¶
If you write information to a buffer created with the [StorageModeManaged] storage mode, you need to call this method to inform the GPU that the information has changed. If you execute GPU commands that read from the modified sections without calling this method first, the behavior is undefined.
See: https://developer.apple.com/documentation/Metal/MTLBuffer/didModifyRange:
func (MTLBufferObject) GpuAddress ¶
func (o MTLBufferObject) GpuAddress() MTLGPUAddress
See: https://developer.apple.com/documentation/Metal/MTLBuffer/gpuAddress
func (MTLBufferObject) HazardTrackingMode ¶
func (o MTLBufferObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLBufferObject) Heap ¶
func (o MTLBufferObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLBufferObject) HeapOffset ¶
func (o MTLBufferObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLBufferObject) IsAliasable ¶
func (o MTLBufferObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLBufferObject) Label ¶
func (o MTLBufferObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLBufferObject) Length ¶
func (o MTLBufferObject) Length() uint
The logical size of the buffer, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLBuffer/length
func (MTLBufferObject) MakeAliasable ¶
func (o MTLBufferObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLBufferObject) NewRemoteBufferViewForDevice ¶
func (o MTLBufferObject) NewRemoteBufferViewForDevice(device MTLDevice) MTLBuffer
Creates a remote view of the buffer for another GPU in the same peer group.
Discussion ¶
The device instance that this buffer belongs to and the device you pass to the method both need to have the same nonzero peer group identifier (peerGroupID). This buffer needs to use the private storage mode ([StorageModePrivate]).
A remote view doesn’t allocate any storage for the new buffer; it references the memory allocated for the original buffer. You can use remote views only as a source for copy commands encoded by an MTLBlitCommandEncoder. For more information, see Transferring data between connected GPUs.
See: https://developer.apple.com/documentation/Metal/MTLBuffer/makeRemoteBufferView(_:)
func (MTLBufferObject) NewTensorWithDescriptorOffsetError ¶
func (o MTLBufferObject) NewTensorWithDescriptorOffsetError(descriptor IMTLTensorDescriptor, offset uint) (MTLTensor, error)
Creates a tensor that shares storage with this buffer.
descriptor: A description of the properties for the new tensor.
offset: Offset into the buffer at which the data of the tensor begins.
Discussion ¶
If the descriptor specifies MTLTensorUsageMachineLearning usage, you need to observe the following restrictions:
- pass in `0` for the `offset` parameter - set the element stride the descriptor to `1` - ensure that number of bytes per row is a multiple of `64` - for dimensions greater than `2`, make sure `strides[dim] = strides[dim -1] * dimensions[dim - 1]`
See: https://developer.apple.com/documentation/Metal/MTLBuffer/makeTensor(descriptor:offset:)
func (MTLBufferObject) NewTextureWithDescriptorOffsetBytesPerRow ¶
func (o MTLBufferObject) NewTextureWithDescriptorOffsetBytesPerRow(descriptor IMTLTextureDescriptor, offset uint, bytesPerRow uint) MTLTexture
Creates a texture that shares its storage with the buffer.
descriptor: The descriptor that contains the properties of the texture.
offset: The offset, in bytes, from the base address for the first row of texture data.
bytesPerRow: The stride, in bytes, from one row of texture data to the next.
Return Value ¶
A new texture that shares the buffer’s underlying storage.
Discussion ¶
This method creates a new MTLTexture instance that uses the same data as the buffer’s. Modifying the buffer also modifies the new texture because they share the same underlying memory.
The texture’s resource data is coherent between multiple render passes. However, that data may not be coherent within a single render pass due to caching at runtime. For example, a texture you create from the method may not be able to immediately reflect changes to the underlying buffer that come from a render or kernel function.
If this buffer’s [StorageMode] is [StorageModeManaged], and a render or kernel function modifies it, the CPU can access the new values through a texture after calling the [SynchronizeResource] method. CPU memory operations are only coherent between command buffer boundaries. GPU barriers guard its memory operations to buffers and textures so that each operation finishes running before the next one begins.
You can create multiple, nonoverlapping textures that use the same buffer; however, the GPU serializes memory operations to those textures.
To create a linear texture, you need to:
- Align the `offset` and `bytesPerRow` parameters to the value that the [MinimumLinearTextureAlignmentForPixelFormat] method returns. - Set the `bytesPerRow` parameter to a value greater than or equal to the number of bytes in one row of pixels — the product of the row’s width, in pixels, and the size of one pixel, in bytes.
Additionally, creating a linear texture from this method adds the following restrictions for the `descriptor` parameter’s properties:
[Table data omitted]
Samplers can use any MTLSamplerAddressMode to sample linear textures from this method on any device that supports the [GPUFamilyApple2] feature family or later.
func (MTLBufferObject) RemoteStorageBuffer ¶
func (o MTLBufferObject) RemoteStorageBuffer() MTLBuffer
The buffer on another GPU that the buffer was created from, if any.
See: https://developer.apple.com/documentation/Metal/MTLBuffer/remoteStorageBuffer
func (MTLBufferObject) RemoveAllDebugMarkers ¶
func (o MTLBufferObject) RemoveAllDebugMarkers()
Removes all debug marker strings from the buffer.
See: https://developer.apple.com/documentation/Metal/MTLBuffer/removeAllDebugMarkers()
func (MTLBufferObject) ResourceOptions ¶
func (o MTLBufferObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLBufferObject) SetLabel ¶
func (o MTLBufferObject) SetLabel(value string)
func (MTLBufferObject) SetOwnerWithIdentity ¶
func (o MTLBufferObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLBufferObject) SetPurgeableState ¶
func (o MTLBufferObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLBufferObject) SparseBufferTier ¶
func (o MTLBufferObject) SparseBufferTier() MTLBufferSparseTier
See: https://developer.apple.com/documentation/Metal/MTLBuffer/sparseBufferTier
func (MTLBufferObject) StorageMode ¶
func (o MTLBufferObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
type MTLBufferSparseTier ¶
type MTLBufferSparseTier int
See: https://developer.apple.com/documentation/Metal/MTLBufferSparseTier
const ( // MTLBufferSparseTier1: Indicates support for sparse buffers tier 1. MTLBufferSparseTier1 MTLBufferSparseTier = 1 // MTLBufferSparseTierNone: Indicates that the buffer is not sparse. MTLBufferSparseTierNone MTLBufferSparseTier = 0 )
func (MTLBufferSparseTier) String ¶
func (e MTLBufferSparseTier) String() string
type MTLCPUCacheMode ¶
type MTLCPUCacheMode int
See: https://developer.apple.com/documentation/Metal/MTLCPUCacheMode
const ( // MTLCPUCacheModeDefaultCache: The default CPU cache mode for the resource, which guarantees that read and write operations are executed in the expected order. MTLCPUCacheModeDefaultCache MTLCPUCacheMode = 0 // MTLCPUCacheModeWriteCombined: A write-combined CPU cache mode that is optimized for resources that the CPU writes into, but never reads. MTLCPUCacheModeWriteCombined MTLCPUCacheMode = 1 )
func (MTLCPUCacheMode) String ¶
func (e MTLCPUCacheMode) String() string
type MTLCaptureDescriptor ¶
type MTLCaptureDescriptor struct {
objectivec.Object
}
A configuration for a Metal capture session.
Setting capture parameters ¶
- MTLCaptureDescriptor.CaptureObject: The instance whose contents should be captured.
- MTLCaptureDescriptor.SetCaptureObject
- MTLCaptureDescriptor.Destination: The destination for any captured command data.
- MTLCaptureDescriptor.SetDestination
- MTLCaptureDescriptor.OutputURL: A URL for a file to write the capture data into.
- MTLCaptureDescriptor.SetOutputURL
See: https://developer.apple.com/documentation/Metal/MTLCaptureDescriptor
func MTLCaptureDescriptorFromID ¶
func MTLCaptureDescriptorFromID(id objc.ID) MTLCaptureDescriptor
MTLCaptureDescriptorFromID constructs a MTLCaptureDescriptor from an objc.ID.
A configuration for a Metal capture session.
func NewMTLCaptureDescriptor ¶
func NewMTLCaptureDescriptor() MTLCaptureDescriptor
NewMTLCaptureDescriptor creates a new MTLCaptureDescriptor instance.
func (MTLCaptureDescriptor) Autorelease ¶
func (c MTLCaptureDescriptor) Autorelease() MTLCaptureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLCaptureDescriptor) CaptureObject ¶
func (c MTLCaptureDescriptor) CaptureObject() objectivec.IObject
The instance whose contents should be captured.
Discussion ¶
The default value is `nil`, but you need to set an instance before using this descriptor to start a capture session.
The behavior of the capture session depends on the kind of instance being captured:
- Specify an MTLDevice instance to capture commands in command buffers created on any command queues created by the device instance. - Specify an MTLCommandQueue instance to capture commands in command buffers created by a specific command queue. - Specify an MTLCaptureScope instance to indirectly define which commands are captured.
See: https://developer.apple.com/documentation/Metal/MTLCaptureDescriptor/captureObject
func (MTLCaptureDescriptor) Destination ¶
func (c MTLCaptureDescriptor) Destination() MTLCaptureDestination
The destination for any captured command data.
Discussion ¶
The default value is [CaptureDestinationDeveloperTools].
See: https://developer.apple.com/documentation/Metal/MTLCaptureDescriptor/destination
func (MTLCaptureDescriptor) Init ¶
func (c MTLCaptureDescriptor) Init() MTLCaptureDescriptor
Init initializes the instance.
func (MTLCaptureDescriptor) OutputURL ¶
func (c MTLCaptureDescriptor) OutputURL() foundation.INSURL
A URL for a file to write the capture data into.
Discussion ¶
The default value is `nil`. If you set [Destination] to [CaptureDestinationGPUTraceDocument], you need to set this property to where you want the file to be written to.
See: https://developer.apple.com/documentation/Metal/MTLCaptureDescriptor/outputURL
func (MTLCaptureDescriptor) SetCaptureObject ¶
func (c MTLCaptureDescriptor) SetCaptureObject(value objectivec.IObject)
func (MTLCaptureDescriptor) SetDestination ¶
func (c MTLCaptureDescriptor) SetDestination(value MTLCaptureDestination)
func (MTLCaptureDescriptor) SetOutputURL ¶
func (c MTLCaptureDescriptor) SetOutputURL(value foundation.INSURL)
type MTLCaptureDescriptorClass ¶
type MTLCaptureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLCaptureDescriptorClass ¶
func GetMTLCaptureDescriptorClass() MTLCaptureDescriptorClass
GetMTLCaptureDescriptorClass returns the class object for MTLCaptureDescriptor.
func (MTLCaptureDescriptorClass) Alloc ¶
func (mc MTLCaptureDescriptorClass) Alloc() MTLCaptureDescriptor
Alloc allocates memory for a new instance of the class.
type MTLCaptureDestination ¶
type MTLCaptureDestination int
See: https://developer.apple.com/documentation/Metal/MTLCaptureDestination
const ( // MTLCaptureDestinationDeveloperTools: An option specifying that data should be captured to Xcode and that execution should stop in Xcode after the data is captured. MTLCaptureDestinationDeveloperTools MTLCaptureDestination = 1 // MTLCaptureDestinationGPUTraceDocument: An option specifying that the captured command data should be saved to a GPU trace document. MTLCaptureDestinationGPUTraceDocument MTLCaptureDestination = 2 )
func (MTLCaptureDestination) String ¶
func (e MTLCaptureDestination) String() string
type MTLCaptureError ¶
type MTLCaptureError int
See: https://developer.apple.com/documentation/Metal/MTLCaptureError
const ( // MTLCaptureErrorAlreadyCapturing: A capture error that indicates the session is already in progress. MTLCaptureErrorAlreadyCapturing MTLCaptureError = 2 // MTLCaptureErrorInvalidDescriptor: A capture error that indicates your descriptor has invalid properties. MTLCaptureErrorInvalidDescriptor MTLCaptureError = 3 // MTLCaptureErrorNotSupported: A capture error that indicates the capture options you’re requesting aren’t available. MTLCaptureErrorNotSupported MTLCaptureError = 1 )
func (MTLCaptureError) String ¶
func (e MTLCaptureError) String() string
type MTLCaptureManager ¶
type MTLCaptureManager struct {
objectivec.Object
}
An instance you use to capture Metal command data in your app.
Overview ¶
A capture manager works with the frame capture feature to:
- Capture data about Metal commands programmatically. See Capturing a Metal workload programmatically. - Only capture commands that apply to a specific MTLDevice, command queue, or MTLCaptureScope instance. - Assign a default MTLCaptureScope instance for captures you create in Xcode by clicking the Capture GPU workload button in the debug bar, which has an icon with the Metal logo.
The Metal debugger requires you to enable GPU Frame Capture in your project settings; see Capturing a Metal workload in Xcode.
For more information about Metal frame capture, see Metal debugger.
Querying support for a capture destination ¶
- MTLCaptureManager.SupportsDestination: Checks to see whether a particular capture destination is supported.
Creating a capture scope ¶
- MTLCaptureManager.NewCaptureScopeWithDevice: Creates a capture scope for commands submitted to a specific device object.
- MTLCaptureManager.NewCaptureScopeWithCommandQueue: Creates a capture scope for commands submitted to a specific command queue.
- MTLCaptureManager.DefaultCaptureScope: The capture scope to use when a capture is initiated in Xcode.
- MTLCaptureManager.SetDefaultCaptureScope
Starting capture ¶
- MTLCaptureManager.StartCaptureWithDescriptorError: Starts capturing any of your app’s Metal commands, with the capture session defined by a descriptor object.
Stopping capture ¶
- MTLCaptureManager.StopCapture: Stops capturing Metal commands.
Monitoring capture ¶
- MTLCaptureManager.IsCapturing: A Boolean value that indicates whether Metal commands are being captured.
Instance Methods ¶
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager
func MTLCaptureManagerFromID ¶
func MTLCaptureManagerFromID(id objc.ID) MTLCaptureManager
MTLCaptureManagerFromID constructs a MTLCaptureManager from an objc.ID.
An instance you use to capture Metal command data in your app.
func NewMTLCaptureManager ¶
func NewMTLCaptureManager() MTLCaptureManager
NewMTLCaptureManager creates a new MTLCaptureManager instance.
func (MTLCaptureManager) Autorelease ¶
func (c MTLCaptureManager) Autorelease() MTLCaptureManager
Autorelease adds the receiver to the current autorelease pool.
func (MTLCaptureManager) DefaultCaptureScope ¶
func (c MTLCaptureManager) DefaultCaptureScope() MTLCaptureScope
The capture scope to use when a capture is initiated in Xcode.
Discussion ¶
Use this property to specify a default capture scope for Xcode to use when the user presses the capture button. You can still long-press the button to select a different capture scope.
The default value is `nil.` When the value is `nil`, the capture scope is defined by drawable presentation boundaries; such as those created by calls to [PresentDrawable] or [Present].
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager/defaultCaptureScope
func (MTLCaptureManager) Init ¶
func (c MTLCaptureManager) Init() MTLCaptureManager
Init initializes the instance.
func (MTLCaptureManager) IsCapturing ¶
func (c MTLCaptureManager) IsCapturing() bool
A Boolean value that indicates whether Metal commands are being captured.
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager/isCapturing
func (MTLCaptureManager) NewCaptureScopeWithCommandQueue ¶
func (c MTLCaptureManager) NewCaptureScopeWithCommandQueue(commandQueue MTLCommandQueue) MTLCaptureScope
Creates a capture scope for commands submitted to a specific command queue.
commandQueue: The command queue whose commands you want to capture.
func (MTLCaptureManager) NewCaptureScopeWithDevice ¶
func (c MTLCaptureManager) NewCaptureScopeWithDevice(device MTLDevice) MTLCaptureScope
Creates a capture scope for commands submitted to a specific device object.
device: The device object whose commands you want to capture.
Discussion ¶
The capture scope captures commands in command buffers created on any command queues created by the device object.
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager/makeCaptureScope(device:)
func (MTLCaptureManager) NewCaptureScopeWithMTL4CommandQueue ¶
func (c MTLCaptureManager) NewCaptureScopeWithMTL4CommandQueue(commandQueue MTL4CommandQueue) MTLCaptureScope
func (MTLCaptureManager) SetDefaultCaptureScope ¶
func (c MTLCaptureManager) SetDefaultCaptureScope(value MTLCaptureScope)
func (MTLCaptureManager) StartCaptureWithDescriptorError ¶
func (c MTLCaptureManager) StartCaptureWithDescriptorError(descriptor IMTLCaptureDescriptor) (bool, error)
Starts capturing any of your app’s Metal commands, with the capture session defined by a descriptor object.
descriptor: A description of the capture session to create.
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager/startCapture(with:)
func (MTLCaptureManager) StopCapture ¶
func (c MTLCaptureManager) StopCapture()
Stops capturing Metal commands.
Discussion ¶
Calling this method stops a capture that was started manually in Xcode or programmatically by calling one of the methods on MTLCaptureManager.
When using a custom capture scope, calling this function preempts any [EndScope] demarcations of the capture scope.
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager/stopCapture()
func (MTLCaptureManager) SupportsDestination ¶
func (c MTLCaptureManager) SupportsDestination(destination MTLCaptureDestination) bool
Checks to see whether a particular capture destination is supported.
destination: The destination to test for.
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager/supportsDestination(_:)
type MTLCaptureManagerClass ¶
type MTLCaptureManagerClass struct {
// contains filtered or unexported fields
}
func GetMTLCaptureManagerClass ¶
func GetMTLCaptureManagerClass() MTLCaptureManagerClass
GetMTLCaptureManagerClass returns the class object for MTLCaptureManager.
func (MTLCaptureManagerClass) Alloc ¶
func (mc MTLCaptureManagerClass) Alloc() MTLCaptureManager
Alloc allocates memory for a new instance of the class.
func (MTLCaptureManagerClass) SharedCaptureManager ¶
func (_MTLCaptureManagerClass MTLCaptureManagerClass) SharedCaptureManager() MTLCaptureManager
Provides the shared capture manager for your Metal app.
Discussion ¶
There is only one capture manager per process.
See: https://developer.apple.com/documentation/Metal/MTLCaptureManager/shared()
type MTLCaptureScope ¶
type MTLCaptureScope interface {
objectivec.IObject
// Tells Metal to begin recording command information.
//
// See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/begin()
BeginScope()
// Tells Metal to stop recording command information.
//
// See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/end()
EndScope()
// A string that helps you identify the capture scope.
//
// See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/label
Label() string
// The device object from which you created the capture scope.
//
// See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/device
Device() MTLDevice
// The command queue that this capture scope uses to limit which commands are recorded.
//
// See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/commandQueue
CommandQueue() MTLCommandQueue
// If set, this scope will only capture Metal commands from the associated Metal 4 command queue. Defaults to nil (all command queues from the associated device are captured).
//
// See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/mtl4CommandQueue
Mtl4CommandQueue() MTL4CommandQueue
// A string that helps you identify the capture scope.
//
// See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/label
SetLabel(value string)
}
A type that can programmatically customize a GPU frame capture.
See: https://developer.apple.com/documentation/Metal/MTLCaptureScope
type MTLCaptureScopeObject ¶
type MTLCaptureScopeObject struct {
objectivec.Object
}
MTLCaptureScopeObject wraps an existing Objective-C object that conforms to the MTLCaptureScope protocol.
func MTLCaptureScopeObjectFromID ¶
func MTLCaptureScopeObjectFromID(id objc.ID) MTLCaptureScopeObject
MTLCaptureScopeObjectFromID constructs a MTLCaptureScopeObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCaptureScopeObject) BaseObject ¶
func (o MTLCaptureScopeObject) BaseObject() objectivec.Object
func (MTLCaptureScopeObject) BeginScope ¶
func (o MTLCaptureScopeObject) BeginScope()
Tells Metal to begin recording command information.
See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/begin()
func (MTLCaptureScopeObject) CommandQueue ¶
func (o MTLCaptureScopeObject) CommandQueue() MTLCommandQueue
The command queue that this capture scope uses to limit which commands are recorded.
See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/commandQueue
func (MTLCaptureScopeObject) Device ¶
func (o MTLCaptureScopeObject) Device() MTLDevice
The device object from which you created the capture scope.
See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/device
func (MTLCaptureScopeObject) EndScope ¶
func (o MTLCaptureScopeObject) EndScope()
Tells Metal to stop recording command information.
See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/end()
func (MTLCaptureScopeObject) Label ¶
func (o MTLCaptureScopeObject) Label() string
A string that helps you identify the capture scope.
See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/label
func (MTLCaptureScopeObject) Mtl4CommandQueue ¶
func (o MTLCaptureScopeObject) Mtl4CommandQueue() MTL4CommandQueue
If set, this scope will only capture Metal commands from the associated Metal 4 command queue. Defaults to nil (all command queues from the associated device are captured).
See: https://developer.apple.com/documentation/Metal/MTLCaptureScope/mtl4CommandQueue
func (MTLCaptureScopeObject) SetLabel ¶
func (o MTLCaptureScopeObject) SetLabel(value string)
type MTLClearColor ¶
type MTLClearColor struct {
Red float64 // The red color channel.
Green float64 // The green color channel.
Blue float64 // The blue color channel.
Alpha float64 // The alpha channel.
}
MTLClearColor - An RGBA value used for a color pixel.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLClearColor
type MTLColorWriteMask ¶
type MTLColorWriteMask int
See: https://developer.apple.com/documentation/Metal/MTLColorWriteMask
const ( // MTLColorWriteMaskAll: All color channels are enabled. MTLColorWriteMaskAll MTLColorWriteMask = 15 // MTLColorWriteMaskAlpha: The alpha color channel is enabled. MTLColorWriteMaskAlpha MTLColorWriteMask = 1 // MTLColorWriteMaskBlue: The blue color channel is enabled. MTLColorWriteMaskBlue MTLColorWriteMask = 1 // MTLColorWriteMaskGreen: The green color channel is enabled. MTLColorWriteMaskGreen MTLColorWriteMask = 1 // MTLColorWriteMaskNone: All color channels are disabled. MTLColorWriteMaskNone MTLColorWriteMask = 0 // MTLColorWriteMaskRed: The red color channel is enabled. MTLColorWriteMaskRed MTLColorWriteMask = 1 // MTLColorWriteMaskUnspecialized: Defers assigning the color write mask. MTLColorWriteMaskUnspecialized MTLColorWriteMask = 16 )
func (MTLColorWriteMask) String ¶
func (e MTLColorWriteMask) String() string
type MTLCommandBuffer ¶
type MTLCommandBuffer interface {
objectivec.IObject
// Applies a residency set to a command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/useResidencySet(_:)
UseResidencySet(residencySet MTLResidencySet)
// Encodes a command into the command buffer that pauses the GPU from running the buffer’s subsequent passes until the event equals or exceeds a value.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/encodeWaitForEvent(_:value:)
EncodeWaitForEventValue(event MTLEvent, value uint64)
// Encodes a command that updates an event’s value, which can clear the GPU to run passes from other command buffers waiting for the event.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/encodeSignalEvent(_:value:)
EncodeSignalEventValue(event MTLEvent, value uint64)
// Presents a drawable as early as possible.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/present(_:)
PresentDrawable(drawable MTLDrawable)
// Presents a drawable at a specific time.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/present(_:atTime:)
PresentDrawableAtTime(drawable MTLDrawable, presentationTime float64)
// Presents a drawable after the system presents the previous drawable for an amount of time.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/present(_:afterMinimumDuration:)
PresentDrawableAfterMinimumDuration(drawable MTLDrawable, duration float64)
// Registers a completion handler the GPU device calls immediately after it schedules the command buffer to run on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/addScheduledHandler(_:)
AddScheduledHandler(block MTLCommandBufferHandler)
// Registers a completion handler the GPU device calls immediately after the GPU finishes running the commands in the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/addCompletedHandler(_:)
AddCompletedHandler(block MTLCommandBufferHandler)
// Reserves the next available place for the command buffer in its command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/enqueue()
Enqueue()
// Submits the command buffer to run on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/commit()
Commit()
// Blocks the current thread until the command queue schedules the buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/waitUntilScheduled()
WaitUntilScheduled()
// Blocks the current thread until the GPU finishes executing the command buffer and all of its completion handlers.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/waitUntilCompleted()
WaitUntilCompleted()
// The command buffer’s current state.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/status
Status() MTLCommandBufferStatus
// Creates a ray-tracing acceleration structure command encoder that uses default settings.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeAccelerationStructureCommandEncoder()
AccelerationStructureCommandEncoder() MTLAccelerationStructureCommandEncoder
// Creates a ray-tracing acceleration structure command encoder from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeAccelerationStructureCommandEncoder(descriptor:)
AccelerationStructureCommandEncoderWithDescriptor(descriptor IMTLAccelerationStructurePassDescriptor) MTLAccelerationStructureCommandEncoder
// Creates a block information transfer (blit) encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeBlitCommandEncoder()
BlitCommandEncoder() MTLBlitCommandEncoder
// Creates a block information transfer (blit) encoder from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeBlitCommandEncoder(descriptor:)
BlitCommandEncoderWithDescriptor(blitPassDescriptor IMTLBlitPassDescriptor) MTLBlitCommandEncoder
// Creates a compute command encoder that uses default settings.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeComputeCommandEncoder()
ComputeCommandEncoder() MTLComputeCommandEncoder
// Creates a compute command encoder from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeComputeCommandEncoder(descriptor:)
ComputeCommandEncoderWithDescriptor(computePassDescriptor IMTLComputePassDescriptor) MTLComputeCommandEncoder
// Creates a compute command encoder with a dispatch type.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeComputeCommandEncoder(dispatchType:)
ComputeCommandEncoderWithDispatchType(dispatchType MTLDispatchType) MTLComputeCommandEncoder
// Creates a parallel render command encoder from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeParallelRenderCommandEncoder(descriptor:)
ParallelRenderCommandEncoderWithDescriptor(renderPassDescriptor IMTLRenderPassDescriptor) MTLParallelRenderCommandEncoder
// Marks the end of a debug group and, if applicable, restores the previous group from a stack.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/popDebugGroup()
PopDebugGroup()
// Marks the beginning of a debug group and gives it an identifying label, which temporarily replaces the previous group, if applicable.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/pushDebugGroup(_:)
PushDebugGroup(string_ string)
// Creates a render command encoder from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeRenderCommandEncoder(descriptor:)
RenderCommandEncoderWithDescriptor(renderPassDescriptor IMTLRenderPassDescriptor) MTLRenderCommandEncoder
// Creates a resource state command encoder that uses default settings.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeResourceStateCommandEncoder()
ResourceStateCommandEncoder() MTLResourceStateCommandEncoder
// Creates a resource state command encoder from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/resourceStateCommandEncoder(with:)
ResourceStateCommandEncoderWithDescriptor(resourceStatePassDescriptor IMTLResourceStatePassDescriptor) MTLResourceStateCommandEncoder
// Applies multiple residency sets to a command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/useResidencySets:count:
UseResidencySetsCount(residencySets []MTLResidencySet, count uint)
// The host time, in seconds, when the GPU finishes execution of the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/gpuEndTime
GPUEndTime() float64
// The host time, in seconds, when the GPU starts command buffer execution.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/gpuStartTime
GPUStartTime() float64
// The command queue that creates the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/commandQueue
CommandQueue() MTLCommandQueue
// The GPU device that indirectly owns the command buffer because you create it from a command queue the device also owns.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/device
Device() MTLDevice
// A description of an error when the GPU encounters an issue as it runs the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/error
Error() foundation.INSError
// Settings that determine which information the command buffer records about execution errors, and how it does it.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/errorOptions
ErrorOptions() MTLCommandBufferErrorOption
// The host time, in seconds, when the CPU finishes scheduling the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/kernelEndTime
KernelEndTime() float64
// The host time, in seconds, when the CPU begins to schedule the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/kernelStartTime
KernelStartTime() float64
// An optional name that can help you identify the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/label
Label() string
SetLabel(value string)
// The messages the command buffer records as the GPU runs its commands.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/logs
Logs() MTLLogContainer
// A Boolean value that indicates whether the command buffer maintains strong references to the resources it uses.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/retainedReferences
RetainedReferences() bool
}
A container that stores a sequence of GPU commands that you encode into it.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer
type MTLCommandBufferDescriptor ¶
type MTLCommandBufferDescriptor struct {
objectivec.Object
}
A configuration that customizes the behavior for a new command buffer.
Overview ¶
Create a command buffer with a custom configuration by creating an MTLCommandBufferDescriptor instance and passing it to an MTLCommandQueue instance’s [CommandBufferWithDescriptor] method. You can configure whether the command buffer retains references to resources that its commands refer to with the MTLCommandBufferDescriptor.RetainedReferences property. The command buffer can save extra error information, which is useful during development, by setting its MTLCommandBufferDescriptor.ErrorOptions property to [CommandBufferErrorOptionEncoderExecutionStatus].
Configuring the command buffer ¶
- MTLCommandBufferDescriptor.LogState: The shader logging configuration that the command buffer uses.
- MTLCommandBufferDescriptor.SetLogState
- MTLCommandBufferDescriptor.RetainedReferences: A Boolean value that indicates whether the command buffer the descriptor creates maintains strong references to the resources it uses.
- MTLCommandBufferDescriptor.SetRetainedReferences
- MTLCommandBufferDescriptor.ErrorOptions: The reporting configuration that indicates which information the GPU driver stores in a command buffer’s error property.
- MTLCommandBufferDescriptor.SetErrorOptions
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferDescriptor
func MTLCommandBufferDescriptorFromID ¶
func MTLCommandBufferDescriptorFromID(id objc.ID) MTLCommandBufferDescriptor
MTLCommandBufferDescriptorFromID constructs a MTLCommandBufferDescriptor from an objc.ID.
A configuration that customizes the behavior for a new command buffer.
func NewMTLCommandBufferDescriptor ¶
func NewMTLCommandBufferDescriptor() MTLCommandBufferDescriptor
NewMTLCommandBufferDescriptor creates a new MTLCommandBufferDescriptor instance.
func (MTLCommandBufferDescriptor) Autorelease ¶
func (c MTLCommandBufferDescriptor) Autorelease() MTLCommandBufferDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLCommandBufferDescriptor) EncoderExecutionStatus ¶
func (c MTLCommandBufferDescriptor) EncoderExecutionStatus() MTLCommandBufferErrorOption
An option that instructs a command buffer to save additional details about a GPU runtime error.
See: https://developer.apple.com/documentation/metal/mtlcommandbuffererroroption/encoderexecutionstatus
func (MTLCommandBufferDescriptor) ErrorOptions ¶
func (c MTLCommandBufferDescriptor) ErrorOptions() MTLCommandBufferErrorOption
The reporting configuration that indicates which information the GPU driver stores in a command buffer’s error property.
Discussion ¶
By default, a GPU driver doesn’t report additional error information.
To create a command buffer that saves additional GPU runtime error information, add the [CommandBufferErrorOptionEncoderExecutionStatus] option to this property. If the GPU encounters an error as it runs the command buffer, you can retrieve the additional information from the command buffer’s error property.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferDescriptor/errorOptions
func (MTLCommandBufferDescriptor) Init ¶
func (c MTLCommandBufferDescriptor) Init() MTLCommandBufferDescriptor
Init initializes the instance.
func (MTLCommandBufferDescriptor) LogState ¶
func (c MTLCommandBufferDescriptor) LogState() MTLLogState
The shader logging configuration that the command buffer uses.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferDescriptor/logState
func (MTLCommandBufferDescriptor) MTLCommandBufferErrorDomain ¶
func (c MTLCommandBufferDescriptor) MTLCommandBufferErrorDomain() string
The domain for Metal command buffer errors.
See: https://developer.apple.com/documentation/metal/mtlcommandbuffererrordomain
func (MTLCommandBufferDescriptor) RetainedReferences ¶
func (c MTLCommandBufferDescriptor) RetainedReferences() bool
A Boolean value that indicates whether the command buffer the descriptor creates maintains strong references to the resources it uses.
Discussion ¶
Set this property to true (its default) to create a command buffer that maintains strong references to resource instances that its commands need. Otherwise, set it to false to create a command buffer that doesn’t maintain strong references to its resources.
Apps typically create command buffers that don’t maintain references to resources for extremely performance-critical situations. Even though the runtime cost for retaining or releasing a single resource is trivial, the aggregate time savings may be worth it.
It’s your app’s responsibility to maintain strong references to all the resources the command buffer uses until it finishes running on the GPU.
You can determine whether an existing command buffer retains references by checking its retainedReferences property.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferDescriptor/retainedReferences
func (MTLCommandBufferDescriptor) SetEncoderExecutionStatus ¶
func (c MTLCommandBufferDescriptor) SetEncoderExecutionStatus(value MTLCommandBufferErrorOption)
func (MTLCommandBufferDescriptor) SetErrorOptions ¶
func (c MTLCommandBufferDescriptor) SetErrorOptions(value MTLCommandBufferErrorOption)
func (MTLCommandBufferDescriptor) SetLogState ¶
func (c MTLCommandBufferDescriptor) SetLogState(value MTLLogState)
func (MTLCommandBufferDescriptor) SetRetainedReferences ¶
func (c MTLCommandBufferDescriptor) SetRetainedReferences(value bool)
type MTLCommandBufferDescriptorClass ¶
type MTLCommandBufferDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLCommandBufferDescriptorClass ¶
func GetMTLCommandBufferDescriptorClass() MTLCommandBufferDescriptorClass
GetMTLCommandBufferDescriptorClass returns the class object for MTLCommandBufferDescriptor.
func (MTLCommandBufferDescriptorClass) Alloc ¶
func (mc MTLCommandBufferDescriptorClass) Alloc() MTLCommandBufferDescriptor
Alloc allocates memory for a new instance of the class.
type MTLCommandBufferEncoderInfo ¶
type MTLCommandBufferEncoderInfo interface {
objectivec.IObject
// The name of the encoder that generates the error information.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfo/label
Label() string
// An array of debug signposts that Metal records as the GPU executes the commands of the encoder’s pass.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfo/debugSignposts
DebugSignposts() []string
// The execution status of the command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfo/errorState
ErrorState() MTLCommandEncoderErrorState
}
A container that provides additional information about a runtime failure a GPU encounters as it runs the commands in a command buffer.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfo
type MTLCommandBufferEncoderInfoObject ¶
type MTLCommandBufferEncoderInfoObject struct {
objectivec.Object
}
MTLCommandBufferEncoderInfoObject wraps an existing Objective-C object that conforms to the MTLCommandBufferEncoderInfo protocol.
func MTLCommandBufferEncoderInfoObjectFromID ¶
func MTLCommandBufferEncoderInfoObjectFromID(id objc.ID) MTLCommandBufferEncoderInfoObject
MTLCommandBufferEncoderInfoObjectFromID constructs a MTLCommandBufferEncoderInfoObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCommandBufferEncoderInfoObject) BaseObject ¶
func (o MTLCommandBufferEncoderInfoObject) BaseObject() objectivec.Object
func (MTLCommandBufferEncoderInfoObject) DebugSignposts ¶
func (o MTLCommandBufferEncoderInfoObject) DebugSignposts() []string
An array of debug signposts that Metal records as the GPU executes the commands of the encoder’s pass.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfo/debugSignposts
func (MTLCommandBufferEncoderInfoObject) ErrorState ¶
func (o MTLCommandBufferEncoderInfoObject) ErrorState() MTLCommandEncoderErrorState
The execution status of the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfo/errorState
func (MTLCommandBufferEncoderInfoObject) Label ¶
func (o MTLCommandBufferEncoderInfoObject) Label() string
The name of the encoder that generates the error information.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferEncoderInfo/label
type MTLCommandBufferError ¶
type MTLCommandBufferError int
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferError-swift.struct/Code
const ( // MTLCommandBufferErrorAccessRevoked: An error code that indicates the system has revoked the Metal device’s access because it’s responsible for too many timeouts or hangs. MTLCommandBufferErrorAccessRevoked MTLCommandBufferError = 4 // MTLCommandBufferErrorDeviceRemoved: An error code that indicates a person physically removed the GPU device before the command buffer finished running. MTLCommandBufferErrorDeviceRemoved MTLCommandBufferError = 11 // MTLCommandBufferErrorInternal: An error code that indicates the Metal framework has an internal problem. MTLCommandBufferErrorInternal MTLCommandBufferError = 1 // MTLCommandBufferErrorInvalidResource: An error code that indicates the command buffer has an invalid reference to resource. MTLCommandBufferErrorInvalidResource MTLCommandBufferError = 9 // MTLCommandBufferErrorMemoryless: An error code that indicates the GPU ran out of one or more of its internal resources that support memoryless render pass attachments. MTLCommandBufferErrorMemoryless MTLCommandBufferError = 10 // MTLCommandBufferErrorNone: An error code that represents the absence of any problems. MTLCommandBufferErrorNone MTLCommandBufferError = 0 // MTLCommandBufferErrorNotPermitted: An error code that indicates a process doesn’t have access to a GPU device. MTLCommandBufferErrorNotPermitted MTLCommandBufferError = 7 // MTLCommandBufferErrorOutOfMemory: An error code that indicates the GPU device doesn’t have sufficient memory to execute a command buffer. MTLCommandBufferErrorOutOfMemory MTLCommandBufferError = 8 // MTLCommandBufferErrorPageFault: An error code that indicates the command buffer generated a page fault the GPU can’t service. MTLCommandBufferErrorPageFault MTLCommandBufferError = 3 // MTLCommandBufferErrorStackOverflow: An error code that indicates the GPU terminated the command buffer because a kernel function of tile shader used too many stack frames. MTLCommandBufferErrorStackOverflow MTLCommandBufferError = 12 // MTLCommandBufferErrorTimeout: An error code that indicates the system interrupted and terminated the command buffer before it finished running. MTLCommandBufferErrorTimeout MTLCommandBufferError = 2 // Deprecated. MTLCommandBufferErrorBlacklisted MTLCommandBufferError = 4 )
func (MTLCommandBufferError) String ¶
func (e MTLCommandBufferError) String() string
type MTLCommandBufferErrorOption ¶
type MTLCommandBufferErrorOption int
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferErrorOption
const ( // MTLCommandBufferErrorOptionEncoderExecutionStatus: An option that instructs a command buffer to save additional details about a GPU runtime error. MTLCommandBufferErrorOptionEncoderExecutionStatus MTLCommandBufferErrorOption = 1 // MTLCommandBufferErrorOptionNone: An option that clears a command buffer’s error options. MTLCommandBufferErrorOptionNone MTLCommandBufferErrorOption = 0 )
func (MTLCommandBufferErrorOption) String ¶
func (e MTLCommandBufferErrorOption) String() string
type MTLCommandBufferHandler ¶
type MTLCommandBufferHandler = func(MTLCommandBuffer)
MTLCommandBufferHandler is a completion handler signature a GPU device calls when it finishes scheduling a command buffer, or when the GPU finishes running it.
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferHandler
type MTLCommandBufferObject ¶
type MTLCommandBufferObject struct {
objectivec.Object
}
MTLCommandBufferObject wraps an existing Objective-C object that conforms to the MTLCommandBuffer protocol.
func MTLCommandBufferObjectFromID ¶
func MTLCommandBufferObjectFromID(id objc.ID) MTLCommandBufferObject
MTLCommandBufferObjectFromID constructs a MTLCommandBufferObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCommandBufferObject) AccelerationStructureCommandEncoder ¶
func (o MTLCommandBufferObject) AccelerationStructureCommandEncoder() MTLAccelerationStructureCommandEncoder
Creates a ray-tracing acceleration structure command encoder that uses default settings.
Discussion ¶
Use an MTLAccelerationStructureCommandEncoder instance’s methods to set up a single ray-tracing pass.
func (MTLCommandBufferObject) AccelerationStructureCommandEncoderWithDescriptor ¶
func (o MTLCommandBufferObject) AccelerationStructureCommandEncoderWithDescriptor(descriptor IMTLAccelerationStructurePassDescriptor) MTLAccelerationStructureCommandEncoder
Creates a ray-tracing acceleration structure command encoder from a descriptor.
descriptor: An MTLAccelerationStructurePassDescriptor instance that configures the MTLAccelerationStructureCommandEncoder the method returns.
Discussion ¶
Use an MTLAccelerationStructureCommandEncoder instance’s methods to set up a single ray-tracing pass.
func (MTLCommandBufferObject) AddCompletedHandler ¶
func (o MTLCommandBufferObject) AddCompletedHandler(block MTLCommandBufferHandler)
Registers a completion handler the GPU device calls immediately after the GPU finishes running the commands in the command buffer.
block: A Swift closure or an Objective-C block that Metal calls after the GPU finishes running the commands in the command buffer.
Discussion ¶
You can register one or more completion handlers for the same command buffer. The GPU device’s driver (on the CPU) calls the completion handlers after the GPU finishes executing the command buffer.
For example, you can use the command buffer’s gpuEndTime and gpuStartTime properties to calculate how much time the GPU spends running the command buffer.
The completion handler is also a good place to check the [Status] property to determine whether the GPU successfully completes the buffer’s commands. If the status is equal to [CommandBufferStatusError], you can investigate further by checking the error and log properties for more details about the issue. See Command buffer debugging for more methods and properties that can help you isolate the issue.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/addCompletedHandler(_:)
func (MTLCommandBufferObject) AddScheduledHandler ¶
func (o MTLCommandBufferObject) AddScheduledHandler(block MTLCommandBufferHandler)
Registers a completion handler the GPU device calls immediately after it schedules the command buffer to run on the GPU.
block: A Swift closure or an Objective-C block that Metal calls after it schedules the command buffer to run on the GPU.
Discussion ¶
You can register one or more scheduling completion handlers for the same command buffer. The GPU device’s driver (on the CPU) calls the completion handlers after it finishes scheduling the command buffer to run on the GPU.
The GPU device schedules each command buffer — along with tasks from other command buffers — after it identifies the command buffer’s dependencies. At that time, the GPU device sets the command buffer’s status to [CommandBufferStatusScheduled] and calls your completion handler.
You can use the command buffer’s kernelEndTime and kernelStartTime properties to calculate how much time the CPU spends scheduling the command buffer.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/addScheduledHandler(_:)
func (MTLCommandBufferObject) BaseObject ¶
func (o MTLCommandBufferObject) BaseObject() objectivec.Object
func (MTLCommandBufferObject) BlitCommandEncoder ¶
func (o MTLCommandBufferObject) BlitCommandEncoder() MTLBlitCommandEncoder
Creates a block information transfer (blit) encoder.
Discussion ¶
Use an MTLBlitCommandEncoder instance’s methods to create a block information transfer (blit) pass that quickly copies memory between a GPU device’s resources.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeBlitCommandEncoder()
func (MTLCommandBufferObject) BlitCommandEncoderWithDescriptor ¶
func (o MTLCommandBufferObject) BlitCommandEncoderWithDescriptor(blitPassDescriptor IMTLBlitPassDescriptor) MTLBlitCommandEncoder
Creates a block information transfer (blit) encoder from a descriptor.
blitPassDescriptor: An MTLBlitPassDescriptor instance that configures the MTLBlitCommandEncoder the method returns.
Discussion ¶
Use an MTLBlitCommandEncoder instance’s methods to create a block information transfer (blit) pass that quickly copies memory between a GPU device’s resources.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeBlitCommandEncoder(descriptor:)
func (MTLCommandBufferObject) CommandQueue ¶
func (o MTLCommandBufferObject) CommandQueue() MTLCommandQueue
The command queue that creates the command buffer.
Discussion ¶
Each command buffer can only submit its commands to the queue that creates it.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/commandQueue
func (MTLCommandBufferObject) Commit ¶
func (o MTLCommandBufferObject) Commit()
Submits the command buffer to run on the GPU.
Discussion ¶
The [Commit] method sends the command buffer to the MTLCommandQueue instance that owns it, which then schedules it to run on the GPU. If your app calls [Commit] for a command buffer that isn’t enqueued, the method effectively calls [Enqueue] for you.
The [Commit] method has several restrictions, including:
- You can commit a command buffer to its command queue only one time. - You can only commit a command buffer when it doesn’t have an active encoder (see MTLCommandBuffer and MTLCommandEncoder). - You can’t encode additional commands to a command buffer after you commit it. - You can’t call the [AddScheduledHandler] or [AddCompletedHandler] methods after you commit a command buffer.
The GPU starts the command buffer after it starts any command buffers that are ahead of it in the same command queue.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/commit()
func (MTLCommandBufferObject) ComputeCommandEncoder ¶
func (o MTLCommandBufferObject) ComputeCommandEncoder() MTLComputeCommandEncoder
Creates a compute command encoder that uses default settings.
Discussion ¶
Use an MTLComputeCommandEncoder instance’s methods to set up a single compute pass. The encoder this method returns dispatches its compute commands serially (see [DispatchTypeSerial]). To create a compute command encoder that dispatches commands concurrently (see [DispatchTypeConcurrent]), use the [ComputeCommandEncoderWithDispatchType] or [ComputeCommandEncoderWithDescriptor] method.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeComputeCommandEncoder()
func (MTLCommandBufferObject) ComputeCommandEncoderWithDescriptor ¶
func (o MTLCommandBufferObject) ComputeCommandEncoderWithDescriptor(computePassDescriptor IMTLComputePassDescriptor) MTLComputeCommandEncoder
Creates a compute command encoder from a descriptor.
computePassDescriptor: An MTLComputePassDescriptor instance that configures the MTLComputeCommandEncoder the method returns.
Discussion ¶
Use an MTLComputeCommandEncoder instance’s methods to set up a single compute pass.
func (MTLCommandBufferObject) ComputeCommandEncoderWithDispatchType ¶
func (o MTLCommandBufferObject) ComputeCommandEncoderWithDispatchType(dispatchType MTLDispatchType) MTLComputeCommandEncoder
Creates a compute command encoder with a dispatch type.
dispatchType: An MTLDispatchType instance that indicates whether the compute pass the encoder creates runs commands serially or concurrently. // MTLDispatchType: https://developer.apple.com/documentation/Metal/MTLDispatchType
Discussion ¶
Use an MTLComputeCommandEncoder instance’s methods to set up a single compute pass.
func (MTLCommandBufferObject) Device ¶
func (o MTLCommandBufferObject) Device() MTLDevice
The GPU device that indirectly owns the command buffer because you create it from a command queue the device also owns.
Discussion ¶
The command buffer can only work with other instances that device creates, directly or indirectly, such as buffers and textures.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/device
func (MTLCommandBufferObject) EncodeSignalEventValue ¶
func (o MTLCommandBufferObject) EncodeSignalEventValue(event MTLEvent, value uint64)
Encodes a command that updates an event’s value, which can clear the GPU to run passes from other command buffers waiting for the event.
event: An MTLEvent instance the GPU driver signals between passes as it runs the command buffer.
If `event` is an MTLSharedEvent instance, the update:
- Signals any command buffers waiting for the shared event, including those on other GPU devices - Invokes any notification handlers waiting for the shared event (see [NotifyListenerAtValueBlock])
Otherwise, the method can signal only command buffers from the same GPU device.
value: A value that’s greater than or equal to the event’s current value; otherwise, the command has no effect.
Discussion ¶
The method can unblock one or more command buffers that are waiting for `event`, including those in other command queues (see [EncodeWaitForEventValue]).
A command buffer can signal an event only between passes, not within a pass. If a command buffer has an active encoder, finish using the encoder, call its [EndEncoding] method, and then call this method before creating another encoder.
When the GPU device reaches the signal command that this method encodes, Metal updates the event after the GPU finishes the buffer’s prior commands. Updating the event’s value can signal any command buffer that’s waiting for a value equal to or less than the `value` parameter.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/encodeSignalEvent(_:value:)
func (MTLCommandBufferObject) EncodeWaitForEventValue ¶
func (o MTLCommandBufferObject) EncodeWaitForEventValue(event MTLEvent, value uint64)
Encodes a command into the command buffer that pauses the GPU from running the buffer’s subsequent passes until the event equals or exceeds a value.
event: An MTLEvent instance the GPU driver waits for between passes as it runs the command buffer.
If `event` is an MTLSharedEvent instance, a command buffer from any GPU device can signal this command buffer. Otherwise, only command buffers from the same GPU device can signal this command buffer.
value: The event’s smallest value that allows the GPU to continue running the remaining passes in the command buffer.
Discussion ¶
This method prevents the GPU from starting the next pass in the command buffer until another command buffer signals `event` (see [EncodeSignalEventValue].
A command buffer can instruct the GPU to wait for an event only between passes, not within a pass. If a command buffer has an active encoder, finish using the encoder, call its [EndEncoding] method, and then call this method before creating another encoder.
When the GPU device reaches the wait command that this method encodes into the buffer, it checks the event’s current value. If the event’s value — which increases monotonically — is less than the `value` parameter, the GPU waits before running the next pass in the buffer. The GPU starts the next pass when the event signals a value that’s equal to or greater than the `value` parameter (see [EncodeSignalEventValue]). However, If the event’s value is already greater than or equal to the `value` parameter, the GPU immediately starts the next pass without waiting.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/encodeWaitForEvent(_:value:)
func (MTLCommandBufferObject) Enqueue ¶
func (o MTLCommandBufferObject) Enqueue()
Reserves the next available place for the command buffer in its command queue.
Discussion ¶
The [Enqueue] method adds the command buffer to the MTLCommandQueue instance that owns it, but doesn’t commit the command buffer to run on the GPU. You can call the command buffer’s [Commit] method at a later time when it’s ready to run on the GPU. You can call a command buffer’s [Enqueue] method any time before you call [Commit], including before, after, or as you encode commands to it.
Enqueuing your command buffers first gives you the flexibility to arrange their relative order of execution before encoding commands to any of them. This approach lets you potentially encode each command buffer on a thread, in parallel, instead of encoding them one by one on a single thread. The order in which each worker thread finishes encoding and commits its command buffer doesn’t matter when you enqueue them in order before committing.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/enqueue()
func (MTLCommandBufferObject) Error ¶
func (o MTLCommandBufferObject) Error() foundation.INSError
A description of an error when the GPU encounters an issue as it runs the command buffer.
Discussion ¶
You typically check this property during development to get more information about a runtime issue. The property remains `nil` unless the GPU can’t successfully run the command buffer.
An error’s userInfo dictionary property contains additional information if the command buffer’s errorOptions property includes [CommandBufferErrorOptionEncoderExecutionStatus]. You can retrieve an MTLCommandBufferEncoderInfo instance from the dictionary by accessing it with MTLCommandBufferEncoderInfoErrorKey.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/error
func (MTLCommandBufferObject) ErrorOptions ¶
func (o MTLCommandBufferObject) ErrorOptions() MTLCommandBufferErrorOption
Settings that determine which information the command buffer records about execution errors, and how it does it.
Discussion ¶
The property reflects the [ErrorOptions] property of the MTLCommandBufferDescriptor instance at the time you create the command buffer.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/errorOptions
func (MTLCommandBufferObject) GPUEndTime ¶
func (o MTLCommandBufferObject) GPUEndTime() float64
The host time, in seconds, when the GPU finishes execution of the command buffer.
Discussion ¶
You can calculate how much time the GPU spends running a command buffer by subtracting gpuStartTime from this value. Both values are relative to system mach time.
The GPU start and end times remain `0.0` until the GPU finishes running the command buffer. Check this value after the [WaitUntilCompleted] method returns, or within a completion handler passed to the [AddCompletedHandler] method.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/gpuEndTime
func (MTLCommandBufferObject) GPUStartTime ¶
func (o MTLCommandBufferObject) GPUStartTime() float64
The host time, in seconds, when the GPU starts command buffer execution.
Discussion ¶
You can calculate how much time the GPU spends running a command buffer by subtracting this value from gpuEndTime. Both values are relative to system mach time.
The GPU start and end times remain `0.0` until the GPU finishes running the command buffer. Check this value after the [WaitUntilCompleted] method returns, or within a completion handler passed to the [AddCompletedHandler] method.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/gpuStartTime
func (MTLCommandBufferObject) KernelEndTime ¶
func (o MTLCommandBufferObject) KernelEndTime() float64
The host time, in seconds, when the CPU finishes scheduling the command buffer.
Discussion ¶
You can calculate how much time the kernel spends scheduling a command buffer by subtracting kernelStartTime from this value.
The kernel start and end times remain `0.0` until the GPU driver (on the CPU) schedules the command buffer to run on the GPU. Apps typically use these values after the [WaitUntilScheduled] method returns, or within a completion handler (see [AddScheduledHandler] and [AddCompletedHandler]).
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/kernelEndTime
func (MTLCommandBufferObject) KernelStartTime ¶
func (o MTLCommandBufferObject) KernelStartTime() float64
The host time, in seconds, when the CPU begins to schedule the command buffer.
Discussion ¶
You can calculate how much time the kernel spends scheduling a command buffer by subtracting this value from kernelEndTime.
The kernel start and end times remain `0.0` until the GPU driver (on the CPU) schedules the command buffer to run on the GPU. Apps typically use these values after the [WaitUntilScheduled] method returns, or within a completion handler (see [AddScheduledHandler] and [AddCompletedHandler]).
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/kernelStartTime
func (MTLCommandBufferObject) Label ¶
func (o MTLCommandBufferObject) Label() string
An optional name that can help you identify the command buffer.
Discussion ¶
Set labels to help you quickly identify a command buffer at runtime in the Metal debugging and profiling tools. See Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/label
func (MTLCommandBufferObject) Logs ¶
func (o MTLCommandBufferObject) Logs() MTLLogContainer
The messages the command buffer records as the GPU runs its commands.
Discussion ¶
The value of this property is valid only after the command buffer finishes executing.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/logs
func (MTLCommandBufferObject) ParallelRenderCommandEncoderWithDescriptor ¶
func (o MTLCommandBufferObject) ParallelRenderCommandEncoderWithDescriptor(renderPassDescriptor IMTLRenderPassDescriptor) MTLParallelRenderCommandEncoder
Creates a parallel render command encoder from a descriptor.
renderPassDescriptor: An MTLRenderPassDescriptor instance that configures the MTLParallelRenderCommandEncoder the method returns.
Discussion ¶
An MTLParallelRenderCommandEncoder instance can create multiple, independent render command encoders that contribute to the same render pass on different threads.
func (MTLCommandBufferObject) PopDebugGroup ¶
func (o MTLCommandBufferObject) PopDebugGroup()
Marks the end of a debug group and, if applicable, restores the previous group from a stack.
Discussion ¶
Use [PushDebugGroup] to group commands within the command buffer, which adds a new group to a stack, effectively nesting a group within any previous group. Call [PopDebugGroup] to mark the end of a group of commands within the command buffer, and restore the previous group, if applicable. You can inspect the group and the commands it contains when viewing the contents of a frame capture with Metal Debugger.
Labels can help you profile and debug your app at runtime with Metal Debugger and other tools. See Naming resources and commands for more information about using labels and other debugging techniques.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/popDebugGroup()
func (MTLCommandBufferObject) PresentDrawable ¶
func (o MTLCommandBufferObject) PresentDrawable(drawable MTLDrawable)
Presents a drawable as early as possible.
drawable: An MTLDrawable instance that contains a texture the system can show on a display.
Discussion ¶
This convenience method calls the drawable’s [Present] method after the command queue schedules the command buffer for execution. The command buffer does this by adding a completion handler by calling its own [AddScheduledHandler] method for you.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/present(_:)
func (MTLCommandBufferObject) PresentDrawableAfterMinimumDuration ¶
func (o MTLCommandBufferObject) PresentDrawableAfterMinimumDuration(drawable MTLDrawable, duration float64)
Presents a drawable after the system presents the previous drawable for an amount of time.
drawable: An MTLDrawable instance that contains a texture the system can show on a display.
duration: The shortest display time you want the system to give to the previous drawable before presenting this one.
Discussion ¶
This convenience method calls the drawable’s [PresentAfterMinimumDuration] method after the command queue schedules the command buffer for execution. The command buffer does this by adding a completion handler by calling its own [AddScheduledHandler] method for you.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/present(_:afterMinimumDuration:)
func (MTLCommandBufferObject) PresentDrawableAtTime ¶
func (o MTLCommandBufferObject) PresentDrawableAtTime(drawable MTLDrawable, presentationTime float64)
Presents a drawable at a specific time.
drawable: An MTLDrawable instance that contains a texture the system can show on a display.
presentationTime: The Mach absolute time, in seconds, that you want to present the drawable.
Discussion ¶
This convenience method calls the drawable’s [PresentAtTime] method after the command queue schedules the command buffer for execution. The command buffer does this by adding a completion handler by calling its own [AddScheduledHandler] method for you.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/present(_:atTime:)
func (MTLCommandBufferObject) PushDebugGroup ¶
func (o MTLCommandBufferObject) PushDebugGroup(string_ string)
Marks the beginning of a debug group and gives it an identifying label, which temporarily replaces the previous group, if applicable.
string: A name for the debug group.
Discussion ¶
Use [PushDebugGroup] to group commands within the command buffer, which adds a new group to a stack, effectively nesting a group within any previous group. Call [PopDebugGroup] to mark the end of a group of commands within the command buffer, and restore the previous group, if applicable. You can inspect the group and the commands it contains when viewing the contents of a frame capture with Metal Debugger.
Labels can help you profile and debug your app at runtime with Metal Debugger and other tools. See Naming resources and commands for more information about using labels and other debugging techniques.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/pushDebugGroup(_:)
func (MTLCommandBufferObject) RenderCommandEncoderWithDescriptor ¶
func (o MTLCommandBufferObject) RenderCommandEncoderWithDescriptor(renderPassDescriptor IMTLRenderPassDescriptor) MTLRenderCommandEncoder
Creates a render command encoder from a descriptor.
renderPassDescriptor: An MTLRenderPassDescriptor instance that configures the MTLRenderCommandEncoder the method returns.
Discussion ¶
Use an MTLRenderCommandEncoder instance’s methods to set up a single graphics-rendering pass.
func (MTLCommandBufferObject) ResourceStateCommandEncoder ¶
func (o MTLCommandBufferObject) ResourceStateCommandEncoder() MTLResourceStateCommandEncoder
Creates a resource state command encoder that uses default settings.
Discussion ¶
Use an MTLResourceStateCommandEncoder instance’s methods to create a pass that updates the state of one or more sparse textures.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/makeResourceStateCommandEncoder()
func (MTLCommandBufferObject) ResourceStateCommandEncoderWithDescriptor ¶
func (o MTLCommandBufferObject) ResourceStateCommandEncoderWithDescriptor(resourceStatePassDescriptor IMTLResourceStatePassDescriptor) MTLResourceStateCommandEncoder
Creates a resource state command encoder from a descriptor.
resourceStatePassDescriptor: An MTLResourceStatePassDescriptor instance that configures the MTLResourceStateCommandEncoder the method returns.
Discussion ¶
Use an MTLResourceStateCommandEncoder instance’s methods to create a pass that updates the state of one or more sparse textures.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/resourceStateCommandEncoder(with:)
func (MTLCommandBufferObject) RetainedReferences ¶
func (o MTLCommandBufferObject) RetainedReferences() bool
A Boolean value that indicates whether the command buffer maintains strong references to the resources it uses.
Discussion ¶
You can configure this property when you create a command buffer by setting [RetainedReferences] of an MTLCommandBufferDescriptor instance and calling the [CommandBufferWithDescriptor] method. The [CommandBuffer] method sets this property to true, and [CommandBufferWithUnretainedReferences] sets it to false.
If false, your app is responsible for maintaining strong references to all the resources the command buffer relies on until it completes.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/retainedReferences
func (MTLCommandBufferObject) SetLabel ¶
func (o MTLCommandBufferObject) SetLabel(value string)
func (MTLCommandBufferObject) Status ¶
func (o MTLCommandBufferObject) Status() MTLCommandBufferStatus
The command buffer’s current state.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/status
func (MTLCommandBufferObject) UseResidencySet ¶
func (o MTLCommandBufferObject) UseResidencySet(residencySet MTLResidencySet)
Applies a residency set to a command buffer.
residencySet: A residency set that contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
Discussion ¶
Each command buffer can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/useResidencySet(_:)
func (MTLCommandBufferObject) UseResidencySetsCount ¶
func (o MTLCommandBufferObject) UseResidencySetsCount(residencySets []MTLResidencySet, count uint)
Applies multiple residency sets to a command buffer.
residencySets: A C array of residency sets, each of which contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `residencySets`.
Discussion ¶
Each command buffer can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/useResidencySets:count:
func (MTLCommandBufferObject) WaitUntilCompleted ¶
func (o MTLCommandBufferObject) WaitUntilCompleted()
Blocks the current thread until the GPU finishes executing the command buffer and all of its completion handlers.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/waitUntilCompleted()
func (MTLCommandBufferObject) WaitUntilScheduled ¶
func (o MTLCommandBufferObject) WaitUntilScheduled()
Blocks the current thread until the command queue schedules the buffer.
Discussion ¶
This method returns after the following events:
- The command queue (see [Status] and [CommandBufferStatusScheduled]) the command buffer to run on the GPU. - The command buffer invokes all the completion handlers your app submits with [AddScheduledHandler].
Use the [WaitUntilCompleted] method to check for completion of the scheduled work.
See: https://developer.apple.com/documentation/Metal/MTLCommandBuffer/waitUntilScheduled()
type MTLCommandBufferStatus ¶
type MTLCommandBufferStatus int
See: https://developer.apple.com/documentation/Metal/MTLCommandBufferStatus
const ( // MTLCommandBufferStatusCommitted: A command buffer’s third state, which indicates the command queue is preparing to schedule the command buffer by resolving its dependencies. MTLCommandBufferStatusCommitted MTLCommandBufferStatus = 2 // MTLCommandBufferStatusCompleted: A command buffer’s successful, final state, which indicates the GPU finished running the command buffer’s commands without any problems. MTLCommandBufferStatusCompleted MTLCommandBufferStatus = 4 // MTLCommandBufferStatusEnqueued: A command buffer’s second state, which indicates its command queue is reserving a place for it. MTLCommandBufferStatusEnqueued MTLCommandBufferStatus = 1 // MTLCommandBufferStatusError: A command buffer’s unsuccessful, final state, which indicates the GPU stopped running the buffer’s commands because of a runtime issue. MTLCommandBufferStatusError MTLCommandBufferStatus = 5 // MTLCommandBufferStatusNotEnqueued: A command buffer’s initial state, which indicates its command queue isn’t reserving a place for it. MTLCommandBufferStatusNotEnqueued MTLCommandBufferStatus = 0 // MTLCommandBufferStatusScheduled: A command buffer’s fourth state, which indicates the command buffer has its resources ready and is waiting for the GPU to run its commands. MTLCommandBufferStatusScheduled MTLCommandBufferStatus = 3 )
func (MTLCommandBufferStatus) String ¶
func (e MTLCommandBufferStatus) String() string
type MTLCommandEncoder ¶
type MTLCommandEncoder interface {
objectivec.IObject
// Declares that all command generation from the encoder is completed.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
EndEncoding()
// Inserts a debug string into the captured frame data.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
InsertDebugSignpost(string_ string)
// Pushes a specific string onto a stack of debug group strings for the command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
PushDebugGroup(string_ string)
// Pops the latest string off of a stack of debug group strings for the command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
PopDebugGroup()
// The Metal device from which the command encoder was created.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
Device() MTLDevice
// A string that labels the command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
Label() string
// Encodes a consumer barrier on work you commit to the same command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/barrier(afterQueueStages:beforeStages:)
BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
// A string that labels the command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
SetLabel(value string)
}
An encoder that writes GPU commands into a command buffer.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder
type MTLCommandEncoderErrorState ¶
type MTLCommandEncoderErrorState int
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoderErrorState
const ( // MTLCommandEncoderErrorStateAffected: An error state that indicates the GPU failed to fully execute the commands because of an error. MTLCommandEncoderErrorStateAffected MTLCommandEncoderErrorState = 2 // MTLCommandEncoderErrorStateCompleted: A state that indicates the GPU successfully executed the commands without any errors. MTLCommandEncoderErrorStateCompleted MTLCommandEncoderErrorState = 1 // MTLCommandEncoderErrorStateFaulted: An error state that indicates the commands in the command buffer are the cause of an error. MTLCommandEncoderErrorStateFaulted MTLCommandEncoderErrorState = 4 // MTLCommandEncoderErrorStatePending: An error state that indicates the GPU didn’t execute the commands. MTLCommandEncoderErrorStatePending MTLCommandEncoderErrorState = 3 // MTLCommandEncoderErrorStateUnknown: An error state that indicates the command buffer doesn’t know the state of its commands on the GPU. MTLCommandEncoderErrorStateUnknown MTLCommandEncoderErrorState = 0 )
func (MTLCommandEncoderErrorState) String ¶
func (e MTLCommandEncoderErrorState) String() string
type MTLCommandEncoderObject ¶
type MTLCommandEncoderObject struct {
objectivec.Object
}
MTLCommandEncoderObject wraps an existing Objective-C object that conforms to the MTLCommandEncoder protocol.
func MTLCommandEncoderObjectFromID ¶
func MTLCommandEncoderObjectFromID(id objc.ID) MTLCommandEncoderObject
MTLCommandEncoderObjectFromID constructs a MTLCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCommandEncoderObject) BarrierAfterQueueStagesBeforeStages ¶
func (o MTLCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTLCommandEncoderObject) BaseObject ¶
func (o MTLCommandEncoderObject) BaseObject() objectivec.Object
func (MTLCommandEncoderObject) Device ¶
func (o MTLCommandEncoderObject) Device() MTLDevice
The Metal device from which the command encoder was created.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
func (MTLCommandEncoderObject) EndEncoding ¶
func (o MTLCommandEncoderObject) EndEncoding()
Declares that all command generation from the encoder is completed.
Discussion ¶
After `endEncoding` is called, the command encoder has no further use. You cannot encode any other commands with this encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
func (MTLCommandEncoderObject) InsertDebugSignpost ¶
func (o MTLCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the captured frame data.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
func (MTLCommandEncoderObject) Label ¶
func (o MTLCommandEncoderObject) Label() string
A string that labels the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
func (MTLCommandEncoderObject) PopDebugGroup ¶
func (o MTLCommandEncoderObject) PopDebugGroup()
Pops the latest string off of a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
func (MTLCommandEncoderObject) PushDebugGroup ¶
func (o MTLCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a specific string onto a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
func (MTLCommandEncoderObject) SetLabel ¶
func (o MTLCommandEncoderObject) SetLabel(value string)
type MTLCommandQueue ¶
type MTLCommandQueue interface {
objectivec.IObject
// Returns a command buffer from the command queue that you configure with a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/makeCommandBuffer(descriptor:)
CommandBufferWithDescriptor(descriptor IMTLCommandBufferDescriptor) MTLCommandBuffer
// Returns a command buffer from the command queue that maintains strong references to resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/makeCommandBuffer()
CommandBuffer() MTLCommandBuffer
// Returns a command buffer from the command queue that doesn’t maintain strong references to resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/makeCommandBufferWithUnretainedReferences()
CommandBufferWithUnretainedReferences() MTLCommandBuffer
// Applies a residency set to a queue, which Metal applies to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/addResidencySet(_:)
AddResidencySet(residencySet MTLResidencySet)
// Removes a residency set from a command queue’s list, which means Metal doesn’t apply it to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/removeResidencySet(_:)
RemoveResidencySet(residencySet MTLResidencySet)
// The GPU device that creates the command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/device
Device() MTLDevice
// An optional name that can help you identify the command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/label
Label() string
// Applies multiple residency sets to a queue, which Metal applies to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/addResidencySets:count:
AddResidencySetsCount(residencySets []MTLResidencySet, count uint)
// Removes multiple residency sets from a command queue’s list, which means Metal doesn’t apply them to the queue’s command buffers as you commit them.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/removeResidencySets:count:
RemoveResidencySetsCount(residencySets []MTLResidencySet, count uint)
// An optional name that can help you identify the command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/label
SetLabel(value string)
}
An instance you use to create, submit, and schedule command buffers to a specific GPU device to run the commands within those buffers.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue
type MTLCommandQueueDescriptor ¶
type MTLCommandQueueDescriptor struct {
objectivec.Object
}
A configuration that customizes the behavior for a new command queue.
Instance Properties ¶
- MTLCommandQueueDescriptor.LogState: The shader logging configuration that the command queue uses.
- MTLCommandQueueDescriptor.SetLogState
- MTLCommandQueueDescriptor.MaxCommandBufferCount: An integer that sets the maximum number of uncompleted command buffers the queue can allow.
- MTLCommandQueueDescriptor.SetMaxCommandBufferCount
See: https://developer.apple.com/documentation/Metal/MTLCommandQueueDescriptor
func MTLCommandQueueDescriptorFromID ¶
func MTLCommandQueueDescriptorFromID(id objc.ID) MTLCommandQueueDescriptor
MTLCommandQueueDescriptorFromID constructs a MTLCommandQueueDescriptor from an objc.ID.
A configuration that customizes the behavior for a new command queue.
func NewMTLCommandQueueDescriptor ¶
func NewMTLCommandQueueDescriptor() MTLCommandQueueDescriptor
NewMTLCommandQueueDescriptor creates a new MTLCommandQueueDescriptor instance.
func (MTLCommandQueueDescriptor) Autorelease ¶
func (c MTLCommandQueueDescriptor) Autorelease() MTLCommandQueueDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLCommandQueueDescriptor) Init ¶
func (c MTLCommandQueueDescriptor) Init() MTLCommandQueueDescriptor
Init initializes the instance.
func (MTLCommandQueueDescriptor) LogState ¶
func (c MTLCommandQueueDescriptor) LogState() MTLLogState
The shader logging configuration that the command queue uses.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueueDescriptor/logState
func (MTLCommandQueueDescriptor) MTLCommandBufferErrorDomain ¶
func (c MTLCommandQueueDescriptor) MTLCommandBufferErrorDomain() string
The domain for Metal command buffer errors.
See: https://developer.apple.com/documentation/metal/mtlcommandbuffererrordomain
func (MTLCommandQueueDescriptor) MaxCommandBufferCount ¶
func (c MTLCommandQueueDescriptor) MaxCommandBufferCount() uint
An integer that sets the maximum number of uncompleted command buffers the queue can allow.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueueDescriptor/maxCommandBufferCount
func (MTLCommandQueueDescriptor) SetLogState ¶
func (c MTLCommandQueueDescriptor) SetLogState(value MTLLogState)
func (MTLCommandQueueDescriptor) SetMaxCommandBufferCount ¶
func (c MTLCommandQueueDescriptor) SetMaxCommandBufferCount(value uint)
type MTLCommandQueueDescriptorClass ¶
type MTLCommandQueueDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLCommandQueueDescriptorClass ¶
func GetMTLCommandQueueDescriptorClass() MTLCommandQueueDescriptorClass
GetMTLCommandQueueDescriptorClass returns the class object for MTLCommandQueueDescriptor.
func (MTLCommandQueueDescriptorClass) Alloc ¶
func (mc MTLCommandQueueDescriptorClass) Alloc() MTLCommandQueueDescriptor
Alloc allocates memory for a new instance of the class.
type MTLCommandQueueObject ¶
type MTLCommandQueueObject struct {
objectivec.Object
}
MTLCommandQueueObject wraps an existing Objective-C object that conforms to the MTLCommandQueue protocol.
func MTLCommandQueueObjectFromID ¶
func MTLCommandQueueObjectFromID(id objc.ID) MTLCommandQueueObject
MTLCommandQueueObjectFromID constructs a MTLCommandQueueObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCommandQueueObject) AddResidencySet ¶
func (o MTLCommandQueueObject) AddResidencySet(residencySet MTLResidencySet)
Applies a residency set to a queue, which Metal applies to the queue’s command buffers as you commit them.
residencySet: A residency set that contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
Discussion ¶
Each command queue can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/addResidencySet(_:)
func (MTLCommandQueueObject) AddResidencySetsCount ¶
func (o MTLCommandQueueObject) AddResidencySetsCount(residencySets []MTLResidencySet, count uint)
Applies multiple residency sets to a queue, which Metal applies to the queue’s command buffers as you commit them.
residencySets: A C array of residency sets, each of which contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `residencySets`.
Discussion ¶
Each command queue can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/addResidencySets:count:
func (MTLCommandQueueObject) BaseObject ¶
func (o MTLCommandQueueObject) BaseObject() objectivec.Object
func (MTLCommandQueueObject) CommandBuffer ¶
func (o MTLCommandQueueObject) CommandBuffer() MTLCommandBuffer
Returns a command buffer from the command queue that maintains strong references to resources.
Discussion ¶
The command buffers you create with this method maintain strong references to the resources you encode into it, including buffers, textures, samplers, and pipeline states. The command buffer releases these references after it finishes running on the GPU.
This method sets the retainedReferences property to true for the command buffer it creates.
Each command queue has a fixed number of command buffers for its lifetime (see [NewCommandQueueWithMaxCommandBufferCount]). This method blocks the calling CPU thread when the queue doesn’t have any free command buffers, and returns after the GPU finishes executing one.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/makeCommandBuffer()
func (MTLCommandQueueObject) CommandBufferWithDescriptor ¶
func (o MTLCommandQueueObject) CommandBufferWithDescriptor(descriptor IMTLCommandBufferDescriptor) MTLCommandBuffer
Returns a command buffer from the command queue that you configure with a descriptor.
descriptor: An MTLCommandBufferDescriptor instance that configures the MTLCommandBuffer the method returns.
Discussion ¶
Use this method to create a command buffer that you configure with a descriptor. You can configure whether the command buffer retains references to resources that its commands refer to by setting the `descriptor` parameter’s [RetainedReferences] property. You can also configure whether the command buffer saves extra error information, which is useful during development, by setting the descriptor’s [ErrorOptions] property.
Each command queue has a fixed number of command buffers for its lifetime (see [NewCommandQueueWithMaxCommandBufferCount]). This method blocks the calling CPU thread when the queue doesn’t have any free command buffers, and returns after the GPU finishes executing one.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/makeCommandBuffer(descriptor:)
func (MTLCommandQueueObject) CommandBufferWithUnretainedReferences ¶
func (o MTLCommandQueueObject) CommandBufferWithUnretainedReferences() MTLCommandBuffer
Returns a command buffer from the command queue that doesn’t maintain strong references to resources.
Discussion ¶
Use this method to create a command buffer that doesn’t retain or release any of the resources it needs to run its commands.
Apps typically create command buffers that don’t maintain references to resources for extremely performance-critical situations. Even though the runtime cost for retaining or releasing a single resource is trivial, the aggregate time savings may be worth it.
It’s your app’s responsibility to maintain strong references to all the resources the command buffer uses until it finishes running on the GPU.
This method sets the retainedReferences property to false for the command buffer it creates.
Each command queue has a fixed number of command buffers for its lifetime (see [NewCommandQueueWithMaxCommandBufferCount]). This method blocks the calling CPU thread when the queue doesn’t have any free command buffers, and returns after the GPU finishes executing one.
func (MTLCommandQueueObject) Device ¶
func (o MTLCommandQueueObject) Device() MTLDevice
The GPU device that creates the command queue.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/device
func (MTLCommandQueueObject) Label ¶
func (o MTLCommandQueueObject) Label() string
An optional name that can help you identify the command queue.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/label
func (MTLCommandQueueObject) RemoveResidencySet ¶
func (o MTLCommandQueueObject) RemoveResidencySet(residencySet MTLResidencySet)
Removes a residency set from a command queue’s list, which means Metal doesn’t apply it to the queue’s command buffers as you commit them.
residencySet: A residency set that contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
Discussion ¶
The method doesn’t remove the residency set from command buffers the queue owns with a [Status] property that’s equal to [CommandBufferStatusCommitted] or [CommandBufferStatusScheduled].
See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/removeResidencySet(_:)
func (MTLCommandQueueObject) RemoveResidencySetsCount ¶
func (o MTLCommandQueueObject) RemoveResidencySetsCount(residencySets []MTLResidencySet, count uint)
Removes multiple residency sets from a command queue’s list, which means Metal doesn’t apply them to the queue’s command buffers as you commit them.
residencySets: A C array of residency sets, each of which contains resource allocations, such as MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `residencySets`.
Discussion ¶
The method doesn’t remove the residency sets from command buffers the queue owns with a [Status] property that’s equal to [CommandBufferStatusCommitted] or [CommandBufferStatusScheduled].
See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.
See: https://developer.apple.com/documentation/Metal/MTLCommandQueue/removeResidencySets:count:
func (MTLCommandQueueObject) SetLabel ¶
func (o MTLCommandQueueObject) SetLabel(value string)
type MTLCommonCounter ¶
type MTLCommonCounter = string
MTLCommonCounter is the name of a specific counter that can appear in a GPU device’s counter sets.
See: https://developer.apple.com/documentation/Metal/MTLCommonCounter
type MTLCommonCounterSet ¶
type MTLCommonCounterSet = string
MTLCommonCounterSet is the name of a specific counter set that a GPU device can support.
See: https://developer.apple.com/documentation/Metal/MTLCommonCounterSet
type MTLCompareFunction ¶
type MTLCompareFunction int
See: https://developer.apple.com/documentation/Metal/MTLCompareFunction
const ( // MTLCompareFunctionAlways: A new value always passes the comparison test. MTLCompareFunctionAlways MTLCompareFunction = 7 // MTLCompareFunctionEqual: A new value passes the comparison test if it is equal to the existing value. MTLCompareFunctionEqual MTLCompareFunction = 2 // MTLCompareFunctionGreater: A new value passes the comparison test if it is greater than the existing value. MTLCompareFunctionGreater MTLCompareFunction = 4 // MTLCompareFunctionGreaterEqual: A new value passes the comparison test if it is greater than or equal to the existing value. MTLCompareFunctionGreaterEqual MTLCompareFunction = 6 // MTLCompareFunctionLess: A new value passes the comparison test if it is less than the existing value. MTLCompareFunctionLess MTLCompareFunction = 1 // MTLCompareFunctionLessEqual: A new value passes the comparison test if it is less than or equal to the existing value. MTLCompareFunctionLessEqual MTLCompareFunction = 3 // MTLCompareFunctionNever: A new value never passes the comparison test. MTLCompareFunctionNever MTLCompareFunction = 0 // MTLCompareFunctionNotEqual: A new value passes the comparison test if it is not equal to the existing value. MTLCompareFunctionNotEqual MTLCompareFunction = 5 )
func (MTLCompareFunction) String ¶
func (e MTLCompareFunction) String() string
type MTLCompileOptions ¶
type MTLCompileOptions struct {
objectivec.Object
}
Compilation settings for a Metal shader library.
Overview ¶
You can configure the Metal compiler’s options by setting any or all of an MTLCompileOptions instance’s properties, including the following:
- Target previous OS releases by assigning the MTLCompileOptions.LanguageVersion property to an MTLLanguageVersion case. - Set preprocessor macros for the Metal compiler by assigning a dictionary to the MTLCompileOptions.PreprocessorMacros property. - Choose what the Metal compiler’s optimizer prioritizes by setting the MTLCompileOptions.OptimizationLevel property to an MTLLibraryOptimizationLevel case. - Allow the compiler to optimize for floating-point arithmetic that may violate the IEEE 754 standard by setting MTLCompileOptions.MathMode to [MathModeFast].
You can compile a library with your compile options instance by calling an MTLDevice instance’s [NewLibraryWithSourceOptionsError] or [NewLibraryWithSourceOptionsCompletionHandler] method.
Configuring the compiler options ¶
- MTLCompileOptions.EnableLogging: A Boolean value that enables shader logging.
- MTLCompileOptions.SetEnableLogging
- MTLCompileOptions.MathMode: An indication of whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
- MTLCompileOptions.SetMathMode
- MTLCompileOptions.MathFloatingPointFunctions: The FP32 math functions Metal uses.
- MTLCompileOptions.SetMathFloatingPointFunctions
- MTLCompileOptions.PreserveInvariance: A Boolean value that indicates whether the compiler compiles vertex shaders conservatively to generate consistent position calculations.
- MTLCompileOptions.SetPreserveInvariance
- MTLCompileOptions.LanguageVersion: The language version for interpreting the library source code.
- MTLCompileOptions.SetLanguageVersion
- MTLCompileOptions.PreprocessorMacros: A list of preprocessor macros to apply when compiling the library source.
- MTLCompileOptions.SetPreprocessorMacros
- MTLCompileOptions.OptimizationLevel: An option that tells the compiler what to prioritize when it compiles Metal shader code.
- MTLCompileOptions.SetOptimizationLevel
- MTLCompileOptions.Libraries: An array of dynamic libraries the Metal compiler links against.
- MTLCompileOptions.SetLibraries
- MTLCompileOptions.FastMathEnabled: A Boolean value that indicates whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
- MTLCompileOptions.SetFastMathEnabled
Configuring the library output options ¶
- MTLCompileOptions.LibraryType: The kind of library to create.
- MTLCompileOptions.SetLibraryType
- MTLCompileOptions.InstallName: For a dynamic library, the name to use when installing the library.
- MTLCompileOptions.SetInstallName
Instance Properties ¶
- MTLCompileOptions.AllowReferencingUndefinedSymbols
- MTLCompileOptions.SetAllowReferencingUndefinedSymbols
- MTLCompileOptions.CompileSymbolVisibility
- MTLCompileOptions.SetCompileSymbolVisibility
- MTLCompileOptions.MaxTotalThreadsPerThreadgroup
- MTLCompileOptions.SetMaxTotalThreadsPerThreadgroup
- MTLCompileOptions.RequiredThreadsPerThreadgroup
- MTLCompileOptions.SetRequiredThreadsPerThreadgroup
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions
func MTLCompileOptionsFromID ¶
func MTLCompileOptionsFromID(id objc.ID) MTLCompileOptions
MTLCompileOptionsFromID constructs a MTLCompileOptions from an objc.ID.
Compilation settings for a Metal shader library.
func NewMTLCompileOptions ¶
func NewMTLCompileOptions() MTLCompileOptions
NewMTLCompileOptions creates a new MTLCompileOptions instance.
func (MTLCompileOptions) AllowReferencingUndefinedSymbols ¶
func (c MTLCompileOptions) AllowReferencingUndefinedSymbols() bool
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/allowReferencingUndefinedSymbols
func (MTLCompileOptions) Autorelease ¶
func (c MTLCompileOptions) Autorelease() MTLCompileOptions
Autorelease adds the receiver to the current autorelease pool.
func (MTLCompileOptions) CompileSymbolVisibility ¶
func (c MTLCompileOptions) CompileSymbolVisibility() MTLCompileSymbolVisibility
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/compileSymbolVisibility
func (MTLCompileOptions) EnableLogging ¶
func (c MTLCompileOptions) EnableLogging() bool
A Boolean value that enables shader logging.
Discussion ¶
Because logging incurs overhead, regardless of whether the system prints messages, you need to explicitly enable logging.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/enableLogging
func (MTLCompileOptions) FastMathEnabled ¶
func (c MTLCompileOptions) FastMathEnabled() bool
A Boolean value that indicates whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
Discussion ¶
The default value is true. A true value also enables the high-precision variant of math functions for single-precision floating-point scalar and vector types.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/fastMathEnabled
func (MTLCompileOptions) Init ¶
func (c MTLCompileOptions) Init() MTLCompileOptions
Init initializes the instance.
func (MTLCompileOptions) InstallName ¶
func (c MTLCompileOptions) InstallName() string
For a dynamic library, the name to use when installing the library.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/installName
func (MTLCompileOptions) LanguageVersion ¶
func (c MTLCompileOptions) LanguageVersion() MTLLanguageVersion
The language version for interpreting the library source code.
Discussion ¶
By default, Metal uses the most recent language version.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/languageVersion
func (MTLCompileOptions) Libraries ¶
func (c MTLCompileOptions) Libraries() []objectivec.IObject
An array of dynamic libraries the Metal compiler links against.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/libraries
func (MTLCompileOptions) LibraryType ¶
func (c MTLCompileOptions) LibraryType() MTLLibraryType
The kind of library to create.
Discussion ¶
The default value is [LibraryTypeExecutable].
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/libraryType
func (MTLCompileOptions) MathFloatingPointFunctions ¶
func (c MTLCompileOptions) MathFloatingPointFunctions() MTLMathFloatingPointFunctions
The FP32 math functions Metal uses.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/mathFloatingPointFunctions
func (MTLCompileOptions) MathMode ¶
func (c MTLCompileOptions) MathMode() MTLMathMode
An indication of whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.
Discussion ¶
This property replaces the [FastMathEnabled] property.
If [FastMathEnabled] is `true`, the system sets [MathMode] to [MathModeFast] and [MathFloatingPointFunctions] to [MathFloatingPointFunctionsFast].
If [FastMathEnabled] is `false`, the system sets [MathMode] to [MathModeSafe] and [MathFloatingPointFunctions] to [MathFloatingPointFunctionsPrecise].
Subsequent calls to [MathMode] or [MathFloatingPointFunctions] set the variables directly.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/mathMode
func (MTLCompileOptions) MaxTotalThreadsPerThreadgroup ¶
func (c MTLCompileOptions) MaxTotalThreadsPerThreadgroup() uint
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/maxTotalThreadsPerThreadgroup
func (MTLCompileOptions) OptimizationLevel ¶
func (c MTLCompileOptions) OptimizationLevel() MTLLibraryOptimizationLevel
An option that tells the compiler what to prioritize when it compiles Metal shader code.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/optimizationLevel
func (MTLCompileOptions) PreprocessorMacros ¶
func (c MTLCompileOptions) PreprocessorMacros() foundation.INSDictionary
A list of preprocessor macros to apply when compiling the library source.
Discussion ¶
Define the macros as a dictionary where each key is a string, and the values can be either an NSString or NSNumber instance.
The default value is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/preprocessorMacros
func (MTLCompileOptions) PreserveInvariance ¶
func (c MTLCompileOptions) PreserveInvariance() bool
A Boolean value that indicates whether the compiler compiles vertex shaders conservatively to generate consistent position calculations.
Discussion ¶
The default value is false. When true, the Metal shader compiler looks at the position value in all vertex output structures that it compiles. If the position value also has the `[[invariant]]` attribute, the compiler compiles the corresponding vertex shader conservatively to guarantee that the GPU performs the calculations the same way. You need to preserve invariance when your renderer contains multiple render passes and requires the same position calculations in each render pass.
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/preserveInvariance
func (MTLCompileOptions) RequiredThreadsPerThreadgroup ¶
func (c MTLCompileOptions) RequiredThreadsPerThreadgroup() MTLSize
Discussion ¶
Sets the required threads-per-threadgroup during dispatches. The `threadsPerThreadgroup` argument of any dispatch must match this value if it is set. Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set. Setting this to a size of 0 in every dimension disables this property
See: https://developer.apple.com/documentation/Metal/MTLCompileOptions/requiredThreadsPerThreadgroup
func (MTLCompileOptions) SetAllowReferencingUndefinedSymbols ¶
func (c MTLCompileOptions) SetAllowReferencingUndefinedSymbols(value bool)
func (MTLCompileOptions) SetCompileSymbolVisibility ¶
func (c MTLCompileOptions) SetCompileSymbolVisibility(value MTLCompileSymbolVisibility)
func (MTLCompileOptions) SetEnableLogging ¶
func (c MTLCompileOptions) SetEnableLogging(value bool)
func (MTLCompileOptions) SetFastMathEnabled ¶
func (c MTLCompileOptions) SetFastMathEnabled(value bool)
func (MTLCompileOptions) SetInstallName ¶
func (c MTLCompileOptions) SetInstallName(value string)
func (MTLCompileOptions) SetLanguageVersion ¶
func (c MTLCompileOptions) SetLanguageVersion(value MTLLanguageVersion)
func (MTLCompileOptions) SetLibraries ¶
func (c MTLCompileOptions) SetLibraries(value []objectivec.IObject)
func (MTLCompileOptions) SetLibraryType ¶
func (c MTLCompileOptions) SetLibraryType(value MTLLibraryType)
func (MTLCompileOptions) SetMathFloatingPointFunctions ¶
func (c MTLCompileOptions) SetMathFloatingPointFunctions(value MTLMathFloatingPointFunctions)
func (MTLCompileOptions) SetMathMode ¶
func (c MTLCompileOptions) SetMathMode(value MTLMathMode)
func (MTLCompileOptions) SetMaxTotalThreadsPerThreadgroup ¶
func (c MTLCompileOptions) SetMaxTotalThreadsPerThreadgroup(value uint)
func (MTLCompileOptions) SetOptimizationLevel ¶
func (c MTLCompileOptions) SetOptimizationLevel(value MTLLibraryOptimizationLevel)
func (MTLCompileOptions) SetPreprocessorMacros ¶
func (c MTLCompileOptions) SetPreprocessorMacros(value foundation.INSDictionary)
func (MTLCompileOptions) SetPreserveInvariance ¶
func (c MTLCompileOptions) SetPreserveInvariance(value bool)
func (MTLCompileOptions) SetRequiredThreadsPerThreadgroup ¶
func (c MTLCompileOptions) SetRequiredThreadsPerThreadgroup(value MTLSize)
type MTLCompileOptionsClass ¶
type MTLCompileOptionsClass struct {
// contains filtered or unexported fields
}
func GetMTLCompileOptionsClass ¶
func GetMTLCompileOptionsClass() MTLCompileOptionsClass
GetMTLCompileOptionsClass returns the class object for MTLCompileOptions.
func (MTLCompileOptionsClass) Alloc ¶
func (mc MTLCompileOptionsClass) Alloc() MTLCompileOptions
Alloc allocates memory for a new instance of the class.
type MTLCompileSymbolVisibility ¶
type MTLCompileSymbolVisibility int
See: https://developer.apple.com/documentation/Metal/MTLCompileSymbolVisibility
const ( MTLCompileSymbolVisibilityDefault MTLCompileSymbolVisibility = 0 MTLCompileSymbolVisibilityHidden MTLCompileSymbolVisibility = 1 )
func (MTLCompileSymbolVisibility) String ¶
func (e MTLCompileSymbolVisibility) String() string
type MTLComponentTransform ¶
type MTLComponentTransform struct {
Scale MTLPackedFloat3
Shear MTLPackedFloat3
Pivot MTLPackedFloat3
Rotation MTLPackedFloatQuaternion
Translation MTLPackedFloat3
}
MTLComponentTransform
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLComponentTransform
type MTLComputeCommandEncoder ¶
type MTLComputeCommandEncoder interface {
objectivec.IObject
MTLCommandEncoder
// Configures the compute encoder with a pipeline state for subsequent kernel calls.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setComputePipelineState(_:)
SetComputePipelineState(state MTLComputePipelineState)
// The dispatch type to use when submitting compute work to the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/dispatchType
DispatchType() MTLDispatchType
// Changes where the data begins in a buffer already bound to the buffer argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBufferOffset(_:index:)
SetBufferOffsetAtIndex(offset uint, index uint)
// Changes where the data begins and the distance between adjacent elements in a buffer already bound to the buffer argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBufferOffset(offset:attributeStride:index:)
SetBufferOffsetAttributeStrideAtIndex(offset uint, stride uint, index uint)
// Copies data directly to the GPU to populate an entry in the buffer argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBytes(_:length:index:)
SetBytesLengthAtIndex(bytes []byte, index uint)
// Copies data with a given stride directly to the GPU to populate an entry in the buffer argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBytes(_:length:attributeStride:index:)
SetBytesLengthAttributeStrideAtIndex(bytes []byte, stride uint, index uint)
// Binds a texture to the texture argument table, allowing compute kernels to access its data on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setTexture(_:index:)
SetTextureAtIndex(texture MTLTexture, index uint)
// Encodes a texture sampler, allowing compute kernels to use it for sampling textures on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setSamplerState(_:index:)
SetSamplerStateAtIndex(sampler MTLSamplerState, index uint)
// Encodes a texture sampler with a custom level of detail clamping, allowing compute kernels to use it for sampling textures on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setSamplerState(_:lodMinClamp:lodMaxClamp:index:)
SetSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
// Binds a visible function table to the buffer argument table, allowing you to call its functions on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setVisibleFunctionTable(_:bufferIndex:)
SetVisibleFunctionTableAtBufferIndex(visibleFunctionTable MTLVisibleFunctionTable, bufferIndex uint)
// Binds an acceleration structure to the buffer argument table, allowing functions to access it on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setAccelerationStructure(_:bufferIndex:)
SetAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
// Binds an intersection function table to the buffer argument table, making it callable in your Metal shaders.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setIntersectionFunctionTable(_:bufferIndex:)
SetIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
// Ensures kernel calls that the system encodes in subsequent commands have access to a resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useResource(_:usage:)
UseResourceUsage(resource MTLResource, usage MTLResourceUsage)
// Ensures the shaders in the render pass’s subsequent draw commands have access to all of the resources you allocate from a heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useHeap(_:)
UseHeap(heap MTLHeap)
// Configures the size of a block of threadgroup memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setThreadgroupMemoryLength(_:index:)
SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
// Sets the size, in pixels, of imageblock data in tile memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setImageblockWidth(_:height:)
SetImageblockWidthHeight(width uint, height uint)
// Sets the dimensions over the thread grid of how your compute kernel receives stage-in arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setStageInRegion(_:)
SetStageInRegion(region MTLRegion)
// Sets the region of the stage-in attributes to apply to a compute kernel using an indirect buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setStageInRegionWithIndirectBuffer(_:indirectBufferOffset:)
SetStageInRegionWithIndirectBufferIndirectBufferOffset(indirectBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes a compute command using an arbitrarily sized grid.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/dispatchThreads(_:threadsPerThreadgroup:)
DispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
// Encodes a compute dispatch command using a grid aligned to threadgroup boundaries.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/dispatchThreadgroups(_:threadsPerThreadgroup:)
DispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
// Encodes a dispatch call for a compute pass, using an indirect buffer that defines the size of a grid that aligns to threadgroup boundaries.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/dispatchThreadgroups(indirectBuffer:indirectBufferOffset:threadsPerThreadgroup:)
DispatchThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerThreadgroup(indirectBuffer MTLBuffer, indirectBufferOffset uint, threadsPerThreadgroup MTLSize)
// Encodes a command that instructs the GPU to pause the compute pass until another pass updates a fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/waitForFence(_:)
WaitForFence(fence MTLFence)
// Encodes a command that instructs the GPU to update a fence after the compute pass completes.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/updateFence(_:)
UpdateFence(fence MTLFence)
// Creates a memory barrier that enforces the order of write and read operations for specific resource types.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/memoryBarrier(scope:)
MemoryBarrierWithScope(scope MTLBarrierScope)
// Encodes a command to sample hardware counters, providing performance information.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/sampleCounters(sampleBuffer:sampleIndex:barrier:)
SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
// Encodes an instruction to run commands from an indirect buffer, using another buffer to provide the command range.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:
ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes an instruction to run commands from an indirect buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/executeCommandsInBuffer:withRange:
ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
// Creates a memory barrier that enforces the order of write and read operations for specific resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/memoryBarrierWithResources:count:
MemoryBarrierWithResourcesCount(resources []MTLResource, count uint)
// Binds multiple buffers with data in stride to the buffer argument table at once, allowing compute kernels to access their data on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBuffers:offsets:attributeStrides:withRange:
SetBuffersOffsetsAttributeStridesWithRange(buffers []MTLBuffer, offsets uint, strides uint, range_ foundation.NSRange)
// Binds multiple buffers to the buffer argument table at once, allowing compute kernels to access their data on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBuffers:offsets:withRange:
SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Binds multiple intersection function tables to the buffer argument table, allowing you to call their functions on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setIntersectionFunctionTables:withBufferRange:
SetIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
// Encodes multiple texture samplers with custom levels of detail clamping, allowing compute kernels to use them for sampling textures on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setSamplerStates:lodMinClamps:lodMaxClamps:withRange:
SetSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
// Encodes multiple texture samplers, allowing compute kernels to use them for sampling textures on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setSamplerStates:withRange:
SetSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
// Binds multiple textures to the texture argument table, allowing compute kernels to access their data on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setTextures:withRange:
SetTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
// Binds multiple visible function tables to the buffer argument table, allowing you to call their functions on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setVisibleFunctionTables:withBufferRange:
SetVisibleFunctionTablesWithBufferRange(visibleFunctionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
// Ensures the shaders in the render pass’s subsequent draw commands have access to all of the resources you allocate from multiple heaps.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useHeaps:count:
UseHeapsCount(heaps []MTLHeap, count uint)
// Ensures kernel calls that the system encodes in subsequent commands have access to multiple resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useResources:count:usage:
UseResourcesCountUsage(resources []MTLResource, count uint, usage MTLResourceUsage)
}
Encodes computation dispatch commands for a single compute pass into a command buffer.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder
type MTLComputeCommandEncoderObject ¶
type MTLComputeCommandEncoderObject struct {
objectivec.Object
}
MTLComputeCommandEncoderObject wraps an existing Objective-C object that conforms to the MTLComputeCommandEncoder protocol.
func MTLComputeCommandEncoderObjectFromID ¶
func MTLComputeCommandEncoderObjectFromID(id objc.ID) MTLComputeCommandEncoderObject
MTLComputeCommandEncoderObjectFromID constructs a MTLComputeCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLComputeCommandEncoderObject) BarrierAfterQueueStagesBeforeStages ¶
func (o MTLComputeCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTLComputeCommandEncoderObject) BaseObject ¶
func (o MTLComputeCommandEncoderObject) BaseObject() objectivec.Object
func (MTLComputeCommandEncoderObject) Device ¶
func (o MTLComputeCommandEncoderObject) Device() MTLDevice
The Metal device from which the command encoder was created.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
func (MTLComputeCommandEncoderObject) DispatchThreadgroupsThreadsPerThreadgroup ¶
func (o MTLComputeCommandEncoderObject) DispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
Encodes a compute dispatch command using a grid aligned to threadgroup boundaries.
threadgroupsPerGrid: An MTLSize instance that represents the number of threads for each grid dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerThreadgroup: An MTLSize instance that represents the number of threads in a threadgroup. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
Discussion ¶
Metal calculates the number of threads in a grid by multiplying `threadsPerThreadgroup` by `threadgroupsPerGrid`.
If the size of your data doesn’t match the size of the grid, perform boundary checks in your compute function to avoid accessing data out of bounds. See Calculating threadgroup and grid sizes for an example.
func (MTLComputeCommandEncoderObject) DispatchThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerThreadgroup ¶
func (o MTLComputeCommandEncoderObject) DispatchThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerThreadgroup(indirectBuffer MTLBuffer, indirectBufferOffset uint, threadsPerThreadgroup MTLSize)
Encodes a dispatch call for a compute pass, using an indirect buffer that defines the size of a grid that aligns to threadgroup boundaries.
indirectBuffer: An MTLBuffer instance providing compute parameters. Lay out the data in this buffer as described in the MTLDispatchThreadgroupsIndirectArguments structure. // MTLDispatchThreadgroupsIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDispatchThreadgroupsIndirectArguments
indirectBufferOffset: Where the data begins, in bytes, from the start of the buffer. This value needs to be a multiple of `4`.
threadsPerThreadgroup: The number of threads in one threadgroup, in each dimension.
Discussion ¶
The GPU fetches parameters from the indirect buffer just before the thread grid starts. This process lets the compute function run based on GPU feedback, without latency from data transfer between the CPU and the GPU.
func (MTLComputeCommandEncoderObject) DispatchThreadsThreadsPerThreadgroup ¶
func (o MTLComputeCommandEncoderObject) DispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
Encodes a compute command using an arbitrarily sized grid.
threadsPerGrid: The number of threads in the grid, in each dimension.
threadsPerThreadgroup: The number of threads in one threadgroup, in each dimension.
Discussion ¶
This method encodes a call that uses an arbitrary number of threads in its execution grid. Metal calculates the number of threadgroups needed, providing partial threadgroups if necessary. Prefer this method to [DispatchThreadgroupsThreadsPerThreadgroup] if your app requires bounds checking or you need extra data allocations to saturate a uniform grid.
func (MTLComputeCommandEncoderObject) DispatchType ¶
func (o MTLComputeCommandEncoderObject) DispatchType() MTLDispatchType
The dispatch type to use when submitting compute work to the GPU.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/dispatchType
func (MTLComputeCommandEncoderObject) EndEncoding ¶
func (o MTLComputeCommandEncoderObject) EndEncoding()
Declares that all command generation from the encoder is completed.
Discussion ¶
After `endEncoding` is called, the command encoder has no further use. You cannot encode any other commands with this encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
func (MTLComputeCommandEncoderObject) ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset ¶
func (o MTLComputeCommandEncoderObject) ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLBuffer, indirectBufferOffset uint)
Encodes an instruction to run commands from an indirect buffer, using another buffer to provide the command range.
indirectCommandbuffer: The MTLIndirectCommandBuffer instance containing the commands to execute.
indirectRangeBuffer: An indirect buffer containing the execution range, laid out in an MTLIndirectCommandBufferExecutionRange instance. The maximum length of the range is `16384` commands. // MTLIndirectCommandBufferExecutionRange: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferExecutionRange
indirectBufferOffset: The number of bytes from the start of `indirectRangeBuffer` containing the execution range to use. Align the offset on a multiple of `4`.
func (MTLComputeCommandEncoderObject) ExecuteCommandsInBufferWithRange ¶
func (o MTLComputeCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
Encodes an instruction to run commands from an indirect buffer.
indirectCommandBuffer: The MTLIndirectCommandBuffer instance containing the commands to execute.
executionRange: The range of commands to execute. The maximum length of the range is `16384` commands.
func (MTLComputeCommandEncoderObject) InsertDebugSignpost ¶
func (o MTLComputeCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the captured frame data.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
func (MTLComputeCommandEncoderObject) Label ¶
func (o MTLComputeCommandEncoderObject) Label() string
A string that labels the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
func (MTLComputeCommandEncoderObject) MemoryBarrierWithResourcesCount ¶
func (o MTLComputeCommandEncoderObject) MemoryBarrierWithResourcesCount(resources []MTLResource, count uint)
Creates a memory barrier that enforces the order of write and read operations for specific resources.
resources: A C array of MTLResource instances the barrier applies to.
count: The number of resources in the array.
Discussion ¶
Memory barriers ensure the relevant passes finish updating resources before starting the stages of subsequent commands that depend on those resources.
To determine whether a GPU supports memory barriers, see the Metal feature set tables (PDF).
func (MTLComputeCommandEncoderObject) MemoryBarrierWithScope ¶
func (o MTLComputeCommandEncoderObject) MemoryBarrierWithScope(scope MTLBarrierScope)
Creates a memory barrier that enforces the order of write and read operations for specific resource types.
scope: An MTLBarrierScope instance that represents the resource types the barrier synchronizes operations on. // MTLBarrierScope: https://developer.apple.com/documentation/Metal/MTLBarrierScope
Discussion ¶
Memory barriers ensure the relevant passes finish updating resources before starting the stages of subsequent commands that depend on those resources.
To determine whether a GPU supports memory barriers, see the Metal feature set tables (PDF).
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/memoryBarrier(scope:)
func (MTLComputeCommandEncoderObject) PopDebugGroup ¶
func (o MTLComputeCommandEncoderObject) PopDebugGroup()
Pops the latest string off of a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
func (MTLComputeCommandEncoderObject) PushDebugGroup ¶
func (o MTLComputeCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a specific string onto a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
func (MTLComputeCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier ¶
func (o MTLComputeCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
Encodes a command to sample hardware counters, providing performance information.
sampleBuffer: An MTLCounterSampleBuffer instance that stores the GPU hardware data.
sampleIndex: An index within `sampleBuffer` the command stores the data to.
barrier: Whether or not the command inserts a barrier before sampling the counter’s data.
A barrier ensures that the commands you encode before this one complete before the GPU samples the hardware counters, but can negatively impact runtime performance.
Running this command without a barrier means the GPU can sample counters concurrently with other commands from the encoder.
The `barrier` parameter for the command has no impact on sampling commands from other passes.
Discussion ¶
See GPU counters and counter sample buffers, Sampling GPU data into counter sample buffers, and MTLCounter for more information.
func (MTLComputeCommandEncoderObject) SetAccelerationStructureAtBufferIndex ¶
func (o MTLComputeCommandEncoderObject) SetAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
Binds an acceleration structure to the buffer argument table, allowing functions to access it on the GPU.
accelerationStructure: An MTLAccelerationStructure instance to bind to the argument table.
bufferIndex: The index the structure binds to in the argument table.
func (MTLComputeCommandEncoderObject) SetBufferOffsetAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetBufferOffsetAtIndex(offset uint, index uint)
Changes where the data begins in a buffer already bound to the buffer argument table.
offset: Where the data to bind begins, in bytes, from the start of the bound buffer.
index: The argument table entry to change.
Discussion ¶
Prefer calling this method to unbinding and then rebinding data.
For buffers binding to an argument using the `device` address space, align the offset to the data type’s size. The maximum size for an offset is `16` bytes.
For buffers in the `constant` address space, the minimum alignment depends on the hardware running your app. See the Metal feature set tables (PDF) for information on each Apple GPU family.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBufferOffset(_:index:)
func (MTLComputeCommandEncoderObject) SetBufferOffsetAttributeStrideAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetBufferOffsetAttributeStrideAtIndex(offset uint, stride uint, index uint)
Changes where the data begins and the distance between adjacent elements in a buffer already bound to the buffer argument table.
offset: Where the data to bind begins, in bytes, from the start of the bound buffer.
stride: The number of bytes between the start of one element and the start of the next.
index: The index of the buffer to change in the argument table.
Discussion ¶
_ _Prefer calling this method to unbinding and then rebinding data.
For buffers binding to an argument using the `device` address space, align the offset to the data type’s size. The maximum size for an offset is `16` bytes.
For buffers in the `constant` address space, the minimum alignment depends on the hardware running your app. See the Metal feature set tables (PDF) for information on each Apple GPU family.
func (MTLComputeCommandEncoderObject) SetBuffersOffsetsAttributeStridesWithRange ¶
func (o MTLComputeCommandEncoderObject) SetBuffersOffsetsAttributeStridesWithRange(buffers []MTLBuffer, offsets uint, strides uint, range_ foundation.NSRange)
Binds multiple buffers with data in stride to the buffer argument table at once, allowing compute kernels to access their data on the GPU.
buffers: The MTLBuffer instances to bind to the buffer argument table.
offsets: An array of offsets, each of which specifies where the data begins, in bytes, from the start of its corresponding buffer.
strides: An array of strides, each of which specifies the number of bytes between the start of one element and the start of the next for its corresponding buffer.
range: The argument table indices to bind each of the `buffers` to, in the order they appear.
Discussion ¶
For buffers binding to an argument using the `device` address space, align the offset to the data type’s size. The maximum size for an offset is `16` bytes.
For buffers in the `constant` address space, the minimum alignment depends on the hardware running your app. See the Metal feature set tables (PDF) for information on each Apple GPU family.
Rebinding an already bound buffer causes a Metal error.
func (MTLComputeCommandEncoderObject) SetBuffersOffsetsWithRange ¶
func (o MTLComputeCommandEncoderObject) SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Binds multiple buffers to the buffer argument table at once, allowing compute kernels to access their data on the GPU.
buffers: The MTLBuffer instances to bind to the buffer argument table.
offsets: An array of offsets, each of which specifies where the data begins, in bytes, from the start of its corresponding buffer.
range: The argument table indices to bind each of the `buffers` to, in the order they appear.
Discussion ¶
For buffers binding to an argument using the `device` address space, align the offset to the data type’s size. The maximum size for an offset is `16` bytes.
For buffers in the `constant` address space, the minimum alignment depends on the hardware running your app. See the Metal feature set tables (PDF) for information on each Apple GPU family.
Rebinding an already bound buffer causes a Metal error.
func (MTLComputeCommandEncoderObject) SetBytesLengthAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetBytesLengthAtIndex(bytes []byte, index uint)
Copies data directly to the GPU to populate an entry in the buffer argument table.
bytes: A pointer to where the data to copy starts.
length: The number of bytes to copy.
index: The index the data binds to in the argument table.
Discussion ¶
This method allows Metal to copy data efficiently onto the GPU without the need for your own buffer. Binding data directly can improve performance, especially when making many small allocations.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setBytes(_:length:index:)
func (MTLComputeCommandEncoderObject) SetBytesLengthAttributeStrideAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetBytesLengthAttributeStrideAtIndex(bytes []byte, stride uint, index uint)
Copies data with a given stride directly to the GPU to populate an entry in the buffer argument table.
bytes: A pointer to the memory where the data to copy starts.
length: The number of bytes to copy.
stride: The number of bytes between the start of one element and the start of the next.
index: The index the data binds to in the argument table.
Discussion ¶
This method allows Metal to copy data directly onto the GPU, rather than creating a new MTLBuffer instance and binding it. Binding data directly can improve performance, especially when making many small allocations.
func (MTLComputeCommandEncoderObject) SetComputePipelineState ¶
func (o MTLComputeCommandEncoderObject) SetComputePipelineState(state MTLComputePipelineState)
Configures the compute encoder with a pipeline state for subsequent kernel calls.
state: An MTLComputePipelineState instance.
Discussion ¶
Create your pipeline state through one of the MTLDevice methods in Creating Compute Pipeline States.
A compute pipeline state provides information Metal uses to compile and run encoded commands. You can change the pipeline state at any time, allowing you to encode multiple kernel calls in a single command buffer. Changing the pipeline state doesn’t affect any previously encoded commands.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setComputePipelineState(_:)
func (MTLComputeCommandEncoderObject) SetImageblockWidthHeight ¶
func (o MTLComputeCommandEncoderObject) SetImageblockWidthHeight(width uint, height uint)
Sets the size, in pixels, of imageblock data in tile memory.
width: The width of the imageblock, in pixels.
height: The height of the imageblock, in pixels.
Discussion ¶
Both imageblocks and threadgroup memory share the available space you can reserve in tile memory, so the sum of these allocations can’t exceed the maximum total tile memory limit. To find the amount of memory used by an imageblock, call [ImageblockMemoryLengthForDimensions]. Kernels accessing an imageblock argument from threadgroup memory have the `[[threadgroup_imageblock]]` attribute.
To learn more about using imageblocks, see the following sections in the Metal Shading Language Specification:
- For information on the `threadgroup_imageblock` address space, see Section 4.5. - For information on the `imageblock` type, see Section 2.11.
func (MTLComputeCommandEncoderObject) SetIntersectionFunctionTableAtBufferIndex ¶
func (o MTLComputeCommandEncoderObject) SetIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
Binds an intersection function table to the buffer argument table, making it callable in your Metal shaders.
intersectionFunctionTable: The MTLIntersectionFunctionTable to bind.
bufferIndex: The index in the buffer argument table the intersection function table binds to.
func (MTLComputeCommandEncoderObject) SetIntersectionFunctionTablesWithBufferRange ¶
func (o MTLComputeCommandEncoderObject) SetIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
Binds multiple intersection function tables to the buffer argument table, allowing you to call their functions on the GPU.
intersectionFunctionTables: An array of MTLIntersectionFunctionTable instances to bind.
range: The argument buffer table indices to bind each of the `intersectionFunctionTables` to, in the order they appear.
Discussion ¶
func (MTLComputeCommandEncoderObject) SetLabel ¶
func (o MTLComputeCommandEncoderObject) SetLabel(value string)
func (MTLComputeCommandEncoderObject) SetSamplerStateAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetSamplerStateAtIndex(sampler MTLSamplerState, index uint)
Encodes a texture sampler, allowing compute kernels to use it for sampling textures on the GPU.
sampler: An MTLSamplerState instance to bind to the sampler argument table.
index: The index in the sampler argument table to bind the sampler to.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setSamplerState(_:index:)
func (MTLComputeCommandEncoderObject) SetSamplerStateLodMinClampLodMaxClampAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
Encodes a texture sampler with a custom level of detail clamping, allowing compute kernels to use it for sampling textures on the GPU.
sampler: An MTLSamplerState instance to bind to the sampler argument table.
lodMinClamp: The minimum level of detail used when sampling a texture.
lodMaxClamp: The maximum level of detail used when sampling a texture.
index: The index in the sampler argument table to bind the sampler to.
Discussion ¶
Calling this method ignores the [LodMinClamp] and [LodMaxClamp] properties of the sampler, using the provided levels of detail instead.
func (MTLComputeCommandEncoderObject) SetSamplerStatesLodMinClampsLodMaxClampsWithRange ¶
func (o MTLComputeCommandEncoderObject) SetSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
Encodes multiple texture samplers with custom levels of detail clamping, allowing compute kernels to use them for sampling textures on the GPU.
samplers: An array of MTLSamplerState instances to bind to the sampler argument table.
lodMinClamps: An array of minimum levels of detail to use for the corresponding sampler in the `samplers` array.
lodMaxClamps: An array of maximum levels of detail to use for the corresponding sampler in the `samplers` array.
range: The sampler table indicies to bind each of the `samplers` to, in the order they appear.
Discussion ¶
Calling this method ignores the [LodMinClamp] and [LodMaxClamp] properties of the samplers, using the provided levels of detail instead.
func (MTLComputeCommandEncoderObject) SetSamplerStatesWithRange ¶
func (o MTLComputeCommandEncoderObject) SetSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
Encodes multiple texture samplers, allowing compute kernels to use them for sampling textures on the GPU.
samplers: An array of MTLSamplerState instances to bind to the sampler argument table.
range: The sampler table indexes to bind each of the `samplers` to, in the order they appear.
Discussion ¶
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setSamplerStates:withRange:
func (MTLComputeCommandEncoderObject) SetStageInRegion ¶
func (o MTLComputeCommandEncoderObject) SetStageInRegion(region MTLRegion)
Sets the dimensions over the thread grid of how your compute kernel receives stage-in arguments.
region: The MTLRegion defining how to interpret a thread’s location as a coordinate for stage-in data. // MTLRegion: https://developer.apple.com/documentation/Metal/MTLRegion
Discussion ¶
The region’s origin point, starting from `(0,0,0)` in the upper left of the bound data, determines the final index of `[[stage_in]]` data. Note that the total number of threads Metal launches may be larger than your stage-in data.
To determine the index used to fetch `[[stage_in]]` data for a given thread, the GPU adds the values specified by the region’s origin to the thread position in the grid. Threads in the grid outside of the maximum stage-in data size have undefined behavior when accessing the stage-in memory region.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setStageInRegion(_:)
func (MTLComputeCommandEncoderObject) SetStageInRegionWithIndirectBufferIndirectBufferOffset ¶
func (o MTLComputeCommandEncoderObject) SetStageInRegionWithIndirectBufferIndirectBufferOffset(indirectBuffer MTLBuffer, indirectBufferOffset uint)
Sets the region of the stage-in attributes to apply to a compute kernel using an indirect buffer.
indirectBuffer: The MTLRegion defining how to interpret a thread’s location as a coordinate for stage-in data. // MTLRegion: https://developer.apple.com/documentation/Metal/MTLRegion
indirectBufferOffset: Where the data begins, in bytes, from the start of the buffer.
Discussion ¶
The region’s origin point, starting from `(0,0,0)` in the upper left of the bound data, determines the final index of `[[stage_in]]` data. Note that the total number of threads Metal launches may be larger than your stage-in data.
To determine the index used to fetch `[[stage_in]]` data for a given thread, the GPU adds the values specified by the region’s origin to the thread position in the grid. Threads in the grid outside of the maximum stage-in data size have undefined behavior when accessing the stage-in memory region.
func (MTLComputeCommandEncoderObject) SetTextureAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetTextureAtIndex(texture MTLTexture, index uint)
Binds a texture to the texture argument table, allowing compute kernels to access its data on the GPU.
texture: An MTLTexture instance to bind to the texture argument table.
index: The index the texture binds to in the texture argument table.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setTexture(_:index:)
func (MTLComputeCommandEncoderObject) SetTexturesWithRange ¶
func (o MTLComputeCommandEncoderObject) SetTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
Binds multiple textures to the texture argument table, allowing compute kernels to access their data on the GPU.
textures: An array of MTLTexture instances to bind to the texture argument table.
range: The texture table indices to bind each of the `textures` to, in the order they appear.
Discussion ¶
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/setTextures:withRange:
func (MTLComputeCommandEncoderObject) SetThreadgroupMemoryLengthAtIndex ¶
func (o MTLComputeCommandEncoderObject) SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
Configures the size of a block of threadgroup memory.
length: The size of the threadgroup memory, in bytes, which needs to be a multiple of `16` bytes.
index: The index in the threadgroup memory argument table using this allocation.
Discussion ¶
The `threadgroup` memory space allows for sharing data between multiple threads in a threadgroup, which can be faster than using `device` memory in your kernels. Before using any threadgroup memory, call this method to configure the threadgroup memory argument table. Kernels accessing their arguments from threadgroup memory have the `[[threadgroup]]` attribute.
To learn more about using the threadgroup address space, see the Metal Shading Language Specification section 4.4.
func (MTLComputeCommandEncoderObject) SetVisibleFunctionTableAtBufferIndex ¶
func (o MTLComputeCommandEncoderObject) SetVisibleFunctionTableAtBufferIndex(visibleFunctionTable MTLVisibleFunctionTable, bufferIndex uint)
Binds a visible function table to the buffer argument table, allowing you to call its functions on the GPU.
visibleFunctionTable: The MTLVisibleFunctionTable to bind.
bufferIndex: The index the function table binds to in the buffer argument table.
func (MTLComputeCommandEncoderObject) SetVisibleFunctionTablesWithBufferRange ¶
func (o MTLComputeCommandEncoderObject) SetVisibleFunctionTablesWithBufferRange(visibleFunctionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
Binds multiple visible function tables to the buffer argument table, allowing you to call their functions on the GPU.
visibleFunctionTables: An array of MTLVisibleFunctionTable instances to bind.
range: The buffer argument table indices to bind each of the `visibleFunctionTables` to, in the order they appear.
Discussion ¶
func (MTLComputeCommandEncoderObject) UpdateFence ¶
func (o MTLComputeCommandEncoderObject) UpdateFence(fence MTLFence)
Encodes a command that instructs the GPU to update a fence after the compute pass completes.
fence: A fence the pass updates after it completes.
Discussion ¶
You can synchronize memory operations of a compute pass that access resources with an MTLFence. This method instructs the pass to update `fence` after it runs all its memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a compute pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFence] method before encoding commands that need to wait for other passes. - Call the [UpdateFence] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/updateFence(_:)
func (MTLComputeCommandEncoderObject) UseHeap ¶
func (o MTLComputeCommandEncoderObject) UseHeap(heap MTLHeap)
Ensures the shaders in the render pass’s subsequent draw commands have access to all of the resources you allocate from a heap.
heap: An MTLHeap instance containing resources used in an argument buffer.
Discussion ¶
You can make the resources in `heap` (available in GPU memory) for the remaining duration of the render pass by calling this method. Call the method before encoding draw calls that may access resources within `heap` through an argument buffer. The method ensures each resource is in a format that’s compatible with the shaders that depend on it.
This method applies the [ResourceUsageRead] resource usage option to all of the resources within the `heaps`, except for textures. The method ignores any texture that has [TextureUsageRenderTarget], [TextureUsageShaderWrite], or both in its [Usage] property. For all other textures in each of the `heaps`, the method optimizes each texture’s memory layout for rendering with a sampler. However, your kernels can’t read from those textures by calling this method because the texture needs a different memory layout that’s suitable for reading.
Methods that apply a usage option for resources (see Encoding Resident Resources) override any previous calls that apply to a resource. For example, you can change the usage option of any heap in `heaps` to [ResourceUsageWrite] by passing it to [UseResourceUsageStages] after calling this method. However, you can’t reverse the call order because this method resets the usage for all resources within `heap` to [ResourceUsageRead], overriding previous calls to [UseResourceUsage].
This method instructs Metal to apply hazard tracking for resources you allocate from a heap that you create with [HazardTrackingModeTracked]. However, for untracked resources — which come from heaps you create with [HazardTrackingModeUntracked] — you need to account for hazards by applying MTLFence or MTLEvent instances.
Apps typically call the method for heaps that have resources in argument buffers for a implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useHeap(_:)
func (MTLComputeCommandEncoderObject) UseHeapsCount ¶
func (o MTLComputeCommandEncoderObject) UseHeapsCount(heaps []MTLHeap, count uint)
Ensures the shaders in the render pass’s subsequent draw commands have access to all of the resources you allocate from multiple heaps.
heaps: An array of MTLHeap instances, each of which contain resources used in an argument buffer.
count: The number of heaps in the array.
Discussion ¶
You can make the resources in each of the `heaps` (available in GPU memory) for the remaining duration of the render pass by calling this method. Call the method before encoding draw calls that may access resources within the `heaps` through an argument buffer. The method ensures each resource is in a format that’s compatible with the kernels that depend on it.
This method applies the [ResourceUsageRead] resource usage option to all of the resources within `heap`, except for textures. The method ignores any texture that has [TextureUsageRenderTarget], [TextureUsageShaderWrite], or both in its [Usage] property. For all other textures in `heap`, the method optimizes each texture’s memory layout for rendering with a sampler. However, your kernels can’t read from those textures by calling this method because the texture needs a different memory layout that’s suitable for reading.
Methods that apply a usage option for resources (see Encoding Resident Resources) override any previous calls that apply to a resource. For example, you can change the usage option for a buffer allocated in `heap` to [ResourceUsageWrite] by passing it to [UseResourcesCountUsage] after calling this method. However, you can’t reverse the call order because this method resets the usage for all resources within `heap` to [ResourceUsageRead], overriding previous calls to [UseResourceUsage].
This method instructs Metal to apply hazard tracking for resources you allocate from a heap that you create with [HazardTrackingModeTracked]. However, for untracked resources — which come from heaps you create with [HazardTrackingModeUntracked] — you need to account for hazards by applying MTLFence or MTLEvent instances.
Apps typically call the method for heaps that have resources in argument buffers for a implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useHeaps:count:
func (MTLComputeCommandEncoderObject) UseResourceUsage ¶
func (o MTLComputeCommandEncoderObject) UseResourceUsage(resource MTLResource, usage MTLResourceUsage)
Ensures kernel calls that the system encodes in subsequent commands have access to a resource.
resource: An MTLResource instance used in an argument buffer.
usage: How the compute pass can access data, including [ResourceUsageRead] and [ResourceUsageWrite] permission.
For applicable resources, you may be able to prevent the GPU from unnecessarily decompressing color attachments on some devices by setting `usage` to [ResourceUsageRead].
Discussion ¶
You can make a resource (available in GPU memory) for the remaining duration of the compute pass by calling this method. Call the method before encoding function calls that may access the `resource` through an argument buffer. The method ensures the resource is in a format that’s compatible with the kernels that depend on it.
The method also informs Metal when to apply hazard tracking for a resource you create with [HazardTrackingModeTracked]. For a resource you create with [HazardTrackingModeUntracked], you need to apply an MTLFence or an MTLEvent to account for potential reading and writing hazards.
You can reconfigure an individual resource’s `usage` options for subsequent draw calls in the same render pass by calling this method again.
Apps typically call this method for a resource in an argument buffer as a part of their implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useResource(_:usage:)
func (MTLComputeCommandEncoderObject) UseResourcesCountUsage ¶
func (o MTLComputeCommandEncoderObject) UseResourcesCountUsage(resources []MTLResource, count uint, usage MTLResourceUsage)
Ensures kernel calls that the system encodes in subsequent commands have access to multiple resources.
resources: An array of MTLResource instances used in one or more argument buffers.
count: The number of resources in the array.
usage: All the applicable access types the compute pass’s use of these resources, including [ResourceUsageRead] and [ResourceUsageWrite]. Your resource usage type applies to all resources passed to this method call.
For applicable resources, you may be able to prevent the GPU from unnecessarily decompressing color attachments on some devices by setting `usage` to [ResourceUsageRead].
Discussion ¶
You can make many resources (available in GPU memory) for the remaining duration of the compute pass by calling this method. Call the method before encoding function calls that may access these `resources` through an argument buffer. The method ensures the resource is in a format that’s compatible with the kernels that depend on it.
The method also informs Metal when to apply hazard tracking for a resource you create with [HazardTrackingModeTracked]. For a resource you create with [HazardTrackingModeUntracked], you need to apply an MTLFence or an MTLEvent to account for potential reading and writing hazards.
You can reconfigure an individual resource’s `usage` options for subsequent draw calls with the [UseResourceUsage] method.
Apps typically call this method for a resource in an argument buffer as a part of their implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/useResources:count:usage:
func (MTLComputeCommandEncoderObject) WaitForFence ¶
func (o MTLComputeCommandEncoderObject) WaitForFence(fence MTLFence)
Encodes a command that instructs the GPU to pause the compute pass until another pass updates a fence.
fence: A fence that the pass waits for before it runs any of its commands.
Discussion ¶
You can synchronize memory operations of a compute pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the compute pass. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a compute pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFence] method before encoding commands that need to wait for other passes. - Call the [UpdateFence] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
See: https://developer.apple.com/documentation/Metal/MTLComputeCommandEncoder/waitForFence(_:)
type MTLComputePassDescriptor ¶
type MTLComputePassDescriptor struct {
objectivec.Object
}
A description of how to dispatch execution of pass commands and GPU performance sampling.
Configuring the dispatch mechanism ¶
- MTLComputePassDescriptor.DispatchType: The strategy for dispatching any compute commands encoded in the compute pass.
- MTLComputePassDescriptor.SetDispatchType
Specifying sample buffers for GPU counters ¶
- MTLComputePassDescriptor.SampleBufferAttachments: The sample buffers that the compute pass can access.
See: https://developer.apple.com/documentation/Metal/MTLComputePassDescriptor
func MTLComputePassDescriptorFromID ¶
func MTLComputePassDescriptorFromID(id objc.ID) MTLComputePassDescriptor
MTLComputePassDescriptorFromID constructs a MTLComputePassDescriptor from an objc.ID.
A description of how to dispatch execution of pass commands and GPU performance sampling.
func NewMTLComputePassDescriptor ¶
func NewMTLComputePassDescriptor() MTLComputePassDescriptor
NewMTLComputePassDescriptor creates a new MTLComputePassDescriptor instance.
func (MTLComputePassDescriptor) Autorelease ¶
func (c MTLComputePassDescriptor) Autorelease() MTLComputePassDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLComputePassDescriptor) DispatchType ¶
func (c MTLComputePassDescriptor) DispatchType() MTLDispatchType
The strategy for dispatching any compute commands encoded in the compute pass.
Discussion ¶
The default dispatch type is [DispatchTypeSerial].
See: https://developer.apple.com/documentation/Metal/MTLComputePassDescriptor/dispatchType
func (MTLComputePassDescriptor) Init ¶
func (c MTLComputePassDescriptor) Init() MTLComputePassDescriptor
Init initializes the instance.
func (MTLComputePassDescriptor) SampleBufferAttachments ¶
func (c MTLComputePassDescriptor) SampleBufferAttachments() IMTLComputePassSampleBufferAttachmentDescriptorArray
The sample buffers that the compute pass can access.
Discussion ¶
The GPU uses sample buffers to record performance information. See GPU counters and counter sample buffers, Sampling GPU data into counter sample buffers, and MTLCounter for more information.
See: https://developer.apple.com/documentation/Metal/MTLComputePassDescriptor/sampleBufferAttachments
func (MTLComputePassDescriptor) SetDispatchType ¶
func (c MTLComputePassDescriptor) SetDispatchType(value MTLDispatchType)
type MTLComputePassDescriptorClass ¶
type MTLComputePassDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLComputePassDescriptorClass ¶
func GetMTLComputePassDescriptorClass() MTLComputePassDescriptorClass
GetMTLComputePassDescriptorClass returns the class object for MTLComputePassDescriptor.
func (MTLComputePassDescriptorClass) Alloc ¶
func (mc MTLComputePassDescriptorClass) Alloc() MTLComputePassDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLComputePassDescriptorClass) ComputePassDescriptor ¶
func (_MTLComputePassDescriptorClass MTLComputePassDescriptorClass) ComputePassDescriptor() MTLComputePassDescriptor
Creates a default compute pass descriptor.
Return Value ¶
A new compute pass descriptor populated with default values.
See: https://developer.apple.com/documentation/Metal/MTLComputePassDescriptor/computePassDescriptor
type MTLComputePassSampleBufferAttachmentDescriptor ¶
type MTLComputePassSampleBufferAttachmentDescriptor struct {
objectivec.Object
}
A configuration that instructs the GPU where to store counter data from the beginning and end of a compute pass.
Overview ¶
For more context about configuring sample buffer attachments for compute passes, see Sampling GPU data into counter sample buffers. That article is one of a series in GPU counters and counter sample buffers about sampling Metal hardware counters for performance measurement.
Configuring the sample buffer attachment ¶
- MTLComputePassSampleBufferAttachmentDescriptor.SampleBuffer: A specialized memory buffer that the GPU uses to store its counter data during a compute pass.
- MTLComputePassSampleBufferAttachmentDescriptor.SetSampleBuffer
- MTLComputePassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex: An index within a counter sample buffer that tells the GPU where to store counter data from the start of a compute pass.
- MTLComputePassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex
- MTLComputePassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex: An index within a counter sample buffer that tells the GPU where to store counter data from the end of a compute pass.
- MTLComputePassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex
See: https://developer.apple.com/documentation/Metal/MTLComputePassSampleBufferAttachmentDescriptor
func MTLComputePassSampleBufferAttachmentDescriptorFromID ¶
func MTLComputePassSampleBufferAttachmentDescriptorFromID(id objc.ID) MTLComputePassSampleBufferAttachmentDescriptor
MTLComputePassSampleBufferAttachmentDescriptorFromID constructs a MTLComputePassSampleBufferAttachmentDescriptor from an objc.ID.
A configuration that instructs the GPU where to store counter data from the beginning and end of a compute pass.
func NewMTLComputePassSampleBufferAttachmentDescriptor ¶
func NewMTLComputePassSampleBufferAttachmentDescriptor() MTLComputePassSampleBufferAttachmentDescriptor
NewMTLComputePassSampleBufferAttachmentDescriptor creates a new MTLComputePassSampleBufferAttachmentDescriptor instance.
func (MTLComputePassSampleBufferAttachmentDescriptor) Autorelease ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) Autorelease() MTLComputePassSampleBufferAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLComputePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
An index within a counter sample buffer that tells the GPU where to store counter data from the end of a compute pass.
Discussion ¶
This property indicates where the GPU stores the counter data within an MTLCounterSampleBuffer instance that it samples at the end of a compute pass.
You can tell the GPU to skip sampling at the end of the compute pass by assigning MTLCounterDontSample to this property.
func (MTLComputePassSampleBufferAttachmentDescriptor) Init ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) Init() MTLComputePassSampleBufferAttachmentDescriptor
Init initializes the instance.
func (MTLComputePassSampleBufferAttachmentDescriptor) SampleBuffer ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
A specialized memory buffer that the GPU uses to store its counter data during a compute pass.
Discussion ¶
The property defaults to `nil`, which means the GPU doesn’t save any GPU counter information during the compute pass. For more information, see Creating a counter sample buffer to store a GPU’s counter data during a pass and Sampling GPU data into counter sample buffers.
func (MTLComputePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
func (MTLComputePassSampleBufferAttachmentDescriptor) SetSampleBuffer ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
func (MTLComputePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
func (MTLComputePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex ¶
func (c MTLComputePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
An index within a counter sample buffer that tells the GPU where to store counter data from the start of a compute pass.
Discussion ¶
This property indicates where the GPU stores the counter data within an MTLCounterSampleBuffer instance that it samples at the beginning of a compute pass.
You can tell the GPU to skip sampling at the start of the compute pass by assigning MTLCounterDontSample to this property.
type MTLComputePassSampleBufferAttachmentDescriptorArray ¶
type MTLComputePassSampleBufferAttachmentDescriptorArray struct {
objectivec.Object
}
A container that stores an array of sample buffer attachments for a compute pass.
Overview ¶
The number of elements in the array is at least the number of elements in an MTLDevice instance’s counterSets property.
Accessing a sample buffer attachment ¶
- MTLComputePassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript: Returns the descriptor object for the specified sample buffer attachment.
See: https://developer.apple.com/documentation/Metal/MTLComputePassSampleBufferAttachmentDescriptorArray
func MTLComputePassSampleBufferAttachmentDescriptorArrayFromID ¶
func MTLComputePassSampleBufferAttachmentDescriptorArrayFromID(id objc.ID) MTLComputePassSampleBufferAttachmentDescriptorArray
MTLComputePassSampleBufferAttachmentDescriptorArrayFromID constructs a MTLComputePassSampleBufferAttachmentDescriptorArray from an objc.ID.
A container that stores an array of sample buffer attachments for a compute pass.
func NewMTLComputePassSampleBufferAttachmentDescriptorArray ¶
func NewMTLComputePassSampleBufferAttachmentDescriptorArray() MTLComputePassSampleBufferAttachmentDescriptorArray
NewMTLComputePassSampleBufferAttachmentDescriptorArray creates a new MTLComputePassSampleBufferAttachmentDescriptorArray instance.
func (MTLComputePassSampleBufferAttachmentDescriptorArray) Autorelease ¶
func (c MTLComputePassSampleBufferAttachmentDescriptorArray) Autorelease() MTLComputePassSampleBufferAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLComputePassSampleBufferAttachmentDescriptorArray) CounterSets ¶
func (c MTLComputePassSampleBufferAttachmentDescriptorArray) CounterSets() MTLCounterSet
The counter sets supported by the device object.
See: https://developer.apple.com/documentation/metal/mtldevice/countersets
func (MTLComputePassSampleBufferAttachmentDescriptorArray) Init ¶
func (c MTLComputePassSampleBufferAttachmentDescriptorArray) Init() MTLComputePassSampleBufferAttachmentDescriptorArray
Init initializes the instance.
func (MTLComputePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (c MTLComputePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLComputePassSampleBufferAttachmentDescriptor
Returns the descriptor object for the specified sample buffer attachment.
attachmentIndex: An index for the sample buffer attachment to fetch.
Return Value ¶
The requested MTLComputePassSampleBufferAttachmentDescriptor object.
func (MTLComputePassSampleBufferAttachmentDescriptorArray) SetCounterSets ¶
func (c MTLComputePassSampleBufferAttachmentDescriptorArray) SetCounterSets(value MTLCounterSet)
func (MTLComputePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (c MTLComputePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLComputePassSampleBufferAttachmentDescriptor, attachmentIndex uint)
Sets the descriptor object for the specified sample buffer attachment.
attachment: A sample buffer attachment descriptor. When set to `nil`, removes any existing buffer attachment descriptor at `attachmentIndex`.
attachmentIndex: The attachment in the array to replace.
Discussion ¶
The method copies the `attachment` parameter’s contents into the attachment at the specified index.
type MTLComputePassSampleBufferAttachmentDescriptorArrayClass ¶
type MTLComputePassSampleBufferAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLComputePassSampleBufferAttachmentDescriptorArrayClass ¶
func GetMTLComputePassSampleBufferAttachmentDescriptorArrayClass() MTLComputePassSampleBufferAttachmentDescriptorArrayClass
GetMTLComputePassSampleBufferAttachmentDescriptorArrayClass returns the class object for MTLComputePassSampleBufferAttachmentDescriptorArray.
func (MTLComputePassSampleBufferAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLComputePassSampleBufferAttachmentDescriptorArrayClass) Alloc() MTLComputePassSampleBufferAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLComputePassSampleBufferAttachmentDescriptorClass ¶
type MTLComputePassSampleBufferAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLComputePassSampleBufferAttachmentDescriptorClass ¶
func GetMTLComputePassSampleBufferAttachmentDescriptorClass() MTLComputePassSampleBufferAttachmentDescriptorClass
GetMTLComputePassSampleBufferAttachmentDescriptorClass returns the class object for MTLComputePassSampleBufferAttachmentDescriptor.
func (MTLComputePassSampleBufferAttachmentDescriptorClass) Alloc ¶
func (mc MTLComputePassSampleBufferAttachmentDescriptorClass) Alloc() MTLComputePassSampleBufferAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLComputePipelineDescriptor ¶
type MTLComputePipelineDescriptor struct {
objectivec.Object
}
An instance describing the desired GPU state for a kernel call in a compute pass.
Overview ¶
A pipeline descriptor provides information necessary for creating an MTLComputePipelineState instance.
Configuring the compute execution environment ¶
- MTLComputePipelineDescriptor.ComputeFunction: The compute kernel the pipeline calls.
- MTLComputePipelineDescriptor.SetComputeFunction
- MTLComputePipelineDescriptor.ThreadGroupSizeIsMultipleOfThreadExecutionWidth: A Boolean value that indicates whether the threadgroup size is always a multiple of the thread execution width.
- MTLComputePipelineDescriptor.SetThreadGroupSizeIsMultipleOfThreadExecutionWidth
- MTLComputePipelineDescriptor.MaxTotalThreadsPerThreadgroup: A property that limits the number of threads you can dispatch in a threadgroup for the compute function.
- MTLComputePipelineDescriptor.SetMaxTotalThreadsPerThreadgroup
- MTLComputePipelineDescriptor.MaxCallStackDepth: The maximum call stack depth for indirect function calls in compute shaders.
- MTLComputePipelineDescriptor.SetMaxCallStackDepth
Configuring compute pass inputs ¶
- MTLComputePipelineDescriptor.StageInputDescriptor: The organization of input and output data for the next kernel call.
- MTLComputePipelineDescriptor.SetStageInputDescriptor
Configuring buffer mutability ¶
- MTLComputePipelineDescriptor.Buffers: The buffer mutability options to apply to the next kernel call.
Identifying the pipeline state object ¶
- MTLComputePipelineDescriptor.Label: A string that identifies the instance.
- MTLComputePipelineDescriptor.SetLabel
Configuring indirect command buffers ¶
- MTLComputePipelineDescriptor.SupportIndirectCommandBuffers: A Boolean value that indicates whether you can encode commands that reference the pipeline state object into an indirect command buffer.
- MTLComputePipelineDescriptor.SetSupportIndirectCommandBuffers
Configuring shader validation ¶
- MTLComputePipelineDescriptor.ShaderValidation: A value that enables or disables shader validation for the pipeline.
- MTLComputePipelineDescriptor.SetShaderValidation
Reset to defaults ¶
- MTLComputePipelineDescriptor.Reset: Resets all compute pipeline descriptor properties to their default values.
Loading dynamic libraries to link at runtime ¶
- MTLComputePipelineDescriptor.PreloadedLibraries: The dynamic libraries that contain precompiled shader functions you want to link.
- MTLComputePipelineDescriptor.SetPreloadedLibraries
Setting callable functions ¶
- MTLComputePipelineDescriptor.LinkedFunctions: The functions with available function pointers for the next kernel call.
- MTLComputePipelineDescriptor.SetLinkedFunctions
Loading binary archives ¶
- MTLComputePipelineDescriptor.SupportAddingBinaryFunctions: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
- MTLComputePipelineDescriptor.SetSupportAddingBinaryFunctions
- MTLComputePipelineDescriptor.BinaryArchives: The binary archives that contain any precompiled shader functions to link.
- MTLComputePipelineDescriptor.SetBinaryArchives
Instance Properties ¶
- MTLComputePipelineDescriptor.RequiredThreadsPerThreadgroup
- MTLComputePipelineDescriptor.SetRequiredThreadsPerThreadgroup
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor
func MTLComputePipelineDescriptorFromID ¶
func MTLComputePipelineDescriptorFromID(id objc.ID) MTLComputePipelineDescriptor
MTLComputePipelineDescriptorFromID constructs a MTLComputePipelineDescriptor from an objc.ID.
An instance describing the desired GPU state for a kernel call in a compute pass.
func NewMTLComputePipelineDescriptor ¶
func NewMTLComputePipelineDescriptor() MTLComputePipelineDescriptor
NewMTLComputePipelineDescriptor creates a new MTLComputePipelineDescriptor instance.
func (MTLComputePipelineDescriptor) Autorelease ¶
func (c MTLComputePipelineDescriptor) Autorelease() MTLComputePipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLComputePipelineDescriptor) BinaryArchives ¶
func (c MTLComputePipelineDescriptor) BinaryArchives() []objectivec.IObject
The binary archives that contain any precompiled shader functions to link.
Discussion ¶
The default value is `nil`.
When you create a Metal library, Metal compiles shader functions into an intermediate representation. When you create the pipeline state object, the GPU compiles this intermediate code.
By providing a set of binary archives, when Metal creates the pipeline state object, it first checks the archives to see if there’s already a compiled function. If so, Metal uses it instead.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/binaryArchives
func (MTLComputePipelineDescriptor) Buffers ¶
func (c MTLComputePipelineDescriptor) Buffers() IMTLPipelineBufferDescriptorArray
The buffer mutability options to apply to the next kernel call.
Discussion ¶
This property holds an array of MTLPipelineBufferDescriptor instances, where each index corresponds to the same entry in the buffer argument table.
Metal can perform additional optimizations if you guarantee that neither the CPU nor the GPU modify a buffer’s contents after set in a function’s argument table and before its command buffer completes. Use immutable buffers as much as possible, for either regular buffers or argument buffers.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/buffers
func (MTLComputePipelineDescriptor) ComputeFunction ¶
func (c MTLComputePipelineDescriptor) ComputeFunction() MTLFunction
The compute kernel the pipeline calls.
Discussion ¶
The default value is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/computeFunction
func (MTLComputePipelineDescriptor) Init ¶
func (c MTLComputePipelineDescriptor) Init() MTLComputePipelineDescriptor
Init initializes the instance.
func (MTLComputePipelineDescriptor) Label ¶
func (c MTLComputePipelineDescriptor) Label() string
A string that identifies the instance.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/label
func (MTLComputePipelineDescriptor) LinkedFunctions ¶
func (c MTLComputePipelineDescriptor) LinkedFunctions() IMTLLinkedFunctions
The functions with available function pointers for the next kernel call.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/linkedFunctions
func (MTLComputePipelineDescriptor) MaxCallStackDepth ¶
func (c MTLComputePipelineDescriptor) MaxCallStackDepth() uint
The maximum call stack depth for indirect function calls in compute shaders.
Discussion ¶
The property’s default value is `1`. Change its value if you use recursive functions in your compute pass.
The maximum call stack depth applies only to indirect function calls in your shader, and affects the upper bound of stack memory for each thread. Indirect function calls include those to visible functions, intersection functions, and to dynamic libraries.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/maxCallStackDepth
func (MTLComputePipelineDescriptor) MaxTotalThreadsPerThreadgroup ¶
func (c MTLComputePipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
A property that limits the number of threads you can dispatch in a threadgroup for the compute function.
Discussion ¶
Metal automatically selects a maximum threadgroup size when you set this value to `0`.
Your shader can also configure the maximum number of threads per threadgroup with the `[[max_total_threads_per_threadgroup]]` attribute. See the Metal Shading Language Specification for more information.
By default, this property’s value is `0`, which instructs Metal to calculate the maximum number of threads per threadgroup based on the device’s capabilities and the compute shader’s memory usage.
The [MaxTotalThreadsPerThreadgroup] property of an MTLComputePipelineState instance reports the maximum number of threads you can dispatch in a threadgroup for that specific compute shader.
Metal may return an error if this value exceeds the available resources for the device, or Metal may lower the thread limit when creating the compute pipeline state, which can reduce runtime performance.
func (MTLComputePipelineDescriptor) PreloadedLibraries ¶
func (c MTLComputePipelineDescriptor) PreloadedLibraries() []objectivec.IObject
The dynamic libraries that contain precompiled shader functions you want to link.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/preloadedLibraries
func (MTLComputePipelineDescriptor) RequiredThreadsPerThreadgroup ¶
func (c MTLComputePipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
Discussion ¶
Sets the required threads-per-threadgroup during dispatches. The `threadsPerThreadgroup` argument of any dispatch must match this value if it is set. Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set. Setting this to a size of 0 in every dimension disables this property
func (MTLComputePipelineDescriptor) Reset ¶
func (c MTLComputePipelineDescriptor) Reset()
Resets all compute pipeline descriptor properties to their default values.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/reset()
func (MTLComputePipelineDescriptor) SetBinaryArchives ¶
func (c MTLComputePipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
func (MTLComputePipelineDescriptor) SetComputeFunction ¶
func (c MTLComputePipelineDescriptor) SetComputeFunction(value MTLFunction)
func (MTLComputePipelineDescriptor) SetLabel ¶
func (c MTLComputePipelineDescriptor) SetLabel(value string)
func (MTLComputePipelineDescriptor) SetLinkedFunctions ¶
func (c MTLComputePipelineDescriptor) SetLinkedFunctions(value IMTLLinkedFunctions)
func (MTLComputePipelineDescriptor) SetMaxCallStackDepth ¶
func (c MTLComputePipelineDescriptor) SetMaxCallStackDepth(value uint)
func (MTLComputePipelineDescriptor) SetMaxTotalThreadsPerThreadgroup ¶
func (c MTLComputePipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
func (MTLComputePipelineDescriptor) SetPreloadedLibraries ¶
func (c MTLComputePipelineDescriptor) SetPreloadedLibraries(value []objectivec.IObject)
func (MTLComputePipelineDescriptor) SetRequiredThreadsPerThreadgroup ¶
func (c MTLComputePipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
func (MTLComputePipelineDescriptor) SetShaderValidation ¶
func (c MTLComputePipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
func (MTLComputePipelineDescriptor) SetStageInputDescriptor ¶
func (c MTLComputePipelineDescriptor) SetStageInputDescriptor(value IMTLStageInputOutputDescriptor)
func (MTLComputePipelineDescriptor) SetSupportAddingBinaryFunctions ¶
func (c MTLComputePipelineDescriptor) SetSupportAddingBinaryFunctions(value bool)
func (MTLComputePipelineDescriptor) SetSupportIndirectCommandBuffers ¶
func (c MTLComputePipelineDescriptor) SetSupportIndirectCommandBuffers(value bool)
func (MTLComputePipelineDescriptor) SetThreadGroupSizeIsMultipleOfThreadExecutionWidth ¶
func (c MTLComputePipelineDescriptor) SetThreadGroupSizeIsMultipleOfThreadExecutionWidth(value bool)
func (MTLComputePipelineDescriptor) ShaderValidation ¶
func (c MTLComputePipelineDescriptor) ShaderValidation() MTLShaderValidation
A value that enables or disables shader validation for the pipeline.
Discussion ¶
You can override the value using either of these environment variables: `MTL_SHADER_VALIDATION_ENABLE_PIPELINES` or `MTL_SHADER_VALIDATION_DISABLE_PIPELINES.`
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/shaderValidation
func (MTLComputePipelineDescriptor) StageInputDescriptor ¶
func (c MTLComputePipelineDescriptor) StageInputDescriptor() IMTLStageInputOutputDescriptor
The organization of input and output data for the next kernel call.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineDescriptor/stageInputDescriptor
func (MTLComputePipelineDescriptor) SupportAddingBinaryFunctions ¶
func (c MTLComputePipelineDescriptor) SupportAddingBinaryFunctions() bool
A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
func (MTLComputePipelineDescriptor) SupportIndirectCommandBuffers ¶
func (c MTLComputePipelineDescriptor) SupportIndirectCommandBuffers() bool
A Boolean value that indicates whether you can encode commands that reference the pipeline state object into an indirect command buffer.
func (MTLComputePipelineDescriptor) ThreadGroupSizeIsMultipleOfThreadExecutionWidth ¶
func (c MTLComputePipelineDescriptor) ThreadGroupSizeIsMultipleOfThreadExecutionWidth() bool
A Boolean value that indicates whether the threadgroup size is always a multiple of the thread execution width.
Discussion ¶
If you can guarantee that the threadgroup size used by all compute commands in this pipeline is a multiple of [ThreadExecutionWidth], set this property to `true` to take advantage of additional Metal optimizations.
The default value is `false`.
type MTLComputePipelineDescriptorClass ¶
type MTLComputePipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLComputePipelineDescriptorClass ¶
func GetMTLComputePipelineDescriptorClass() MTLComputePipelineDescriptorClass
GetMTLComputePipelineDescriptorClass returns the class object for MTLComputePipelineDescriptor.
func (MTLComputePipelineDescriptorClass) Alloc ¶
func (mc MTLComputePipelineDescriptorClass) Alloc() MTLComputePipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTLComputePipelineReflection ¶
type MTLComputePipelineReflection struct {
objectivec.Object
}
Information about the arguments of a compute function.
Overview ¶
An MTLComputePipelineReflection object provides access to the arguments of the compute function used in an MTLComputePipelineState object. An MTLComputePipelineReflection object can be created along with an MTLComputePipelineState object. Don’t create an MTLComputePipelineReflection object directly. Instead, call either the [NewComputePipelineStateWithFunctionOptionsReflectionError] or [NewComputePipelineStateWithFunctionOptionsCompletionHandler] method of MTLDevice to create both an MTLComputePipelineState object and an MTLComputePipelineReflection object.
MTLComputePipelineReflection objects can use a significant amount of memory; release any strong references to them after you finish creating pipeline objects.
Instance Properties ¶
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineReflection
func MTLComputePipelineReflectionFromID ¶
func MTLComputePipelineReflectionFromID(id objc.ID) MTLComputePipelineReflection
MTLComputePipelineReflectionFromID constructs a MTLComputePipelineReflection from an objc.ID.
Information about the arguments of a compute function.
func NewMTLComputePipelineReflection ¶
func NewMTLComputePipelineReflection() MTLComputePipelineReflection
NewMTLComputePipelineReflection creates a new MTLComputePipelineReflection instance.
func (MTLComputePipelineReflection) Autorelease ¶
func (c MTLComputePipelineReflection) Autorelease() MTLComputePipelineReflection
Autorelease adds the receiver to the current autorelease pool.
func (MTLComputePipelineReflection) Bindings ¶
func (c MTLComputePipelineReflection) Bindings() []objectivec.IObject
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineReflection/bindings
func (MTLComputePipelineReflection) Init ¶
func (c MTLComputePipelineReflection) Init() MTLComputePipelineReflection
Init initializes the instance.
type MTLComputePipelineReflectionClass ¶
type MTLComputePipelineReflectionClass struct {
// contains filtered or unexported fields
}
func GetMTLComputePipelineReflectionClass ¶
func GetMTLComputePipelineReflectionClass() MTLComputePipelineReflectionClass
GetMTLComputePipelineReflectionClass returns the class object for MTLComputePipelineReflection.
func (MTLComputePipelineReflectionClass) Alloc ¶
func (mc MTLComputePipelineReflectionClass) Alloc() MTLComputePipelineReflection
Alloc allocates memory for a new instance of the class.
type MTLComputePipelineState ¶
type MTLComputePipelineState interface {
objectivec.IObject
MTLAllocation
// The device instance that created the pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/device
Device() MTLDevice
// An unique identifier that represents the pipeline state, which you can add to an argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/gpuResourceID
GpuResourceID() MTLResourceID
// A string that helps you identify the compute pipeline state during debugging.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/label
Label() string
// The maximum number of threads in a threadgroup that you can dispatch to the pipeline.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/maxTotalThreadsPerThreadgroup
MaxTotalThreadsPerThreadgroup() uint
// The number of threads that the GPU executes simultaneously.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/threadExecutionWidth
ThreadExecutionWidth() uint
// The length, in bytes, of statically allocated threadgroup memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/staticThreadgroupMemoryLength
StaticThreadgroupMemoryLength() uint
// Returns the length of reserved memory for an imageblock of a given size.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/imageblockMemoryLength(forDimensions:)
ImageblockMemoryLengthForDimensions(imageblockDimensions MTLSize) uint
// A Boolean value that indicates whether the compute pipeline supports indirect command buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/supportIndirectCommandBuffers
SupportIndirectCommandBuffers() bool
// The current state of shader validation for the pipeline.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/shaderValidation
ShaderValidation() MTLShaderValidation
// Creates a function handle for a visible function.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/functionHandle(function:)-7d523
FunctionHandleWithFunction(function MTLFunction) MTLFunctionHandle
// Creates a new pipeline state object with additional callable functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/makeComputePipelineStateWithAdditionalBinaryFunctions(functions:)
NewComputePipelineStateWithAdditionalBinaryFunctionsError(functions []objectivec.IObject) (MTLComputePipelineState, error)
// Creates a new visible function table.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/makeVisibleFunctionTable(descriptor:)
NewVisibleFunctionTableWithDescriptor(descriptor IMTLVisibleFunctionTableDescriptor) MTLVisibleFunctionTable
// Creates a new intersection function table.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/makeIntersectionFunctionTable(descriptor:)
NewIntersectionFunctionTableWithDescriptor(descriptor IMTLIntersectionFunctionTableDescriptor) MTLIntersectionFunctionTable
// Provides access to this compute pipeline’s reflection.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/reflection
Reflection() IMTLComputePipelineReflection
// RequiredThreadsPerThreadgroup protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/requiredThreadsPerThreadgroup
RequiredThreadsPerThreadgroup() MTLSize
// Gets the function handle for a function this pipeline links at the binary level.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/functionHandle(function:)-8spaa
FunctionHandleWithBinaryFunction(function MTL4BinaryFunction) MTLFunctionHandle
// Gets the function handle for a function this pipeline links at the Metal IR level by name.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/functionHandle(withName:)
FunctionHandleWithName(name string) MTLFunctionHandle
// Allocates a new compute pipeline state by adding binary functions to this pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/makeComputePipelineState(additionalBinaryFunctions:)
NewComputePipelineStateWithBinaryFunctionsError(additionalBinaryFunctions []objectivec.IObject) (MTLComputePipelineState, error)
}
An interface that represents a GPU pipeline configuration for running kernels in a compute pass.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState
type MTLComputePipelineStateObject ¶
type MTLComputePipelineStateObject struct {
objectivec.Object
}
MTLComputePipelineStateObject wraps an existing Objective-C object that conforms to the MTLComputePipelineState protocol.
func MTLComputePipelineStateObjectFromID ¶
func MTLComputePipelineStateObjectFromID(id objc.ID) MTLComputePipelineStateObject
MTLComputePipelineStateObjectFromID constructs a MTLComputePipelineStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLComputePipelineStateObject) AllocatedSize ¶
func (o MTLComputePipelineStateObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLComputePipelineStateObject) BaseObject ¶
func (o MTLComputePipelineStateObject) BaseObject() objectivec.Object
func (MTLComputePipelineStateObject) Device ¶
func (o MTLComputePipelineStateObject) Device() MTLDevice
The device instance that created the pipeline state.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/device
func (MTLComputePipelineStateObject) FunctionHandleWithBinaryFunction ¶
func (o MTLComputePipelineStateObject) FunctionHandleWithBinaryFunction(function MTL4BinaryFunction) MTLFunctionHandle
Gets the function handle for a function this pipeline links at the binary level.
function: A binary function object representing the function binary to find.
Return Value ¶
A function handle corresponding to the function if the binary function mathces a function in this pipeline state, otherwise `nil`.
func (MTLComputePipelineStateObject) FunctionHandleWithFunction ¶
func (o MTLComputePipelineStateObject) FunctionHandleWithFunction(function MTLFunction) MTLFunctionHandle
Creates a function handle for a visible function.
function: An MTLFunction instance that represents the visible function to create a handle for.
Return Value ¶
A handle to the visible function. When this value is `nil`, an error occurred during handle creation.
func (MTLComputePipelineStateObject) FunctionHandleWithName ¶
func (o MTLComputePipelineStateObject) FunctionHandleWithName(name string) MTLFunctionHandle
Gets the function handle for a function this pipeline links at the Metal IR level by name.
name: A string representing the name of the function.
Return Value ¶
A function handle corresponding to the function if the name matches a function in this pipeline state, otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/functionHandle(withName:)
func (MTLComputePipelineStateObject) GpuResourceID ¶
func (o MTLComputePipelineStateObject) GpuResourceID() MTLResourceID
An unique identifier that represents the pipeline state, which you can add to an argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/gpuResourceID
func (MTLComputePipelineStateObject) ImageblockMemoryLengthForDimensions ¶
func (o MTLComputePipelineStateObject) ImageblockMemoryLengthForDimensions(imageblockDimensions MTLSize) uint
Returns the length of reserved memory for an imageblock of a given size.
imageblockDimensions: An MTLSize instance that represents the dimensions of an imageblock. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
Return Value ¶
The length, in bytes, occupied by the image block in memory.
func (MTLComputePipelineStateObject) Label ¶
func (o MTLComputePipelineStateObject) Label() string
A string that helps you identify the compute pipeline state during debugging.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/label
func (MTLComputePipelineStateObject) MaxTotalThreadsPerThreadgroup ¶
func (o MTLComputePipelineStateObject) MaxTotalThreadsPerThreadgroup() uint
The maximum number of threads in a threadgroup that you can dispatch to the pipeline.
func (MTLComputePipelineStateObject) NewComputePipelineStateWithAdditionalBinaryFunctionsError ¶
func (o MTLComputePipelineStateObject) NewComputePipelineStateWithAdditionalBinaryFunctionsError(functions []objectivec.IObject) (MTLComputePipelineState, error)
Creates a new pipeline state object with additional callable functions.
functions: The list of additional functions that you want to be able to call.
Return Value ¶
A new compute pipeline state with access to the provided functions. When this value is `nil`, an error occurred during handle creation.
func (MTLComputePipelineStateObject) NewComputePipelineStateWithBinaryFunctionsError ¶
func (o MTLComputePipelineStateObject) NewComputePipelineStateWithBinaryFunctionsError(additionalBinaryFunctions []objectivec.IObject) (MTLComputePipelineState, error)
Allocates a new compute pipeline state by adding binary functions to this pipeline state.
additionalBinaryFunctions: A non-`nil` array containing binary functions to add to this pipeline.
Return Value ¶
A new compute pipeline state upon success, otherwise `nil`.
func (MTLComputePipelineStateObject) NewIntersectionFunctionTableWithDescriptor ¶
func (o MTLComputePipelineStateObject) NewIntersectionFunctionTableWithDescriptor(descriptor IMTLIntersectionFunctionTableDescriptor) MTLIntersectionFunctionTable
Creates a new intersection function table.
descriptor: An MTLIntersectionFunctionTableDescriptor instance that configures the created table.
Return Value ¶
A new intersection function table, or `nil` if an error occurred in creation.
func (MTLComputePipelineStateObject) NewVisibleFunctionTableWithDescriptor ¶
func (o MTLComputePipelineStateObject) NewVisibleFunctionTableWithDescriptor(descriptor IMTLVisibleFunctionTableDescriptor) MTLVisibleFunctionTable
Creates a new visible function table.
descriptor: An MTLVisibleFunctionTableDescriptor instance that configures the created table.
Return Value ¶
A new visible function table, or `nil` if an error occurred in creation.
func (MTLComputePipelineStateObject) Reflection ¶
func (o MTLComputePipelineStateObject) Reflection() IMTLComputePipelineReflection
Provides access to this compute pipeline’s reflection.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/reflection
func (MTLComputePipelineStateObject) RequiredThreadsPerThreadgroup ¶
func (o MTLComputePipelineStateObject) RequiredThreadsPerThreadgroup() MTLSize
func (MTLComputePipelineStateObject) ShaderValidation ¶
func (o MTLComputePipelineStateObject) ShaderValidation() MTLShaderValidation
The current state of shader validation for the pipeline.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/shaderValidation
func (MTLComputePipelineStateObject) StaticThreadgroupMemoryLength ¶
func (o MTLComputePipelineStateObject) StaticThreadgroupMemoryLength() uint
The length, in bytes, of statically allocated threadgroup memory.
func (MTLComputePipelineStateObject) SupportIndirectCommandBuffers ¶
func (o MTLComputePipelineStateObject) SupportIndirectCommandBuffers() bool
A Boolean value that indicates whether the compute pipeline supports indirect command buffers.
func (MTLComputePipelineStateObject) ThreadExecutionWidth ¶
func (o MTLComputePipelineStateObject) ThreadExecutionWidth() uint
The number of threads that the GPU executes simultaneously.
See: https://developer.apple.com/documentation/Metal/MTLComputePipelineState/threadExecutionWidth
type MTLCoordinate2D ¶
type MTLCoordinate2D = MTLSamplePosition
MTLCoordinate2D is a coordinate in the viewport.
See: https://developer.apple.com/documentation/Metal/MTLCoordinate2D
type MTLCounter ¶
type MTLCounter interface {
objectivec.IObject
// The name of a GPU’s counter instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLCounter/name
Name() string
}
An individual counter a GPU device lists within one of its counter sets.
See: https://developer.apple.com/documentation/Metal/MTLCounter
type MTLCounterObject ¶
type MTLCounterObject struct {
objectivec.Object
}
MTLCounterObject wraps an existing Objective-C object that conforms to the MTLCounter protocol.
func MTLCounterObjectFromID ¶
func MTLCounterObjectFromID(id objc.ID) MTLCounterObject
MTLCounterObjectFromID constructs a MTLCounterObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCounterObject) BaseObject ¶
func (o MTLCounterObject) BaseObject() objectivec.Object
func (MTLCounterObject) Name ¶
func (o MTLCounterObject) Name() string
The name of a GPU’s counter instance.
See: https://developer.apple.com/documentation/Metal/MTLCounter/name
type MTLCounterResultStageUtilization ¶
type MTLCounterResultStageUtilization struct {
TotalCycles uint64 // The total number of cycles the GPU uses to run a pass.
VertexCycles uint64 // The number of cycles the GPU uses to run vertex shaders during a pass.
TessellationCycles uint64 // The number of cycles the GPU uses to run the tessellation stage during a pass.
PostTessellationVertexCycles uint64 // The number of cycles the GPU uses to run post-tessellation vertex shaders during a pass.
FragmentCycles uint64 // The number of cycles the GPU uses to run fragment shaders during a pass.
RenderTargetCycles uint64 // The number of cycles the GPU uses to write data to render targets during a render pass.
}
MTLCounterResultStageUtilization - The data structure for storing the data you resolve from a stage-utilization counter set.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLCounterResultStageUtilization
type MTLCounterResultStatistic ¶
type MTLCounterResultStatistic struct {
TessellationInputPatches uint64 // The number of tessellation patches a render pass sends to the tessellation stage.
VertexInvocations uint64 // The number of times a render pass calls any vertex shader.
PostTessellationVertexInvocations uint64 // The number of vertices a render pass sends to a post-tessellation vertex shader.
ClipperInvocations uint64 // The number of primitives a render pass sends to the clip stage.
ClipperPrimitivesOut uint64 // The number of primitives the clip stage produces during a render pass.
FragmentInvocations uint64 // The number of times a render pass calls fragment shaders.
FragmentsPassed uint64 // The number of fragments a render pass sends to the visibility and blend stages because they pass the scissor, depth, and stencil tests.
ComputeKernelInvocations uint64 // The number of times a pass calls any compute kernel.
}
MTLCounterResultStatistic - The data structure for storing the data you resolve from a statistic counter set.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLCounterResultStatistic
type MTLCounterResultTimestamp ¶
type MTLCounterResultTimestamp struct {
Timestamp uint64 // A timestamp value from a GPU at a particular point in time during an operation, typically at the beginning or ending of a render stage.
}
MTLCounterResultTimestamp - The data structure for storing the data you resolve from a timestamp counter set.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLCounterResultTimestamp
type MTLCounterSampleBuffer ¶
type MTLCounterSampleBuffer interface {
objectivec.IObject
// A string that identifies the counter sample buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/label
Label() string
// The GPU device instance that owns the counter sample buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/device
Device() MTLDevice
// The number of samples in the buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/sampleCount
SampleCount() uint
// Transforms samples of a GPU’s counter set from the driver’s internal format to a standard Metal data structure.
//
// See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/resolveCounterRange:
ResolveCounterRange(range_ foundation.NSRange) foundation.INSData
}
A specialized memory buffer that stores a GPU’s counter set data.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer
type MTLCounterSampleBufferDescriptor ¶
type MTLCounterSampleBufferDescriptor struct {
objectivec.Object
}
A group of properties that configures the counter sample buffers you create with it.
Overview ¶
To create a new counter sample buffer, create and configure an MTLCounterSampleBufferDescriptor instance, and then call an MTLDevice instance’s [NewCounterSampleBufferWithDescriptorError] method. See Creating a counter sample buffer to store a GPU’s counter data during a pass.
Each new sample counter buffer inherits the values of the descriptor’s properties when you create it. You can modify a descriptor and reuse it to create other counter sample buffers, which has no effect on existing counter sample buffers.
Configuring a descriptor for a counter sample buffer ¶
- MTLCounterSampleBufferDescriptor.CounterSet: A GPU device’s counter set instance that you want to sample.
- MTLCounterSampleBufferDescriptor.SetCounterSet
- MTLCounterSampleBufferDescriptor.Label: The name for the counter sample buffer you create with the descriptor.
- MTLCounterSampleBufferDescriptor.SetLabel
- MTLCounterSampleBufferDescriptor.SampleCount: The number of instances of a counter set’s data that a counter sample buffer can store.
- MTLCounterSampleBufferDescriptor.SetSampleCount
- MTLCounterSampleBufferDescriptor.StorageMode: The memory storage mode for the counter sample buffers you create with the descriptor.
- MTLCounterSampleBufferDescriptor.SetStorageMode
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBufferDescriptor
func MTLCounterSampleBufferDescriptorFromID ¶
func MTLCounterSampleBufferDescriptorFromID(id objc.ID) MTLCounterSampleBufferDescriptor
MTLCounterSampleBufferDescriptorFromID constructs a MTLCounterSampleBufferDescriptor from an objc.ID.
A group of properties that configures the counter sample buffers you create with it.
func NewMTLCounterSampleBufferDescriptor ¶
func NewMTLCounterSampleBufferDescriptor() MTLCounterSampleBufferDescriptor
NewMTLCounterSampleBufferDescriptor creates a new MTLCounterSampleBufferDescriptor instance.
func (MTLCounterSampleBufferDescriptor) Autorelease ¶
func (c MTLCounterSampleBufferDescriptor) Autorelease() MTLCounterSampleBufferDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLCounterSampleBufferDescriptor) CounterSet ¶
func (c MTLCounterSampleBufferDescriptor) CounterSet() MTLCounterSet
A GPU device’s counter set instance that you want to sample.
Discussion ¶
Assign this property to one of the counter sets in an MTLDevice instance’s counterSets property.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBufferDescriptor/counterSet
func (MTLCounterSampleBufferDescriptor) Init ¶
func (c MTLCounterSampleBufferDescriptor) Init() MTLCounterSampleBufferDescriptor
Init initializes the instance.
func (MTLCounterSampleBufferDescriptor) Label ¶
func (c MTLCounterSampleBufferDescriptor) Label() string
The name for the counter sample buffer you create with the descriptor.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBufferDescriptor/label
func (MTLCounterSampleBufferDescriptor) MTLCounterDontSample ¶
func (c MTLCounterSampleBufferDescriptor) MTLCounterDontSample() int
A sentinel value that instructs an encoder to skip sampling a counter as the GPU runs the encoder’s pass.
See: https://developer.apple.com/documentation/metal/mtlcounterdontsample
func (MTLCounterSampleBufferDescriptor) SampleCount ¶
func (c MTLCounterSampleBufferDescriptor) SampleCount() uint
The number of instances of a counter set’s data that a counter sample buffer can store.
Discussion ¶
The counter sample buffer instances you create with the MTLCounterSampleBufferDescriptor can store [SampleCount] instances of a counter set.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBufferDescriptor/sampleCount
func (MTLCounterSampleBufferDescriptor) SetCounterSet ¶
func (c MTLCounterSampleBufferDescriptor) SetCounterSet(value MTLCounterSet)
func (MTLCounterSampleBufferDescriptor) SetLabel ¶
func (c MTLCounterSampleBufferDescriptor) SetLabel(value string)
func (MTLCounterSampleBufferDescriptor) SetMTLCounterDontSample ¶
func (c MTLCounterSampleBufferDescriptor) SetMTLCounterDontSample(value int)
func (MTLCounterSampleBufferDescriptor) SetSampleCount ¶
func (c MTLCounterSampleBufferDescriptor) SetSampleCount(value uint)
func (MTLCounterSampleBufferDescriptor) SetStorageMode ¶
func (c MTLCounterSampleBufferDescriptor) SetStorageMode(value MTLStorageMode)
func (MTLCounterSampleBufferDescriptor) StorageMode ¶
func (c MTLCounterSampleBufferDescriptor) StorageMode() MTLStorageMode
The memory storage mode for the counter sample buffers you create with the descriptor.
Discussion ¶
To access a counter sample buffer with the CPU, set this property to [StorageModeShared], otherwise [StorageModePrivate].
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBufferDescriptor/storageMode
type MTLCounterSampleBufferDescriptorClass ¶
type MTLCounterSampleBufferDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLCounterSampleBufferDescriptorClass ¶
func GetMTLCounterSampleBufferDescriptorClass() MTLCounterSampleBufferDescriptorClass
GetMTLCounterSampleBufferDescriptorClass returns the class object for MTLCounterSampleBufferDescriptor.
func (MTLCounterSampleBufferDescriptorClass) Alloc ¶
func (mc MTLCounterSampleBufferDescriptorClass) Alloc() MTLCounterSampleBufferDescriptor
Alloc allocates memory for a new instance of the class.
type MTLCounterSampleBufferError ¶
type MTLCounterSampleBufferError int
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBufferError-swift.struct/Code
const ( // MTLCounterSampleBufferErrorInternal: An error code that indicates the Metal framework has an internal problem. MTLCounterSampleBufferErrorInternal MTLCounterSampleBufferError = 2 // MTLCounterSampleBufferErrorInvalid: An error code that indicates when a counter-sample buffer descriptor has at least one invalid property. MTLCounterSampleBufferErrorInvalid MTLCounterSampleBufferError = 1 // MTLCounterSampleBufferErrorOutOfMemory: An error code that indicates the GPU device doesn’t have sufficient memory to create a counter sample buffer. MTLCounterSampleBufferErrorOutOfMemory MTLCounterSampleBufferError = 0 )
func (MTLCounterSampleBufferError) String ¶
func (e MTLCounterSampleBufferError) String() string
type MTLCounterSampleBufferObject ¶
type MTLCounterSampleBufferObject struct {
objectivec.Object
}
MTLCounterSampleBufferObject wraps an existing Objective-C object that conforms to the MTLCounterSampleBuffer protocol.
func MTLCounterSampleBufferObjectFromID ¶
func MTLCounterSampleBufferObjectFromID(id objc.ID) MTLCounterSampleBufferObject
MTLCounterSampleBufferObjectFromID constructs a MTLCounterSampleBufferObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCounterSampleBufferObject) BaseObject ¶
func (o MTLCounterSampleBufferObject) BaseObject() objectivec.Object
func (MTLCounterSampleBufferObject) Device ¶
func (o MTLCounterSampleBufferObject) Device() MTLDevice
The GPU device instance that owns the counter sample buffer.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/device
func (MTLCounterSampleBufferObject) Label ¶
func (o MTLCounterSampleBufferObject) Label() string
A string that identifies the counter sample buffer.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/label
func (MTLCounterSampleBufferObject) ResolveCounterRange ¶
func (o MTLCounterSampleBufferObject) ResolveCounterRange(range_ foundation.NSRange) foundation.INSData
Transforms samples of a GPU’s counter set from the driver’s internal format to a standard Metal data structure.
range: A range that indicates which sample instances the method resolves in the counter sample buffer.
Return Value ¶
An NSData instance if the method successfully resolves the range of samples in the buffer; otherwise, `nil`.
Discussion ¶
You can only call this method on a counter sample buffer that you create with [StorageModeShared] (see [StorageMode]). For an example of how and when to use this method, see Converting a GPU’s counter data into a readable format.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/resolveCounterRange:
func (MTLCounterSampleBufferObject) SampleCount ¶
func (o MTLCounterSampleBufferObject) SampleCount() uint
The number of samples in the buffer.
See: https://developer.apple.com/documentation/Metal/MTLCounterSampleBuffer/sampleCount
type MTLCounterSamplingPoint ¶
type MTLCounterSamplingPoint int
See: https://developer.apple.com/documentation/Metal/MTLCounterSamplingPoint
const ( // MTLCounterSamplingPointAtBlitBoundary: Counter sampling is allowed between blit commands in a blit pass. MTLCounterSamplingPointAtBlitBoundary MTLCounterSamplingPoint = 4 // MTLCounterSamplingPointAtDispatchBoundary: Counter sampling is allowed between kernel dispatches in a compute pass. MTLCounterSamplingPointAtDispatchBoundary MTLCounterSamplingPoint = 2 // MTLCounterSamplingPointAtDrawBoundary: Counter sampling is allowed between draw commands in a render pass. MTLCounterSamplingPointAtDrawBoundary MTLCounterSamplingPoint = 1 // MTLCounterSamplingPointAtStageBoundary: Counter sampling is allowed at the start and end of a render pass’s vertex and fragment stages, and at the start and end of compute and blit passes. MTLCounterSamplingPointAtStageBoundary MTLCounterSamplingPoint = 0 // MTLCounterSamplingPointAtTileDispatchBoundary: Counter sampling is allowed between tile dispatches in a render pass. MTLCounterSamplingPointAtTileDispatchBoundary MTLCounterSamplingPoint = 3 )
func (MTLCounterSamplingPoint) String ¶
func (e MTLCounterSamplingPoint) String() string
type MTLCounterSet ¶
type MTLCounterSet interface {
objectivec.IObject
// The name of the GPU’s counter set instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLCounterSet/name
Name() string
// An array of the counter instances a GPU device supports.
//
// See: https://developer.apple.com/documentation/Metal/MTLCounterSet/counters
Counters() []objectivec.IObject
}
A collection of individual counters a GPU device supports for a counter set.
See: https://developer.apple.com/documentation/Metal/MTLCounterSet
type MTLCounterSetObject ¶
type MTLCounterSetObject struct {
objectivec.Object
}
MTLCounterSetObject wraps an existing Objective-C object that conforms to the MTLCounterSet protocol.
func MTLCounterSetObjectFromID ¶
func MTLCounterSetObjectFromID(id objc.ID) MTLCounterSetObject
MTLCounterSetObjectFromID constructs a MTLCounterSetObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLCounterSetObject) BaseObject ¶
func (o MTLCounterSetObject) BaseObject() objectivec.Object
func (MTLCounterSetObject) Counters ¶
func (o MTLCounterSetObject) Counters() []objectivec.IObject
An array of the counter instances a GPU device supports.
See: https://developer.apple.com/documentation/Metal/MTLCounterSet/counters
func (MTLCounterSetObject) Name ¶
func (o MTLCounterSetObject) Name() string
The name of the GPU’s counter set instance.
See: https://developer.apple.com/documentation/Metal/MTLCounterSet/name
type MTLCullMode ¶
type MTLCullMode int
See: https://developer.apple.com/documentation/Metal/MTLCullMode
const ( // MTLCullModeBack: Culls back-facing primitives. MTLCullModeBack MTLCullMode = 2 // MTLCullModeFront: Culls front-facing primitives. MTLCullModeFront MTLCullMode = 1 // MTLCullModeNone: Does not cull any primitives. MTLCullModeNone MTLCullMode = 0 )
func (MTLCullMode) String ¶
func (e MTLCullMode) String() string
type MTLCurveBasis ¶
type MTLCurveBasis int
See: https://developer.apple.com/documentation/Metal/MTLCurveBasis
const ( MTLCurveBasisBSpline MTLCurveBasis = 0 MTLCurveBasisBezier MTLCurveBasis = 3 MTLCurveBasisCatmullRom MTLCurveBasis = 1 MTLCurveBasisLinear MTLCurveBasis = 2 )
func (MTLCurveBasis) String ¶
func (e MTLCurveBasis) String() string
type MTLCurveEndCaps ¶
type MTLCurveEndCaps int
See: https://developer.apple.com/documentation/Metal/MTLCurveEndCaps
const ( MTLCurveEndCapsDisk MTLCurveEndCaps = 1 MTLCurveEndCapsNone MTLCurveEndCaps = 0 MTLCurveEndCapsSphere MTLCurveEndCaps = 2 )
func (MTLCurveEndCaps) String ¶
func (e MTLCurveEndCaps) String() string
type MTLCurveType ¶
type MTLCurveType int
See: https://developer.apple.com/documentation/Metal/MTLCurveType
const ( MTLCurveTypeFlat MTLCurveType = 1 MTLCurveTypeRound MTLCurveType = 0 )
func (MTLCurveType) String ¶
func (e MTLCurveType) String() string
type MTLDataType ¶
type MTLDataType int
See: https://developer.apple.com/documentation/Metal/MTLDataType
const ( // MTLDataTypeArray: An array instance. MTLDataTypeArray MTLDataType = 2 // MTLDataTypeBFloat: A 16-bit, brain floating-point value. MTLDataTypeBFloat MTLDataType = 121 // MTLDataTypeBFloat2: A two-component vector with 16-bit, brain floating-point values. MTLDataTypeBFloat2 MTLDataType = 122 // MTLDataTypeBFloat3: A three-component vector with 16-bit, brain floating-point values. MTLDataTypeBFloat3 MTLDataType = 123 // MTLDataTypeBFloat4: A four-component vector with 16-bit, brain floating-point values. MTLDataTypeBFloat4 MTLDataType = 124 // MTLDataTypeBool: A Boolean value. MTLDataTypeBool MTLDataType = 53 // MTLDataTypeBool2: A two-component Boolean vector. MTLDataTypeBool2 MTLDataType = 54 // MTLDataTypeBool3: A three-component Boolean vector. MTLDataTypeBool3 MTLDataType = 55 // MTLDataTypeBool4: A four-component Boolean vector. MTLDataTypeBool4 MTLDataType = 56 // MTLDataTypeChar: An 8-bit, signed integer value. MTLDataTypeChar MTLDataType = 45 // MTLDataTypeChar2: A two-component vector with 8-bit, signed integer values. MTLDataTypeChar2 MTLDataType = 46 // MTLDataTypeChar3: A three-component vector with 8-bit, signed integer values. MTLDataTypeChar3 MTLDataType = 47 // MTLDataTypeChar4: A four-component vector with 8-bit, signed integer values. MTLDataTypeChar4 MTLDataType = 48 // MTLDataTypeComputePipeline: A Metal compute pipeline instance. MTLDataTypeComputePipeline MTLDataType = 79 // MTLDataTypeDepthStencilState: Represents a data type corresponding to a depth-stencil state object. MTLDataTypeDepthStencilState MTLDataType = 139 // MTLDataTypeFloat: A 32-bit floating-point value. MTLDataTypeFloat MTLDataType = 3 // MTLDataTypeFloat2: A two-component vector with 32-bit floating-point values. MTLDataTypeFloat2 MTLDataType = 4 // MTLDataTypeFloat2x2: A 2x2 component matrix with 32-bit floating-point values. MTLDataTypeFloat2x2 MTLDataType = 7 // MTLDataTypeFloat2x3: A 2x3 component matrix with 32-bit floating-point values. MTLDataTypeFloat2x3 MTLDataType = 8 // MTLDataTypeFloat2x4: A 2x4 component matrix with 32-bit floating-point values. MTLDataTypeFloat2x4 MTLDataType = 9 // MTLDataTypeFloat3: A three-component vector with 32-bit floating-point values. MTLDataTypeFloat3 MTLDataType = 5 // MTLDataTypeFloat3x2: A 3x2 component matrix with 32-bit floating-point values. MTLDataTypeFloat3x2 MTLDataType = 10 // MTLDataTypeFloat3x3: A 3x3 component matrix with 32-bit floating-point values. MTLDataTypeFloat3x3 MTLDataType = 11 // MTLDataTypeFloat3x4: A 3x4 component matrix with 32-bit floating-point values. MTLDataTypeFloat3x4 MTLDataType = 12 // MTLDataTypeFloat4: A four-component vector with 32-bit floating-point values. MTLDataTypeFloat4 MTLDataType = 6 // MTLDataTypeFloat4x2: A 4x2 component matrix with 32-bit floating-point values. MTLDataTypeFloat4x2 MTLDataType = 13 // MTLDataTypeFloat4x3: A 4x3 component matrix with 32-bit floating-point values. MTLDataTypeFloat4x3 MTLDataType = 14 // MTLDataTypeFloat4x4: A 4x4 component matrix with 32-bit floating-point values. MTLDataTypeFloat4x4 MTLDataType = 15 // MTLDataTypeHalf: A 16-bit floating-point value. MTLDataTypeHalf MTLDataType = 16 // MTLDataTypeHalf2: A two-component vector with 16-bit floating-point values. MTLDataTypeHalf2 MTLDataType = 17 // MTLDataTypeHalf2x2: A 2x2 component matrix with 16-bit floating-point values. MTLDataTypeHalf2x2 MTLDataType = 20 // MTLDataTypeHalf2x3: A 2x3 component matrix with 16-bit floating-point values. MTLDataTypeHalf2x3 MTLDataType = 21 // MTLDataTypeHalf2x4: A 2x4 component matrix with 16-bit floating-point values. MTLDataTypeHalf2x4 MTLDataType = 22 // MTLDataTypeHalf3: A three-component vector with 16-bit floating-point values. MTLDataTypeHalf3 MTLDataType = 18 // MTLDataTypeHalf3x2: A 3x2 component matrix with 16-bit floating-point values. MTLDataTypeHalf3x2 MTLDataType = 23 // MTLDataTypeHalf3x3: A 3x3 component matrix with 16-bit floating-point values. MTLDataTypeHalf3x3 MTLDataType = 24 // MTLDataTypeHalf3x4: A 3x4 component matrix with 16-bit floating-point values. MTLDataTypeHalf3x4 MTLDataType = 25 // MTLDataTypeHalf4: A four-component vector with 16-bit floating-point values. MTLDataTypeHalf4 MTLDataType = 19 // MTLDataTypeHalf4x2: A 4x2 component matrix with 16-bit floating-point values. MTLDataTypeHalf4x2 MTLDataType = 26 // MTLDataTypeHalf4x3: A 4x3 component matrix with 16-bit floating-point values. MTLDataTypeHalf4x3 MTLDataType = 27 // MTLDataTypeHalf4x4: A 4x4 component matrix with 16-bit floating-point values. MTLDataTypeHalf4x4 MTLDataType = 28 // MTLDataTypeIndirectCommandBuffer: An indirect command buffer resource instance. MTLDataTypeIndirectCommandBuffer MTLDataType = 80 // MTLDataTypeInstanceAccelerationStructure: A high-level, ray-tracing acceleration structure for a set of low-level primitive instances. MTLDataTypeInstanceAccelerationStructure MTLDataType = 118 // MTLDataTypeInt: A 32-bit, signed integer value. MTLDataTypeInt MTLDataType = 29 // MTLDataTypeInt2: A two-component vector with 32-bit, signed integer values. MTLDataTypeInt2 MTLDataType = 30 // MTLDataTypeInt3: A three-component vector with 32-bit, signed integer values. MTLDataTypeInt3 MTLDataType = 31 // MTLDataTypeInt4: A four-component vector with 32-bit, signed integer values. MTLDataTypeInt4 MTLDataType = 32 // MTLDataTypeIntersectionFunctionTable: A table of intersection functions that a render or compute pipeline can call. MTLDataTypeIntersectionFunctionTable MTLDataType = 116 // MTLDataTypeLong: A 64-bit, signed integer value. MTLDataTypeLong MTLDataType = 81 // MTLDataTypeLong2: A two-component vector with 64-bit, signed integer values. MTLDataTypeLong2 MTLDataType = 82 // MTLDataTypeLong3: A three-component vector with 64-bit, signed integer values. MTLDataTypeLong3 MTLDataType = 83 // MTLDataTypeLong4: A four-component vector with 64-bit, signed integer values. MTLDataTypeLong4 MTLDataType = 84 // MTLDataTypeNone: A sentinel value that represents a GPU function parameter that doesn’t have a valid data type. MTLDataTypeNone MTLDataType = 0 // MTLDataTypePointer: A pointer. MTLDataTypePointer MTLDataType = 60 // MTLDataTypePrimitiveAccelerationStructure: A low-level ray-tracing acceleration structure for a set of primitives. MTLDataTypePrimitiveAccelerationStructure MTLDataType = 117 // MTLDataTypeR16Snorm: An ordinary pixel with one component that’s a 16-bit, normalized, signed integer value. MTLDataTypeR16Snorm MTLDataType = 65 // MTLDataTypeR16Unorm: An ordinary pixel with one component that’s a 16-bit, normalized, unsigned integer value. MTLDataTypeR16Unorm MTLDataType = 64 // MTLDataTypeR8Snorm: An ordinary pixel with one component that’s an 8-bit, normalized, signed integer value. MTLDataTypeR8Snorm MTLDataType = 63 // MTLDataTypeR8Unorm: An ordinary pixel with one component that’s an 8-bit, normalized, unsigned integer value. MTLDataTypeR8Unorm MTLDataType = 62 // MTLDataTypeRG11B10Float: A packed 32-bit format with three floating-point color components, two of which are 11-bit values, and one is a 10-bit value. MTLDataTypeRG11B10Float MTLDataType = 76 // MTLDataTypeRG16Snorm: An ordinary pixel with two components, each of which is a 16-bit, normalized, signed integer value. MTLDataTypeRG16Snorm MTLDataType = 69 // MTLDataTypeRG16Unorm: An ordinary pixel with two components, each of which is a 16-bit, normalized, unsigned integer value. MTLDataTypeRG16Unorm MTLDataType = 68 // MTLDataTypeRG8Snorm: An ordinary pixel with two components, each of which is an 8-bit, normalized, signed integer value. MTLDataTypeRG8Snorm MTLDataType = 67 // MTLDataTypeRG8Unorm: An ordinary pixel with two components, each of which is an 8-bit, normalized, unsigned integer value. MTLDataTypeRG8Unorm MTLDataType = 66 // MTLDataTypeRGB10A2Unorm: A packed 32-bit format with three color components, each of which is a 10-bit, normalized, unsigned integer value. MTLDataTypeRGB10A2Unorm MTLDataType = 75 // MTLDataTypeRGB9E5Float: A packed 32-bit format with three color components, each of which is a 9-bit floating-point value. MTLDataTypeRGB9E5Float MTLDataType = 77 // MTLDataTypeRGBA16Snorm: An ordinary pixel with four components, each of which is a 16-bit, normalized, signed integer value. MTLDataTypeRGBA16Snorm MTLDataType = 74 // MTLDataTypeRGBA16Unorm: An ordinary pixel with four components, each of which is a 16-bit, normalized, unsigned integer value. MTLDataTypeRGBA16Unorm MTLDataType = 73 // MTLDataTypeRGBA8Snorm: An ordinary pixel with four components, each of which is an 8-bit, normalized, signed integer value. MTLDataTypeRGBA8Snorm MTLDataType = 72 // MTLDataTypeRGBA8Unorm: An ordinary pixel with four components, each of which is an 8-bit, normalized, unsigned integer value. MTLDataTypeRGBA8Unorm MTLDataType = 70 // MTLDataTypeRGBA8Unorm_sRGB: An ordinary pixel with four components, each of which is an 8-bit, normalized, unsigned integer value in the sRGB color space. MTLDataTypeRGBA8Unorm_sRGB MTLDataType = 71 // MTLDataTypeRenderPipeline: A Metal render pipeline instance. MTLDataTypeRenderPipeline MTLDataType = 78 // MTLDataTypeSampler: A Metal texture sampler instance. MTLDataTypeSampler MTLDataType = 59 // MTLDataTypeShort: A 16-bit, signed integer value. MTLDataTypeShort MTLDataType = 37 // MTLDataTypeShort2: A two-component vector with 16-bit, signed integer values. MTLDataTypeShort2 MTLDataType = 38 // MTLDataTypeShort3: A three-component vector with 16-bit, signed integer values. MTLDataTypeShort3 MTLDataType = 39 // MTLDataTypeShort4: A four-component vector with 16-bit, signed integer values. MTLDataTypeShort4 MTLDataType = 40 // MTLDataTypeStruct: A structure instance. MTLDataTypeStruct MTLDataType = 1 // MTLDataTypeTensor: Represents a data type corresponding to a machine learning tensor. MTLDataTypeTensor MTLDataType = 140 // MTLDataTypeTexture: A Metal texture resource instance. MTLDataTypeTexture MTLDataType = 58 // MTLDataTypeUChar: An 8-bit, unsigned integer value. MTLDataTypeUChar MTLDataType = 49 // MTLDataTypeUChar2: A two-component vector with 8-bit, unsigned integer values. MTLDataTypeUChar2 MTLDataType = 50 // MTLDataTypeUChar3: A three-component vector with 8-bit, unsigned integer values. MTLDataTypeUChar3 MTLDataType = 51 // MTLDataTypeUChar4: A four-component vector with 8-bit, unsigned integer values. MTLDataTypeUChar4 MTLDataType = 52 // MTLDataTypeUInt: A 32-bit, unsigned integer value. MTLDataTypeUInt MTLDataType = 33 // MTLDataTypeUInt2: A two-component vector with 32-bit, unsigned integer values. MTLDataTypeUInt2 MTLDataType = 34 // MTLDataTypeUInt3: A three-component vector with 32-bit, unsigned integer values. MTLDataTypeUInt3 MTLDataType = 35 // MTLDataTypeUInt4: A four-component vector with 32-bit, unsigned integer values. MTLDataTypeUInt4 MTLDataType = 36 // MTLDataTypeULong: A 64-bit, unsigned integer value. MTLDataTypeULong MTLDataType = 85 // MTLDataTypeULong2: A two-component vector with 64-bit, unsigned integer values. MTLDataTypeULong2 MTLDataType = 86 // MTLDataTypeULong3: A three-component vector with 64-bit, unsigned integer values. MTLDataTypeULong3 MTLDataType = 87 // MTLDataTypeULong4: A four-component vector with 64-bit, unsigned integer values. MTLDataTypeULong4 MTLDataType = 88 // MTLDataTypeUShort: A 16-bit, unsigned integer value. MTLDataTypeUShort MTLDataType = 41 // MTLDataTypeUShort2: A two-component vector with 16-bit, unsigned integer values. MTLDataTypeUShort2 MTLDataType = 42 // MTLDataTypeUShort3: A three-component vector with 16-bit, unsigned integer values. MTLDataTypeUShort3 MTLDataType = 43 // MTLDataTypeUShort4: A four-component vector with 16-bit, unsigned integer values. MTLDataTypeUShort4 MTLDataType = 44 // MTLDataTypeVisibleFunctionTable: A table of visible functions that a render or compute pipeline can call. MTLDataTypeVisibleFunctionTable MTLDataType = 115 )
func (MTLDataType) String ¶
func (e MTLDataType) String() string
type MTLDepthClipMode ¶
type MTLDepthClipMode int
See: https://developer.apple.com/documentation/Metal/MTLDepthClipMode
const ( // MTLDepthClipModeClamp: Clamp fragments outside the near or far planes. MTLDepthClipModeClamp MTLDepthClipMode = 1 // MTLDepthClipModeClip: Clip fragments outside the near or far planes. MTLDepthClipModeClip MTLDepthClipMode = 0 )
func (MTLDepthClipMode) String ¶
func (e MTLDepthClipMode) String() string
type MTLDepthStencilDescriptor ¶
type MTLDepthStencilDescriptor struct {
objectivec.Object
}
An instance that configures new MTLDepthStencilState instances.
Overview ¶
An MTLDepthStencilDescriptor instance is used to define a specific configuration of the depth and stencil stages of a rendering pipeline. To create an MTLDepthStencilDescriptor instance, use standard allocation and initialization techniques.
To enable writing the depth value to a depth attachment, set the depthWriteEnabled property to true.
The depthCompareFunction property specifies how the depth test is performed. If a fragment’s depth value fails the depth test, the fragment is discarded. [CompareFunctionLess] is a commonly used value for MTLDepthStencilDescriptor.DepthCompareFunction, because fragment values that are farther away from the viewer than the pixel depth value (a previously written fragment) fail the depth test and are considered occluded by the earlier depth value.
The MTLDepthStencilDescriptor.FrontFaceStencil and MTLDepthStencilDescriptor.BackFaceStencil properties define two independent stencil descriptors: one for front-facing primitives and the other for back-facing primitives, respectively. Both properties can be set to the same MTLStencilDescriptor instance.
Specifying depth operations ¶
- MTLDepthStencilDescriptor.DepthCompareFunction: The comparison that is performed between a fragment’s depth value and the depth value in the attachment, which determines whether to discard the fragment.
- MTLDepthStencilDescriptor.SetDepthCompareFunction
- MTLDepthStencilDescriptor.DepthWriteEnabled: A Boolean value that indicates whether depth values can be written to the depth attachment.
- MTLDepthStencilDescriptor.SetDepthWriteEnabled
Specifying stencil descriptors for primitives ¶
- MTLDepthStencilDescriptor.BackFaceStencil: The stencil descriptor for back-facing primitives.
- MTLDepthStencilDescriptor.SetBackFaceStencil
- MTLDepthStencilDescriptor.FrontFaceStencil: The stencil descriptor for front-facing primitives.
- MTLDepthStencilDescriptor.SetFrontFaceStencil
Identifying properties ¶
- MTLDepthStencilDescriptor.Label: A string that identifies this object.
- MTLDepthStencilDescriptor.SetLabel
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilDescriptor
func MTLDepthStencilDescriptorFromID ¶
func MTLDepthStencilDescriptorFromID(id objc.ID) MTLDepthStencilDescriptor
MTLDepthStencilDescriptorFromID constructs a MTLDepthStencilDescriptor from an objc.ID.
An instance that configures new MTLDepthStencilState instances.
func NewMTLDepthStencilDescriptor ¶
func NewMTLDepthStencilDescriptor() MTLDepthStencilDescriptor
NewMTLDepthStencilDescriptor creates a new MTLDepthStencilDescriptor instance.
func (MTLDepthStencilDescriptor) Autorelease ¶
func (d MTLDepthStencilDescriptor) Autorelease() MTLDepthStencilDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLDepthStencilDescriptor) BackFaceStencil ¶
func (d MTLDepthStencilDescriptor) BackFaceStencil() IMTLStencilDescriptor
The stencil descriptor for back-facing primitives.
Discussion ¶
The default value is `nil`, which indicates the stencil test is disabled for the back-facing primitives. For more information, see MTLStencilDescriptor.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilDescriptor/backFaceStencil
func (MTLDepthStencilDescriptor) DepthCompareFunction ¶
func (d MTLDepthStencilDescriptor) DepthCompareFunction() MTLCompareFunction
The comparison that is performed between a fragment’s depth value and the depth value in the attachment, which determines whether to discard the fragment.
Discussion ¶
The default value is [CompareFunctionAlways], which indicates that the depth test always passes and the fragment remains a candidate to replace the data at the specified location. For more information on possible values, see MTLCompareFunction.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilDescriptor/depthCompareFunction
func (MTLDepthStencilDescriptor) DepthWriteEnabled ¶
func (d MTLDepthStencilDescriptor) DepthWriteEnabled() bool
A Boolean value that indicates whether depth values can be written to the depth attachment.
Discussion ¶
The default value is false, which indicates the depth attachment is read-only.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilDescriptor/isDepthWriteEnabled
func (MTLDepthStencilDescriptor) FrontFaceStencil ¶
func (d MTLDepthStencilDescriptor) FrontFaceStencil() IMTLStencilDescriptor
The stencil descriptor for front-facing primitives.
Discussion ¶
The default value is `nil`, which indicates the stencil test is disabled for the front-facing primitives. For more information, see MTLStencilDescriptor.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilDescriptor/frontFaceStencil
func (MTLDepthStencilDescriptor) Init ¶
func (d MTLDepthStencilDescriptor) Init() MTLDepthStencilDescriptor
Init initializes the instance.
func (MTLDepthStencilDescriptor) Label ¶
func (d MTLDepthStencilDescriptor) Label() string
A string that identifies this object.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilDescriptor/label
func (MTLDepthStencilDescriptor) SetBackFaceStencil ¶
func (d MTLDepthStencilDescriptor) SetBackFaceStencil(value IMTLStencilDescriptor)
func (MTLDepthStencilDescriptor) SetDepthCompareFunction ¶
func (d MTLDepthStencilDescriptor) SetDepthCompareFunction(value MTLCompareFunction)
func (MTLDepthStencilDescriptor) SetDepthWriteEnabled ¶
func (d MTLDepthStencilDescriptor) SetDepthWriteEnabled(value bool)
func (MTLDepthStencilDescriptor) SetFrontFaceStencil ¶
func (d MTLDepthStencilDescriptor) SetFrontFaceStencil(value IMTLStencilDescriptor)
func (MTLDepthStencilDescriptor) SetLabel ¶
func (d MTLDepthStencilDescriptor) SetLabel(value string)
type MTLDepthStencilDescriptorClass ¶
type MTLDepthStencilDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLDepthStencilDescriptorClass ¶
func GetMTLDepthStencilDescriptorClass() MTLDepthStencilDescriptorClass
GetMTLDepthStencilDescriptorClass returns the class object for MTLDepthStencilDescriptor.
func (MTLDepthStencilDescriptorClass) Alloc ¶
func (mc MTLDepthStencilDescriptorClass) Alloc() MTLDepthStencilDescriptor
Alloc allocates memory for a new instance of the class.
type MTLDepthStencilState ¶
type MTLDepthStencilState interface {
objectivec.IObject
// The device from which this state object was created.
//
// See: https://developer.apple.com/documentation/Metal/MTLDepthStencilState/device
Device() MTLDevice
// A string that identifies this object.
//
// See: https://developer.apple.com/documentation/Metal/MTLDepthStencilState/label
Label() string
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLDepthStencilState/gpuResourceID
GpuResourceID() MTLResourceID
}
A depth and stencil state instance that specifies the depth and stencil configuration and operations used in a render pass.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilState
type MTLDepthStencilStateObject ¶
type MTLDepthStencilStateObject struct {
objectivec.Object
}
MTLDepthStencilStateObject wraps an existing Objective-C object that conforms to the MTLDepthStencilState protocol.
func MTLDepthStencilStateObjectFromID ¶
func MTLDepthStencilStateObjectFromID(id objc.ID) MTLDepthStencilStateObject
MTLDepthStencilStateObjectFromID constructs a MTLDepthStencilStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLDepthStencilStateObject) BaseObject ¶
func (o MTLDepthStencilStateObject) BaseObject() objectivec.Object
func (MTLDepthStencilStateObject) Device ¶
func (o MTLDepthStencilStateObject) Device() MTLDevice
The device from which this state object was created.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilState/device
func (MTLDepthStencilStateObject) GpuResourceID ¶
func (o MTLDepthStencilStateObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilState/gpuResourceID
func (MTLDepthStencilStateObject) Label ¶
func (o MTLDepthStencilStateObject) Label() string
A string that identifies this object.
See: https://developer.apple.com/documentation/Metal/MTLDepthStencilState/label
type MTLDevice ¶
type MTLDevice interface {
objectivec.IObject
// The maximum number of concurrent compilation tasks the device is running.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/maximumConcurrentCompilationTaskCount
MaximumConcurrentCompilationTaskCount() uint
// A Boolean value that indicates whether the device uses additional CPU threads for compilation tasks.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/shouldMaximizeConcurrentCompilation
ShouldMaximizeConcurrentCompilation() bool
// FunctionHandleWithFunction protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/functionHandle(function:)-4bw39
FunctionHandleWithFunction(function MTLFunction) MTLFunctionHandle
// Get the function handle for the specified binary-linked function from the pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/functionHandle(function:)-w9ia
FunctionHandleWithBinaryFunction(function MTL4BinaryFunction) MTLFunctionHandle
// Creates a new archive from data available at an [NSURL] address.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArchive(url:)
NewArchiveWithURLError(url foundation.INSURL) (MTL4Archive, error)
// Creates a new argument table from an argument table descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArgumentTable(descriptor:)
NewArgumentTableWithDescriptorError(descriptor IMTL4ArgumentTableDescriptor) (MTL4ArgumentTable, error)
// Creates a new placement sparse buffer of a specific length.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBuffer(length:options:placementSparsePageSize:)
NewBufferWithLengthOptionsPlacementSparsePageSize(length uint, options MTLResourceOptions, placementSparsePageSize MTLSparsePageSize) MTLBuffer
// Creates a new command allocator.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandAllocator()
NewCommandAllocator() MTL4CommandAllocator
// Creates a new command allocator from a command allocator descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandAllocator(descriptor:)
NewCommandAllocatorWithDescriptorError(descriptor IMTL4CommandAllocatorDescriptor) (MTL4CommandAllocator, error)
// Creates a new command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandBuffer()
NewCommandBuffer() MTL4CommandBuffer
// Creates a command queue with the provided configuration.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandQueue(descriptor:)
NewCommandQueueWithDescriptor(descriptor IMTLCommandQueueDescriptor) MTLCommandQueue
// Creates a new compiler from a compiler descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCompiler(descriptor:)
NewCompilerWithDescriptorError(descriptor IMTL4CompilerDescriptor) (MTL4Compiler, error)
// Creates a new counter heap configured from a counter heap descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCounterHeap(descriptor:)
NewCounterHeapWithDescriptorError(descriptor IMTL4CounterHeapDescriptor) (MTL4CounterHeap, error)
// Creates a shader log state with the provided configuration.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLogState(descriptor:)
NewLogStateWithDescriptorError(descriptor IMTLLogStateDescriptor) (MTLLogState, error)
// Creates a new command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeMTL4CommandQueue()
NewMTL4CommandQueue() MTL4CommandQueue
// Creates a new command queue from a queue descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeMTL4CommandQueue(descriptor:)
NewMTL4CommandQueueWithDescriptorError(descriptor IMTL4CommandQueueDescriptor) (MTL4CommandQueue, error)
// Creates a new pipeline data set serializer instance from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makePipelineDataSetSerializer(descriptor:)
NewPipelineDataSetSerializerWithDescriptor(descriptor IMTL4PipelineDataSetSerializerDescriptor) MTL4PipelineDataSetSerializer
// Creates a tensor by allocating new memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTensor(descriptor:)
NewTensorWithDescriptorError(descriptor IMTLTensorDescriptor) (MTLTensor, error)
// Creates a new texture view pool from a resource view pool descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTextureViewPool(descriptor:)
NewTextureViewPoolWithDescriptorError(descriptor IMTLResourceViewPoolDescriptor) (MTLTextureViewPool, error)
// Queries the frequency of the GPU timestamp in ticks per second.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/queryTimestampFrequency()
QueryTimestampFrequency() uint64
// Returns the size, in bytes, of each entry in a counter heap of a specific counter heap type when your app resolves it into a usable format.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/size(ofCounterHeapEntry:)
SizeOfCounterHeapEntry(type_ MTL4CounterHeapType) uint
// Determines the size and alignment required to hold the data of a tensor you create with a descriptor in a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/tensorSizeAndAlign(descriptor:)
TensorSizeAndAlignWithDescriptor(descriptor IMTLTensorDescriptor) MTLSizeAndAlign
// Returns the buffer sizes the GPU device needs to build, refit, and store an acceleration structure.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/accelerationStructureSizes(descriptor:)
AccelerationStructureSizesWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructureSizes
// Retrieves the default sample positions for a specific sample count.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/getDefaultSamplePositions:count:
GetDefaultSamplePositionsCount(positions *MTLSamplePosition, count uint)
// Returns the size and alignment, in bytes, of an acceleration structure if you create it from a heap with a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/heapAccelerationStructureSizeAndAlign(descriptor:)
HeapAccelerationStructureSizeAndAlignWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLSizeAndAlign
// Returns the size and alignment, in bytes, of an acceleration structure if you create it from a heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/heapAccelerationStructureSizeAndAlign(size:)
HeapAccelerationStructureSizeAndAlignWithSize(size uint) MTLSizeAndAlign
// Returns the size and alignment, in bytes, of a buffer if you create it from a heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/heapBufferSizeAndAlign(length:options:)
HeapBufferSizeAndAlignWithLengthOptions(length uint, options MTLResourceOptions) MTLSizeAndAlign
// Returns the size and alignment, in bytes, of a texture if you create it from a heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/heapTextureSizeAndAlign(descriptor:)
HeapTextureSizeAndAlignWithDescriptor(desc IMTLTextureDescriptor) MTLSizeAndAlign
// Returns the minimum alignment the GPU device requires to create a linear texture from a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/minimumLinearTextureAlignment(for:)
MinimumLinearTextureAlignmentForPixelFormat(format MTLPixelFormat) uint
// Returns the minimum alignment the GPU device requires to create a texture buffer from a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/minimumTextureBufferAlignment(for:)
MinimumTextureBufferAlignmentForPixelFormat(format MTLPixelFormat) uint
// Creates a new ray-tracing acceleration structure from a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeAccelerationStructure(descriptor:)
NewAccelerationStructureWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructure
// Creates a new acceleration structure with a specific size.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeAccelerationStructure(size:)
NewAccelerationStructureWithSize(size uint) MTLAccelerationStructure
// Creates a new argument encoder for an array of arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArgumentEncoder(arguments:)
NewArgumentEncoderWithArguments(arguments []MTLArgumentDescriptor) MTLArgumentEncoder
// Creates a new argument encoder for a buffer binding.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArgumentEncoder(bufferBinding:)
NewArgumentEncoderWithBufferBinding(bufferBinding MTLBufferBinding) MTLArgumentEncoder
// Creates a Metal binary archive instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBinaryArchive(descriptor:)
NewBinaryArchiveWithDescriptorError(descriptor IMTLBinaryArchiveDescriptor) (MTLBinaryArchive, error)
// Allocates a new buffer of a given length and initializes its contents by copying existing data into it.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBuffer(bytes:length:options:)
NewBufferWithBytesLengthOptions(pointer unsafe.Pointer, length uint, options MTLResourceOptions) MTLBuffer
// Creates a buffer that wraps an existing contiguous memory allocation.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBuffer(bytesNoCopy:length:options:deallocator:)
NewBufferWithBytesNoCopyLengthOptionsDeallocator(pointer unsafe.Pointer, length uint, options MTLResourceOptions, deallocator func(unsafe.Pointer, uint64)) MTLBuffer
// Creates a buffer the method clears with zero values.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBuffer(length:options:)
NewBufferWithLengthOptions(length uint, options MTLResourceOptions) MTLBuffer
// Creates a queue you use to submit rendering and computation commands to a GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandQueue()
NewCommandQueue() MTLCommandQueue
// Creates a queue you use to submit rendering and computation commands to a GPU that has a fixed number of uncompleted command buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandQueue(maxCommandBufferCount:)
NewCommandQueueWithMaxCommandBufferCount(maxCommandBufferCount uint) MTLCommandQueue
// Asynchronously creates a compute pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeComputePipelineState(descriptor:options:completionHandler:)
NewComputePipelineStateWithDescriptorOptionsCompletionHandler(descriptor IMTLComputePipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
// Synchronously creates a compute pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeComputePipelineState(descriptor:options:reflection:)
NewComputePipelineStateWithDescriptorOptionsReflectionError(descriptor IMTLComputePipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedComputePipelineReflection) (MTLComputePipelineState, error)
// Asynchronously creates a compute pipeline state with a function instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeComputePipelineState(function:completionHandler:)
NewComputePipelineStateWithFunctionCompletionHandler(computeFunction MTLFunction, completionHandler ErrorHandler)
// Synchronously creates a compute pipeline state with a function instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeComputePipelineState(function:)
NewComputePipelineStateWithFunctionError(computeFunction MTLFunction) (MTLComputePipelineState, error)
// Asynchronously creates a compute pipeline state and reflection with a function instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeComputePipelineState(function:options:completionHandler:)
NewComputePipelineStateWithFunctionOptionsCompletionHandler(computeFunction MTLFunction, options MTLPipelineOption, completionHandler ErrorHandler)
// Synchronously creates a compute pipeline state and reflection with a function instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeComputePipelineState(function:options:reflection:)
NewComputePipelineStateWithFunctionOptionsReflectionError(computeFunction MTLFunction, options MTLPipelineOption, reflection *MTLAutoreleasedComputePipelineReflection) (MTLComputePipelineState, error)
// Creates a counter sample buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCounterSampleBuffer(descriptor:)
NewCounterSampleBufferWithDescriptorError(descriptor IMTLCounterSampleBufferDescriptor) (MTLCounterSampleBuffer, error)
// Creates a Metal library instance that contains the functions from your app’s default Metal library.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDefaultLibrary()
NewDefaultLibrary() MTLLibrary
// Creates a Metal library instance that contains the functions in a bundle’s default Metal library.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDefaultLibrary(bundle:)
NewDefaultLibraryWithBundleError(bundle foundation.NSBundle) (MTLLibrary, error)
// Creates a depth-stencil state instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDepthStencilState(descriptor:)
NewDepthStencilStateWithDescriptor(descriptor IMTLDepthStencilDescriptor) MTLDepthStencilState
// Creates a Metal dynamic library instance from a Metal library instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDynamicLibrary(library:)
NewDynamicLibraryError(library MTLLibrary) (MTLDynamicLibrary, error)
// Creates a Metal dynamic library instance that contains the functions in the Metal library file at a URL.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDynamicLibrary(url:)
NewDynamicLibraryWithURLError(url foundation.INSURL) (MTLDynamicLibrary, error)
// Creates a new event instance that you can use to synchronize commands and resources within the same GPU device.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeEvent()
NewEvent() MTLEvent
// Creates a new memory fence instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeFence()
NewFence() MTLFence
// Creates a new GPU heap instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeHeap(descriptor:)
NewHeapWithDescriptor(descriptor IMTLHeapDescriptor) MTLHeap
// Creates an input/output command queue you use to submit commands that load assets from the file system into GPU resources or system memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeIOCommandQueue(descriptor:)
NewIOCommandQueueWithDescriptorError(descriptor IMTLIOCommandQueueDescriptor) (MTLIOCommandQueue, error)
// Creates an input/output file handle instance that represents a compressed file at a URL.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeIOFileHandle(url:compressionMethod:)
NewIOFileHandleWithURLCompressionMethodError(url foundation.INSURL, compressionMethod MTLIOCompressionMethod) (MTLIOFileHandle, error)
// Creates an input/output file handle instance that represents a file at a URL.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeIOFileHandle(url:)
NewIOFileHandleWithURLError(url foundation.INSURL) (MTLIOFileHandle, error)
// Creates an indirect command buffer instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeIndirectCommandBuffer(descriptor:maxCommandCount:options:)
NewIndirectCommandBufferWithDescriptorMaxCommandCountOptions(descriptor IMTLIndirectCommandBufferDescriptor, maxCount uint, options MTLResourceOptions) MTLIndirectCommandBuffer
// Creates a Metal library instance from a dispatch-data instance that contains the functions in a precompiled Metal library.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(data:)
NewLibraryWithDataError(data dispatch.Data) (MTLLibrary, error)
// Asynchronously creates a Metal library instance by compiling the functions in a source string.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(source:options:completionHandler:)
NewLibraryWithSourceOptionsCompletionHandler(source string, options IMTLCompileOptions, completionHandler ErrorHandler)
// Synchronously creates a Metal library instance by compiling the functions in a source string.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(source:options:)
NewLibraryWithSourceOptionsError(source string, options IMTLCompileOptions) (MTLLibrary, error)
// Asynchronously creates a Metal library from the function stitching graphs in a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(stitchedDescriptor:completionHandler:)
NewLibraryWithStitchedDescriptorCompletionHandler(descriptor IMTLStitchedLibraryDescriptor, completionHandler ErrorHandler)
// Synchronously creates a Metal library from the function stitching graphs in a descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(stitchedDescriptor:)
NewLibraryWithStitchedDescriptorError(descriptor IMTLStitchedLibraryDescriptor) (MTLLibrary, error)
// Creates a Metal library instance that contains the functions in the Metal library file at a URL.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(URL:)
NewLibraryWithURLError(url foundation.INSURL) (MTLLibrary, error)
// Creates a rasterization rate map instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRasterizationRateMap(descriptor:)
NewRasterizationRateMapWithDescriptor(descriptor IMTLRasterizationRateMapDescriptor) MTLRasterizationRateMap
// Asynchronously creates a render pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:completionHandler:)
NewRenderPipelineStateWithDescriptorCompletionHandler(descriptor IMTLRenderPipelineDescriptor, completionHandler ErrorHandler)
// Synchronously creates a render pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:)
NewRenderPipelineStateWithDescriptorError(descriptor IMTLRenderPipelineDescriptor) (MTLRenderPipelineState, error)
// Asynchronously creates a render pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:completionHandler:)-5gdww
NewRenderPipelineStateWithDescriptorOptionsCompletionHandler(descriptor IMTLRenderPipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
// Synchronously creates a render pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:reflection:)
NewRenderPipelineStateWithDescriptorOptionsReflectionError(descriptor IMTLRenderPipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedRenderPipelineReflection) (MTLRenderPipelineState, error)
// Asynchronously creates a mesh render pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:completionHandler:)-1wvya
NewRenderPipelineStateWithMeshDescriptorOptionsCompletionHandler(descriptor IMTLMeshRenderPipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
// Synchronously creates a mesh render pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/newRenderPipelineStateWithMeshDescriptor:options:reflection:error:
NewRenderPipelineStateWithMeshDescriptorOptionsReflectionError(descriptor IMTLMeshRenderPipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedRenderPipelineReflection) (MTLRenderPipelineState, error)
// Asynchronously creates a tile shader’s render pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(tileDescriptor:options:completionHandler:)
NewRenderPipelineStateWithTileDescriptorOptionsCompletionHandler(descriptor IMTLTileRenderPipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
// Synchronously creates a tile shader’s render pipeline state and reflection information.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(tileDescriptor:options:reflection:)
NewRenderPipelineStateWithTileDescriptorOptionsReflectionError(descriptor IMTLTileRenderPipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedRenderPipelineReflection) (MTLRenderPipelineState, error)
// Creates a residency set, which can move resources in and out of memory residency.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeResidencySet(descriptor:)
NewResidencySetWithDescriptorError(desc IMTLResidencySetDescriptor) (MTLResidencySet, error)
// Creates a sampler state instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSamplerState(descriptor:)
NewSamplerStateWithDescriptor(descriptor IMTLSamplerDescriptor) MTLSamplerState
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedEvent()
NewSharedEvent() MTLSharedEvent
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedEvent(handle:)
NewSharedEventWithHandle(sharedEventHandle IMTLSharedEventHandle) MTLSharedEvent
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedTexture(descriptor:)
NewSharedTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedTexture(handle:)
NewSharedTextureWithHandle(sharedHandle IMTLSharedTextureHandle) MTLTexture
// Creates a new texture instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTexture(descriptor:)
NewTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
// Creates a texture instance that uses I/O surface to store its underlying data.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTexture(descriptor:iosurface:plane:)
NewTextureWithDescriptorIosurfacePlane(descriptor IMTLTextureDescriptor, iosurface iosurface.IOSurfaceRef, plane uint) MTLTexture
// Captures and returns a CPU timestamp and a GPU timestamp from the same moment in time.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/sampleTimestamps:gpuTimestamp:
SampleTimestampsGpuTimestamp(cpuTimestamp *MTLTimestamp, gpuTimestamp *MTLTimestamp)
// Returns the size, in bytes, of a sparse tile the GPU device creates with a specific page size.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/sparseTileSizeInBytes(sparsePageSize:)
SparseTileSizeInBytesForSparsePageSize(sparsePageSize MTLSparsePageSize) uint
// Returns the dimensions of a sparse tile for a texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/sparseTileSize(with:pixelFormat:sampleCount:)
SparseTileSizeWithTextureTypePixelFormatSampleCount(textureType MTLTextureType, pixelFormat MTLPixelFormat, sampleCount uint) MTLSize
// Returns the dimensions of a sparse tile for a texture that has a specific sparse page size.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/sparseTileSize(textureType:pixelFormat:sampleCount:sparsePageSize:)
SparseTileSizeWithTextureTypePixelFormatSampleCountSparsePageSize(textureType MTLTextureType, pixelFormat MTLPixelFormat, sampleCount uint, sparsePageSize MTLSparsePageSize) MTLSize
// Returns a Boolean value that indicates whether you can read GPU counters at the specified command boundary.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsCounterSampling(_:)
SupportsCounterSampling(samplingPoint MTLCounterSamplingPoint) bool
// Returns a Boolean value that indicates whether the GPU device supports the feature set of a specific GPU family.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsFamily(_:)
SupportsFamily(gpuFamily MTLGPUFamily) bool
// Returns a Boolean value that indicates whether the GPU can create a rasterization rate map with a specific number of layers.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRasterizationRateMap(layerCount:)
SupportsRasterizationRateMapWithLayerCount(layerCount uint) bool
// Returns a Boolean value that indicates whether the GPU can sample a texture with a specific number of sample points.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsTextureSampleCount(_:)
SupportsTextureSampleCount(sampleCount uint) bool
// Returns a Boolean value that indicates whether the GPU supports an amplification factor.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsVertexAmplificationCount(_:)
SupportsVertexAmplificationCount(count uint) bool
// A Boolean value that indicates whether the device uses additional CPU threads for compilation tasks.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/shouldMaximizeConcurrentCompilation
SetShouldMaximizeConcurrentCompilation(value bool)
// The architectural details of the GPU device.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/architecture
Architecture() IMTLArchitecture
// Returns the GPU device’s support tier for argument buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/argumentBuffersSupport
ArgumentBuffersSupport() MTLArgumentBuffersTier
// The counter sets supported by the device object.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/counterSets
CounterSets() []objectivec.IObject
// The total amount of memory, in bytes, the GPU device is using for all of its resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/currentAllocatedSize
CurrentAllocatedSize() uint
// A Boolean value that indicates whether a device supports a packed depth-and-stencil pixel format.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/isDepth24Stencil8PixelFormatSupported
Depth24Stencil8PixelFormatSupported() bool
// A Boolean value that indicates whether the GPU shares all of its memory with the CPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/hasUnifiedMemory
HasUnifiedMemory() bool
// A Boolean value that indicates whether a GPU device doesn’t have a connection to a display.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/isHeadless
Headless() bool
// The physical location of the GPU relative to the system.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/location
Location() MTLDeviceLocation
// A specific GPU position based on its general location.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/locationNumber
LocationNumber() uint
// A Boolean value that indicates whether the GPU lowers its performance to conserve energy.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/isLowPower
LowPower() bool
// The maximum number of unique argument buffer samplers per app.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/maxArgumentBufferSamplerCount
MaxArgumentBufferSamplerCount() uint
// The largest amount of memory, in bytes, that a GPU device can allocate to a buffer instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/maxBufferLength
MaxBufferLength() uint
// The maximum threadgroup memory available to a compute kernel, in bytes.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/maxThreadgroupMemoryLength
MaxThreadgroupMemoryLength() uint
// The maximum number of threads along each dimension of a threadgroup.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/maxThreadsPerThreadgroup
MaxThreadsPerThreadgroup() MTLSize
// The highest theoretical rate, in bytes per second, the system can copy between system memory and the GPU’s dedicated memory (VRAM).
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/maxTransferRate
MaxTransferRate() uint64
// The full name of the GPU device.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/name
Name() string
// The total number of GPUs in the peer group, if applicable.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/peerCount
PeerCount() uint32
// The peer group ID the GPU belongs to, if applicable.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/peerGroupID
PeerGroupID() uint64
// The unique identifier for a GPU in a peer group.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/peerIndex
PeerIndex() uint32
// A Boolean value that indicates whether the GPU supports programmable sample positions.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/areProgrammableSamplePositionsSupported
ProgrammableSamplePositionsSupported() bool
// A Boolean value that indicates whether the GPU supports raster order groups.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/areRasterOrderGroupsSupported
RasterOrderGroupsSupported() bool
// The GPU device’s texture support tier.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/readWriteTextureSupport
ReadWriteTextureSupport() MTLReadWriteTextureTier
// An approximation of how much memory, in bytes, this GPU device can allocate without affecting its runtime performance.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/recommendedMaxWorkingSetSize
RecommendedMaxWorkingSetSize() uint64
// The GPU device’s registry identifier.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/registryID
RegistryID() uint64
// A Boolean value that indicates whether the GPU is removable.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/isRemovable
Removable() bool
// Returns the size, in bytes, of a sparse tile the GPU device creates using a default page size.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/sparseTileSizeInBytes
SparseTileSizeInBytes() uint
// A Boolean value that indicates whether the GPU can filter a texture with a 32-bit floating-point format.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supports32BitFloatFiltering
Supports32BitFloatFiltering() bool
// A Boolean value that indicates whether the GPU can allocate 32-bit integer texture formats and resolve to 32-bit floating-point texture formats.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supports32BitMSAA
Supports32BitMSAA() bool
// A Boolean value that indicates whether you can use textures that use BC compression.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsBCTextureCompression
SupportsBCTextureCompression() bool
// A Boolean value that indicates whether the GPU device can create and use dynamic libraries in compute pipelines.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsDynamicLibraries
SupportsDynamicLibraries() bool
// A Boolean value that indicates whether the device supports function pointers in compute kernel functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsFunctionPointers
SupportsFunctionPointers() bool
// A Boolean value that indicates whether the device supports function pointers in render functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsFunctionPointersFromRender
SupportsFunctionPointersFromRender() bool
// A Boolean value that indicates whether the device supports placement sparse resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsPlacementSparse
SupportsPlacementSparse() bool
// A Boolean value that indicates whether the GPU device supports motion blur for ray tracing.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsPrimitiveMotionBlur
SupportsPrimitiveMotionBlur() bool
// A Boolean value that indicates whether the GPU can compute multiple interpolations of a fragment function’s input.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsPullModelInterpolation
SupportsPullModelInterpolation() bool
// A Boolean value that indicates whether you can query the texture level of detail from within a shader.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsQueryTextureLOD
SupportsQueryTextureLOD() bool
// A Boolean value that indicates whether the GPU device supports ray tracing.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRaytracing
SupportsRaytracing() bool
// A Boolean value that indicates whether you can call ray-tracing functions from a vertex or fragment shader.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRaytracingFromRender
SupportsRaytracingFromRender() bool
// A Boolean value that indicates whether the GPU device can create and use dynamic libraries in render pipelines.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRenderDynamicLibraries
SupportsRenderDynamicLibraries() bool
// A Boolean value that indicates whether the GPU supports barycentric coordinates.
//
// See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsShaderBarycentricCoordinates
SupportsShaderBarycentricCoordinates() bool
}
The main Metal interface to a GPU that apps use to draw graphics and run computations in parallel.
See: https://developer.apple.com/documentation/Metal/MTLDevice
type MTLDeviceLocation ¶
type MTLDeviceLocation int
See: https://developer.apple.com/documentation/Metal/MTLDeviceLocation
const ( // MTLDeviceLocationBuiltIn: A location that indicates the GPU is permanently connected to the system internally. MTLDeviceLocationBuiltIn MTLDeviceLocation = 0 // MTLDeviceLocationExternal: A GPU location that indicates a person connected the GPU to the system with an external interface, such as Thunderbolt. MTLDeviceLocationExternal MTLDeviceLocation = 2 // MTLDeviceLocationSlot: A GPU location that indicates a person connected the GPU to a system’s internal slot. MTLDeviceLocationSlot MTLDeviceLocation = 1 // MTLDeviceLocationUnspecified: A value that indicates the system can’t determine how the GPU connects to it. MTLDeviceLocationUnspecified MTLDeviceLocation = 0 )
func (MTLDeviceLocation) String ¶
func (e MTLDeviceLocation) String() string
type MTLDeviceNotificationHandler ¶
MTLDeviceNotificationHandler is a Swift closure or an Objective-C block that Metal calls when the system adds or removes a GPU device.
See: https://developer.apple.com/documentation/Metal/MTLDeviceNotificationHandler
type MTLDeviceNotificationName ¶
type MTLDeviceNotificationName = string
MTLDeviceNotificationName is a notification that represents a change to a GPU device in the system.
See: https://developer.apple.com/documentation/Metal/MTLDeviceNotificationName
var ( // MTLDeviceRemovalRequestedNotification is a notification that Metal sends to observers when a person requests to remove a GPU device from the system. // // See: https://developer.apple.com/documentation/Metal/MTLDeviceNotificationName/removalRequested MTLDeviceRemovalRequestedNotification MTLDeviceNotificationName // MTLDeviceWasAddedNotification is a notification that Metal sends to observers when the system adds a GPU device. // // See: https://developer.apple.com/documentation/Metal/MTLDeviceNotificationName/wasAdded MTLDeviceWasAddedNotification MTLDeviceNotificationName // MTLDeviceWasRemovedNotification is a notification that Metal sends to observers when the system removes a GPU device. // // See: https://developer.apple.com/documentation/Metal/MTLDeviceNotificationName/wasRemoved MTLDeviceWasRemovedNotification MTLDeviceNotificationName )
type MTLDeviceObject ¶
type MTLDeviceObject struct {
objectivec.Object
}
MTLDeviceObject wraps an existing Objective-C object that conforms to the MTLDevice protocol.
func MTLCopyAllDevices ¶
func MTLCopyAllDevices() []MTLDeviceObject
MTLCopyAllDevices returns an array of all the Metal device instances in the system.
See: https://developer.apple.com/documentation/Metal/MTLCopyAllDevices()
func MTLCopyAllDevicesWithObserver ¶
func MTLCopyAllDevicesWithObserver(observer objectivec.Object, handler MTLDeviceNotificationHandler) []MTLDeviceObject
MTLCopyAllDevicesWithObserver returns an array of all the Metal GPU devices in the system and registers a notification handler that Metal calls when the device list changes.
See: https://developer.apple.com/documentation/Metal/MTLCopyAllDevicesWithObserver
func MTLCreateSystemDefaultDevice ¶
func MTLCreateSystemDefaultDevice() MTLDeviceObject
MTLCreateSystemDefaultDevice returns the device instance Metal selects as the default.
See: https://developer.apple.com/documentation/Metal/MTLCreateSystemDefaultDevice()
func MTLDeviceObjectFromID ¶
func MTLDeviceObjectFromID(id objc.ID) MTLDeviceObject
MTLDeviceObjectFromID constructs a MTLDeviceObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLDeviceObject) AccelerationStructureSizesWithDescriptor ¶
func (o MTLDeviceObject) AccelerationStructureSizesWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructureSizes
Returns the buffer sizes the GPU device needs to build, refit, and store an acceleration structure.
descriptor: An MTLAccelerationStructureDescriptor instance.
Return Value ¶
A new MTLAccelerationStructureSizes instance.
See: https://developer.apple.com/documentation/Metal/MTLDevice/accelerationStructureSizes(descriptor:)
func (MTLDeviceObject) Architecture ¶
func (o MTLDeviceObject) Architecture() IMTLArchitecture
The architectural details of the GPU device.
See: https://developer.apple.com/documentation/Metal/MTLDevice/architecture
func (MTLDeviceObject) ArgumentBuffersSupport ¶
func (o MTLDeviceObject) ArgumentBuffersSupport() MTLArgumentBuffersTier
Returns the GPU device’s support tier for argument buffers.
See: https://developer.apple.com/documentation/Metal/MTLDevice/argumentBuffersSupport
func (MTLDeviceObject) BaseObject ¶
func (o MTLDeviceObject) BaseObject() objectivec.Object
func (MTLDeviceObject) ConvertSparsePixelRegionsToTileRegionsWithTileSizeAlignmentModeNumRegions ¶
func (o MTLDeviceObject) ConvertSparsePixelRegionsToTileRegionsWithTileSizeAlignmentModeNumRegions(pixelRegions []MTLRegion, tileRegions []MTLRegion, tileSize MTLSize, mode MTLSparseTextureRegionAlignmentMode, numRegions uint)
Converts a list of sparse pixel regions to tile regions.
pixelRegions: A pointer to a C array of pixel MTLRegion instances. // MTLRegion: https://developer.apple.com/documentation/Metal/MTLRegion
tileRegions: A pointer to a C array of tile MTLRegion instances. // MTLRegion: https://developer.apple.com/documentation/Metal/MTLRegion
tileSize: An MTLSize instance that represents a sparse tile’s size, in pixels. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
mode: An MTLSparseTextureRegionAlignmentMode instance. // MTLSparseTextureRegionAlignmentMode: https://developer.apple.com/documentation/Metal/MTLSparseTextureRegionAlignmentMode
numRegions: The number of regions you want the method to convert.
func (MTLDeviceObject) ConvertSparseTileRegionsToPixelRegionsWithTileSizeNumRegions ¶
func (o MTLDeviceObject) ConvertSparseTileRegionsToPixelRegionsWithTileSizeNumRegions(tileRegions []MTLRegion, pixelRegions []MTLRegion, tileSize MTLSize, numRegions uint)
Converts a list of sparse tile regions to pixel regions.
tileRegions: A pointer to a C array of tile MTLRegion instances. // MTLRegion: https://developer.apple.com/documentation/Metal/MTLRegion
pixelRegions: A pointer to a C array of pixel MTLRegion instances. // MTLRegion: https://developer.apple.com/documentation/Metal/MTLRegion
tileSize: An MTLSize instance that represents a sparse tile’s size, in pixels. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
numRegions: The number of regions you want the method to convert.
func (MTLDeviceObject) CounterSets ¶
func (o MTLDeviceObject) CounterSets() []objectivec.IObject
The counter sets supported by the device object.
See: https://developer.apple.com/documentation/Metal/MTLDevice/counterSets
func (MTLDeviceObject) CurrentAllocatedSize ¶
func (o MTLDeviceObject) CurrentAllocatedSize() uint
The total amount of memory, in bytes, the GPU device is using for all of its resources.
See: https://developer.apple.com/documentation/Metal/MTLDevice/currentAllocatedSize
func (MTLDeviceObject) Depth24Stencil8PixelFormatSupported ¶
func (o MTLDeviceObject) Depth24Stencil8PixelFormatSupported() bool
A Boolean value that indicates whether a device supports a packed depth-and-stencil pixel format.
Discussion ¶
If the value is true, the device supports the [PixelFormatDepth24Unorm_Stencil8] pixel format.
See: https://developer.apple.com/documentation/Metal/MTLDevice/isDepth24Stencil8PixelFormatSupported
func (MTLDeviceObject) FunctionHandleWithBinaryFunction ¶
func (o MTLDeviceObject) FunctionHandleWithBinaryFunction(function MTL4BinaryFunction) MTLFunctionHandle
Get the function handle for the specified binary-linked function from the pipeline state.
function: A MTL4BinaryFunction instance representing the function binary.
Return Value ¶
A MTLFunctionHandle instance for a binary function that was compiled with MTLFunctionOptionPipelineIndependent, otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/functionHandle(function:)-w9ia
func (MTLDeviceObject) FunctionHandleWithFunction ¶
func (o MTLDeviceObject) FunctionHandleWithFunction(function MTLFunction) MTLFunctionHandle
Discussion ¶
Returns the function handle for a function that was compiled with MTLFunctionOptionPipelineIndependent and MTLFunctionOptionCompileToBinary.
See: https://developer.apple.com/documentation/Metal/MTLDevice/functionHandle(function:)-4bw39
func (MTLDeviceObject) GetDefaultSamplePositionsCount ¶
func (o MTLDeviceObject) GetDefaultSamplePositionsCount(positions *MTLSamplePosition, count uint)
Retrieves the default sample positions for a specific sample count.
positions: A pointer to a destination C array of MTLSamplePosition instances — with at least `count` elements — the method writes the default positions to. // MTLSamplePosition: https://developer.apple.com/documentation/Metal/MTLSamplePosition
count: The number of points a GPU can sample from a texture. Ensure the GPU can support the `count` value by first calling the device’s [SupportsTextureSampleCount] method.
Discussion ¶
The default sample positions are the same on all GPUs that support programmable sample positions (see areProgrammableSamplePositionsSupported).
The default sample position for GPUs that can sample one time is at the pixel’s center.
[positioning-samples-programmatically-2]
The default sample positions for GPUs that can sample two times have locations in the center of the pixel’s second quadrant and fourth quadrants.
[getDefaultSamplePositions-2]
The default sample positions for GPUs that can sample four times have one location in each of the pixel’s quadrants. Each location is at the center of one of that quadrant’s subquadrants.
[getDefaultSamplePositions-3]
The default sample positions for GPUs that can sample eight times have two locations in each of the pixel’s quadrants.
[getDefaultSamplePositions-4]
The table lists the indices and default locations for GPUs that support 1, 2, 4, or 8 sample positions.
[Table data omitted]
See: https://developer.apple.com/documentation/Metal/MTLDevice/getDefaultSamplePositions:count:
func (MTLDeviceObject) HasUnifiedMemory ¶
func (o MTLDeviceObject) HasUnifiedMemory() bool
A Boolean value that indicates whether the GPU shares all of its memory with the CPU.
Discussion ¶
A GPU with unified memory (true) is typically an integrated GPU. A GPU with dedicated memory (false) may take additional time to synchronize managed resources or copy data into private GPU resources.
See: https://developer.apple.com/documentation/Metal/MTLDevice/hasUnifiedMemory
func (MTLDeviceObject) Headless ¶
func (o MTLDeviceObject) Headless() bool
A Boolean value that indicates whether a GPU device doesn’t have a connection to a display.
Discussion ¶
The value is true when the GPU is , which means it isn’t connected to any displays.
See: https://developer.apple.com/documentation/Metal/MTLDevice/isHeadless
func (MTLDeviceObject) HeapAccelerationStructureSizeAndAlignWithDescriptor ¶
func (o MTLDeviceObject) HeapAccelerationStructureSizeAndAlignWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLSizeAndAlign
Returns the size and alignment, in bytes, of an acceleration structure if you create it from a heap with a descriptor.
descriptor: An MTLAccelerationStructureDescriptor instance.
Return Value ¶
An MTLSizeAndAlign instance.
Discussion ¶
Use this method to help estimate an appropriate size for a new heap before you create it.
func (MTLDeviceObject) HeapAccelerationStructureSizeAndAlignWithSize ¶
func (o MTLDeviceObject) HeapAccelerationStructureSizeAndAlignWithSize(size uint) MTLSizeAndAlign
Returns the size and alignment, in bytes, of an acceleration structure if you create it from a heap.
size: The size of an acceleration structure, in bytes.
Return Value ¶
An MTLSizeAndAlign instance
Discussion ¶
Use this method to help estimate an appropriate size for a new heap before you create it.
func (MTLDeviceObject) HeapBufferSizeAndAlignWithLengthOptions ¶
func (o MTLDeviceObject) HeapBufferSizeAndAlignWithLengthOptions(length uint, options MTLResourceOptions) MTLSizeAndAlign
Returns the size and alignment, in bytes, of a buffer if you create it from a heap.
length: The size of the buffer, in bytes.
options: An MTLResourceOptions instance for a would-be buffer’s storage and hazard tracking modes. See [Resource fundamentals] and [Setting resource storage modes] for more information. // MTLResourceOptions: https://developer.apple.com/documentation/Metal/MTLResourceOptions [Resource fundamentals]: https://developer.apple.com/documentation/Metal/resource-fundamentals [Setting resource storage modes]: https://developer.apple.com/documentation/Metal/setting-resource-storage-modes
Return Value ¶
An MTLSizeAndAlign instance.
Discussion ¶
Use this method to help estimate an appropriate size for a new heap before you create it.
See: https://developer.apple.com/documentation/Metal/MTLDevice/heapBufferSizeAndAlign(length:options:)
func (MTLDeviceObject) HeapTextureSizeAndAlignWithDescriptor ¶
func (o MTLDeviceObject) HeapTextureSizeAndAlignWithDescriptor(desc IMTLTextureDescriptor) MTLSizeAndAlign
Returns the size and alignment, in bytes, of a texture if you create it from a heap.
desc: An MTLTextureDescriptor instance.
Return Value ¶
An MTLSizeAndAlign instance.
Discussion ¶
Use this method to help estimate an appropriate size for a new heap before you create it.
See: https://developer.apple.com/documentation/Metal/MTLDevice/heapTextureSizeAndAlign(descriptor:)
func (MTLDeviceObject) Location ¶
func (o MTLDeviceObject) Location() MTLDeviceLocation
The physical location of the GPU relative to the system.
Discussion ¶
The value indicates whether the GPU connects to the system through a built-in connection, an internal card slot, or an external connection.
See: https://developer.apple.com/documentation/Metal/MTLDevice/location
func (MTLDeviceObject) LocationNumber ¶
func (o MTLDeviceObject) LocationNumber() uint
A specific GPU position based on its general location.
Discussion ¶
The meaning of the location number depends on a device’s location property:
- For [DeviceLocationBuiltIn], the location number is `0` for low-power GPUs (see isLowPower) and `1` for other GPUs. - For [DeviceLocationSlot], the location number represents the slot. - For [DeviceLocationExternal], the location number represents the Thunderbolt port.
See: https://developer.apple.com/documentation/Metal/MTLDevice/locationNumber
func (MTLDeviceObject) LowPower ¶
func (o MTLDeviceObject) LowPower() bool
A Boolean value that indicates whether the GPU lowers its performance to conserve energy.
Discussion ¶
Some systems contain multiple GPUs that run with different performance and energy characteristics. At runtime, choose a GPU that best matches your performance needs while considering the current state of the system. For example, your app may choose a lower-power GPU if it doesn’t need the best possible performance on a MacBook Pro that’s running on battery power. For more information on discovering and selecting GPUs at runtime, see Multi-GPU systems.
The property is typically true for integrated GPUs and false for discrete GPUs. However, an Apple silicon GPU on a Mac sets the property to false because it doesn’t need to lower its performance to conserve energy.
See: https://developer.apple.com/documentation/Metal/MTLDevice/isLowPower
func (MTLDeviceObject) MaxArgumentBufferSamplerCount ¶
func (o MTLDeviceObject) MaxArgumentBufferSamplerCount() uint
The maximum number of unique argument buffer samplers per app.
Discussion ¶
This limit only applies to samplers that support argument buffers (see [SupportArgumentBuffers]). An MTLSamplerState instance is only unique if the properties of the MTLSamplerDescriptor instance that created it are unique. For example, two samplers with equal [MinFilter] values but different [MagFilter] values are unique.
See Improving CPU performance by using argument buffers for more information about argument buffer tiers, limits, and capabilities.
See: https://developer.apple.com/documentation/Metal/MTLDevice/maxArgumentBufferSamplerCount
func (MTLDeviceObject) MaxBufferLength ¶
func (o MTLDeviceObject) MaxBufferLength() uint
The largest amount of memory, in bytes, that a GPU device can allocate to a buffer instance.
Discussion ¶
The property’s value is at least 256 MB (268,435,456 bytes).
See: https://developer.apple.com/documentation/Metal/MTLDevice/maxBufferLength
func (MTLDeviceObject) MaxThreadgroupMemoryLength ¶
func (o MTLDeviceObject) MaxThreadgroupMemoryLength() uint
The maximum threadgroup memory available to a compute kernel, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLDevice/maxThreadgroupMemoryLength
func (MTLDeviceObject) MaxThreadsPerThreadgroup ¶
func (o MTLDeviceObject) MaxThreadsPerThreadgroup() MTLSize
The maximum number of threads along each dimension of a threadgroup.
Discussion ¶
This property reports the maximum thread group size the device can support for a trivial shader. This size isn’t guaranteed for all shaders. For the actual thread group size of a specific compute shader, see the [MaxTotalThreadsPerThreadgroup] property of your compute pipeline state.
For more information on the specific threadgroup limits of each GPU family, see the Metal feature set tables:
- Metal feature set tables (PDF) - Metal feature set tables (Numbers)
See: https://developer.apple.com/documentation/Metal/MTLDevice/maxThreadsPerThreadgroup
func (MTLDeviceObject) MaxTransferRate ¶
func (o MTLDeviceObject) MaxTransferRate() uint64
The highest theoretical rate, in bytes per second, the system can copy between system memory and the GPU’s dedicated memory (VRAM).
Discussion ¶
Metal calculates this value from the raw data-clock rate, and the GPU may not be able to reach this speed in real-world conditions.
See: https://developer.apple.com/documentation/Metal/MTLDevice/maxTransferRate
func (MTLDeviceObject) MaximumConcurrentCompilationTaskCount ¶
func (o MTLDeviceObject) MaximumConcurrentCompilationTaskCount() uint
The maximum number of concurrent compilation tasks the device is running.
See: https://developer.apple.com/documentation/Metal/MTLDevice/maximumConcurrentCompilationTaskCount
func (MTLDeviceObject) MinimumLinearTextureAlignmentForPixelFormat ¶
func (o MTLDeviceObject) MinimumLinearTextureAlignmentForPixelFormat(format MTLPixelFormat) uint
Returns the minimum alignment the GPU device requires to create a linear texture from a buffer.
format: An MTLPixelFormat instance that can’t be any of the depth, stencil, or compressed pixel formats. // MTLPixelFormat: https://developer.apple.com/documentation/Metal/MTLPixelFormat
Discussion ¶
Metal aligns linear textures to their minimum alignment value, which directly affects the [NewTextureWithDescriptorOffsetBytesPerRow] method’s `offset` and `bytesPerRow` parameters.
See: https://developer.apple.com/documentation/Metal/MTLDevice/minimumLinearTextureAlignment(for:)
func (MTLDeviceObject) MinimumTextureBufferAlignmentForPixelFormat ¶
func (o MTLDeviceObject) MinimumTextureBufferAlignmentForPixelFormat(format MTLPixelFormat) uint
Returns the minimum alignment the GPU device requires to create a texture buffer from a buffer.
format: An MTLPixelFormat instance. // MTLPixelFormat: https://developer.apple.com/documentation/Metal/MTLPixelFormat
Discussion ¶
Metal aligns textures to their minimum alignment value, which directly affects the [NewTextureWithDescriptorOffsetBytesPerRow] method’s `offset` and `bytesPerRow` parameters.
See: https://developer.apple.com/documentation/Metal/MTLDevice/minimumTextureBufferAlignment(for:)
func (MTLDeviceObject) Name ¶
func (o MTLDeviceObject) Name() string
The full name of the GPU device.
See: https://developer.apple.com/documentation/Metal/MTLDevice/name
func (MTLDeviceObject) NewAccelerationStructureWithDescriptor ¶
func (o MTLDeviceObject) NewAccelerationStructureWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructure
Creates a new ray-tracing acceleration structure from a descriptor.
descriptor: An MTLAccelerationStructureDescriptor instance.
Return Value ¶
A new MTLAccelerationStructure instance if the method completed successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeAccelerationStructure(descriptor:)
func (MTLDeviceObject) NewAccelerationStructureWithSize ¶
func (o MTLDeviceObject) NewAccelerationStructureWithSize(size uint) MTLAccelerationStructure
Creates a new acceleration structure with a specific size.
size: The size of the new acceleration structure, in bytes.
Return Value ¶
A new MTLAccelerationStructure instance if the method completed successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeAccelerationStructure(size:)
func (MTLDeviceObject) NewArchiveWithURLError ¶
func (o MTLDeviceObject) NewArchiveWithURLError(url foundation.INSURL) (MTL4Archive, error)
Creates a new archive from data available at an [NSURL] address.
url: An [NSURL] instance that represents the path from which the device loads the MTL4Archive.
Return Value ¶
A MTL4Archive instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArchive(url:)
func (MTLDeviceObject) NewArgumentEncoderWithArguments ¶
func (o MTLDeviceObject) NewArgumentEncoderWithArguments(arguments []MTLArgumentDescriptor) MTLArgumentEncoder
Creates a new argument encoder for an array of arguments.
arguments: An array of MTLArgumentDescriptor instances that you need to sort by their [Index] properties in monotonically increasing order.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArgumentEncoder(arguments:)
func (MTLDeviceObject) NewArgumentEncoderWithBufferBinding ¶
func (o MTLDeviceObject) NewArgumentEncoderWithBufferBinding(bufferBinding MTLBufferBinding) MTLArgumentEncoder
Creates a new argument encoder for a buffer binding.
bufferBinding: An MTLBufferBinding instance.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArgumentEncoder(bufferBinding:)
func (MTLDeviceObject) NewArgumentTableWithDescriptorError ¶
func (o MTLDeviceObject) NewArgumentTableWithDescriptorError(descriptor IMTL4ArgumentTableDescriptor) (MTL4ArgumentTable, error)
Creates a new argument table from an argument table descriptor.
descriptor: A MTL4ArgumentTableDescriptor instance that configures the MTL4ArgumentTable instance.
Return Value ¶
A MTL4ArgumentTable instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeArgumentTable(descriptor:)
func (MTLDeviceObject) NewBinaryArchiveWithDescriptorError ¶
func (o MTLDeviceObject) NewBinaryArchiveWithDescriptorError(descriptor IMTLBinaryArchiveDescriptor) (MTLBinaryArchive, error)
Creates a Metal binary archive instance.
descriptor: An MTLBinaryArchiveDescriptor instance.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBinaryArchive(descriptor:)
func (MTLDeviceObject) NewBufferWithBytesLengthOptions ¶
func (o MTLDeviceObject) NewBufferWithBytesLengthOptions(pointer unsafe.Pointer, length uint, options MTLResourceOptions) MTLBuffer
Allocates a new buffer of a given length and initializes its contents by copying existing data into it.
pointer: A pointer to the starting memory address the method copies the initialization data from.
length: The size of the new buffer, in bytes, and the number of bytes the method copies from `pointer`.
options: An MTLResourceOptions instance that sets the buffer’s storage and hazard-tracking modes. See [Resource fundamentals] and [Setting resource storage modes] for more information. // MTLResourceOptions: https://developer.apple.com/documentation/Metal/MTLResourceOptions [Resource fundamentals]: https://developer.apple.com/documentation/Metal/resource-fundamentals [Setting resource storage modes]: https://developer.apple.com/documentation/Metal/setting-resource-storage-modes
Return Value ¶
A new MTLBuffer instance if the method completes successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBuffer(bytes:length:options:)
func (MTLDeviceObject) NewBufferWithBytesNoCopyLengthOptionsDeallocator ¶
func (o MTLDeviceObject) NewBufferWithBytesNoCopyLengthOptionsDeallocator(pointer unsafe.Pointer, length uint, options MTLResourceOptions, deallocator func(unsafe.Pointer, uint64)) MTLBuffer
Creates a buffer that wraps an existing contiguous memory allocation.
pointer: A page-aligned pointer to the starting memory address.
length: The size of the new buffer, in bytes, that results in a page-aligned region of memory.
options: An MTLResourceOptions instance that sets the buffer’s storage and hazard-tracking modes. See [Resource fundamentals] and [Setting resource storage modes] for more information. // MTLResourceOptions: https://developer.apple.com/documentation/Metal/MTLResourceOptions [Resource fundamentals]: https://developer.apple.com/documentation/Metal/resource-fundamentals [Setting resource storage modes]: https://developer.apple.com/documentation/Metal/setting-resource-storage-modes
deallocator: A block the framework invokes when it deallocates the buffer so that your app can release the underlying memory; otherwise `nil` to opt out.
Return Value ¶
A new MTLBuffer instance if the method completes successfully; otherwise `nil`.
Discussion ¶
func (MTLDeviceObject) NewBufferWithLengthOptions ¶
func (o MTLDeviceObject) NewBufferWithLengthOptions(length uint, options MTLResourceOptions) MTLBuffer
Creates a buffer the method clears with zero values.
length: The size of the new buffer, in bytes.
options: An MTLResourceOptions instance that sets the buffer’s storage and hazard-tracking modes. See [Resource fundamentals] and [Setting resource storage modes] for more information. // MTLResourceOptions: https://developer.apple.com/documentation/Metal/MTLResourceOptions [Resource fundamentals]: https://developer.apple.com/documentation/Metal/resource-fundamentals [Setting resource storage modes]: https://developer.apple.com/documentation/Metal/setting-resource-storage-modes
Return Value ¶
A new MTLBuffer instance if the method completed successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeBuffer(length:options:)
func (MTLDeviceObject) NewBufferWithLengthOptionsPlacementSparsePageSize ¶
func (o MTLDeviceObject) NewBufferWithLengthOptionsPlacementSparsePageSize(length uint, options MTLResourceOptions, placementSparsePageSize MTLSparsePageSize) MTLBuffer
Creates a new placement sparse buffer of a specific length.
length: The size of the MTLBuffer, in bytes.
options: A MTLResourceOptions instance that establishes the buffer’s storage modes. // MTLResourceOptions: https://developer.apple.com/documentation/Metal/MTLResourceOptions
placementSparsePageSize: MTLSparsePageSize to use for the placement sparse buffer. // MTLSparsePageSize: https://developer.apple.com/documentation/Metal/MTLSparsePageSize
Return Value ¶
A MTLBuffer instance, or `nil` if the function failed.
Discussion ¶
This method creates a new placement sparse MTLBuffer of a specific length. You assign memory to placement sparse buffers using a MTLHeap of type [HeapTypePlacement].
func (MTLDeviceObject) NewCommandAllocator ¶
func (o MTLDeviceObject) NewCommandAllocator() MTL4CommandAllocator
Creates a new command allocator.
Return Value ¶
A MTL4CommandAllocator instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandAllocator()
func (MTLDeviceObject) NewCommandAllocatorWithDescriptorError ¶
func (o MTLDeviceObject) NewCommandAllocatorWithDescriptorError(descriptor IMTL4CommandAllocatorDescriptor) (MTL4CommandAllocator, error)
Creates a new command allocator from a command allocator descriptor.
descriptor: A MTL4CommandAllocatorDescriptor instance that configures the MTL4CommandAllocator instance.
Return Value ¶
A MTL4CommandAllocator instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandAllocator(descriptor:)
func (MTLDeviceObject) NewCommandBuffer ¶
func (o MTLDeviceObject) NewCommandBuffer() MTL4CommandBuffer
Creates a new command buffer.
Return Value ¶
A MTL4CommandBuffer instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandBuffer()
func (MTLDeviceObject) NewCommandQueue ¶
func (o MTLDeviceObject) NewCommandQueue() MTLCommandQueue
Creates a queue you use to submit rendering and computation commands to a GPU.
Return Value ¶
A new MTLCommandQueue instance if the method completed successfully; otherwise `nil`.
Discussion ¶
A command queue can only submit commands to the GPU device instance that created it.
This method is the equivalent of passing `64` to the [NewCommandQueueWithMaxCommandBufferCount] method.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandQueue()
func (MTLDeviceObject) NewCommandQueueWithDescriptor ¶
func (o MTLDeviceObject) NewCommandQueueWithDescriptor(descriptor IMTLCommandQueueDescriptor) MTLCommandQueue
Creates a command queue with the provided configuration.
descriptor: The configuration for the new command queue.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandQueue(descriptor:)
func (MTLDeviceObject) NewCommandQueueWithMaxCommandBufferCount ¶
func (o MTLDeviceObject) NewCommandQueueWithMaxCommandBufferCount(maxCommandBufferCount uint) MTLCommandQueue
Creates a queue you use to submit rendering and computation commands to a GPU that has a fixed number of uncompleted command buffers.
maxCommandBufferCount: An integer that sets the maximum number of uncompleted command buffers the queue can allow.
Return Value ¶
A new MTLCommandQueue instance if the method completed successfully; otherwise `nil`.
Discussion ¶
A Command queue can only submit commands to the GPU device instance that created it.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCommandQueue(maxCommandBufferCount:)
func (MTLDeviceObject) NewCompilerWithDescriptorError ¶
func (o MTLDeviceObject) NewCompilerWithDescriptorError(descriptor IMTL4CompilerDescriptor) (MTL4Compiler, error)
Creates a new compiler from a compiler descriptor.
descriptor: A MTL4CompilerDescriptor instance that configures the MTL4Compiler instance.
Return Value ¶
A MTL4Compiler instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCompiler(descriptor:)
func (MTLDeviceObject) NewComputePipelineStateWithDescriptorOptionsCompletionHandler ¶
func (o MTLDeviceObject) NewComputePipelineStateWithDescriptorOptionsCompletionHandler(descriptor IMTLComputePipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
Asynchronously creates a compute pipeline state and reflection information.
descriptor: An MTLComputePipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
completionHandler: A Swift closure or an Objective-C block the method calls when it finishes creating the compute pipeline state.
Discussion ¶
Use the compute pipeline state to configure a compute pass by calling the [SetComputePipelineState] method of an MTLComputeCommandEncoder instance.
func (MTLDeviceObject) NewComputePipelineStateWithDescriptorOptionsReflectionError ¶
func (o MTLDeviceObject) NewComputePipelineStateWithDescriptorOptionsReflectionError(descriptor IMTLComputePipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedComputePipelineReflection) (MTLComputePipelineState, error)
Synchronously creates a compute pipeline state and reflection information.
descriptor: An MTLComputePipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
reflection: In Swift, an optional pointer to an MTLAutoreleasedComputePipelineReflection optional. In Objective-C, a pointer to an MTLAutoreleasedComputePipelineReflection instance.
Pass `nil` in either language when you don’t need reflection data. Otherwise on return, if the method completes successfully, it assigns an MTLComputePipelineReflection instance to the pointee, which contains the details about the function arguments.
Discussion ¶
Use the compute pipeline state to configure a compute pass by calling the [SetComputePipelineState] method of an MTLComputeCommandEncoder instance.
func (MTLDeviceObject) NewComputePipelineStateWithFunctionCompletionHandler ¶
func (o MTLDeviceObject) NewComputePipelineStateWithFunctionCompletionHandler(computeFunction MTLFunction, completionHandler ErrorHandler)
Asynchronously creates a compute pipeline state with a function instance.
computeFunction: An MTLFunction instance.
completionHandler: A Swift closure or an Objective-C block the method calls when it finishes creating the compute pipeline state.
Discussion ¶
Use the compute pipeline state to configure a compute pass by calling the [SetComputePipelineState] method of an MTLComputeCommandEncoder instance.
func (MTLDeviceObject) NewComputePipelineStateWithFunctionError ¶
func (o MTLDeviceObject) NewComputePipelineStateWithFunctionError(computeFunction MTLFunction) (MTLComputePipelineState, error)
Synchronously creates a compute pipeline state with a function instance.
computeFunction: An MTLFunction instance.
Discussion ¶
Use the compute pipeline state to configure a compute pass by calling the [SetComputePipelineState] method of an MTLComputeCommandEncoder instance.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeComputePipelineState(function:)
func (MTLDeviceObject) NewComputePipelineStateWithFunctionOptionsCompletionHandler ¶
func (o MTLDeviceObject) NewComputePipelineStateWithFunctionOptionsCompletionHandler(computeFunction MTLFunction, options MTLPipelineOption, completionHandler ErrorHandler)
Asynchronously creates a compute pipeline state and reflection with a function instance.
computeFunction: An MTLFunction instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
completionHandler: A Swift closure or an Objective-C block the method calls when it finishes creating the compute pipeline state.
Discussion ¶
Use the compute pipeline state to configure a compute pass by calling the [SetComputePipelineState] method of an MTLComputeCommandEncoder instance.
func (MTLDeviceObject) NewComputePipelineStateWithFunctionOptionsReflectionError ¶
func (o MTLDeviceObject) NewComputePipelineStateWithFunctionOptionsReflectionError(computeFunction MTLFunction, options MTLPipelineOption, reflection *MTLAutoreleasedComputePipelineReflection) (MTLComputePipelineState, error)
Synchronously creates a compute pipeline state and reflection with a function instance.
computeFunction: An MTLFunction instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
reflection: In Swift, an optional pointer to an MTLAutoreleasedComputePipelineReflection optional. In Objective-C, a pointer to an MTLAutoreleasedComputePipelineReflection instance.
Discussion ¶
Use the compute pipeline state to configure a compute pass by calling the [SetComputePipelineState] method of an MTLComputeCommandEncoder instance.
func (MTLDeviceObject) NewCounterHeapWithDescriptorError ¶
func (o MTLDeviceObject) NewCounterHeapWithDescriptorError(descriptor IMTL4CounterHeapDescriptor) (MTL4CounterHeap, error)
Creates a new counter heap configured from a counter heap descriptor.
descriptor: MTL4CounterHeapDescriptor instance that configures the MTL4CounterHeap instance.
Return Value ¶
A MTL4CounterHeap instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCounterHeap(descriptor:)
func (MTLDeviceObject) NewCounterSampleBufferWithDescriptorError ¶
func (o MTLDeviceObject) NewCounterSampleBufferWithDescriptorError(descriptor IMTLCounterSampleBufferDescriptor) (MTLCounterSampleBuffer, error)
Creates a counter sample buffer.
descriptor: An MTLCounterSampleBufferDescriptor instance.
Return Value ¶
A new MTLCounterSampleBuffer instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
The method may produce an error if the GPU driver has exhausted its underlying resources for counter sample buffers.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeCounterSampleBuffer(descriptor:)
func (MTLDeviceObject) NewDefaultLibrary ¶
func (o MTLDeviceObject) NewDefaultLibrary() MTLLibrary
Creates a Metal library instance that contains the functions from your app’s default Metal library.
Return Value ¶
A new MTLLibrary instance if the method completes successfully; otherwise `nil`.
Discussion ¶
Xcode compiles all the Metal source files (ending in `XCUIElementTypeMetal`) in an Xcode project into a single default library.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDefaultLibrary()
func (MTLDeviceObject) NewDefaultLibraryWithBundleError ¶
func (o MTLDeviceObject) NewDefaultLibraryWithBundleError(bundle foundation.NSBundle) (MTLLibrary, error)
Creates a Metal library instance that contains the functions in a bundle’s default Metal library.
bundle: A bundle instance.
Return Value ¶
A new MTLLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDefaultLibrary(bundle:)
func (MTLDeviceObject) NewDepthStencilStateWithDescriptor ¶
func (o MTLDeviceObject) NewDepthStencilStateWithDescriptor(descriptor IMTLDepthStencilDescriptor) MTLDepthStencilState
Creates a depth-stencil state instance.
descriptor: An MTLDepthStencilDescriptor instance.
Return Value ¶
A new MTLDepthStencilState instance if the method completed successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDepthStencilState(descriptor:)
func (MTLDeviceObject) NewDynamicLibraryError ¶
func (o MTLDeviceObject) NewDynamicLibraryError(library MTLLibrary) (MTLDynamicLibrary, error)
Creates a Metal dynamic library instance from a Metal library instance.
library: An MTLLibrary instance.
Return Value ¶
A new MTLDynamicLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDynamicLibrary(library:)
func (MTLDeviceObject) NewDynamicLibraryWithURLError ¶
func (o MTLDeviceObject) NewDynamicLibraryWithURLError(url foundation.INSURL) (MTLDynamicLibrary, error)
Creates a Metal dynamic library instance that contains the functions in the Metal library file at a URL.
url: A URL to a Metal library file (ending in `XCUIElementTypeMetallib`).
Return Value ¶
A new MTLDynamicLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeDynamicLibrary(url:)
func (MTLDeviceObject) NewEvent ¶
func (o MTLDeviceObject) NewEvent() MTLEvent
Creates a new event instance that you can use to synchronize commands and resources within the same GPU device.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeEvent()
func (MTLDeviceObject) NewFence ¶
func (o MTLDeviceObject) NewFence() MTLFence
Creates a new memory fence instance.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeFence()
func (MTLDeviceObject) NewHeapWithDescriptor ¶
func (o MTLDeviceObject) NewHeapWithDescriptor(descriptor IMTLHeapDescriptor) MTLHeap
Creates a new GPU heap instance.
descriptor: An MTLHeapDescriptor instance.
Return Value ¶
A new MTLHeap instance if the method completed successfully; otherwise nil.
Discussion ¶
For more information about using heaps, see Memory heaps.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeHeap(descriptor:)
func (MTLDeviceObject) NewIOCommandQueueWithDescriptorError ¶
func (o MTLDeviceObject) NewIOCommandQueueWithDescriptorError(descriptor IMTLIOCommandQueueDescriptor) (MTLIOCommandQueue, error)
Creates an input/output command queue you use to submit commands that load assets from the file system into GPU resources or system memory.
descriptor: A descriptor instance that configures the command queue.
Return Value ¶
A new MTLIOCommandQueue instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
For information about using input/output command queues and file handles, see Resource loading.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeIOCommandQueue(descriptor:)
func (MTLDeviceObject) NewIOFileHandleWithURLCompressionMethodError ¶
func (o MTLDeviceObject) NewIOFileHandleWithURLCompressionMethodError(url foundation.INSURL, compressionMethod MTLIOCompressionMethod) (MTLIOFileHandle, error)
Creates an input/output file handle instance that represents a compressed file at a URL.
url: A location URL to a compressed file in the file system.
compressionMethod: The file’s compression format.
Return Value ¶
A new MTLIOFileHandle instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
For information about using input/output command queues and file handles, see Resource loading.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeIOFileHandle(url:compressionMethod:)
func (MTLDeviceObject) NewIOFileHandleWithURLError ¶
func (o MTLDeviceObject) NewIOFileHandleWithURLError(url foundation.INSURL) (MTLIOFileHandle, error)
Creates an input/output file handle instance that represents a file at a URL.
url: The URL to a resource file in the file system.
Return Value ¶
A new MTLIOFileHandle instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
For information about using input/output command queues and file handles, see Resource loading.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeIOFileHandle(url:)
func (MTLDeviceObject) NewIndirectCommandBufferWithDescriptorMaxCommandCountOptions ¶
func (o MTLDeviceObject) NewIndirectCommandBufferWithDescriptorMaxCommandCountOptions(descriptor IMTLIndirectCommandBufferDescriptor, maxCount uint, options MTLResourceOptions) MTLIndirectCommandBuffer
Creates an indirect command buffer instance.
descriptor: An MTLIndirectCommandBufferDescriptor instance.
maxCount: The largest number of commands you can store in the buffer.
options: An MTLResourceOptions instance. // MTLResourceOptions: https://developer.apple.com/documentation/Metal/MTLResourceOptions
Return Value ¶
A new MTLIndirectCommandBuffer instance if the method completed successfully; otherwise `nil`.
func (MTLDeviceObject) NewLibraryWithDataError ¶
func (o MTLDeviceObject) NewLibraryWithDataError(data dispatch.Data) (MTLLibrary, error)
Creates a Metal library instance from a dispatch-data instance that contains the functions in a precompiled Metal library.
data: The data from a precompiled Metal library. For more information, see [Building a shader library by precompiling source files]. // [Building a shader library by precompiling source files]: https://developer.apple.com/documentation/Metal/building-a-shader-library-by-precompiling-source-files
Return Value ¶
A new MTLLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
In Swift, you can also use the makeLibrary(data:) default implementation, which has a DispatchData parameter.
Use either method if your application manages its own archiving system for libraries — for example, if your app uses a single file that contains several libraries.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(data:)
func (MTLDeviceObject) NewLibraryWithSourceOptionsCompletionHandler ¶
func (o MTLDeviceObject) NewLibraryWithSourceOptionsCompletionHandler(source string, options IMTLCompileOptions, completionHandler ErrorHandler)
Asynchronously creates a Metal library instance by compiling the functions in a source string.
source: A string that contains source code for one or more Metal functions. For information about writing source in Metal Shading Language (MSL), see the [Metal Shading Language Specification]. // [Metal Shading Language Specification]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
options: An MTLCompileOptions instance that affects the compilation of the source code in the string.
completionHandler: A Swift closure or an Objective-C block the method calls when the library finishes loading.
Discussion ¶
Because there’s no search path to find other functions, the source may only import the Metal default library.
func (MTLDeviceObject) NewLibraryWithSourceOptionsError ¶
func (o MTLDeviceObject) NewLibraryWithSourceOptionsError(source string, options IMTLCompileOptions) (MTLLibrary, error)
Synchronously creates a Metal library instance by compiling the functions in a source string.
source: A string that contains source code for one or more Metal functions. For information about writing source in Metal Shading Language (MSL), see the [Metal Shading Language Specification]. // [Metal Shading Language Specification]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
options: An MTLCompileOptions instance that affects the compilation of the source code in the string.
Return Value ¶
A new MTLLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
Because there’s no search path to find other functions, the source may only import the Metal default library.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(source:options:)
func (MTLDeviceObject) NewLibraryWithStitchedDescriptorCompletionHandler ¶
func (o MTLDeviceObject) NewLibraryWithStitchedDescriptorCompletionHandler(descriptor IMTLStitchedLibraryDescriptor, completionHandler ErrorHandler)
Asynchronously creates a Metal library from the function stitching graphs in a descriptor.
descriptor: An MTLStitchedLibraryDescriptor instance.
completionHandler: A Swift closure or Objective-C block the method calls when the library finishes loading.
func (MTLDeviceObject) NewLibraryWithStitchedDescriptorError ¶
func (o MTLDeviceObject) NewLibraryWithStitchedDescriptorError(descriptor IMTLStitchedLibraryDescriptor) (MTLLibrary, error)
Synchronously creates a Metal library from the function stitching graphs in a descriptor.
descriptor: An MTLStitchedLibraryDescriptor instance.
Return Value ¶
A new MTLLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(stitchedDescriptor:)
func (MTLDeviceObject) NewLibraryWithURLError ¶
func (o MTLDeviceObject) NewLibraryWithURLError(url foundation.INSURL) (MTLLibrary, error)
Creates a Metal library instance that contains the functions in the Metal library file at a URL.
url: A URL to a Metal library file (ending in `XCUIElementTypeMetallib`).
Return Value ¶
A new MTLLibrary instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLibrary(URL:)
func (MTLDeviceObject) NewLogStateWithDescriptorError ¶
func (o MTLDeviceObject) NewLogStateWithDescriptorError(descriptor IMTLLogStateDescriptor) (MTLLogState, error)
Creates a shader log state with the provided configuration.
descriptor: The configuration for the new shader log state.
Return Value ¶
A new MTLLogState instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeLogState(descriptor:)
func (MTLDeviceObject) NewMTL4CommandQueue ¶
func (o MTLDeviceObject) NewMTL4CommandQueue() MTL4CommandQueue
Creates a new command queue.
Return Value ¶
A MTL4CommandQueue instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeMTL4CommandQueue()
func (MTLDeviceObject) NewMTL4CommandQueueWithDescriptorError ¶
func (o MTLDeviceObject) NewMTL4CommandQueueWithDescriptorError(descriptor IMTL4CommandQueueDescriptor) (MTL4CommandQueue, error)
Creates a new command queue from a queue descriptor.
descriptor: A MTL4CommandQueueDescriptor instance that configures the MTL4CommandQueue instance.
Return Value ¶
A MTL4CommandQueue instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeMTL4CommandQueue(descriptor:)
func (MTLDeviceObject) NewPipelineDataSetSerializerWithDescriptor ¶
func (o MTLDeviceObject) NewPipelineDataSetSerializerWithDescriptor(descriptor IMTL4PipelineDataSetSerializerDescriptor) MTL4PipelineDataSetSerializer
Creates a new pipeline data set serializer instance from a descriptor.
descriptor: A MTL4PipelineDataSetSerializerDescriptor instance that configures the new MTL4PipelineDataSetSerializer instance.
Return Value ¶
A MTL4PipelineDataSetSerializer instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makePipelineDataSetSerializer(descriptor:)
func (MTLDeviceObject) NewRasterizationRateMapWithDescriptor ¶
func (o MTLDeviceObject) NewRasterizationRateMapWithDescriptor(descriptor IMTLRasterizationRateMapDescriptor) MTLRasterizationRateMap
Creates a rasterization rate map instance.
descriptor: An MTLRasterizationRateMapDescriptor instance.
Return Value ¶
A new MTLRasterizationRateMapDescriptor instance if the method completes successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRasterizationRateMap(descriptor:)
func (MTLDeviceObject) NewRenderPipelineStateWithDescriptorCompletionHandler ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorCompletionHandler(descriptor IMTLRenderPipelineDescriptor, completionHandler ErrorHandler)
Asynchronously creates a render pipeline state.
descriptor: An MTLRenderPipelineDescriptor instance.
completionHandler: A Swift closure or an Objective-C block the method calls when it finishes creating the render pipeline state.
Discussion ¶
Use the graphics-rendering pipeline state to configure a render pass by calling the [SetRenderPipelineState] method of an MTLRenderCommandEncoder instance.
func (MTLDeviceObject) NewRenderPipelineStateWithDescriptorError ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorError(descriptor IMTLRenderPipelineDescriptor) (MTLRenderPipelineState, error)
Synchronously creates a render pipeline state.
descriptor: An MTLRenderPipelineDescriptor instance.
Return Value ¶
A new MTLRenderPipelineState instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
Use the graphics-rendering pipeline state to configure a render pass by calling the [SetRenderPipelineState] method of an MTLRenderCommandEncoder instance.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:)
func (MTLDeviceObject) NewRenderPipelineStateWithDescriptorOptionsCompletionHandler ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorOptionsCompletionHandler(descriptor IMTLRenderPipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
Asynchronously creates a render pipeline state and reflection information.
descriptor: An MTLRenderPipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
completionHandler: A Swift closure or an Objective-C block the method calls when it finishes creating the render pipeline state.
Discussion ¶
Use the graphics-rendering pipeline state to configure a render pass by calling the [SetRenderPipelineState] method of an MTLRenderCommandEncoder instance.
func (MTLDeviceObject) NewRenderPipelineStateWithDescriptorOptionsReflectionError ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithDescriptorOptionsReflectionError(descriptor IMTLRenderPipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedRenderPipelineReflection) (MTLRenderPipelineState, error)
Synchronously creates a render pipeline state and reflection information.
descriptor: An MTLRenderPipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
reflection: In Swift, an optional pointer to an MTLAutoreleasedRenderPipelineReflection optional. In Objective-C, a pointer to an MTLAutoreleasedRenderPipelineReflection instance.
Pass `nil` in either language when you don’t need reflection data. Otherwise on return, if the method completes successfully, it assigns an MTLRenderPipelineReflection instance to the pointee, which contains the details about the function arguments.
Return Value ¶
A new MTLRenderPipelineState instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
Use the graphics-rendering pipeline state to configure a render pass by calling the [SetRenderPipelineState] method of an MTLRenderCommandEncoder instance.
func (MTLDeviceObject) NewRenderPipelineStateWithMeshDescriptorOptionsCompletionHandler ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithMeshDescriptorOptionsCompletionHandler(descriptor IMTLMeshRenderPipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
Asynchronously creates a mesh render pipeline state and reflection information.
descriptor: An MTLMeshRenderPipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
completionHandler: A Swift closure or an Objective-C block the method calls when it finishes creating the render pipeline state.
Discussion ¶
Use the graphics-rendering pipeline state to configure a render pass by calling the [SetRenderPipelineState] method of an MTLRenderCommandEncoder instance.
func (MTLDeviceObject) NewRenderPipelineStateWithMeshDescriptorOptionsReflectionError ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithMeshDescriptorOptionsReflectionError(descriptor IMTLMeshRenderPipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedRenderPipelineReflection) (MTLRenderPipelineState, error)
Synchronously creates a mesh render pipeline state and reflection information.
descriptor: An MTLMeshRenderPipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
reflection: In Swift, an optional pointer to an MTLAutoreleasedRenderPipelineReflection optional. In Objective-C, a pointer to an MTLAutoreleasedRenderPipelineReflection instance.
Pass `nil` in either language when you don’t need reflection data. Otherwise on return, if the method completes successfully, it assigns an MTLRenderPipelineReflection instance to the pointee, which contains the details about the function arguments.
error: On return, if an error occurs, a pointer to an error information instance; otherwise, `nil`.
Return Value ¶
A new MTLRenderPipelineState instance if the method completes successfully; otherwise, `nil`.
Discussion ¶
Use the graphics-rendering pipeline state to configure a render pass by calling the [SetRenderPipelineState] method of an MTLRenderCommandEncoder instance.
func (MTLDeviceObject) NewRenderPipelineStateWithTileDescriptorOptionsCompletionHandler ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithTileDescriptorOptionsCompletionHandler(descriptor IMTLTileRenderPipelineDescriptor, options MTLPipelineOption, completionHandler ErrorHandler)
Asynchronously creates a tile shader’s render pipeline state and reflection information.
descriptor: An MTLTileRenderPipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
completionHandler: A Swift closure or an Objective-C block the method calls when it finishes creating the render pipeline state.
func (MTLDeviceObject) NewRenderPipelineStateWithTileDescriptorOptionsReflectionError ¶
func (o MTLDeviceObject) NewRenderPipelineStateWithTileDescriptorOptionsReflectionError(descriptor IMTLTileRenderPipelineDescriptor, options MTLPipelineOption, reflection *MTLAutoreleasedRenderPipelineReflection) (MTLRenderPipelineState, error)
Synchronously creates a tile shader’s render pipeline state and reflection information.
descriptor: An MTLTileRenderPipelineDescriptor instance.
options: An MTLPipelineOption instance that represents the reflection information you want the method to generate. // MTLPipelineOption: https://developer.apple.com/documentation/Metal/MTLPipelineOption
reflection: In Swift, an optional pointer to an MTLAutoreleasedRenderPipelineReflection optional. In Objective-C, a pointer to an MTLAutoreleasedRenderPipelineReflection instance.
Pass `nil` in either language when you don’t need reflection data. Otherwise on return, if the method completes successfully, it assigns an MTLRenderPipelineReflection instance to the pointee, which contains the details about the function arguments.
Return Value ¶
A new MTLRenderPipelineState instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
func (MTLDeviceObject) NewResidencySetWithDescriptorError ¶
func (o MTLDeviceObject) NewResidencySetWithDescriptorError(desc IMTLResidencySetDescriptor) (MTLResidencySet, error)
Creates a residency set, which can move resources in and out of memory residency.
desc: A descriptor instance that configures the residency set the method creates.
Return Value ¶
A new MTLResidencySet instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
Create an MTLResidencySet by creating and configuring an MTLResidencySetDescriptor instance and pass it to this method.
See Simplifying GPU resource management with residency sets for more information.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeResidencySet(descriptor:)
func (MTLDeviceObject) NewSamplerStateWithDescriptor ¶
func (o MTLDeviceObject) NewSamplerStateWithDescriptor(descriptor IMTLSamplerDescriptor) MTLSamplerState
Creates a sampler state instance.
descriptor: An MTLSamplerDescriptor instance.
Return Value ¶
A new MTLSamplerState instance if the method completed successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSamplerState(descriptor:)
func (MTLDeviceObject) NewSharedEvent ¶
func (o MTLDeviceObject) NewSharedEvent() MTLSharedEvent
Creates a new shared event instance that you can use to synchronize commands and resources across different GPU devices.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedEvent()
func (MTLDeviceObject) NewSharedEventWithHandle ¶
func (o MTLDeviceObject) NewSharedEventWithHandle(sharedEventHandle IMTLSharedEventHandle) MTLSharedEvent
Recreates a shared event from a handle.
sharedEventHandle: An MTLSharedEventHandle instance from another GPU device or process.
Return Value ¶
A new MTLSharedEvent instance if the method completed successfully; otherwise nil.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedEvent(handle:)
func (MTLDeviceObject) NewSharedEventWithMachPort ¶
func (o MTLDeviceObject) NewSharedEventWithMachPort(port uint32) MTLSharedEvent
NewSharedEventWithMachPort is a private SPI used for IOSurfaceSharedEvent interop. It may be unavailable on some runtimes.
func (MTLDeviceObject) NewSharedTextureWithDescriptor ¶
func (o MTLDeviceObject) NewSharedTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
Creates a texture that you can share across process boundaries.
descriptor: An MTLTextureDescriptor instance.
Return Value ¶
A new MTLTexture instance if the method completed successfully; otherwise `nil`.
Discussion ¶
You can create a shared texture but only with [ResourceStorageModePrivate]. You can share the texture with another process by:
- Creating a texture handle (see [NewSharedTextureHandle]) - Passing the texture handle to the other process - Creating a texture in the other process by calling the [NewSharedTextureWithHandle]method
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedTexture(descriptor:)
func (MTLDeviceObject) NewSharedTextureWithHandle ¶
func (o MTLDeviceObject) NewSharedTextureWithHandle(sharedHandle IMTLSharedTextureHandle) MTLTexture
Creates a texture that references a shared texture.
sharedHandle: An MTLSharedTextureHandle instance, typically from another process using the same GPU device.
Return Value ¶
A new MTLTexture instance if the method completed successfully; otherwise `nil`.
Discussion ¶
Call this method from the same MTLDevice instance that created the shared texture instance.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeSharedTexture(handle:)
func (MTLDeviceObject) NewTensorWithDescriptorError ¶
func (o MTLDeviceObject) NewTensorWithDescriptorError(descriptor IMTLTensorDescriptor) (MTLTensor, error)
Creates a tensor by allocating new memory.
descriptor: A description of the properties for the new tensor.
Return Value ¶
A new tensor instance that Metal configures using `descriptor` or `nil` if an error occurred.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTensor(descriptor:)
func (MTLDeviceObject) NewTextureViewPoolWithDescriptorError ¶
func (o MTLDeviceObject) NewTextureViewPoolWithDescriptorError(descriptor IMTLResourceViewPoolDescriptor) (MTLTextureViewPool, error)
Creates a new texture view pool from a resource view pool descriptor.
descriptor: A MTLResourceViewPoolDescriptor instance that configures the MTLTextureViewPool instance.
Return Value ¶
A MTLTextureViewPool instance, or `nil` if the function failed.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTextureViewPool(descriptor:)
func (MTLDeviceObject) NewTextureWithDescriptor ¶
func (o MTLDeviceObject) NewTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
Creates a new texture instance.
descriptor: An MTLTextureDescriptor instance.
Return Value ¶
A new MTLTexture instance if the method completed successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTexture(descriptor:)
func (MTLDeviceObject) NewTextureWithDescriptorIosurfacePlane ¶
func (o MTLDeviceObject) NewTextureWithDescriptorIosurfacePlane(descriptor IMTLTextureDescriptor, iosurface iosurface.IOSurfaceRef, plane uint) MTLTexture
Creates a texture instance that uses I/O surface to store its underlying data.
descriptor: An MTLTextureDescriptor instance.
iosurface: An [IOSurfaceRef] instance.
plane: A plane within i`osurface` the method sets as the texture’s underlying data.
Return Value ¶
A new MTLTexture instance if the method completed successfully; otherwise `nil`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/makeTexture(descriptor:iosurface:plane:)
func (MTLDeviceObject) PeerCount ¶
func (o MTLDeviceObject) PeerCount() uint32
The total number of GPUs in the peer group, if applicable.
Discussion ¶
A peer count value of `0` indicates the GPU isn’t in a peer group. Otherwise, the GPU is in a peer group and the value represents the total number of GPUs in the group, including this one.
See: https://developer.apple.com/documentation/Metal/MTLDevice/peerCount
func (MTLDeviceObject) PeerGroupID ¶
func (o MTLDeviceObject) PeerGroupID() uint64
The peer group ID the GPU belongs to, if applicable.
Discussion ¶
A group ID value of `0` indicates the GPU isn’t in a peer group. Otherwise, the GPU is in a peer group and the value is the group’s ID. All other GPUs in the same peer group have the same group ID.
See: https://developer.apple.com/documentation/Metal/MTLDevice/peerGroupID
func (MTLDeviceObject) PeerIndex ¶
func (o MTLDeviceObject) PeerIndex() uint32
The unique identifier for a GPU in a peer group.
Discussion ¶
If the GPU is part of a peer group (see peerGroupID or peerCount) the peer index is the GPU’s unique value within the group in the range `[0, `[peerCount]`)`.
See: https://developer.apple.com/documentation/Metal/MTLDevice/peerIndex
func (MTLDeviceObject) ProgrammableSamplePositionsSupported ¶
func (o MTLDeviceObject) ProgrammableSamplePositionsSupported() bool
A Boolean value that indicates whether the GPU supports programmable sample positions.
See: https://developer.apple.com/documentation/Metal/MTLDevice/areProgrammableSamplePositionsSupported
func (MTLDeviceObject) QueryTimestampFrequency ¶
func (o MTLDeviceObject) QueryTimestampFrequency() uint64
Queries the frequency of the GPU timestamp in ticks per second.
Return Value ¶
The frequency of the GPU timestamp in ticks per second.
See: https://developer.apple.com/documentation/Metal/MTLDevice/queryTimestampFrequency()
func (MTLDeviceObject) RasterOrderGroupsSupported ¶
func (o MTLDeviceObject) RasterOrderGroupsSupported() bool
A Boolean value that indicates whether the GPU supports raster order groups.
See: https://developer.apple.com/documentation/Metal/MTLDevice/areRasterOrderGroupsSupported
func (MTLDeviceObject) ReadWriteTextureSupport ¶
func (o MTLDeviceObject) ReadWriteTextureSupport() MTLReadWriteTextureTier
The GPU device’s texture support tier.
See: https://developer.apple.com/documentation/Metal/MTLDevice/readWriteTextureSupport
func (MTLDeviceObject) RecommendedMaxWorkingSetSize ¶
func (o MTLDeviceObject) RecommendedMaxWorkingSetSize() uint64
An approximation of how much memory, in bytes, this GPU device can allocate without affecting its runtime performance.
Discussion ¶
You can help the GPU maintain its performance by keeping the total memory footprint of its resources and heaps less than this threshold value.
See: https://developer.apple.com/documentation/Metal/MTLDevice/recommendedMaxWorkingSetSize
func (MTLDeviceObject) RegistryID ¶
func (o MTLDeviceObject) RegistryID() uint64
The GPU device’s registry identifier.
Discussion ¶
You can use the value to identify the same GPU across task boundaries because it’s global to all tasks.
See: https://developer.apple.com/documentation/Metal/MTLDevice/registryID
func (MTLDeviceObject) Removable ¶
func (o MTLDeviceObject) Removable() bool
A Boolean value that indicates whether the GPU is removable.
Discussion ¶
You can respond to GPU removal notifications by registering with the MTLCopyAllDevicesWithObserver(handler:) function in Swift, or the MTLCopyAllDevicesWithObserver function in Objective-C, and responding to the removalRequested and wasRemoved device notification names.
See: https://developer.apple.com/documentation/Metal/MTLDevice/isRemovable
func (MTLDeviceObject) SampleTimestampsGpuTimestamp ¶
func (o MTLDeviceObject) SampleTimestampsGpuTimestamp(cpuTimestamp *MTLTimestamp, gpuTimestamp *MTLTimestamp)
Captures and returns a CPU timestamp and a GPU timestamp from the same moment in time.
cpuTimestamp: A pointer the method uses to save a timestamp from the CPU.
gpuTimestamp: A pointer the method uses to save a timestamp from the GPU the device instance represents.
Discussion ¶
For an example of how and when to use corresponding timestamps from the CPU and GPU, see Converting GPU timestamps into CPU time.
See: https://developer.apple.com/documentation/Metal/MTLDevice/sampleTimestamps:gpuTimestamp:
func (MTLDeviceObject) SetShouldMaximizeConcurrentCompilation ¶
func (o MTLDeviceObject) SetShouldMaximizeConcurrentCompilation(value bool)
func (MTLDeviceObject) ShouldMaximizeConcurrentCompilation ¶
func (o MTLDeviceObject) ShouldMaximizeConcurrentCompilation() bool
A Boolean value that indicates whether the device uses additional CPU threads for compilation tasks.
See: https://developer.apple.com/documentation/Metal/MTLDevice/shouldMaximizeConcurrentCompilation
func (MTLDeviceObject) SizeOfCounterHeapEntry ¶
func (o MTLDeviceObject) SizeOfCounterHeapEntry(type_ MTL4CounterHeapType) uint
Returns the size, in bytes, of each entry in a counter heap of a specific counter heap type when your app resolves it into a usable format.
type: MTL4CounterHeapType value that represents the type of the MTL4CounterHeap to resolve. // MTL4CounterHeapType: https://developer.apple.com/documentation/Metal/MTL4CounterHeapType
Return Value ¶
The size of the post-transformation entry from a MTL4CounterHeap of type MTL4CounterHeapType.
Discussion ¶
In order to use the data available in a MTL4CounterHeap, your app first resolves it either in the CPU timeline or in the GPU timeline. When your app calls [ResolveCounterHeapWithRangeIntoBufferWaitFenceUpdateFence] to resolve counter data in the GPU timeline, Metal writes the data into a MTLBuffer.
During this process, Metal transform the data in the heap into a format consisting of entries of the size that this method advertises, based on the MTL4CounterHeapType.
See: https://developer.apple.com/documentation/Metal/MTLDevice/size(ofCounterHeapEntry:)
func (MTLDeviceObject) SparseTileSizeInBytes ¶
func (o MTLDeviceObject) SparseTileSizeInBytes() uint
Returns the size, in bytes, of a sparse tile the GPU device creates using a default page size.
See: https://developer.apple.com/documentation/Metal/MTLDevice/sparseTileSizeInBytes
func (MTLDeviceObject) SparseTileSizeInBytesForSparsePageSize ¶
func (o MTLDeviceObject) SparseTileSizeInBytesForSparsePageSize(sparsePageSize MTLSparsePageSize) uint
Returns the size, in bytes, of a sparse tile the GPU device creates with a specific page size.
sparsePageSize: An MTLSparsePageSize instance. // MTLSparsePageSize: https://developer.apple.com/documentation/Metal/MTLSparsePageSize
See: https://developer.apple.com/documentation/Metal/MTLDevice/sparseTileSizeInBytes(sparsePageSize:)
func (MTLDeviceObject) SparseTileSizeWithTextureTypePixelFormatSampleCount ¶
func (o MTLDeviceObject) SparseTileSizeWithTextureTypePixelFormatSampleCount(textureType MTLTextureType, pixelFormat MTLPixelFormat, sampleCount uint) MTLSize
Returns the dimensions of a sparse tile for a texture.
textureType: An MTLTextureType instance. // MTLTextureType: https://developer.apple.com/documentation/Metal/MTLTextureType
pixelFormat: An MTLPixelFormat instance. // MTLPixelFormat: https://developer.apple.com/documentation/Metal/MTLPixelFormat
sampleCount: The number of samples for each pixel.
Return Value ¶
A new MTLSize instance.
Discussion ¶
The size of a sparse tile, in bytes, is the same for all sparse textures on a GPU device object. Because the size of pixels may vary, the actual dimensions of a sparse tile vary based on the texture and the pixel format. Use this method to get the dimensions of the tile for a particular format. Use these dimensions when converting regions from pixel-based units to sparse tile units and vice versa.
func (MTLDeviceObject) SparseTileSizeWithTextureTypePixelFormatSampleCountSparsePageSize ¶
func (o MTLDeviceObject) SparseTileSizeWithTextureTypePixelFormatSampleCountSparsePageSize(textureType MTLTextureType, pixelFormat MTLPixelFormat, sampleCount uint, sparsePageSize MTLSparsePageSize) MTLSize
Returns the dimensions of a sparse tile for a texture that has a specific sparse page size.
textureType: An MTLTextureType instance. // MTLTextureType: https://developer.apple.com/documentation/Metal/MTLTextureType
pixelFormat: An MTLPixelFormat instance. // MTLPixelFormat: https://developer.apple.com/documentation/Metal/MTLPixelFormat
sampleCount: The number of samples for each pixel.
sparsePageSize: An MTLSparsePageSize instance. // MTLSparsePageSize: https://developer.apple.com/documentation/Metal/MTLSparsePageSize
Return Value ¶
A new MTLSize instance.
func (MTLDeviceObject) Supports32BitFloatFiltering ¶
func (o MTLDeviceObject) Supports32BitFloatFiltering() bool
A Boolean value that indicates whether the GPU can filter a texture with a 32-bit floating-point format.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supports32BitFloatFiltering
func (MTLDeviceObject) Supports32BitMSAA ¶
func (o MTLDeviceObject) Supports32BitMSAA() bool
A Boolean value that indicates whether the GPU can allocate 32-bit integer texture formats and resolve to 32-bit floating-point texture formats.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supports32BitMSAA
func (MTLDeviceObject) SupportsBCTextureCompression ¶
func (o MTLDeviceObject) SupportsBCTextureCompression() bool
A Boolean value that indicates whether you can use textures that use BC compression.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsBCTextureCompression
func (MTLDeviceObject) SupportsCounterSampling ¶
func (o MTLDeviceObject) SupportsCounterSampling(samplingPoint MTLCounterSamplingPoint) bool
Returns a Boolean value that indicates whether you can read GPU counters at the specified command boundary.
samplingPoint: The command boundary to test.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsCounterSampling(_:)
func (MTLDeviceObject) SupportsDynamicLibraries ¶
func (o MTLDeviceObject) SupportsDynamicLibraries() bool
A Boolean value that indicates whether the GPU device can create and use dynamic libraries in compute pipelines.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsDynamicLibraries
func (MTLDeviceObject) SupportsFamily ¶
func (o MTLDeviceObject) SupportsFamily(gpuFamily MTLGPUFamily) bool
Returns a Boolean value that indicates whether the GPU device supports the feature set of a specific GPU family.
gpuFamily: An MTLGPUFamily instance. // MTLGPUFamily: https://developer.apple.com/documentation/Metal/MTLGPUFamily
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsFamily(_:)
func (MTLDeviceObject) SupportsFunctionPointers ¶
func (o MTLDeviceObject) SupportsFunctionPointers() bool
A Boolean value that indicates whether the device supports function pointers in compute kernel functions.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsFunctionPointers
func (MTLDeviceObject) SupportsFunctionPointersFromRender ¶
func (o MTLDeviceObject) SupportsFunctionPointersFromRender() bool
A Boolean value that indicates whether the device supports function pointers in render functions.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsFunctionPointersFromRender
func (MTLDeviceObject) SupportsPlacementSparse ¶
func (o MTLDeviceObject) SupportsPlacementSparse() bool
A Boolean value that indicates whether the device supports placement sparse resources.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsPlacementSparse
func (MTLDeviceObject) SupportsPrimitiveMotionBlur ¶
func (o MTLDeviceObject) SupportsPrimitiveMotionBlur() bool
A Boolean value that indicates whether the GPU device supports motion blur for ray tracing.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsPrimitiveMotionBlur
func (MTLDeviceObject) SupportsPullModelInterpolation ¶
func (o MTLDeviceObject) SupportsPullModelInterpolation() bool
A Boolean value that indicates whether the GPU can compute multiple interpolations of a fragment function’s input.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsPullModelInterpolation
func (MTLDeviceObject) SupportsQueryTextureLOD ¶
func (o MTLDeviceObject) SupportsQueryTextureLOD() bool
A Boolean value that indicates whether you can query the texture level of detail from within a shader.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsQueryTextureLOD
func (MTLDeviceObject) SupportsRasterizationRateMapWithLayerCount ¶
func (o MTLDeviceObject) SupportsRasterizationRateMapWithLayerCount(layerCount uint) bool
Returns a Boolean value that indicates whether the GPU can create a rasterization rate map with a specific number of layers.
layerCount: The number of layers for a rasterization rate map.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRasterizationRateMap(layerCount:)
func (MTLDeviceObject) SupportsRaytracing ¶
func (o MTLDeviceObject) SupportsRaytracing() bool
A Boolean value that indicates whether the GPU device supports ray tracing.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRaytracing
func (MTLDeviceObject) SupportsRaytracingFromRender ¶
func (o MTLDeviceObject) SupportsRaytracingFromRender() bool
A Boolean value that indicates whether you can call ray-tracing functions from a vertex or fragment shader.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRaytracingFromRender
func (MTLDeviceObject) SupportsRenderDynamicLibraries ¶
func (o MTLDeviceObject) SupportsRenderDynamicLibraries() bool
A Boolean value that indicates whether the GPU device can create and use dynamic libraries in render pipelines.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsRenderDynamicLibraries
func (MTLDeviceObject) SupportsShaderBarycentricCoordinates ¶
func (o MTLDeviceObject) SupportsShaderBarycentricCoordinates() bool
A Boolean value that indicates whether the GPU supports barycentric coordinates.
Discussion ¶
If a GPU device supports barycentric coordinates, a fragment shader can receive them by adding the `[[barycentric_coord]]` attribute to one of its arguments. See the Metal Shading Language specification and Detecting GPU features and Metal software versions for more information.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsShaderBarycentricCoordinates
func (MTLDeviceObject) SupportsTextureSampleCount ¶
func (o MTLDeviceObject) SupportsTextureSampleCount(sampleCount uint) bool
Returns a Boolean value that indicates whether the GPU can sample a texture with a specific number of sample points.
sampleCount: The number of points a GPU can sample from a texture.
Discussion ¶
The number of points the GPU can sample a texture varies by device:
[Table data omitted]
Consider a GPU device’s limitations for sample count by checking [MTLTexture]`.`[SampleCount] when configuring these properties:
- [MTLTextureDescriptor]`.`[SampleCount] - [MTLRenderPipelineDescriptor]`.`[RasterSampleCount] - [MTLTileRenderPipelineDescriptor]`.`[RasterSampleCount] - [MTLMeshRenderPipelineDescriptor]`.`[RasterSampleCount] - MTKView`.`sampleCount
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsTextureSampleCount(_:)
func (MTLDeviceObject) SupportsVertexAmplificationCount ¶
func (o MTLDeviceObject) SupportsVertexAmplificationCount(count uint) bool
Returns a Boolean value that indicates whether the GPU supports an amplification factor.
count: An integer that represents the number of output streams you want the GPU to generate from an input stream.
Discussion ¶
A vertex amplification factor of `1` has no effect because it effectively disables vertex amplification.
For more information about vertex amplification, see Improving rendering performance with vertex amplification.
See: https://developer.apple.com/documentation/Metal/MTLDevice/supportsVertexAmplificationCount(_:)
func (MTLDeviceObject) TensorSizeAndAlignWithDescriptor ¶
func (o MTLDeviceObject) TensorSizeAndAlignWithDescriptor(descriptor IMTLTensorDescriptor) MTLSizeAndAlign
Determines the size and alignment required to hold the data of a tensor you create with a descriptor in a buffer.
descriptor: A description of the properties for the new tensor.
Return Value ¶
The size and alignment required to hold the data of a tensor you create with `descriptor` in a buffer.
See: https://developer.apple.com/documentation/Metal/MTLDevice/tensorSizeAndAlign(descriptor:)
type MTLDispatchThreadgroupsIndirectArguments ¶
type MTLDispatchThreadgroupsIndirectArguments struct {
ThreadgroupsPerGrid uint32 // The number of threadgroups for the grid, in each dimension.
}
MTLDispatchThreadgroupsIndirectArguments - The data layout required for arguments needed to specify the size of threadgroups.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLDispatchThreadgroupsIndirectArguments
type MTLDispatchThreadsIndirectArguments ¶
type MTLDispatchThreadsIndirectArguments struct {
ThreadsPerGrid uint32
ThreadsPerThreadgroup uint32
}
MTLDispatchThreadsIndirectArguments
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLDispatchThreadsIndirectArguments
type MTLDispatchType ¶
type MTLDispatchType int
See: https://developer.apple.com/documentation/Metal/MTLDispatchType
const ( // MTLDispatchTypeConcurrent: Sets a command encoder to dispatch encoded commands concurrently during your pass. MTLDispatchTypeConcurrent MTLDispatchType = 1 // MTLDispatchTypeSerial: Sets a command encoder to dispatch encoded commands serially during your pass. MTLDispatchTypeSerial MTLDispatchType = 0 )
func (MTLDispatchType) String ¶
func (e MTLDispatchType) String() string
type MTLDrawIndexedPrimitivesIndirectArguments ¶
type MTLDrawIndexedPrimitivesIndirectArguments struct {
IndexCount uint32 // For each instance, the number of indices to read from the index buffer.
InstanceCount uint32 // The number of instances to draw.
IndexStart uint32 // The first index to draw.
BaseVertex int32 // The first vertex to draw.
BaseInstance uint32 // The first instance to draw.
}
MTLDrawIndexedPrimitivesIndirectArguments - The data layout required for drawing indexed primitives via indirect buffer calls.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLDrawIndexedPrimitivesIndirectArguments
type MTLDrawPatchIndirectArguments ¶
type MTLDrawPatchIndirectArguments struct {
PatchCount uint32 // The number of patches in each instance.
InstanceCount uint32 // The number of instances to draw.
PatchStart uint32 // The patch start index.
BaseInstance uint32 // The first instance to draw.
}
MTLDrawPatchIndirectArguments - The data layout required for drawing patches via indirect buffer calls.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLDrawPatchIndirectArguments
type MTLDrawPrimitivesIndirectArguments ¶
type MTLDrawPrimitivesIndirectArguments struct {
VertexCount uint32 // The number of vertices to draw.
InstanceCount uint32 // The number of instances to draw.
VertexStart uint32 // The first vertex to draw.
BaseInstance uint32 // The first instance to draw.
}
MTLDrawPrimitivesIndirectArguments - The data layout required for drawing primitives via indirect buffer calls.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLDrawPrimitivesIndirectArguments
type MTLDrawable ¶
type MTLDrawable interface {
objectivec.IObject
// A positive integer that identifies the drawable.
//
// See: https://developer.apple.com/documentation/Metal/MTLDrawable/drawableID
DrawableID() uint
// Presents the drawable onscreen as soon as possible.
//
// See: https://developer.apple.com/documentation/Metal/MTLDrawable/present()
Present()
// Presents the drawable onscreen as soon as possible after a previous drawable is visible for the specified duration.
//
// See: https://developer.apple.com/documentation/Metal/MTLDrawable/present(afterMinimumDuration:)
PresentAfterMinimumDuration(duration float64)
// Presents the drawable onscreen at a specific host time.
//
// See: https://developer.apple.com/documentation/Metal/MTLDrawable/present(at:)
PresentAtTime(presentationTime float64)
// Registers a block of code to be called immediately after the drawable is presented.
//
// See: https://developer.apple.com/documentation/Metal/MTLDrawable/addPresentedHandler(_:)
AddPresentedHandler(block MTLDrawablePresentedHandler)
// The host time, in seconds, when the drawable was displayed onscreen.
//
// See: https://developer.apple.com/documentation/Metal/MTLDrawable/presentedTime
PresentedTime() float64
}
A displayable resource that can be rendered or written to.
See: https://developer.apple.com/documentation/Metal/MTLDrawable
type MTLDrawableObject ¶
type MTLDrawableObject struct {
objectivec.Object
}
MTLDrawableObject wraps an existing Objective-C object that conforms to the MTLDrawable protocol.
func MTLDrawableObjectFromID ¶
func MTLDrawableObjectFromID(id objc.ID) MTLDrawableObject
MTLDrawableObjectFromID constructs a MTLDrawableObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLDrawableObject) AddPresentedHandler ¶
func (o MTLDrawableObject) AddPresentedHandler(block MTLDrawablePresentedHandler)
Registers a block of code to be called immediately after the drawable is presented.
block: A block of code to be invoked.
Discussion ¶
You can register multiple handlers for a single drawable object.
The following example code schedules a presentation handler that reads the [PresentedTime] property and uses it to derive the interval between the last and current presentation times. From that information, it determines the app’s frame rate.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/addPresentedHandler(_:)
func (MTLDrawableObject) BaseObject ¶
func (o MTLDrawableObject) BaseObject() objectivec.Object
func (MTLDrawableObject) DrawableID ¶
func (o MTLDrawableObject) DrawableID() uint
A positive integer that identifies the drawable.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/drawableID
func (MTLDrawableObject) Present ¶
func (o MTLDrawableObject) Present()
Presents the drawable onscreen as soon as possible.
Discussion ¶
When a command queue schedules a command buffer for execution, it tracks whether any commands in that command buffer need to render or write to the drawable object. When you call this method, the drawable presents its contents as soon as possible after all scheduled render or write requests for that drawable are complete.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/present()
func (MTLDrawableObject) PresentAfterMinimumDuration ¶
func (o MTLDrawableObject) PresentAfterMinimumDuration(duration float64)
Presents the drawable onscreen as soon as possible after a previous drawable is visible for the specified duration.
duration: The previous drawable’s minimum display time, in seconds.
Discussion ¶
When a command queue schedules a command buffer for execution, it tracks whether any commands in that command buffer need to render or write to the drawable object. When you call this method, the drawable presents its contents at a future time when all render and write requests for that drawable are complete and a previous drawable has been visible onscreen for the specified duration. Use this method to schedule drawables at a regular interval.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/present(afterMinimumDuration:)
func (MTLDrawableObject) PresentAtTime ¶
func (o MTLDrawableObject) PresentAtTime(presentationTime float64)
Presents the drawable onscreen at a specific host time.
presentationTime: The Mach absolute time at which the drawable should be presented, in seconds.
Discussion ¶
When a command queue schedules a command buffer for execution, it tracks whether any commands in that command buffer need to render or write to the drawable object. When you call this method, the drawable waits until all render and write requests for that drawable are complete. If they complete prior to the specified time, the drawable presents the content at that time. If the commands complete after the presentation time, the drawable presents its contents as soon as possible.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/present(at:)
func (MTLDrawableObject) PresentedTime ¶
func (o MTLDrawableObject) PresentedTime() float64
The host time, in seconds, when the drawable was displayed onscreen.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/presentedTime
type MTLDrawablePresentedHandler ¶
type MTLDrawablePresentedHandler = func(MTLDrawable)
MTLDrawablePresentedHandler is a block of code invoked after a drawable is presented.
See: https://developer.apple.com/documentation/Metal/MTLDrawablePresentedHandler
type MTLDynamicLibrary ¶
type MTLDynamicLibrary interface {
objectivec.IObject
// The Metal device object that created the dynamic library.
//
// See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/device
Device() MTLDevice
// A file path for this dynamic library.
//
// See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/installName
InstallName() string
// A string that identifies the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/label
Label() string
// Writes the contents of the dynamic library to a file.
//
// See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/serialize(to:)
SerializeToURLError(url foundation.INSURL) (bool, error)
// A string that identifies the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/label
SetLabel(value string)
}
A dynamically linkable representation of compiled shader code for a specific Metal device object.
See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary
type MTLDynamicLibraryError ¶
type MTLDynamicLibraryError int
See: https://developer.apple.com/documentation/Metal/MTLDynamicLibraryError-swift.struct/Code
const ( // MTLDynamicLibraryErrorCompilationFailure: An error code that indicates Metal couldn’t compile a dynamic library. MTLDynamicLibraryErrorCompilationFailure MTLDynamicLibraryError = 2 // MTLDynamicLibraryErrorDependencyLoadFailure: An error code that indicates a dynamic library couldn’t link to other dynamic libraries. MTLDynamicLibraryErrorDependencyLoadFailure MTLDynamicLibraryError = 4 // MTLDynamicLibraryErrorInvalidFile: An error code that indicates an app is using an invalid reference to a library file, typically related to a URL. MTLDynamicLibraryErrorInvalidFile MTLDynamicLibraryError = 1 // MTLDynamicLibraryErrorNone: An error code that represents the absence of any problems. MTLDynamicLibraryErrorNone MTLDynamicLibraryError = 0 // MTLDynamicLibraryErrorUnresolvedInstallName: An error code that indicates Metal couldn’t resolve the installation name for a new dynamic library. MTLDynamicLibraryErrorUnresolvedInstallName MTLDynamicLibraryError = 3 // MTLDynamicLibraryErrorUnsupported: An error code that indicates the GPU device doesn’t support dynamic libraries. MTLDynamicLibraryErrorUnsupported MTLDynamicLibraryError = 5 )
func (MTLDynamicLibraryError) String ¶
func (e MTLDynamicLibraryError) String() string
type MTLDynamicLibraryObject ¶
type MTLDynamicLibraryObject struct {
objectivec.Object
}
MTLDynamicLibraryObject wraps an existing Objective-C object that conforms to the MTLDynamicLibrary protocol.
func MTLDynamicLibraryObjectFromID ¶
func MTLDynamicLibraryObjectFromID(id objc.ID) MTLDynamicLibraryObject
MTLDynamicLibraryObjectFromID constructs a MTLDynamicLibraryObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLDynamicLibraryObject) BaseObject ¶
func (o MTLDynamicLibraryObject) BaseObject() objectivec.Object
func (MTLDynamicLibraryObject) Device ¶
func (o MTLDynamicLibraryObject) Device() MTLDevice
The Metal device object that created the dynamic library.
See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/device
func (MTLDynamicLibraryObject) InstallName ¶
func (o MTLDynamicLibraryObject) InstallName() string
A file path for this dynamic library.
See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/installName
func (MTLDynamicLibraryObject) Label ¶
func (o MTLDynamicLibraryObject) Label() string
A string that identifies the library.
See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/label
func (MTLDynamicLibraryObject) SerializeToURLError ¶
func (o MTLDynamicLibraryObject) SerializeToURLError(url foundation.INSURL) (bool, error)
Writes the contents of the dynamic library to a file.
url: The URL for the destination file.
Discussion ¶
When the methods succeeds, the file contains a representation of the MTLLibrary from the MTLDynamicLibrary that creates it, as well as the binaries it has for the device your app is running on.
Such files may be combined with offline tools to contain the compiled code for multiple devices.
If this MTLDynamicLibrary was created from a file that contained compiled code for multiple devices, the compiled code for all other devices is not written (since only compiled code for the current device was loaded).
See: https://developer.apple.com/documentation/Metal/MTLDynamicLibrary/serialize(to:)
func (MTLDynamicLibraryObject) SetLabel ¶
func (o MTLDynamicLibraryObject) SetLabel(value string)
type MTLEvent ¶
type MTLEvent interface {
objectivec.IObject
// The device object that created the event.
//
// See: https://developer.apple.com/documentation/Metal/MTLEvent/device
Device() MTLDevice
// A string that identifies the event.
//
// See: https://developer.apple.com/documentation/Metal/MTLEvent/label
Label() string
// A string that identifies the event.
//
// See: https://developer.apple.com/documentation/Metal/MTLEvent/label
SetLabel(value string)
}
A type that synchronizes memory operations to one or more resources within a single Metal device.
See: https://developer.apple.com/documentation/Metal/MTLEvent
type MTLEventObject ¶
type MTLEventObject struct {
objectivec.Object
}
MTLEventObject wraps an existing Objective-C object that conforms to the MTLEvent protocol.
func MTLEventObjectFromID ¶
func MTLEventObjectFromID(id objc.ID) MTLEventObject
MTLEventObjectFromID constructs a MTLEventObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLEventObject) BaseObject ¶
func (o MTLEventObject) BaseObject() objectivec.Object
func (MTLEventObject) Device ¶
func (o MTLEventObject) Device() MTLDevice
The device object that created the event.
See: https://developer.apple.com/documentation/Metal/MTLEvent/device
func (MTLEventObject) Label ¶
func (o MTLEventObject) Label() string
A string that identifies the event.
See: https://developer.apple.com/documentation/Metal/MTLEvent/label
func (MTLEventObject) SetLabel ¶
func (o MTLEventObject) SetLabel(value string)
type MTLFeatureSet ¶
type MTLFeatureSet int
See: https://developer.apple.com/documentation/Metal/MTLFeatureSet
const ( // Deprecated. MTLFeatureSet_OSX_GPUFamily1_v1 MTLFeatureSet = 10000 // Deprecated. MTLFeatureSet_OSX_GPUFamily1_v2 MTLFeatureSet = 10001 // Deprecated. MTLFeatureSet_OSX_ReadWriteTextureTier2 MTLFeatureSet = 10002 // Deprecated. MTLFeatureSet_TVOS_GPUFamily1_v1 MTLFeatureSet = 30000 // Deprecated. MTLFeatureSet_iOS_GPUFamily1_v1 MTLFeatureSet = 0 // Deprecated. MTLFeatureSet_iOS_GPUFamily1_v2 MTLFeatureSet = 2 // Deprecated. MTLFeatureSet_iOS_GPUFamily1_v3 MTLFeatureSet = 5 // Deprecated. MTLFeatureSet_iOS_GPUFamily1_v4 MTLFeatureSet = 8 // Deprecated. MTLFeatureSet_iOS_GPUFamily1_v5 MTLFeatureSet = 12 // Deprecated. MTLFeatureSet_iOS_GPUFamily2_v1 MTLFeatureSet = 1 // Deprecated. MTLFeatureSet_iOS_GPUFamily2_v2 MTLFeatureSet = 3 // Deprecated. MTLFeatureSet_iOS_GPUFamily2_v3 MTLFeatureSet = 6 // Deprecated. MTLFeatureSet_iOS_GPUFamily2_v4 MTLFeatureSet = 9 // Deprecated. MTLFeatureSet_iOS_GPUFamily2_v5 MTLFeatureSet = 13 // Deprecated. MTLFeatureSet_iOS_GPUFamily3_v1 MTLFeatureSet = 4 // Deprecated. MTLFeatureSet_iOS_GPUFamily3_v2 MTLFeatureSet = 7 // Deprecated. MTLFeatureSet_iOS_GPUFamily3_v3 MTLFeatureSet = 10 // Deprecated. MTLFeatureSet_iOS_GPUFamily3_v4 MTLFeatureSet = 14 // Deprecated. MTLFeatureSet_iOS_GPUFamily4_v1 MTLFeatureSet = 11 // Deprecated. MTLFeatureSet_iOS_GPUFamily4_v2 MTLFeatureSet = 15 // Deprecated. MTLFeatureSet_iOS_GPUFamily5_v1 MTLFeatureSet = 16 // Deprecated. MTLFeatureSet_macOS_GPUFamily1_v1 MTLFeatureSet = 10000 // Deprecated. MTLFeatureSet_macOS_GPUFamily1_v2 MTLFeatureSet = 10001 // Deprecated. MTLFeatureSet_macOS_GPUFamily1_v3 MTLFeatureSet = 10003 // Deprecated. MTLFeatureSet_macOS_GPUFamily1_v4 MTLFeatureSet = 10004 // Deprecated. MTLFeatureSet_macOS_GPUFamily2_v1 MTLFeatureSet = 10005 // Deprecated. MTLFeatureSet_macOS_ReadWriteTextureTier2 MTLFeatureSet = 10002 // Deprecated. MTLFeatureSet_tvOS_GPUFamily1_v1 MTLFeatureSet = 30000 // Deprecated. MTLFeatureSet_tvOS_GPUFamily1_v2 MTLFeatureSet = 30001 // Deprecated. MTLFeatureSet_tvOS_GPUFamily1_v3 MTLFeatureSet = 30002 // Deprecated. MTLFeatureSet_tvOS_GPUFamily1_v4 MTLFeatureSet = 30004 // Deprecated. MTLFeatureSet_tvOS_GPUFamily2_v1 MTLFeatureSet = 30003 // Deprecated. MTLFeatureSet_tvOS_GPUFamily2_v2 MTLFeatureSet = 30005 )
func (MTLFeatureSet) String ¶
func (e MTLFeatureSet) String() string
type MTLFence ¶
type MTLFence interface {
objectivec.IObject
// The device object that created the fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLFence/device
Device() MTLDevice
// A string that identifies the fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLFence/label
Label() string
// A string that identifies the fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLFence/label
SetLabel(value string)
}
A synchronization mechanism that orders memory operations between GPU passes.
See: https://developer.apple.com/documentation/Metal/MTLFence
type MTLFenceObject ¶
type MTLFenceObject struct {
objectivec.Object
}
MTLFenceObject wraps an existing Objective-C object that conforms to the MTLFence protocol.
func MTLFenceObjectFromID ¶
func MTLFenceObjectFromID(id objc.ID) MTLFenceObject
MTLFenceObjectFromID constructs a MTLFenceObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLFenceObject) BaseObject ¶
func (o MTLFenceObject) BaseObject() objectivec.Object
func (MTLFenceObject) Device ¶
func (o MTLFenceObject) Device() MTLDevice
The device object that created the fence.
See: https://developer.apple.com/documentation/Metal/MTLFence/device
func (MTLFenceObject) Label ¶
func (o MTLFenceObject) Label() string
A string that identifies the fence.
See: https://developer.apple.com/documentation/Metal/MTLFence/label
func (MTLFenceObject) SetLabel ¶
func (o MTLFenceObject) SetLabel(value string)
type MTLFunction ¶
type MTLFunction interface {
objectivec.IObject
// The device object that created the shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/device
Device() MTLDevice
// A string that identifies the shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/label
Label() string
// The shader function’s type.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/functionType
FunctionType() MTLFunctionType
// The function’s name.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/name
Name() string
// The options that Metal used to compile this function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/options
Options() MTLFunctionOptions
// The tessellation patch type of a post-tessellation vertex function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/patchType
PatchType() MTLPatchType
// The number of patch control points in the post-tessellation vertex function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/patchControlPointCount
PatchControlPointCount() int
// An array that describes the vertex input attributes to a vertex function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/vertexAttributes
VertexAttributes() []MTLVertexAttribute
// An array that describes the input attributes to the function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/stageInputAttributes
StageInputAttributes() []MTLAttribute
// A dictionary of function constants for a specialized function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/functionConstantsDictionary
FunctionConstantsDictionary() foundation.INSDictionary
// Creates an argument encoder for an argument buffer that’s one of this function’s arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/makeArgumentEncoder(bufferIndex:)
NewArgumentEncoderWithBufferIndex(bufferIndex uint) MTLArgumentEncoder
// A string that identifies the shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunction/label
SetLabel(value string)
}
A interface that represents a public shader function in a Metal library.
See: https://developer.apple.com/documentation/Metal/MTLFunction
type MTLFunctionConstant ¶
type MTLFunctionConstant struct {
objectivec.Object
}
A constant that specializes the behavior of a shader.
Overview ¶
Don’t create an MTLFunctionConstant instance directly. Instead, the list of function constants for a function by querying the `functionConstants` property of an MTLFunction instance.
An MTLFunctionConstant instance should only be obtained from a nonspecialized function created with the [NewFunctionWithName] method. You only need an MTLFunctionConstant instance if you don’t have sufficient information to create an MTLFunctionConstantValues instance used to create a specialized function with the [NewFunctionWithNameConstantValuesError] or [NewFunctionWithNameConstantValuesCompletionHandler] method.
Reading the function constant’s properties ¶
- MTLFunctionConstant.Name: The name of the function constant.
- MTLFunctionConstant.Type: The data type of the function constant.
- MTLFunctionConstant.Index: The index of the function constant.
- MTLFunctionConstant.Required: A Boolean value indicating whether the function constant needs to be provided to specialize the function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstant
func MTLFunctionConstantFromID ¶
func MTLFunctionConstantFromID(id objc.ID) MTLFunctionConstant
MTLFunctionConstantFromID constructs a MTLFunctionConstant from an objc.ID.
A constant that specializes the behavior of a shader.
func NewMTLFunctionConstant ¶
func NewMTLFunctionConstant() MTLFunctionConstant
NewMTLFunctionConstant creates a new MTLFunctionConstant instance.
func (MTLFunctionConstant) Autorelease ¶
func (f MTLFunctionConstant) Autorelease() MTLFunctionConstant
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionConstant) Index ¶
func (f MTLFunctionConstant) Index() uint
The index of the function constant.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstant/index
func (MTLFunctionConstant) Init ¶
func (f MTLFunctionConstant) Init() MTLFunctionConstant
Init initializes the instance.
func (MTLFunctionConstant) Name ¶
func (f MTLFunctionConstant) Name() string
The name of the function constant.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstant/name
func (MTLFunctionConstant) Required ¶
func (f MTLFunctionConstant) Required() bool
A Boolean value indicating whether the function constant needs to be provided to specialize the function.
Discussion ¶
This value is true if a constant value needs to be provided for the function constant. A function constant is optional only if it is referenced in a call to the built-in `is_function_constant_defined(name)` function.
Refer to the Metal Shading Language Guide for more information.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstant/required
func (MTLFunctionConstant) Type ¶
func (f MTLFunctionConstant) Type() MTLDataType
The data type of the function constant.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstant/type
type MTLFunctionConstantClass ¶
type MTLFunctionConstantClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionConstantClass ¶
func GetMTLFunctionConstantClass() MTLFunctionConstantClass
GetMTLFunctionConstantClass returns the class object for MTLFunctionConstant.
func (MTLFunctionConstantClass) Alloc ¶
func (mc MTLFunctionConstantClass) Alloc() MTLFunctionConstant
Alloc allocates memory for a new instance of the class.
type MTLFunctionConstantValues ¶
type MTLFunctionConstantValues struct {
objectivec.Object
}
A set of constant values that specialize a graphics or compute GPU function.
Overview ¶
An MTLFunctionConstantValues instance sets constant values for function constants. You declare function constants with the `[[ function_constant(index) ]]` attribute in MSL (Metal Shading Language) source code. See the Metal Shading Language specification for more information.
With an MTLFunctionConstantValues instance, you can set each constant value individually with an index or a name, or set multiple constant values with an index range.
You can apply a single MTLFunctionConstantValues instance to multiple MTLFunction instances of any kind, such as a vertex function and a fragment function. When you create a specialized function, subsequent changes to its constant values have no effect. However, you can reset, add, or modify a constant value in your MTLFunctionConstantValues instance and reuse it to create another MTLFunction instance.
Setting constant values ¶
- MTLFunctionConstantValues.SetConstantValueTypeAtIndex: Sets a value for a function constant at a specific index.
- MTLFunctionConstantValues.SetConstantValueTypeWithName: Sets a value for a function constant with a specific name.
Resetting constant values ¶
- MTLFunctionConstantValues.Reset: Deletes all previously set constant values.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstantValues
func MTLFunctionConstantValuesFromID ¶
func MTLFunctionConstantValuesFromID(id objc.ID) MTLFunctionConstantValues
MTLFunctionConstantValuesFromID constructs a MTLFunctionConstantValues from an objc.ID.
A set of constant values that specialize a graphics or compute GPU function.
func NewMTLFunctionConstantValues ¶
func NewMTLFunctionConstantValues() MTLFunctionConstantValues
NewMTLFunctionConstantValues creates a new MTLFunctionConstantValues instance.
func (MTLFunctionConstantValues) Autorelease ¶
func (f MTLFunctionConstantValues) Autorelease() MTLFunctionConstantValues
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionConstantValues) Init ¶
func (f MTLFunctionConstantValues) Init() MTLFunctionConstantValues
Init initializes the instance.
func (MTLFunctionConstantValues) Reset ¶
func (f MTLFunctionConstantValues) Reset()
Deletes all previously set constant values.
Discussion ¶
You don’t need to call this method if you don’t set any constant values.
See: https://developer.apple.com/documentation/Metal/MTLFunctionConstantValues/reset()
func (MTLFunctionConstantValues) SetConstantValueTypeAtIndex ¶
func (f MTLFunctionConstantValues) SetConstantValueTypeAtIndex(value unsafe.Pointer, type_ MTLDataType, index uint)
Sets a value for a function constant at a specific index.
value: A pointer to the constant value.
type: The data type of the function constant.
index: The index of the function constant.
Discussion ¶
Declare a single function constant in Metal Shading Language (MSL).
Set its value by assigning with a specific index.
func (MTLFunctionConstantValues) SetConstantValueTypeWithName ¶
func (f MTLFunctionConstantValues) SetConstantValueTypeWithName(value unsafe.Pointer, type_ MTLDataType, name string)
Sets a value for a function constant with a specific name.
value: A pointer to the constant value.
type: The data type of the function constant.
name: The name of the function constant.
Discussion ¶
The first example declares a single function constant in a Metal Shading Language file.
The next example sets that Boolean value by providing its specific name.
func (MTLFunctionConstantValues) SetConstantValuesTypeWithRange ¶
func (f MTLFunctionConstantValues) SetConstantValuesTypeWithRange(values unsafe.Pointer, type_ MTLDataType, range_ foundation.NSRange)
Sets values for a group of function constants within a specific index range.
values: A pointer to the constant values.
type: The data type of the function constants.
range: The range of the function constant indices.
Discussion ¶
Declare multiple function constants in Metal Shading Language (MSL).
Set their values by assigning an index range of an array.
type MTLFunctionConstantValuesClass ¶
type MTLFunctionConstantValuesClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionConstantValuesClass ¶
func GetMTLFunctionConstantValuesClass() MTLFunctionConstantValuesClass
GetMTLFunctionConstantValuesClass returns the class object for MTLFunctionConstantValues.
func (MTLFunctionConstantValuesClass) Alloc ¶
func (mc MTLFunctionConstantValuesClass) Alloc() MTLFunctionConstantValues
Alloc allocates memory for a new instance of the class.
type MTLFunctionDescriptor ¶
type MTLFunctionDescriptor struct {
objectivec.Object
}
A description of a function object to create.
Specifying the function configuration ¶
- MTLFunctionDescriptor.Name: The name of the function to fetch from the library.
- MTLFunctionDescriptor.SetName
- MTLFunctionDescriptor.SpecializedName: A new name for the created function object.
- MTLFunctionDescriptor.SetSpecializedName
- MTLFunctionDescriptor.ConstantValues: The set of constant values assigned to the function constants.
- MTLFunctionDescriptor.SetConstantValues
- MTLFunctionDescriptor.Options: Flags specifying how Metal should create the new function object.
- MTLFunctionDescriptor.SetOptions
- MTLFunctionDescriptor.BinaryArchives: The binary archives to search for a previously-compiled version of this function.
- MTLFunctionDescriptor.SetBinaryArchives
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor
func MTLFunctionDescriptorFromID ¶
func MTLFunctionDescriptorFromID(id objc.ID) MTLFunctionDescriptor
MTLFunctionDescriptorFromID constructs a MTLFunctionDescriptor from an objc.ID.
A description of a function object to create.
func NewMTLFunctionDescriptor ¶
func NewMTLFunctionDescriptor() MTLFunctionDescriptor
NewMTLFunctionDescriptor creates a new MTLFunctionDescriptor instance.
func (MTLFunctionDescriptor) Autorelease ¶
func (f MTLFunctionDescriptor) Autorelease() MTLFunctionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionDescriptor) BinaryArchives ¶
func (f MTLFunctionDescriptor) BinaryArchives() []objectivec.IObject
The binary archives to search for a previously-compiled version of this function.
Discussion ¶
If you specify an archive that includes a fully compiled version of this function, Metal uses the compiled version rather than creating a new one.
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor/binaryArchives
func (MTLFunctionDescriptor) ConstantValues ¶
func (f MTLFunctionDescriptor) ConstantValues() IMTLFunctionConstantValues
The set of constant values assigned to the function constants.
Discussion ¶
The default value is `nil`. If you are creating a function object for a specialized function, you need to provide an array of valid constant values for all required function constants.
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor/constantValues
func (MTLFunctionDescriptor) Init ¶
func (f MTLFunctionDescriptor) Init() MTLFunctionDescriptor
Init initializes the instance.
func (MTLFunctionDescriptor) Name ¶
func (f MTLFunctionDescriptor) Name() string
The name of the function to fetch from the library.
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor/name
func (MTLFunctionDescriptor) Options ¶
func (f MTLFunctionDescriptor) Options() MTLFunctionOptions
Flags specifying how Metal should create the new function object.
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor/options
func (MTLFunctionDescriptor) SetBinaryArchives ¶
func (f MTLFunctionDescriptor) SetBinaryArchives(value []objectivec.IObject)
func (MTLFunctionDescriptor) SetConstantValues ¶
func (f MTLFunctionDescriptor) SetConstantValues(value IMTLFunctionConstantValues)
func (MTLFunctionDescriptor) SetName ¶
func (f MTLFunctionDescriptor) SetName(value string)
func (MTLFunctionDescriptor) SetOptions ¶
func (f MTLFunctionDescriptor) SetOptions(value MTLFunctionOptions)
func (MTLFunctionDescriptor) SetSpecializedName ¶
func (f MTLFunctionDescriptor) SetSpecializedName(value string)
func (MTLFunctionDescriptor) SpecializedName ¶
func (f MTLFunctionDescriptor) SpecializedName() string
A new name for the created function object.
Discussion ¶
The default value is `nil`. If you specify a value for this property, Metal creates the new MTLFunction object with the new name. Use this property if you want to specialize a function with multiple variants and give each a distinct name.
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor/specializedName
type MTLFunctionDescriptorClass ¶
type MTLFunctionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionDescriptorClass ¶
func GetMTLFunctionDescriptorClass() MTLFunctionDescriptorClass
GetMTLFunctionDescriptorClass returns the class object for MTLFunctionDescriptor.
func (MTLFunctionDescriptorClass) Alloc ¶
func (mc MTLFunctionDescriptorClass) Alloc() MTLFunctionDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLFunctionDescriptorClass) FunctionDescriptor ¶
func (_MTLFunctionDescriptorClass MTLFunctionDescriptorClass) FunctionDescriptor() MTLFunctionDescriptor
Creates a default function descriptor.
See: https://developer.apple.com/documentation/Metal/MTLFunctionDescriptor/functionDescriptor
type MTLFunctionErrorHandler ¶
type MTLFunctionErrorHandler = func(MTLFunction, error)
MTLFunctionErrorHandler handles A block of code that Metal calls after it creates the specialized function.
- function: A specialized function, or `nil` if an error occurred.
- error: An error object that describes compilation problems, if any. This object contains compiler errors if the specialized function is `nil`, and compiler warnings if Metal created the specialized function with warnings. If Metal created the function without errors or warnings, this error object is `nil`.
The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
- [MTLLibrary.NewFunctionWithDescriptorCompletionHandler]
- [MTLLibrary.NewFunctionWithNameConstantValuesCompletionHandler]
- [MTLLibrary.NewIntersectionFunctionWithDescriptorCompletionHandler]
type MTLFunctionHandle ¶
type MTLFunctionHandle interface {
objectivec.IObject
// The device object that created the shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/device
Device() MTLDevice
// The shader function’s type.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/functionType
FunctionType() MTLFunctionType
// The function’s name.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/name
Name() string
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/gpuResourceID
GpuResourceID() MTLResourceID
}
An object representing a function that you can add to a visible function table.
See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle
type MTLFunctionHandleObject ¶
type MTLFunctionHandleObject struct {
objectivec.Object
}
MTLFunctionHandleObject wraps an existing Objective-C object that conforms to the MTLFunctionHandle protocol.
func MTLFunctionHandleObjectFromID ¶
func MTLFunctionHandleObjectFromID(id objc.ID) MTLFunctionHandleObject
MTLFunctionHandleObjectFromID constructs a MTLFunctionHandleObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLFunctionHandleObject) BaseObject ¶
func (o MTLFunctionHandleObject) BaseObject() objectivec.Object
func (MTLFunctionHandleObject) Device ¶
func (o MTLFunctionHandleObject) Device() MTLDevice
The device object that created the shader function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/device
func (MTLFunctionHandleObject) FunctionType ¶
func (o MTLFunctionHandleObject) FunctionType() MTLFunctionType
The shader function’s type.
See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/functionType
func (MTLFunctionHandleObject) GpuResourceID ¶
func (o MTLFunctionHandleObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/gpuResourceID
func (MTLFunctionHandleObject) Name ¶
func (o MTLFunctionHandleObject) Name() string
The function’s name.
See: https://developer.apple.com/documentation/Metal/MTLFunctionHandle/name
type MTLFunctionLog ¶
type MTLFunctionLog interface {
objectivec.IObject
// The type of message that was logged.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/type
Type() MTLFunctionLogType
// If known, the location of the logging command within a shader source file.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/debugLocation
DebugLocation() MTLFunctionLogDebugLocation
// The label for the encoder that logged the message.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/encoderLabel
EncoderLabel() string
// When known, the function object corresponding to the logged message.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/function
Function() MTLFunction
}
A log entry a Metal device generates when the it runs a command buffer.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLog
type MTLFunctionLogDebugLocation ¶
type MTLFunctionLogDebugLocation interface {
objectivec.IObject
// The name of the shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/functionName
FunctionName() string
// The URL of the file that contains the shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/url
URL() foundation.INSURL
// The line that the log message appears on.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/line
Line() uint
// The column where the log message appears.
//
// See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/column
Column() uint
}
The source code that logged a debug message.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation
type MTLFunctionLogDebugLocationObject ¶
type MTLFunctionLogDebugLocationObject struct {
objectivec.Object
}
MTLFunctionLogDebugLocationObject wraps an existing Objective-C object that conforms to the MTLFunctionLogDebugLocation protocol.
func MTLFunctionLogDebugLocationObjectFromID ¶
func MTLFunctionLogDebugLocationObjectFromID(id objc.ID) MTLFunctionLogDebugLocationObject
MTLFunctionLogDebugLocationObjectFromID constructs a MTLFunctionLogDebugLocationObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLFunctionLogDebugLocationObject) BaseObject ¶
func (o MTLFunctionLogDebugLocationObject) BaseObject() objectivec.Object
func (MTLFunctionLogDebugLocationObject) Column ¶
func (o MTLFunctionLogDebugLocationObject) Column() uint
The column where the log message appears.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/column
func (MTLFunctionLogDebugLocationObject) FunctionName ¶
func (o MTLFunctionLogDebugLocationObject) FunctionName() string
The name of the shader function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/functionName
func (MTLFunctionLogDebugLocationObject) Line ¶
func (o MTLFunctionLogDebugLocationObject) Line() uint
The line that the log message appears on.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/line
func (MTLFunctionLogDebugLocationObject) URL ¶
func (o MTLFunctionLogDebugLocationObject) URL() foundation.INSURL
The URL of the file that contains the shader function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLogDebugLocation/url
type MTLFunctionLogObject ¶
type MTLFunctionLogObject struct {
objectivec.Object
}
MTLFunctionLogObject wraps an existing Objective-C object that conforms to the MTLFunctionLog protocol.
func MTLFunctionLogObjectFromID ¶
func MTLFunctionLogObjectFromID(id objc.ID) MTLFunctionLogObject
MTLFunctionLogObjectFromID constructs a MTLFunctionLogObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLFunctionLogObject) BaseObject ¶
func (o MTLFunctionLogObject) BaseObject() objectivec.Object
func (MTLFunctionLogObject) DebugLocation ¶
func (o MTLFunctionLogObject) DebugLocation() MTLFunctionLogDebugLocation
If known, the location of the logging command within a shader source file.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/debugLocation
func (MTLFunctionLogObject) EncoderLabel ¶
func (o MTLFunctionLogObject) EncoderLabel() string
The label for the encoder that logged the message.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/encoderLabel
func (MTLFunctionLogObject) Function ¶
func (o MTLFunctionLogObject) Function() MTLFunction
When known, the function object corresponding to the logged message.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/function
func (MTLFunctionLogObject) Type ¶
func (o MTLFunctionLogObject) Type() MTLFunctionLogType
The type of message that was logged.
See: https://developer.apple.com/documentation/Metal/MTLFunctionLog/type
type MTLFunctionLogType ¶
type MTLFunctionLogType int
See: https://developer.apple.com/documentation/Metal/MTLFunctionLogType
const ( // MTLFunctionLogTypeValidation: A message related to usage validation. MTLFunctionLogTypeValidation MTLFunctionLogType = 0 )
func (MTLFunctionLogType) String ¶
func (e MTLFunctionLogType) String() string
type MTLFunctionObject ¶
type MTLFunctionObject struct {
objectivec.Object
}
MTLFunctionObject wraps an existing Objective-C object that conforms to the MTLFunction protocol.
func MTLFunctionObjectFromID ¶
func MTLFunctionObjectFromID(id objc.ID) MTLFunctionObject
MTLFunctionObjectFromID constructs a MTLFunctionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLFunctionObject) BaseObject ¶
func (o MTLFunctionObject) BaseObject() objectivec.Object
func (MTLFunctionObject) Device ¶
func (o MTLFunctionObject) Device() MTLDevice
The device object that created the shader function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/device
func (MTLFunctionObject) FunctionConstantsDictionary ¶
func (o MTLFunctionObject) FunctionConstantsDictionary() foundation.INSDictionary
A dictionary of function constants for a specialized function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/functionConstantsDictionary
func (MTLFunctionObject) FunctionType ¶
func (o MTLFunctionObject) FunctionType() MTLFunctionType
The shader function’s type.
See: https://developer.apple.com/documentation/Metal/MTLFunction/functionType
func (MTLFunctionObject) Label ¶
func (o MTLFunctionObject) Label() string
A string that identifies the shader function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/label
func (MTLFunctionObject) Name ¶
func (o MTLFunctionObject) Name() string
The function’s name.
See: https://developer.apple.com/documentation/Metal/MTLFunction/name
func (MTLFunctionObject) NewArgumentEncoderWithBufferIndex ¶
func (o MTLFunctionObject) NewArgumentEncoderWithBufferIndex(bufferIndex uint) MTLArgumentEncoder
Creates an argument encoder for an argument buffer that’s one of this function’s arguments.
bufferIndex: The index of an argument buffer in the function’s argument list. This method fails if the specified index doesn’t correspond to an argument buffer.
Discussion ¶
Resources encoded into an argument buffer by the MTLArgumentEncoder object need to match the structure of the argument buffer located at the specified buffer index. If you want to interpret a regular structure as an argument buffer, at least one of the members of the structure needs to have an `[[id(n)]]` attribute.
See: https://developer.apple.com/documentation/Metal/MTLFunction/makeArgumentEncoder(bufferIndex:)
func (MTLFunctionObject) Options ¶
func (o MTLFunctionObject) Options() MTLFunctionOptions
The options that Metal used to compile this function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/options
func (MTLFunctionObject) PatchControlPointCount ¶
func (o MTLFunctionObject) PatchControlPointCount() int
The number of patch control points in the post-tessellation vertex function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/patchControlPointCount
func (MTLFunctionObject) PatchType ¶
func (o MTLFunctionObject) PatchType() MTLPatchType
The tessellation patch type of a post-tessellation vertex function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/patchType
func (MTLFunctionObject) SetLabel ¶
func (o MTLFunctionObject) SetLabel(value string)
func (MTLFunctionObject) StageInputAttributes ¶
func (o MTLFunctionObject) StageInputAttributes() []MTLAttribute
An array that describes the input attributes to the function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/stageInputAttributes
func (MTLFunctionObject) VertexAttributes ¶
func (o MTLFunctionObject) VertexAttributes() []MTLVertexAttribute
An array that describes the vertex input attributes to a vertex function.
See: https://developer.apple.com/documentation/Metal/MTLFunction/vertexAttributes
type MTLFunctionOptions ¶
type MTLFunctionOptions int
See: https://developer.apple.com/documentation/Metal/MTLFunctionOptions
const ( // MTLFunctionOptionCompileToBinary: An option that instructs the compiler to generate a binary format for dynamic linking. MTLFunctionOptionCompileToBinary MTLFunctionOptions = 1 // MTLFunctionOptionFailOnBinaryArchiveMiss: An option that instructs the compiler to return an error when a GPU function isn’t in a binary archive. MTLFunctionOptionFailOnBinaryArchiveMiss MTLFunctionOptions = 4 // MTLFunctionOptionNone: A sentinel value that represents an empty set of options, which is the default behavior for creating functions. MTLFunctionOptionNone MTLFunctionOptions = 0 // MTLFunctionOptionPipelineIndependent: An option that generates the same function handle across all pipeline states that link a function, which lets you share function tables across pipeline states. MTLFunctionOptionPipelineIndependent MTLFunctionOptions = 8 // MTLFunctionOptionStoreFunctionInMetalPipelinesScript: An option that instructs the compiler to store function information for inspecting binary archives. MTLFunctionOptionStoreFunctionInMetalPipelinesScript MTLFunctionOptions = 2 // Deprecated. MTLFunctionOptionStoreFunctionInMetalScript MTLFunctionOptions = 2 )
func (MTLFunctionOptions) String ¶
func (e MTLFunctionOptions) String() string
type MTLFunctionReflection ¶
type MTLFunctionReflection struct {
objectivec.Object
}
Represents a reflection object containing information about a function in a Metal library.
Instance Properties ¶
- MTLFunctionReflection.Bindings: Provides a list of inputs and outputs of the function.
- MTLFunctionReflection.UserAnnotation: The string passed to the user annotation attribute for this function. Null if no user annotation is present for this function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionReflection
func MTLFunctionReflectionFromID ¶
func MTLFunctionReflectionFromID(id objc.ID) MTLFunctionReflection
MTLFunctionReflectionFromID constructs a MTLFunctionReflection from an objc.ID.
Represents a reflection object containing information about a function in a Metal library.
func NewMTLFunctionReflection ¶
func NewMTLFunctionReflection() MTLFunctionReflection
NewMTLFunctionReflection creates a new MTLFunctionReflection instance.
func (MTLFunctionReflection) Autorelease ¶
func (f MTLFunctionReflection) Autorelease() MTLFunctionReflection
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionReflection) Bindings ¶
func (f MTLFunctionReflection) Bindings() []objectivec.IObject
Provides a list of inputs and outputs of the function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionReflection/bindings
func (MTLFunctionReflection) Init ¶
func (f MTLFunctionReflection) Init() MTLFunctionReflection
Init initializes the instance.
func (MTLFunctionReflection) UserAnnotation ¶
func (f MTLFunctionReflection) UserAnnotation() string
The string passed to the user annotation attribute for this function. Null if no user annotation is present for this function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionReflection/userAnnotation
type MTLFunctionReflectionClass ¶
type MTLFunctionReflectionClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionReflectionClass ¶
func GetMTLFunctionReflectionClass() MTLFunctionReflectionClass
GetMTLFunctionReflectionClass returns the class object for MTLFunctionReflection.
func (MTLFunctionReflectionClass) Alloc ¶
func (mc MTLFunctionReflectionClass) Alloc() MTLFunctionReflection
Alloc allocates memory for a new instance of the class.
type MTLFunctionStitchingAttribute ¶
type MTLFunctionStitchingAttribute interface {
objectivec.IObject
}
A protocol to identify types that customize how the Metal compiler stitches a function together.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingAttribute
type MTLFunctionStitchingAttributeAlwaysInline ¶
type MTLFunctionStitchingAttributeAlwaysInline struct {
objectivec.Object
}
An attribute to specify that Metal needs to inline all of the function calls when generating the stitched function.
Overview ¶
To inline functions in a call graph, instantiate an instance of this class and assign it as an attribute on the MTLFunctionStitchingGraph.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingAttributeAlwaysInline
func MTLFunctionStitchingAttributeAlwaysInlineFromID ¶
func MTLFunctionStitchingAttributeAlwaysInlineFromID(id objc.ID) MTLFunctionStitchingAttributeAlwaysInline
MTLFunctionStitchingAttributeAlwaysInlineFromID constructs a MTLFunctionStitchingAttributeAlwaysInline from an objc.ID.
An attribute to specify that Metal needs to inline all of the function calls when generating the stitched function.
func NewMTLFunctionStitchingAttributeAlwaysInline ¶
func NewMTLFunctionStitchingAttributeAlwaysInline() MTLFunctionStitchingAttributeAlwaysInline
NewMTLFunctionStitchingAttributeAlwaysInline creates a new MTLFunctionStitchingAttributeAlwaysInline instance.
func (MTLFunctionStitchingAttributeAlwaysInline) Attributes ¶
func (f MTLFunctionStitchingAttributeAlwaysInline) Attributes() MTLFunctionStitchingAttribute
A list of attributes to configure how the Metal device object generates the new stitched function.
See: https://developer.apple.com/documentation/metal/mtlfunctionstitchinggraph/attributes
func (MTLFunctionStitchingAttributeAlwaysInline) Autorelease ¶
func (f MTLFunctionStitchingAttributeAlwaysInline) Autorelease() MTLFunctionStitchingAttributeAlwaysInline
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionStitchingAttributeAlwaysInline) SetAttributes ¶
func (f MTLFunctionStitchingAttributeAlwaysInline) SetAttributes(value MTLFunctionStitchingAttribute)
type MTLFunctionStitchingAttributeAlwaysInlineClass ¶
type MTLFunctionStitchingAttributeAlwaysInlineClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionStitchingAttributeAlwaysInlineClass ¶
func GetMTLFunctionStitchingAttributeAlwaysInlineClass() MTLFunctionStitchingAttributeAlwaysInlineClass
GetMTLFunctionStitchingAttributeAlwaysInlineClass returns the class object for MTLFunctionStitchingAttributeAlwaysInline.
func (MTLFunctionStitchingAttributeAlwaysInlineClass) Alloc ¶
func (mc MTLFunctionStitchingAttributeAlwaysInlineClass) Alloc() MTLFunctionStitchingAttributeAlwaysInline
Alloc allocates memory for a new instance of the class.
type MTLFunctionStitchingAttributeObject ¶
type MTLFunctionStitchingAttributeObject struct {
objectivec.Object
}
MTLFunctionStitchingAttributeObject wraps an existing Objective-C object that conforms to the MTLFunctionStitchingAttribute protocol.
func MTLFunctionStitchingAttributeObjectFromID ¶
func MTLFunctionStitchingAttributeObjectFromID(id objc.ID) MTLFunctionStitchingAttributeObject
MTLFunctionStitchingAttributeObjectFromID constructs a MTLFunctionStitchingAttributeObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLFunctionStitchingAttributeObject) BaseObject ¶
func (o MTLFunctionStitchingAttributeObject) BaseObject() objectivec.Object
type MTLFunctionStitchingFunctionNode ¶
type MTLFunctionStitchingFunctionNode struct {
objectivec.Object
}
A call graph node that describes a function call and its inputs.
Overview ¶
When the Metal device object evaluates the function graph to compile the stitched function, it evaluates the nodes stored in the MTLFunctionStitchingFunctionNode.Arguments property that it hasn’t already evaluated, and then calls the function specified by MTLFunctionStitchingFunctionNode.Name to generate the node’s output.
If the function has side effects on the input data, use the MTLFunctionStitchingFunctionNode.ControlDependencies property on other nodes to specify whether the Metal device object needs to evaluate this node first.
Initializing a function node ¶
- MTLFunctionStitchingFunctionNode.InitWithNameArgumentsControlDependencies: Creates a new function node.
Configuring a function node ¶
- MTLFunctionStitchingFunctionNode.Name: The name of the function to call.
- MTLFunctionStitchingFunctionNode.SetName
- MTLFunctionStitchingFunctionNode.Arguments: An ordered list of the nodes that provide the function’s arguments.
- MTLFunctionStitchingFunctionNode.SetArguments
- MTLFunctionStitchingFunctionNode.ControlDependencies: The list of nodes that need to execute before executing the node.
- MTLFunctionStitchingFunctionNode.SetControlDependencies
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingFunctionNode
func MTLFunctionStitchingFunctionNodeFromID ¶
func MTLFunctionStitchingFunctionNodeFromID(id objc.ID) MTLFunctionStitchingFunctionNode
MTLFunctionStitchingFunctionNodeFromID constructs a MTLFunctionStitchingFunctionNode from an objc.ID.
A call graph node that describes a function call and its inputs.
func NewFunctionStitchingFunctionNodeWithNameArgumentsControlDependencies ¶
func NewFunctionStitchingFunctionNodeWithNameArgumentsControlDependencies(name string, arguments []objectivec.IObject, controlDependencies []MTLFunctionStitchingFunctionNode) MTLFunctionStitchingFunctionNode
Creates a new function node.
name: The name of the function to call.
arguments: An ordered list of the nodes that provide the function’s arguments.
controlDependencies: The list of nodes that need to run before executing this node.
func NewMTLFunctionStitchingFunctionNode ¶
func NewMTLFunctionStitchingFunctionNode() MTLFunctionStitchingFunctionNode
NewMTLFunctionStitchingFunctionNode creates a new MTLFunctionStitchingFunctionNode instance.
func (MTLFunctionStitchingFunctionNode) Arguments ¶
func (f MTLFunctionStitchingFunctionNode) Arguments() []objectivec.IObject
An ordered list of the nodes that provide the function’s arguments.
Discussion ¶
Each node’s output data types needs to match the input data type of the matching argument.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingFunctionNode/arguments
func (MTLFunctionStitchingFunctionNode) Autorelease ¶
func (f MTLFunctionStitchingFunctionNode) Autorelease() MTLFunctionStitchingFunctionNode
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionStitchingFunctionNode) ControlDependencies ¶
func (f MTLFunctionStitchingFunctionNode) ControlDependencies() []MTLFunctionStitchingFunctionNode
The list of nodes that need to execute before executing the node.
Discussion ¶
When a stitched function calls functions that have side effects on their input data, you often need the GPU to execute functions in a specific order. In such cases, use the [ControlDependencies] property to specify which nodes need to run before executing this node.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingFunctionNode/controlDependencies
func (MTLFunctionStitchingFunctionNode) Init ¶
func (f MTLFunctionStitchingFunctionNode) Init() MTLFunctionStitchingFunctionNode
Init initializes the instance.
func (MTLFunctionStitchingFunctionNode) InitWithNameArgumentsControlDependencies ¶
func (f MTLFunctionStitchingFunctionNode) InitWithNameArgumentsControlDependencies(name string, arguments []objectivec.IObject, controlDependencies []MTLFunctionStitchingFunctionNode) MTLFunctionStitchingFunctionNode
Creates a new function node.
name: The name of the function to call.
arguments: An ordered list of the nodes that provide the function’s arguments.
controlDependencies: The list of nodes that need to run before executing this node.
func (MTLFunctionStitchingFunctionNode) Name ¶
func (f MTLFunctionStitchingFunctionNode) Name() string
The name of the function to call.
Discussion ¶
The name needs to match one of the functions in the stitched library descriptor’s [Functions] property.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingFunctionNode/name
func (MTLFunctionStitchingFunctionNode) SetArguments ¶
func (f MTLFunctionStitchingFunctionNode) SetArguments(value []objectivec.IObject)
func (MTLFunctionStitchingFunctionNode) SetControlDependencies ¶
func (f MTLFunctionStitchingFunctionNode) SetControlDependencies(value []MTLFunctionStitchingFunctionNode)
func (MTLFunctionStitchingFunctionNode) SetName ¶
func (f MTLFunctionStitchingFunctionNode) SetName(value string)
type MTLFunctionStitchingFunctionNodeClass ¶
type MTLFunctionStitchingFunctionNodeClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionStitchingFunctionNodeClass ¶
func GetMTLFunctionStitchingFunctionNodeClass() MTLFunctionStitchingFunctionNodeClass
GetMTLFunctionStitchingFunctionNodeClass returns the class object for MTLFunctionStitchingFunctionNode.
func (MTLFunctionStitchingFunctionNodeClass) Alloc ¶
func (mc MTLFunctionStitchingFunctionNodeClass) Alloc() MTLFunctionStitchingFunctionNode
Alloc allocates memory for a new instance of the class.
type MTLFunctionStitchingGraph ¶
type MTLFunctionStitchingGraph struct {
objectivec.Object
}
A description of a new stitched function.
Overview ¶
An MTLFunctionStitchingGraph instance describes the function graph for a stitched function. A is a visible function you create by composing other Metal shader functions together in a function graph. A function stitching graph contains nodes for the function’s arguments and any functions it calls in the implementation. Data flows from the arguments to the end of the graph until the stitched function evaluates all of the graph’s nodes.
The graph in the figure below constructs a new function that adds numbers from two source arrays, storing the result in a third array. The function’s parameters are pointers to the source and destination arrays, and an index for performing the array lookup. The graph uses three separate MSL functions to construct the stitched function: a function to look up a value from an array, a function that adds two numbers together, and a function that stores a value to an array.
[media-3842304]
Create an MTLFunctionStitchingGraph instance for each stitched function you want to create. Configure its properties to describe the new function and the nodes that define its behavior, as described below. To create a new library with these stitched functions, see MTLStitchedLibraryDescriptor.
Configuring a function stitching graph ¶
To create a valid stitched function, the function stitching graph and shader code need to meet some requirements:
- Implement the MSL functions that you use to create the new function, adding the `stitchable` attribute to each. Stitchable functions are visible functions that you can also use in a function graph. Stitchable functions may require the compiler to do additional work or emit larger instance code, so mark functions as stitchable only when necessary. - Declare the stitched function’s name and signature in a header file to include in any shader code that calls the new function. Alternatively, you can add the function to a function table with a matching type and pass the function table as an argument. - Create an MTLFunctionStitchingInputNode node for each of the function’s arguments, specifying which parameter each node references. The output type of each input node is the type of that parameter in your function signature. - Create an MTLFunctionStitchingFunctionNode for each function the implementation calls. A function node’s output type is the return type of the MSL function. - Make sure the output types of each node match the types of the node they pass to. For example, if a function takes a `float` parameter, the node that provides that data need to output a `float` value. If you don’t match the types correctly, Metal doesn’t define the behavior of the resulting function. - Create an array from the node instances and assign it to the MTLFunctionStitchingGraph.Nodes property. - If the function produces an output, create another node and assign it to the MTLFunctionStitchingGraph.OutputNode property. The output type of this node needs to match the function’s return type. Don’t include this node in the array of nodes you assign to the MTLFunctionStitchingGraph.Nodes property.
The MSL code below implements the functions in the example graph above, as well as the function’s signature:
The following code creates the graph above:
Initializing a function graph ¶
- MTLFunctionStitchingGraph.InitWithFunctionNameNodesOutputNodeAttributes: Creates a description of a new function call graph.
Configuring a function graph ¶
- MTLFunctionStitchingGraph.FunctionName: The name of the new stitched function.
- MTLFunctionStitchingGraph.SetFunctionName
- MTLFunctionStitchingGraph.Nodes: The nodes in the function’s call graph.
- MTLFunctionStitchingGraph.SetNodes
- MTLFunctionStitchingGraph.OutputNode: The node with the output that’s the output of the new stitched function.
- MTLFunctionStitchingGraph.SetOutputNode
- MTLFunctionStitchingGraph.Attributes: A list of attributes to configure how the Metal device object generates the new stitched function.
- MTLFunctionStitchingGraph.SetAttributes
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingGraph
func MTLFunctionStitchingGraphFromID ¶
func MTLFunctionStitchingGraphFromID(id objc.ID) MTLFunctionStitchingGraph
MTLFunctionStitchingGraphFromID constructs a MTLFunctionStitchingGraph from an objc.ID.
A description of a new stitched function.
func NewFunctionStitchingGraphWithFunctionNameNodesOutputNodeAttributes ¶
func NewFunctionStitchingGraphWithFunctionNameNodesOutputNodeAttributes(functionName string, nodes []MTLFunctionStitchingFunctionNode, outputNode IMTLFunctionStitchingFunctionNode, attributes []objectivec.IObject) MTLFunctionStitchingGraph
Creates a description of a new function call graph.
functionName: The name of the new function.
nodes: The nodes in the function’s call graph.
outputNode: The node whose output is the output of the new stitched function.
attributes: A list of attributes used to generate the new stitched function.
func NewMTLFunctionStitchingGraph ¶
func NewMTLFunctionStitchingGraph() MTLFunctionStitchingGraph
NewMTLFunctionStitchingGraph creates a new MTLFunctionStitchingGraph instance.
func (MTLFunctionStitchingGraph) Attributes ¶
func (f MTLFunctionStitchingGraph) Attributes() []objectivec.IObject
A list of attributes to configure how the Metal device object generates the new stitched function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingGraph/attributes
func (MTLFunctionStitchingGraph) Autorelease ¶
func (f MTLFunctionStitchingGraph) Autorelease() MTLFunctionStitchingGraph
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionStitchingGraph) FunctionName ¶
func (f MTLFunctionStitchingGraph) FunctionName() string
The name of the new stitched function.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingGraph/functionName
func (MTLFunctionStitchingGraph) Init ¶
func (f MTLFunctionStitchingGraph) Init() MTLFunctionStitchingGraph
Init initializes the instance.
func (MTLFunctionStitchingGraph) InitWithFunctionNameNodesOutputNodeAttributes ¶
func (f MTLFunctionStitchingGraph) InitWithFunctionNameNodesOutputNodeAttributes(functionName string, nodes []MTLFunctionStitchingFunctionNode, outputNode IMTLFunctionStitchingFunctionNode, attributes []objectivec.IObject) MTLFunctionStitchingGraph
Creates a description of a new function call graph.
functionName: The name of the new function.
nodes: The nodes in the function’s call graph.
outputNode: The node whose output is the output of the new stitched function.
attributes: A list of attributes used to generate the new stitched function.
func (MTLFunctionStitchingGraph) Nodes ¶
func (f MTLFunctionStitchingGraph) Nodes() []MTLFunctionStitchingFunctionNode
The nodes in the function’s call graph.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingGraph/nodes
func (MTLFunctionStitchingGraph) OutputNode ¶
func (f MTLFunctionStitchingGraph) OutputNode() IMTLFunctionStitchingFunctionNode
The node with the output that’s the output of the new stitched function.
Discussion ¶
The output type of the node needs to match the result type in the stitched function’s declaration.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingGraph/outputNode
func (MTLFunctionStitchingGraph) SetAttributes ¶
func (f MTLFunctionStitchingGraph) SetAttributes(value []objectivec.IObject)
func (MTLFunctionStitchingGraph) SetFunctionName ¶
func (f MTLFunctionStitchingGraph) SetFunctionName(value string)
func (MTLFunctionStitchingGraph) SetNodes ¶
func (f MTLFunctionStitchingGraph) SetNodes(value []MTLFunctionStitchingFunctionNode)
func (MTLFunctionStitchingGraph) SetOutputNode ¶
func (f MTLFunctionStitchingGraph) SetOutputNode(value IMTLFunctionStitchingFunctionNode)
type MTLFunctionStitchingGraphClass ¶
type MTLFunctionStitchingGraphClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionStitchingGraphClass ¶
func GetMTLFunctionStitchingGraphClass() MTLFunctionStitchingGraphClass
GetMTLFunctionStitchingGraphClass returns the class object for MTLFunctionStitchingGraph.
func (MTLFunctionStitchingGraphClass) Alloc ¶
func (mc MTLFunctionStitchingGraphClass) Alloc() MTLFunctionStitchingGraph
Alloc allocates memory for a new instance of the class.
type MTLFunctionStitchingInputNode ¶
type MTLFunctionStitchingInputNode struct {
objectivec.Object
}
A call graph node that describes an input to the call graph.
Overview ¶
An input node contains data from one of the stitched function’s parameters. The output data type of an input node has the same type as the matching parameter.
Initializing an input node ¶
- MTLFunctionStitchingInputNode.InitWithArgumentIndex: Creates a new input node.
Configuring an input node ¶
- MTLFunctionStitchingInputNode.ArgumentIndex: The index in the command’s buffer argument table that declares which data to read for this input node.
- MTLFunctionStitchingInputNode.SetArgumentIndex
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingInputNode
func MTLFunctionStitchingInputNodeFromID ¶
func MTLFunctionStitchingInputNodeFromID(id objc.ID) MTLFunctionStitchingInputNode
MTLFunctionStitchingInputNodeFromID constructs a MTLFunctionStitchingInputNode from an objc.ID.
A call graph node that describes an input to the call graph.
func NewFunctionStitchingInputNodeWithArgumentIndex ¶
func NewFunctionStitchingInputNodeWithArgumentIndex(argument uint) MTLFunctionStitchingInputNode
Creates a new input node.
argument: The index of the parameter in the stitched function’s parameter list. The first parameter is `0`, the second is `1`, and so on.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingInputNode/init(argumentIndex:)
func NewMTLFunctionStitchingInputNode ¶
func NewMTLFunctionStitchingInputNode() MTLFunctionStitchingInputNode
NewMTLFunctionStitchingInputNode creates a new MTLFunctionStitchingInputNode instance.
func (MTLFunctionStitchingInputNode) ArgumentIndex ¶
func (f MTLFunctionStitchingInputNode) ArgumentIndex() uint
The index in the command’s buffer argument table that declares which data to read for this input node.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingInputNode/argumentIndex
func (MTLFunctionStitchingInputNode) Autorelease ¶
func (f MTLFunctionStitchingInputNode) Autorelease() MTLFunctionStitchingInputNode
Autorelease adds the receiver to the current autorelease pool.
func (MTLFunctionStitchingInputNode) Init ¶
func (f MTLFunctionStitchingInputNode) Init() MTLFunctionStitchingInputNode
Init initializes the instance.
func (MTLFunctionStitchingInputNode) InitWithArgumentIndex ¶
func (f MTLFunctionStitchingInputNode) InitWithArgumentIndex(argument uint) MTLFunctionStitchingInputNode
Creates a new input node.
argument: The index of the parameter in the stitched function’s parameter list. The first parameter is `0`, the second is `1`, and so on.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingInputNode/init(argumentIndex:)
func (MTLFunctionStitchingInputNode) SetArgumentIndex ¶
func (f MTLFunctionStitchingInputNode) SetArgumentIndex(value uint)
type MTLFunctionStitchingInputNodeClass ¶
type MTLFunctionStitchingInputNodeClass struct {
// contains filtered or unexported fields
}
func GetMTLFunctionStitchingInputNodeClass ¶
func GetMTLFunctionStitchingInputNodeClass() MTLFunctionStitchingInputNodeClass
GetMTLFunctionStitchingInputNodeClass returns the class object for MTLFunctionStitchingInputNode.
func (MTLFunctionStitchingInputNodeClass) Alloc ¶
func (mc MTLFunctionStitchingInputNodeClass) Alloc() MTLFunctionStitchingInputNode
Alloc allocates memory for a new instance of the class.
type MTLFunctionStitchingNode ¶
type MTLFunctionStitchingNode interface {
objectivec.IObject
foundation.NSCopying
}
A protocol to identify call graph nodes.
See: https://developer.apple.com/documentation/Metal/MTLFunctionStitchingNode
type MTLFunctionStitchingNodeObject ¶
type MTLFunctionStitchingNodeObject struct {
foundation.NSCopyingObject
}
MTLFunctionStitchingNodeObject wraps an existing Objective-C object that conforms to the MTLFunctionStitchingNode protocol.
func MTLFunctionStitchingNodeObjectFromID ¶
func MTLFunctionStitchingNodeObjectFromID(id objc.ID) MTLFunctionStitchingNodeObject
MTLFunctionStitchingNodeObjectFromID constructs a MTLFunctionStitchingNodeObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLFunctionStitchingNodeObject) BaseObject ¶
func (o MTLFunctionStitchingNodeObject) BaseObject() objectivec.Object
type MTLFunctionType ¶
type MTLFunctionType int
See: https://developer.apple.com/documentation/Metal/MTLFunctionType
const ( // MTLFunctionTypeFragment: A fragment function you can use in a render pipeline state object. MTLFunctionTypeFragment MTLFunctionType = 2 // MTLFunctionTypeIntersection: A function you can use in an intersection function table. MTLFunctionTypeIntersection MTLFunctionType = 6 // MTLFunctionTypeKernel: A kernel you can use in a compute pipeline state object. MTLFunctionTypeKernel MTLFunctionType = 3 MTLFunctionTypeMesh MTLFunctionType = 7 MTLFunctionTypeObject MTLFunctionType = 8 // MTLFunctionTypeVertex: A vertex function you can use in a render pipeline state object. MTLFunctionTypeVertex MTLFunctionType = 1 // MTLFunctionTypeVisible: A function you can use in a visible function table. MTLFunctionTypeVisible MTLFunctionType = 5 )
func (MTLFunctionType) String ¶
func (e MTLFunctionType) String() string
type MTLGPUAddress ¶
type MTLGPUAddress = uint64
MTLGPUAddress is a 64-bit unsigned integer type appropriate for storing GPU addresses.
See: https://developer.apple.com/documentation/Metal/MTLGPUAddress
type MTLGPUFamily ¶
type MTLGPUFamily int
See: https://developer.apple.com/documentation/Metal/MTLGPUFamily
const ( // MTLGPUFamilyApple1: Represents the Apple family 1 GPU features that correspond to the Apple A7 GPUs. MTLGPUFamilyApple1 MTLGPUFamily = 1001 MTLGPUFamilyApple10 MTLGPUFamily = 1010 // MTLGPUFamilyApple2: Represents the Apple family 2 GPU features that correspond to the Apple A8 GPUs. MTLGPUFamilyApple2 MTLGPUFamily = 1002 // MTLGPUFamilyApple3: Represents the Apple family 3 GPU features that correspond to the Apple A9 and A10 GPUs. MTLGPUFamilyApple3 MTLGPUFamily = 1003 // MTLGPUFamilyApple4: Represents the Apple family 4 GPU features that correspond to the Apple A11 GPUs. MTLGPUFamilyApple4 MTLGPUFamily = 1004 // MTLGPUFamilyApple5: Represents the Apple family 5 GPU features that correspond to the Apple A12 GPUs. MTLGPUFamilyApple5 MTLGPUFamily = 1005 // MTLGPUFamilyApple6: Represents the Apple family 6 GPU features that correspond to the Apple A13 GPUs. MTLGPUFamilyApple6 MTLGPUFamily = 1006 // MTLGPUFamilyApple7: Represents the Apple family 7 GPU features that correspond to the Apple A14 and M1 GPUs. MTLGPUFamilyApple7 MTLGPUFamily = 1007 // MTLGPUFamilyApple8: Represents the Apple family 8 GPU features that correspond to the Apple A15, A16, and M2 GPUs. MTLGPUFamilyApple8 MTLGPUFamily = 1008 // MTLGPUFamilyApple9: Represents the Apple family 9 GPU features that correspond to the Apple A17, M3, and M4 GPUs. MTLGPUFamilyApple9 MTLGPUFamily = 1009 // MTLGPUFamilyCommon1: Represents the Common family 1 GPU features. MTLGPUFamilyCommon1 MTLGPUFamily = 3001 // MTLGPUFamilyCommon2: Represents the Common family 2 GPU features. MTLGPUFamilyCommon2 MTLGPUFamily = 3002 // MTLGPUFamilyCommon3: Represents the Common family 3 GPU features. MTLGPUFamilyCommon3 MTLGPUFamily = 3003 // MTLGPUFamilyMac2: Represents the Mac family 2 GPU features. MTLGPUFamilyMac2 MTLGPUFamily = 2002 // MTLGPUFamilyMetal3: Represents the Metal 3 features. MTLGPUFamilyMetal3 MTLGPUFamily = 5001 MTLGPUFamilyMetal4 MTLGPUFamily = 5002 // Deprecated. MTLGPUFamilyMac1 MTLGPUFamily = 2001 // Deprecated. MTLGPUFamilyMacCatalyst1 MTLGPUFamily = 4001 // Deprecated. MTLGPUFamilyMacCatalyst2 MTLGPUFamily = 4002 )
func (MTLGPUFamily) String ¶
func (e MTLGPUFamily) String() string
type MTLHazardTrackingMode ¶
type MTLHazardTrackingMode int
See: https://developer.apple.com/documentation/Metal/MTLHazardTrackingMode
const ( // MTLHazardTrackingModeDefault: An option that applies the default tracking behavior in Metal based on the resource or heap type you’re creating. MTLHazardTrackingModeDefault MTLHazardTrackingMode = 0 // MTLHazardTrackingModeTracked: An option that directs Metal to apply runtime safeguards that prevent memory hazards when commands access a resource. MTLHazardTrackingModeTracked MTLHazardTrackingMode = 2 // MTLHazardTrackingModeUntracked: An option that disables automatic memory hazard tracking in Metal for a resource at runtime. MTLHazardTrackingModeUntracked MTLHazardTrackingMode = 1 )
func (MTLHazardTrackingMode) String ¶
func (e MTLHazardTrackingMode) String() string
type MTLHeap ¶
type MTLHeap interface {
objectivec.IObject
MTLAllocation
// A string that identifies the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/label
Label() string
// Creates a buffer on the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeBuffer(length:options:)
NewBufferWithLengthOptions(length uint, options MTLResourceOptions) MTLBuffer
// Creates a buffer at a specified offset on the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeBuffer(length:options:offset:)
NewBufferWithLengthOptionsOffset(length uint, options MTLResourceOptions, offset uint) MTLBuffer
// Creates a texture on the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeTexture(descriptor:)
NewTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
// Creates a texture at a specified offset on the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeTexture(descriptor:offset:)
NewTextureWithDescriptorOffset(descriptor IMTLTextureDescriptor, offset uint) MTLTexture
// NewAccelerationStructureWithSize protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeAccelerationStructure(size:)
NewAccelerationStructureWithSize(size uint) MTLAccelerationStructure
// NewAccelerationStructureWithSizeOffset protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeAccelerationStructure(size:offset:)
NewAccelerationStructureWithSizeOffset(size uint, offset uint) MTLAccelerationStructure
// NewAccelerationStructureWithDescriptor protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeAccelerationStructure(descriptor:)
NewAccelerationStructureWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructure
// NewAccelerationStructureWithDescriptorOffset protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/makeAccelerationStructure(descriptor:offset:)
NewAccelerationStructureWithDescriptorOffset(descriptor IMTLAccelerationStructureDescriptor, offset uint) MTLAccelerationStructure
// Sets the purgeable state of the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/setPurgeableState(_:)
SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
// The maximum size of a resource, in bytes, that can be currently allocated from the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/maxAvailableSize(alignment:)
MaxAvailableSizeWithAlignment(alignment uint) uint
// The total size of the heap, in bytes.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/size
Size() uint
// The size of all resources currently in the heap, in bytes.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/usedSize
UsedSize() uint
// The size, in bytes, of the current heap allocation.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/currentAllocatedSize
CurrentAllocatedSize() uint
// The device object that created the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/device
Device() MTLDevice
// The heap’s type.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/type
Type() MTLHeapType
// The heap’s storage mode.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/storageMode
StorageMode() MTLStorageMode
// The heap’s CPU cache mode.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/cpuCacheMode
CpuCacheMode() MTLCPUCacheMode
// The heap’s hazard tracking mode.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/hazardTrackingMode
HazardTrackingMode() MTLHazardTrackingMode
// The options for resources created by the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/resourceOptions
ResourceOptions() MTLResourceOptions
// A string that identifies the heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLHeap/label
SetLabel(value string)
}
A memory pool from which you can suballocate resources.
See: https://developer.apple.com/documentation/Metal/MTLHeap
type MTLHeapDescriptor ¶
type MTLHeapDescriptor struct {
objectivec.Object
}
A configuration that customizes the behavior for a Metal memory heap.
Overview ¶
Create an MTLHeap by configuring an MTLHeapDescriptor instance’s properties and passing it to the [NewHeapWithDescriptor] method of an MTLDevice.
Each new heap inherits the descriptor’s configuration as you create it, which means you can modify and reuse a descriptor to create other heaps.
Configuring a heap ¶
- MTLHeapDescriptor.Type: The memory placement strategy for any resources you allocate from the heaps you create with this descriptor.
- MTLHeapDescriptor.SetType
- MTLHeapDescriptor.StorageMode: The storage mode for the heaps you create with this descriptor.
- MTLHeapDescriptor.SetStorageMode
- MTLHeapDescriptor.CpuCacheMode: The CPU cache behavior for any resources you allocate from the heaps you create with this descriptor.
- MTLHeapDescriptor.SetCpuCacheMode
- MTLHeapDescriptor.HazardTrackingMode: The hazard tracking behavior for any resources you allocate from the heaps you create with this descriptor.
- MTLHeapDescriptor.SetHazardTrackingMode
- MTLHeapDescriptor.ResourceOptions: The combined behavior for any resources you allocate from the heaps you create with this descriptor.
- MTLHeapDescriptor.SetResourceOptions
- MTLHeapDescriptor.Size: The total amount of memory, in bytes, for the heaps you create with this descriptor.
- MTLHeapDescriptor.SetSize
- MTLHeapDescriptor.SparsePageSize: The page size for any resources you allocate from the heaps you create with this descriptor.
- MTLHeapDescriptor.SetSparsePageSize
Instance Properties ¶
- MTLHeapDescriptor.MaxCompatiblePlacementSparsePageSize: Specifies the largest sparse page size that the Metal heap supports.
- MTLHeapDescriptor.SetMaxCompatiblePlacementSparsePageSize
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor
func MTLHeapDescriptorFromID ¶
func MTLHeapDescriptorFromID(id objc.ID) MTLHeapDescriptor
MTLHeapDescriptorFromID constructs a MTLHeapDescriptor from an objc.ID.
A configuration that customizes the behavior for a Metal memory heap.
func NewMTLHeapDescriptor ¶
func NewMTLHeapDescriptor() MTLHeapDescriptor
NewMTLHeapDescriptor creates a new MTLHeapDescriptor instance.
func (MTLHeapDescriptor) Autorelease ¶
func (h MTLHeapDescriptor) Autorelease() MTLHeapDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLHeapDescriptor) CpuCacheMode ¶
func (h MTLHeapDescriptor) CpuCacheMode() MTLCPUCacheMode
The CPU cache behavior for any resources you allocate from the heaps you create with this descriptor.
Discussion ¶
This property’s default value is [CPUCacheModeDefaultCache].
The resources you allocate from a heap inherit that heap’s CPU cache mode.
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor/cpuCacheMode
func (MTLHeapDescriptor) HazardTrackingMode ¶
func (h MTLHeapDescriptor) HazardTrackingMode() MTLHazardTrackingMode
The hazard tracking behavior for any resources you allocate from the heaps you create with this descriptor.
Discussion ¶
This property’s default value is [HazardTrackingModeDefault], which is equivalent to [HazardTrackingModeUntracked] for a heap.
The resources you allocate from a heap inherit that heap’s hazard tracking mode.
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor/hazardTrackingMode
func (MTLHeapDescriptor) Init ¶
func (h MTLHeapDescriptor) Init() MTLHeapDescriptor
Init initializes the instance.
func (MTLHeapDescriptor) MaxCompatiblePlacementSparsePageSize ¶
func (h MTLHeapDescriptor) MaxCompatiblePlacementSparsePageSize() MTLSparsePageSize
Specifies the largest sparse page size that the Metal heap supports.
Discussion ¶
This parameter only affects the heap if you set the [Type] property of this descriptor to [HeapTypePlacement].
The value you assign to this property determines the compatibility of the Metal heap with with placement sparse resources, because placement sparse resources require that their sparse page size be less than or equal to the placement sparse page of the Metal heap that this property controls.
func (MTLHeapDescriptor) ResourceOptions ¶
func (h MTLHeapDescriptor) ResourceOptions() MTLResourceOptions
The combined behavior for any resources you allocate from the heaps you create with this descriptor.
Discussion ¶
This property aggregates the values of [StorageMode], [CpuCacheMode], and [HazardTrackingMode]. Any modifications you make to this property affect the other properties, and vice versa.
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor/resourceOptions
func (MTLHeapDescriptor) SetCpuCacheMode ¶
func (h MTLHeapDescriptor) SetCpuCacheMode(value MTLCPUCacheMode)
func (MTLHeapDescriptor) SetHazardTrackingMode ¶
func (h MTLHeapDescriptor) SetHazardTrackingMode(value MTLHazardTrackingMode)
func (MTLHeapDescriptor) SetMaxCompatiblePlacementSparsePageSize ¶
func (h MTLHeapDescriptor) SetMaxCompatiblePlacementSparsePageSize(value MTLSparsePageSize)
func (MTLHeapDescriptor) SetResourceOptions ¶
func (h MTLHeapDescriptor) SetResourceOptions(value MTLResourceOptions)
func (MTLHeapDescriptor) SetSize ¶
func (h MTLHeapDescriptor) SetSize(value uint)
func (MTLHeapDescriptor) SetSparsePageSize ¶
func (h MTLHeapDescriptor) SetSparsePageSize(value MTLSparsePageSize)
func (MTLHeapDescriptor) SetStorageMode ¶
func (h MTLHeapDescriptor) SetStorageMode(value MTLStorageMode)
func (MTLHeapDescriptor) SetType ¶
func (h MTLHeapDescriptor) SetType(value MTLHeapType)
func (MTLHeapDescriptor) Size ¶
func (h MTLHeapDescriptor) Size() uint
The total amount of memory, in bytes, for the heaps you create with this descriptor.
Discussion ¶
You can use various MTLDevice methods to help you estimate an appropriate heap size, including the following:
- [HeapBufferSizeAndAlignWithLengthOptions] - [HeapTextureSizeAndAlignWithDescriptor] - [HeapAccelerationStructureSizeAndAlignWithSize] - [HeapAccelerationStructureSizeAndAlignWithDescriptor]
This property’s default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor/size
func (MTLHeapDescriptor) SparsePageSize ¶
func (h MTLHeapDescriptor) SparsePageSize() MTLSparsePageSize
The page size for any resources you allocate from the heaps you create with this descriptor.
Discussion ¶
This property’s default value is 16 kilobytes ([SparsePageSize16]), which is a smaller page size option that can help reduce your app’s memory usage. However, you can reduce operational overhead for sparse textures with larger page sizes, such as [SparsePageSize64] and [SparsePageSize256]. These operations include blit commands and the configuration of sparse texture mappings (see Blit passes and MTLResourceStateCommandEncoder, respectively).
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor/sparsePageSize
func (MTLHeapDescriptor) StorageMode ¶
func (h MTLHeapDescriptor) StorageMode() MTLStorageMode
The storage mode for the heaps you create with this descriptor.
Discussion ¶
For devices with Apple silicon, you can create a heap with either the [StorageModePrivate] or the [StorageModeShared] storage mode. However, you can only create heaps with private storage on macOS devices without Apple silicon.
The resources you allocate from a heap inherit that heap’s storage mode. This property’s default value is [StorageModePrivate].
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor/storageMode
func (MTLHeapDescriptor) Type ¶
func (h MTLHeapDescriptor) Type() MTLHeapType
The memory placement strategy for any resources you allocate from the heaps you create with this descriptor.
Discussion ¶
This property’s default value is [HeapTypeAutomatic].
See: https://developer.apple.com/documentation/Metal/MTLHeapDescriptor/type
type MTLHeapDescriptorClass ¶
type MTLHeapDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLHeapDescriptorClass ¶
func GetMTLHeapDescriptorClass() MTLHeapDescriptorClass
GetMTLHeapDescriptorClass returns the class object for MTLHeapDescriptor.
func (MTLHeapDescriptorClass) Alloc ¶
func (mc MTLHeapDescriptorClass) Alloc() MTLHeapDescriptor
Alloc allocates memory for a new instance of the class.
type MTLHeapObject ¶
type MTLHeapObject struct {
objectivec.Object
}
MTLHeapObject wraps an existing Objective-C object that conforms to the MTLHeap protocol.
func MTLHeapObjectFromID ¶
func MTLHeapObjectFromID(id objc.ID) MTLHeapObject
MTLHeapObjectFromID constructs a MTLHeapObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLHeapObject) AllocatedSize ¶
func (o MTLHeapObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLHeapObject) BaseObject ¶
func (o MTLHeapObject) BaseObject() objectivec.Object
func (MTLHeapObject) CpuCacheMode ¶
func (o MTLHeapObject) CpuCacheMode() MTLCPUCacheMode
The heap’s CPU cache mode.
See: https://developer.apple.com/documentation/Metal/MTLHeap/cpuCacheMode
func (MTLHeapObject) CurrentAllocatedSize ¶
func (o MTLHeapObject) CurrentAllocatedSize() uint
The size, in bytes, of the current heap allocation.
See: https://developer.apple.com/documentation/Metal/MTLHeap/currentAllocatedSize
func (MTLHeapObject) Device ¶
func (o MTLHeapObject) Device() MTLDevice
The device object that created the heap.
See: https://developer.apple.com/documentation/Metal/MTLHeap/device
func (MTLHeapObject) HazardTrackingMode ¶
func (o MTLHeapObject) HazardTrackingMode() MTLHazardTrackingMode
The heap’s hazard tracking mode.
See: https://developer.apple.com/documentation/Metal/MTLHeap/hazardTrackingMode
func (MTLHeapObject) Label ¶
func (o MTLHeapObject) Label() string
A string that identifies the heap.
See: https://developer.apple.com/documentation/Metal/MTLHeap/label
func (MTLHeapObject) MaxAvailableSizeWithAlignment ¶
func (o MTLHeapObject) MaxAvailableSizeWithAlignment(alignment uint) uint
The maximum size of a resource, in bytes, that can be currently allocated from the heap.
alignment: The alignment of the resource, in bytes. This value needs to be a power of two.
Return Value ¶
The maximum size for the resource, in bytes.
Discussion ¶
This method measures fragmentation within the heap. You can use the [HeapBufferSizeAndAlignWithLengthOptions] and [HeapTextureSizeAndAlignWithDescriptor] methods to help you determine the correct alignment for the resource.
See: https://developer.apple.com/documentation/Metal/MTLHeap/maxAvailableSize(alignment:)
func (MTLHeapObject) NewAccelerationStructureWithDescriptor ¶
func (o MTLHeapObject) NewAccelerationStructureWithDescriptor(descriptor IMTLAccelerationStructureDescriptor) MTLAccelerationStructure
See: https://developer.apple.com/documentation/Metal/MTLHeap/makeAccelerationStructure(descriptor:)
func (MTLHeapObject) NewAccelerationStructureWithDescriptorOffset ¶
func (o MTLHeapObject) NewAccelerationStructureWithDescriptorOffset(descriptor IMTLAccelerationStructureDescriptor, offset uint) MTLAccelerationStructure
func (MTLHeapObject) NewAccelerationStructureWithSize ¶
func (o MTLHeapObject) NewAccelerationStructureWithSize(size uint) MTLAccelerationStructure
See: https://developer.apple.com/documentation/Metal/MTLHeap/makeAccelerationStructure(size:)
func (MTLHeapObject) NewAccelerationStructureWithSizeOffset ¶
func (o MTLHeapObject) NewAccelerationStructureWithSizeOffset(size uint, offset uint) MTLAccelerationStructure
See: https://developer.apple.com/documentation/Metal/MTLHeap/makeAccelerationStructure(size:offset:)
func (MTLHeapObject) NewBufferWithLengthOptions ¶
func (o MTLHeapObject) NewBufferWithLengthOptions(length uint, options MTLResourceOptions) MTLBuffer
Creates a buffer on the heap.
length: The size, in bytes, of the buffer.
options: Options that describe the properties of the buffer.
Return Value ¶
A new buffer object backed by heap memory, or `nil` if the heap memory is full.
Discussion ¶
You can call the method with the following restrictions:
- The heap’s type needs to be [HeapTypeAutomatic] - The buffer’s storage mode option needs to match the heap’s [StorageMode] property - The buffer’s CPU cache mode option needs to match the heap’s [CpuCacheMode] property
See: https://developer.apple.com/documentation/Metal/MTLHeap/makeBuffer(length:options:)
func (MTLHeapObject) NewBufferWithLengthOptionsOffset ¶
func (o MTLHeapObject) NewBufferWithLengthOptionsOffset(length uint, options MTLResourceOptions, offset uint) MTLBuffer
Creates a buffer at a specified offset on the heap.
length: The size of the buffer, in bytes.
options: Options that describe the properties of the buffer.
offset: The distance, in bytes, to place the buffer relative to the start of the heap.
Return Value ¶
A new buffer, or `nil` if the heap is not a placement heap.
Discussion ¶
You can call the method with the following restrictions:
- The heap’s type needs to be [HeapTypePlacement] - The buffer’s storage mode option needs to match the heap’s [StorageMode] property - The buffer’s CPU cache mode option needs to match the heap’s [CpuCacheMode] property
Use the [HeapBufferSizeAndAlignWithLengthOptions] method to determine the required size and alignment. If you don’t align the buffer correctly or it extends past the end of the heap, the behavior is undefined.
See: https://developer.apple.com/documentation/Metal/MTLHeap/makeBuffer(length:options:offset:)
func (MTLHeapObject) NewTextureWithDescriptor ¶
func (o MTLHeapObject) NewTextureWithDescriptor(descriptor IMTLTextureDescriptor) MTLTexture
Creates a texture on the heap.
descriptor: A descriptor object that describes the properties of the texture.
Return Value ¶
A new texture object backed by heap memory, or `nil` if the heap memory is full.
Discussion ¶
You can call the method with the following restrictions:
- The heap’s type needs to be [HeapTypeAutomatic] - The texture’s CPU cache mode option needs to match the heap’s [CpuCacheMode] property - The texture’s storage mode option needs to be [StorageModeMemoryless], or match the heap’s [StorageMode] property
See: https://developer.apple.com/documentation/Metal/MTLHeap/makeTexture(descriptor:)
func (MTLHeapObject) NewTextureWithDescriptorOffset ¶
func (o MTLHeapObject) NewTextureWithDescriptorOffset(descriptor IMTLTextureDescriptor, offset uint) MTLTexture
Creates a texture at a specified offset on the heap.
descriptor: A descriptor object that describes the properties of the texture.
offset: The distance, in bytes, to place the texture relative to the start of the heap.
Return Value ¶
A new texture, or `nil` if the heap is not a placement heap.
Discussion ¶
You can call the method with the following restrictions:
- The heap’s type needs to be [HeapTypePlacement] - The texture’s CPU cache mode option needs to match the heap’s [CpuCacheMode] property - The texture’s storage mode option needs to be [StorageModeMemoryless], or match the heap’s [StorageMode] property
Use the [HeapBufferSizeAndAlignWithLengthOptions] to determine the correct size and alignment.
See: https://developer.apple.com/documentation/Metal/MTLHeap/makeTexture(descriptor:offset:)
func (MTLHeapObject) ResourceOptions ¶
func (o MTLHeapObject) ResourceOptions() MTLResourceOptions
The options for resources created by the heap.
See: https://developer.apple.com/documentation/Metal/MTLHeap/resourceOptions
func (MTLHeapObject) SetLabel ¶
func (o MTLHeapObject) SetLabel(value string)
func (MTLHeapObject) SetPurgeableState ¶
func (o MTLHeapObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Sets the purgeable state of the heap.
state: The desired purgeable state of the heap.
Return Value ¶
The previous purgeable state of the heap.
Discussion ¶
The heap purgeability state refers to its whole backing memory and affects all resources in the heap. Heaps can be marked purgeable but its resources cannot; the heap’s resources always reflect the heap’s purgeability state.
Refer to the MTLPurgeableState and [SetPurgeableState] reference for further information.
See: https://developer.apple.com/documentation/Metal/MTLHeap/setPurgeableState(_:)
func (MTLHeapObject) Size ¶
func (o MTLHeapObject) Size() uint
The total size of the heap, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLHeap/size
func (MTLHeapObject) StorageMode ¶
func (o MTLHeapObject) StorageMode() MTLStorageMode
The heap’s storage mode.
See: https://developer.apple.com/documentation/Metal/MTLHeap/storageMode
func (MTLHeapObject) Type ¶
func (o MTLHeapObject) Type() MTLHeapType
The heap’s type.
See: https://developer.apple.com/documentation/Metal/MTLHeap/type
func (MTLHeapObject) UsedSize ¶
func (o MTLHeapObject) UsedSize() uint
The size of all resources currently in the heap, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLHeap/usedSize
type MTLHeapType ¶
type MTLHeapType int
See: https://developer.apple.com/documentation/Metal/MTLHeapType
const ( // MTLHeapTypeAutomatic: A heap that automatically places new resource allocations. MTLHeapTypeAutomatic MTLHeapType = 0 // MTLHeapTypePlacement: The app controls placement of resources on the heap. MTLHeapTypePlacement MTLHeapType = 1 // MTLHeapTypeSparse: The heap contains sparse texture tiles. MTLHeapTypeSparse MTLHeapType = 2 )
func (MTLHeapType) String ¶
func (e MTLHeapType) String() string
type MTLIOCommandBuffer ¶
type MTLIOCommandBuffer interface {
objectivec.IObject
// Encodes a command that loads data from a file handle into a GPU buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/load(_:offset:size:sourceHandle:sourceHandleOffset:)
LoadBufferOffsetSizeSourceHandleSourceHandleOffset(buffer MTLBuffer, offset uint, size uint, sourceHandle MTLIOFileHandle, sourceHandleOffset uint)
// Encodes a command that loads data from a file handle into a GPU texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/load(_:slice:level:size:sourceBytesPerRow:sourceBytesPerImage:destinationOrigin:sourceHandle:sourceHandleOffset:)
LoadTextureSliceLevelSizeSourceBytesPerRowSourceBytesPerImageDestinationOriginSourceHandleSourceHandleOffset(texture MTLTexture, slice uint, level uint, size MTLSize, sourceBytesPerRow uint, sourceBytesPerImage uint, destinationOrigin MTLOrigin, sourceHandle MTLIOFileHandle, sourceHandleOffset uint)
// Encodes a command that loads data from a file handle into CPU-accessible memory buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/loadBytes(_:size:sourceHandle:sourceHandleOffset:)
LoadBytesSizeSourceHandleSourceHandleOffset(pointer unsafe.Pointer, size uint, sourceHandle MTLIOFileHandle, sourceHandleOffset uint)
// Encodes a barrier into the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/addBarrier()
AddBarrier()
// Encodes a command that signals a shared event to other parts of your app.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/signalEvent(_:value:)
SignalEventValue(event MTLSharedEvent, value uint64)
// Encodes a command that pauses the command buffer’s execution until another part of your app signals a shared event.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/waitForEvent(_:value:)
WaitForEventValue(event MTLSharedEvent, value uint64)
// Encodes a command that writes the input/output command buffer’s status to a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/copyStatus(buffer:offset:)
CopyStatusToBufferOffset(buffer MTLBuffer, offset uint)
// Adds a closure that Metal calls immediately after the GPU finishes executing the commands in the input/output command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/addCompletedHandler(_:)
AddCompletedHandler(block MTLIOCommandBufferHandler)
// Submits the command buffer to the queue for execution on the GPU.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/commit()
Commit()
// Reserves a place for the input/output command buffer in the input/output command queue without committing the command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/enqueue()
Enqueue()
// Submits a request to abandon a command buffer the queue is currently running.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/tryCancel()
TryCancel()
// Blocks the current thread until the GPU finishes executing the input/output command buffer and all of its completion handlers.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/waitUntilCompleted()
WaitUntilCompleted()
// Represents the state of the input/output command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/status
Status() MTLIOStatus
// Stores the details of an error when the GPU experienced a problem with the input/output command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/error
Error() foundation.INSError
// An optional name for the input/output command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/label
Label() string
// Sets the current name for this input/output command encoder by adding it to the top of the debug name stack.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/pushDebugGroup(_:)
PushDebugGroup(string_ string)
// Restores the previous name for this input/output command encoder by removing the top item of the debug name stack.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/popDebugGroup()
PopDebugGroup()
// An optional name for the input/output command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/label
SetLabel(value string)
}
A command buffer that contains input/output commands that work with files in the file systems and Metal resources.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer
type MTLIOCommandBufferHandler ¶
type MTLIOCommandBufferHandler = func(MTLIOCommandBuffer)
MTLIOCommandBufferHandler is a convenience type that defines the signature of an input/output command buffer’s completion handler.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBufferHandler
type MTLIOCommandBufferObject ¶
type MTLIOCommandBufferObject struct {
objectivec.Object
}
MTLIOCommandBufferObject wraps an existing Objective-C object that conforms to the MTLIOCommandBuffer protocol.
func MTLIOCommandBufferObjectFromID ¶
func MTLIOCommandBufferObjectFromID(id objc.ID) MTLIOCommandBufferObject
MTLIOCommandBufferObjectFromID constructs a MTLIOCommandBufferObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIOCommandBufferObject) AddBarrier ¶
func (o MTLIOCommandBufferObject) AddBarrier()
Encodes a barrier into the command buffer.
Discussion ¶
The method encodes a barrier that starts any subsequent commands only after all the previously encoded commands have completed.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/addBarrier()
func (MTLIOCommandBufferObject) AddCompletedHandler ¶
func (o MTLIOCommandBufferObject) AddCompletedHandler(block MTLIOCommandBufferHandler)
Adds a closure that Metal calls immediately after the GPU finishes executing the commands in the input/output command buffer.
block: A Swift closure or an Objective-C block with your code.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/addCompletedHandler(_:)
func (MTLIOCommandBufferObject) BaseObject ¶
func (o MTLIOCommandBufferObject) BaseObject() objectivec.Object
func (MTLIOCommandBufferObject) Commit ¶
func (o MTLIOCommandBufferObject) Commit()
Submits the command buffer to the queue for execution on the GPU.
Discussion ¶
If you haven’t already called [Enqueue] for the command buffer, the [Commit] method enqueues it at the next position in the input/output command queue.
You can only commit an input/output command buffer once, after which you can’t encode any additional commands or add more completion handlers to it.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/commit()
func (MTLIOCommandBufferObject) CopyStatusToBufferOffset ¶
func (o MTLIOCommandBufferObject) CopyStatusToBufferOffset(buffer MTLBuffer, offset uint)
Encodes a command that writes the input/output command buffer’s status to a buffer.
buffer: A buffer instance the method copies the status into.
offset: A starting location relative to the beginning of the buffer, in bytes, the method copies data to.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/copyStatus(buffer:offset:)
func (MTLIOCommandBufferObject) Enqueue ¶
func (o MTLIOCommandBufferObject) Enqueue()
Reserves a place for the input/output command buffer in the input/output command queue without committing the command buffer.
Discussion ¶
The method saves the next position for the command buffer in the input/output command queue. You can call [Enqueue] at any time relative to encoding commands, but you can only enqueue a command buffer once. To submit a command buffer to GPU for execution, call its [Commit] method.
For example, to fill multiple command buffers asynchronously that execute in a specific order:
- Call each command buffer’s [Enqueue] method in order. - Encode commands into each command buffer on its own, separate thread. - Call each command buffer’s [Commit] in any order.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/enqueue()
func (MTLIOCommandBufferObject) Error ¶
func (o MTLIOCommandBufferObject) Error() foundation.INSError
Stores the details of an error when the GPU experienced a problem with the input/output command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/error
func (MTLIOCommandBufferObject) Label ¶
func (o MTLIOCommandBufferObject) Label() string
An optional name for the input/output command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/label
func (MTLIOCommandBufferObject) LoadBufferOffsetSizeSourceHandleSourceHandleOffset ¶
func (o MTLIOCommandBufferObject) LoadBufferOffsetSizeSourceHandleSourceHandleOffset(buffer MTLBuffer, offset uint, size uint, sourceHandle MTLIOFileHandle, sourceHandleOffset uint)
Encodes a command that loads data from a file handle into a GPU buffer.
buffer: A buffer instance the method loads data into.
offset: A starting location relative to the beginning of the buffer, in bytes, the method copies data to.
size: The number of bytes the method loads from the file into the buffer.
sourceHandle: A handle to a source file.
sourceHandleOffset: A starting location relative to the beginning of the file, in bytes, the method copies data from.
func (MTLIOCommandBufferObject) LoadBytesSizeSourceHandleSourceHandleOffset ¶
func (o MTLIOCommandBufferObject) LoadBytesSizeSourceHandleSourceHandleOffset(pointer unsafe.Pointer, size uint, sourceHandle MTLIOFileHandle, sourceHandleOffset uint)
Encodes a command that loads data from a file handle into CPU-accessible memory buffer.
pointer: A pointer to memory the method loads data into.
size: The number of bytes the method loads from the file.
sourceHandle: A handle to a source file.
sourceHandleOffset: A starting location relative to the beginning of the file, in bytes, the method copies data from.
func (MTLIOCommandBufferObject) LoadTextureSliceLevelSizeSourceBytesPerRowSourceBytesPerImageDestinationOriginSourceHandleSourceHandleOffset ¶
func (o MTLIOCommandBufferObject) LoadTextureSliceLevelSizeSourceBytesPerRowSourceBytesPerImageDestinationOriginSourceHandleSourceHandleOffset(texture MTLTexture, slice uint, level uint, size MTLSize, sourceBytesPerRow uint, sourceBytesPerImage uint, destinationOrigin MTLOrigin, sourceHandle MTLIOFileHandle, sourceHandleOffset uint)
Encodes a command that loads data from a file handle into a GPU texture.
texture: A texture instance the method loads data into.
slice: A slice within the texture.
level: A level within the texture.
size: The region of the texture the method copies to.
sourceBytesPerRow: The number of bytes in a row of data from the source file.
sourceBytesPerImage: The number of bytes in an image from the source file.
destinationOrigin: A starting location within the texture the method copies data to.
sourceHandle: A handle to a source file.
sourceHandleOffset: A starting location relative to the beginning of the file, in bytes, the method copies data from.
func (MTLIOCommandBufferObject) PopDebugGroup ¶
func (o MTLIOCommandBufferObject) PopDebugGroup()
Restores the previous name for this input/output command encoder by removing the top item of the debug name stack.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/popDebugGroup()
func (MTLIOCommandBufferObject) PushDebugGroup ¶
func (o MTLIOCommandBufferObject) PushDebugGroup(string_ string)
Sets the current name for this input/output command encoder by adding it to the top of the debug name stack.
string: A new debugging name.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/pushDebugGroup(_:)
func (MTLIOCommandBufferObject) SetLabel ¶
func (o MTLIOCommandBufferObject) SetLabel(value string)
func (MTLIOCommandBufferObject) SignalEventValue ¶
func (o MTLIOCommandBufferObject) SignalEventValue(event MTLSharedEvent, value uint64)
Encodes a command that signals a shared event to other parts of your app.
event: A shared event instance the method waits for.
value: A value the command uses to signal for the event to other parts of your app.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/signalEvent(_:value:)
func (MTLIOCommandBufferObject) Status ¶
func (o MTLIOCommandBufferObject) Status() MTLIOStatus
Represents the state of the input/output command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/status
func (MTLIOCommandBufferObject) TryCancel ¶
func (o MTLIOCommandBufferObject) TryCancel()
Submits a request to abandon a command buffer the queue is currently running.
Discussion ¶
Check the command buffer’s [Status] property after it completes, either after [WaitUntilCompleted] or in one of your completion handlers (see [AddCompletedHandler]).
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/tryCancel()
func (MTLIOCommandBufferObject) WaitForEventValue ¶
func (o MTLIOCommandBufferObject) WaitForEventValue(event MTLSharedEvent, value uint64)
Encodes a command that pauses the command buffer’s execution until another part of your app signals a shared event.
event: A shared event instance the method waits for.
value: A value the method compares to the event’s value. The method returns when the event’s value is greater than or equal to `value`.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/waitForEvent(_:value:)
func (MTLIOCommandBufferObject) WaitUntilCompleted ¶
func (o MTLIOCommandBufferObject) WaitUntilCompleted()
Blocks the current thread until the GPU finishes executing the input/output command buffer and all of its completion handlers.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandBuffer/waitUntilCompleted()
type MTLIOCommandQueue ¶
type MTLIOCommandQueue interface {
objectivec.IObject
// Creates an input/output command buffer for the command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/makeCommandBuffer()
CommandBuffer() MTLIOCommandBuffer
// Creates an input/output command buffer for the command queue that doesn’t retain the instances you pass to its methods.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/makeCommandBufferWithUnretainedReferences()
CommandBufferWithUnretainedReferences() MTLIOCommandBuffer
// Appends a barrier that tells the input/output command queue to finish running all in-flight command buffers before running any new command buffers.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/enqueueBarrier()
EnqueueBarrier()
// An optional name for the input/output command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/label
Label() string
// An optional name for the input/output command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/label
SetLabel(value string)
}
A command queue that schedules input/output commands for reading files in the file system, and writing to GPU resources and memory.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue
type MTLIOCommandQueueDescriptor ¶
type MTLIOCommandQueueDescriptor struct {
objectivec.Object
}
A configuration template you use to create a new input/output command queue.
Overview ¶
Use this descriptor type to configure the settings of each input/output command queue that you create using [NewIOCommandQueueWithDescriptorError]. To create additional input/output command queues, you can reuse a descriptor instance and optionally reconfigure its properties.
Create each input/output queue to meet your apps needs by setting the descriptor’s properties.
- Select a queue’s relative level of importance with the MTLIOCommandQueueDescriptor.Priority property. - Create a queue that runs multiple input/output command buffers in parallel by setting the [Type] property to [IOCommandQueueTypeConcurrent]. - Decide how many individual commands a queue can run simultaneously with the MTLIOCommandQueueDescriptor.MaxCommandsInFlight property. - Choose how many command buffers a queue can have waiting to run with MTLIOCommandQueueDescriptor.MaxCommandBufferCount property. - Take control of the queue’s scratch memory allocation by implementing MTLIOScratchBufferAllocator and assign an instance of it to the MTLIOCommandQueueDescriptor.ScratchBufferAllocator property.
Configuring the input/output command queue ¶
- MTLIOCommandQueueDescriptor.Priority: Configures the priority for a new input/output command queue.
- MTLIOCommandQueueDescriptor.SetPriority
- MTLIOCommandQueueDescriptor.Type: Configures the queue type for a new input/output command queue.
- MTLIOCommandQueueDescriptor.SetType
- MTLIOCommandQueueDescriptor.MaxCommandsInFlight: Sets the largest number of individual commands that an input/output command queue can run at a time.
- MTLIOCommandQueueDescriptor.SetMaxCommandsInFlight
- MTLIOCommandQueueDescriptor.MaxCommandBufferCount: Sets the largest number of outstanding input/output command buffers a queue can have at any point in time.
- MTLIOCommandQueueDescriptor.SetMaxCommandBufferCount
Providing your own a scratch buffer ¶
- MTLIOCommandQueueDescriptor.ScratchBufferAllocator: An optional memory allocator that you implement to manage the scratch memory that an input/output command queue requests.
- MTLIOCommandQueueDescriptor.SetScratchBufferAllocator
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueDescriptor
func MTLIOCommandQueueDescriptorFromID ¶
func MTLIOCommandQueueDescriptorFromID(id objc.ID) MTLIOCommandQueueDescriptor
MTLIOCommandQueueDescriptorFromID constructs a MTLIOCommandQueueDescriptor from an objc.ID.
A configuration template you use to create a new input/output command queue.
func NewMTLIOCommandQueueDescriptor ¶
func NewMTLIOCommandQueueDescriptor() MTLIOCommandQueueDescriptor
NewMTLIOCommandQueueDescriptor creates a new MTLIOCommandQueueDescriptor instance.
func (MTLIOCommandQueueDescriptor) Autorelease ¶
func (i MTLIOCommandQueueDescriptor) Autorelease() MTLIOCommandQueueDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLIOCommandQueueDescriptor) Init ¶
func (i MTLIOCommandQueueDescriptor) Init() MTLIOCommandQueueDescriptor
Init initializes the instance.
func (MTLIOCommandQueueDescriptor) MaxCommandBufferCount ¶
func (i MTLIOCommandQueueDescriptor) MaxCommandBufferCount() uint
Sets the largest number of outstanding input/output command buffers a queue can have at any point in time.
Discussion ¶
The input/output command buffers that count against this limit are those that are currently executing in a queue or waiting to execute. The command buffers that have finished executing no longer count against this limit.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueDescriptor/maxCommandBufferCount
func (MTLIOCommandQueueDescriptor) MaxCommandsInFlight ¶
func (i MTLIOCommandQueueDescriptor) MaxCommandsInFlight() uint
Sets the largest number of individual commands that an input/output command queue can run at a time.
Discussion ¶
Set to `0` to instruct Metal to select an appropriate value for you — based on the system’s available memory.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueDescriptor/maxCommandsInFlight
func (MTLIOCommandQueueDescriptor) Priority ¶
func (i MTLIOCommandQueueDescriptor) Priority() MTLIOPriority
Configures the priority for a new input/output command queue.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueDescriptor/priority
func (MTLIOCommandQueueDescriptor) ScratchBufferAllocator ¶
func (i MTLIOCommandQueueDescriptor) ScratchBufferAllocator() MTLIOScratchBufferAllocator
An optional memory allocator that you implement to manage the scratch memory that an input/output command queue requests.
Discussion ¶
Your app can manage an input/output command queue’s scratch memory by an implementing MTLIOScratchBufferAllocator in one of your types, and assigning an instance of it to [ScratchBufferAllocator]. Otherwise, set to `nil` to instruct the input/output command queue to allocate and manage its own scratch buffers.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueDescriptor/scratchBufferAllocator
func (MTLIOCommandQueueDescriptor) SetMaxCommandBufferCount ¶
func (i MTLIOCommandQueueDescriptor) SetMaxCommandBufferCount(value uint)
func (MTLIOCommandQueueDescriptor) SetMaxCommandsInFlight ¶
func (i MTLIOCommandQueueDescriptor) SetMaxCommandsInFlight(value uint)
func (MTLIOCommandQueueDescriptor) SetPriority ¶
func (i MTLIOCommandQueueDescriptor) SetPriority(value MTLIOPriority)
func (MTLIOCommandQueueDescriptor) SetScratchBufferAllocator ¶
func (i MTLIOCommandQueueDescriptor) SetScratchBufferAllocator(value MTLIOScratchBufferAllocator)
func (MTLIOCommandQueueDescriptor) SetType ¶
func (i MTLIOCommandQueueDescriptor) SetType(value MTLIOCommandQueueType)
func (MTLIOCommandQueueDescriptor) Type ¶
func (i MTLIOCommandQueueDescriptor) Type() MTLIOCommandQueueType
Configures the queue type for a new input/output command queue.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueDescriptor/type
type MTLIOCommandQueueDescriptorClass ¶
type MTLIOCommandQueueDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLIOCommandQueueDescriptorClass ¶
func GetMTLIOCommandQueueDescriptorClass() MTLIOCommandQueueDescriptorClass
GetMTLIOCommandQueueDescriptorClass returns the class object for MTLIOCommandQueueDescriptor.
func (MTLIOCommandQueueDescriptorClass) Alloc ¶
func (mc MTLIOCommandQueueDescriptorClass) Alloc() MTLIOCommandQueueDescriptor
Alloc allocates memory for a new instance of the class.
type MTLIOCommandQueueObject ¶
type MTLIOCommandQueueObject struct {
objectivec.Object
}
MTLIOCommandQueueObject wraps an existing Objective-C object that conforms to the MTLIOCommandQueue protocol.
func MTLIOCommandQueueObjectFromID ¶
func MTLIOCommandQueueObjectFromID(id objc.ID) MTLIOCommandQueueObject
MTLIOCommandQueueObjectFromID constructs a MTLIOCommandQueueObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIOCommandQueueObject) BaseObject ¶
func (o MTLIOCommandQueueObject) BaseObject() objectivec.Object
func (MTLIOCommandQueueObject) CommandBuffer ¶
func (o MTLIOCommandQueueObject) CommandBuffer() MTLIOCommandBuffer
Creates an input/output command buffer for the command queue.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/makeCommandBuffer()
func (MTLIOCommandQueueObject) CommandBufferWithUnretainedReferences ¶
func (o MTLIOCommandQueueObject) CommandBufferWithUnretainedReferences() MTLIOCommandBuffer
Creates an input/output command buffer for the command queue that doesn’t retain the instances you pass to its methods.
func (MTLIOCommandQueueObject) EnqueueBarrier ¶
func (o MTLIOCommandQueueObject) EnqueueBarrier()
Appends a barrier that tells the input/output command queue to finish running all in-flight command buffers before running any new command buffers.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/enqueueBarrier()
func (MTLIOCommandQueueObject) Label ¶
func (o MTLIOCommandQueueObject) Label() string
An optional name for the input/output command queue.
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueue/label
func (MTLIOCommandQueueObject) SetLabel ¶
func (o MTLIOCommandQueueObject) SetLabel(value string)
type MTLIOCommandQueueType ¶
type MTLIOCommandQueueType int
See: https://developer.apple.com/documentation/Metal/MTLIOCommandQueueType
const ( // MTLIOCommandQueueTypeConcurrent: Sets a new input/output command queue’s type to a queue that runs commands concurrently. MTLIOCommandQueueTypeConcurrent MTLIOCommandQueueType = 0 // MTLIOCommandQueueTypeSerial: Sets a new input/output command queue’s type to a queue that runs commands serially. MTLIOCommandQueueTypeSerial MTLIOCommandQueueType = 1 )
func (MTLIOCommandQueueType) String ¶
func (e MTLIOCommandQueueType) String() string
type MTLIOCompressionContext ¶
MTLIOCompressionContext is a pointer that represents the state of a file compression session in progress.
See: https://developer.apple.com/documentation/Metal/MTLIOCompressionContext
func MTLIOCreateCompressionContext ¶
func MTLIOCreateCompressionContext(path string, type_ MTLIOCompressionMethod, chunkSize uintptr) MTLIOCompressionContext
MTLIOCreateCompressionContext creates a compression context that you use to compress data into a single file.
See: https://developer.apple.com/documentation/Metal/MTLIOCreateCompressionContext
type MTLIOCompressionMethod ¶
type MTLIOCompressionMethod int
See: https://developer.apple.com/documentation/Metal/MTLIOCompressionMethod
const ( // MTLIOCompressionMethodLZ4: Indicates that a file uses the LZ4 compression algorithm codec. MTLIOCompressionMethodLZ4 MTLIOCompressionMethod = 2 // MTLIOCompressionMethodLZBitmap: Indicates that a file uses the LZBitmap compression algorithm codec. MTLIOCompressionMethodLZBitmap MTLIOCompressionMethod = 4 // MTLIOCompressionMethodLZFSE: Indicates that a file uses the LZFSE compression algorithm codec. MTLIOCompressionMethodLZFSE MTLIOCompressionMethod = 1 // MTLIOCompressionMethodLZMA: Indicates that a file uses the LZMA compression algorithm codec. MTLIOCompressionMethodLZMA MTLIOCompressionMethod = 3 // MTLIOCompressionMethodZlib: Indicates that a file uses the zlib compression algorithm codec. MTLIOCompressionMethodZlib MTLIOCompressionMethod = 0 )
func (MTLIOCompressionMethod) String ¶
func (e MTLIOCompressionMethod) String() string
type MTLIOCompressionStatus ¶
type MTLIOCompressionStatus int
See: https://developer.apple.com/documentation/Metal/MTLIOCompressionStatus
const ( // MTLIOCompressionStatusComplete: Indicates the compression API successfully flushed and destroyed a compression context. MTLIOCompressionStatusComplete MTLIOCompressionStatus = 0 // MTLIOCompressionStatusError: Indicates the compression API had an error while flushing and destroying a compression context. MTLIOCompressionStatusError MTLIOCompressionStatus = 1 )
func MTLIOFlushAndDestroyCompressionContext ¶
func MTLIOFlushAndDestroyCompressionContext(context MTLIOCompressionContext) MTLIOCompressionStatus
MTLIOFlushAndDestroyCompressionContext finishes compressing and saves the file that a compression context represents.
See: https://developer.apple.com/documentation/Metal/MTLIOFlushAndDestroyCompressionContext(_:)
func (MTLIOCompressionStatus) String ¶
func (e MTLIOCompressionStatus) String() string
type MTLIOError ¶
type MTLIOError int
See: https://developer.apple.com/documentation/Metal/MTLIOError-swift.struct/Code
const ( // MTLIOErrorInternal: An error code that represents a problem internal to the Metal framework. MTLIOErrorInternal MTLIOError = 2 // MTLIOErrorURLInvalid: An error code that represents a problem with a file URL. MTLIOErrorURLInvalid MTLIOError = 1 )
func (MTLIOError) String ¶
func (e MTLIOError) String() string
type MTLIOFileHandle ¶
type MTLIOFileHandle interface {
objectivec.IObject
// An optional name for the file that the handle represents.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOFileHandle/label
Label() string
// An optional name for the file that the handle represents.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOFileHandle/label
SetLabel(value string)
}
Represents a raw or compressed file, such as a resource asset file in your app’s bundle.
See: https://developer.apple.com/documentation/Metal/MTLIOFileHandle
type MTLIOFileHandleObject ¶
type MTLIOFileHandleObject struct {
objectivec.Object
}
MTLIOFileHandleObject wraps an existing Objective-C object that conforms to the MTLIOFileHandle protocol.
func MTLIOFileHandleObjectFromID ¶
func MTLIOFileHandleObjectFromID(id objc.ID) MTLIOFileHandleObject
MTLIOFileHandleObjectFromID constructs a MTLIOFileHandleObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIOFileHandleObject) BaseObject ¶
func (o MTLIOFileHandleObject) BaseObject() objectivec.Object
func (MTLIOFileHandleObject) Label ¶
func (o MTLIOFileHandleObject) Label() string
An optional name for the file that the handle represents.
See: https://developer.apple.com/documentation/Metal/MTLIOFileHandle/label
func (MTLIOFileHandleObject) SetLabel ¶
func (o MTLIOFileHandleObject) SetLabel(value string)
type MTLIOPriority ¶
type MTLIOPriority int
See: https://developer.apple.com/documentation/Metal/MTLIOPriority
const ( // MTLIOPriorityHigh: Sets a new input/output command queue’s priority to a high priority. MTLIOPriorityHigh MTLIOPriority = 0 // MTLIOPriorityLow: Designates the low priority for a new input/output command queue. MTLIOPriorityLow MTLIOPriority = 2 // MTLIOPriorityNormal: Designates the normal priority for a new input/output command queue. MTLIOPriorityNormal MTLIOPriority = 1 )
func (MTLIOPriority) String ¶
func (e MTLIOPriority) String() string
type MTLIOScratchBuffer ¶
type MTLIOScratchBuffer interface {
objectivec.IObject
// A Metal buffer that serves as scratch memory for an input/output command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOScratchBuffer/buffer
Buffer() MTLBuffer
}
A protocol your app implements that wraps a Metal buffer instance to serve as scratch memory for an input/output command queue.
See: https://developer.apple.com/documentation/Metal/MTLIOScratchBuffer
type MTLIOScratchBufferAllocator ¶
type MTLIOScratchBufferAllocator interface {
objectivec.IObject
// Creates a scratch memory buffer for an input/output command queue.
//
// See: https://developer.apple.com/documentation/Metal/MTLIOScratchBufferAllocator/makeScratchBuffer(minimumSize:)
NewScratchBufferWithMinimumSize(minimumSize uint) MTLIOScratchBuffer
}
A protocol your app implements to provide scratch memory to an input/output command queue.
See: https://developer.apple.com/documentation/Metal/MTLIOScratchBufferAllocator
type MTLIOScratchBufferAllocatorObject ¶
type MTLIOScratchBufferAllocatorObject struct {
objectivec.Object
}
MTLIOScratchBufferAllocatorObject wraps an existing Objective-C object that conforms to the MTLIOScratchBufferAllocator protocol.
func MTLIOScratchBufferAllocatorObjectFromID ¶
func MTLIOScratchBufferAllocatorObjectFromID(id objc.ID) MTLIOScratchBufferAllocatorObject
MTLIOScratchBufferAllocatorObjectFromID constructs a MTLIOScratchBufferAllocatorObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIOScratchBufferAllocatorObject) BaseObject ¶
func (o MTLIOScratchBufferAllocatorObject) BaseObject() objectivec.Object
func (MTLIOScratchBufferAllocatorObject) NewScratchBufferWithMinimumSize ¶
func (o MTLIOScratchBufferAllocatorObject) NewScratchBufferWithMinimumSize(minimumSize uint) MTLIOScratchBuffer
Creates a scratch memory buffer for an input/output command queue.
minimumSize: The number of bytes the input/output command buffer needs to successfully run a command buffer.
Return Value ¶
An MTLIOScratchBuffer instance that your app implements or `nil`.
Discussion ¶
Your app can reduce additional callbacks from the framework by providing additional memory above `minimumSize`. If your implementation returns `nil`, the input/output command queue cancels the MTLIOCommandBuffer instance that needs the scratch buffer memory.
type MTLIOScratchBufferObject ¶
type MTLIOScratchBufferObject struct {
objectivec.Object
}
MTLIOScratchBufferObject wraps an existing Objective-C object that conforms to the MTLIOScratchBuffer protocol.
func MTLIOScratchBufferObjectFromID ¶
func MTLIOScratchBufferObjectFromID(id objc.ID) MTLIOScratchBufferObject
MTLIOScratchBufferObjectFromID constructs a MTLIOScratchBufferObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIOScratchBufferObject) BaseObject ¶
func (o MTLIOScratchBufferObject) BaseObject() objectivec.Object
func (MTLIOScratchBufferObject) Buffer ¶
func (o MTLIOScratchBufferObject) Buffer() MTLBuffer
A Metal buffer that serves as scratch memory for an input/output command queue.
See: https://developer.apple.com/documentation/Metal/MTLIOScratchBuffer/buffer
type MTLIOStatus ¶
type MTLIOStatus int
See: https://developer.apple.com/documentation/Metal/MTLIOStatus
const ( // MTLIOStatusCancelled: Indicates the GPU has successfully abandoned the input/output command buffer. MTLIOStatusCancelled MTLIOStatus = 1 // MTLIOStatusComplete: Indicates the GPU has successfully finished executing the input/output command buffer. MTLIOStatusComplete MTLIOStatus = 3 // MTLIOStatusError: Indicates the GPU experienced a problem with the input/output command buffer. MTLIOStatusError MTLIOStatus = 2 // MTLIOStatusPending: Indicates the GPU hasn’t finished executing the input/output command buffer. MTLIOStatusPending MTLIOStatus = 0 )
func (MTLIOStatus) String ¶
func (e MTLIOStatus) String() string
type MTLIndexType ¶
type MTLIndexType int
See: https://developer.apple.com/documentation/Metal/MTLIndexType
const ( // MTLIndexTypeUInt16: A 16-bit unsigned integer used as a primitive index. MTLIndexTypeUInt16 MTLIndexType = 0 // MTLIndexTypeUInt32: A 32-bit unsigned integer used as a primitive index. MTLIndexTypeUInt32 MTLIndexType = 1 )
func (MTLIndexType) String ¶
func (e MTLIndexType) String() string
type MTLIndirectAccelerationStructureInstanceDescriptor ¶
type MTLIndirectAccelerationStructureInstanceDescriptor struct {
AccelerationStructureID MTLResourceID
IntersectionFunctionTableOffset uint32
Mask uint32
Options MTLAccelerationStructureInstanceOptions
TransformationMatrix MTLPackedFloat4x3
UserID uint32
}
MTLIndirectAccelerationStructureInstanceDescriptor - A description of an instance in an instanced geometry acceleration structure that the GPU can populate.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLIndirectAccelerationStructureInstanceDescriptor
type MTLIndirectAccelerationStructureMotionInstanceDescriptor ¶
type MTLIndirectAccelerationStructureMotionInstanceDescriptor struct {
AccelerationStructureID MTLResourceID // The acceleration resource handle to use for this instance.
MotionStartTime float32 // The start time of the motion instance.
MotionStartBorderMode MTLMotionBorderMode // The motion border mode describing what happens if Metal samples the acceleration structure before the motion start time.
MotionEndTime float32 // The end time of the motion instance.
MotionEndBorderMode MTLMotionBorderMode // The motion border mode describing what happens if Metal samples the acceleration structure after the motion end time.
MotionTransformsCount uint32 // The number of motion transforms belonging to the motion instance.
MotionTransformsStartIndex uint32 // The index of the first set of transforms describing one keyframe of the animation.
UserID uint32 // A user-assigned ID to help identify the instance.
IntersectionFunctionTableOffset uint32 // An offset for determining which function in the intersection function table Metal calls when testing a ray against the instance.
Mask uint32 // An instance mask to ignore geometry during ray tracing.
Options MTLAccelerationStructureInstanceOptions // The options for this instance.
}
MTLIndirectAccelerationStructureMotionInstanceDescriptor - A description of an instance in an acceleration structure that the GPU can populate, with motion data for the instance.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLIndirectAccelerationStructureMotionInstanceDescriptor
type MTLIndirectCommandBuffer ¶
type MTLIndirectCommandBuffer interface {
objectivec.IObject
MTLAllocation
MTLResource
// The number of commands contained in the indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/size
Size() uint
// Gets the render command at the given index.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/indirectRenderCommandAt(_:)
IndirectRenderCommandAtIndex(commandIndex uint) MTLIndirectRenderCommand
// Gets the compute command at the given index.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/indirectComputeCommandAt(_:)
IndirectComputeCommandAtIndex(commandIndex uint) MTLIndirectComputeCommand
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/gpuResourceID
GpuResourceID() MTLResourceID
// Resets a range of commands to their default state.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/resetWithRange:
ResetWithRange(range_ foundation.NSRange)
}
A command buffer containing reusable commands, encoded either on the CPU or GPU.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer
type MTLIndirectCommandBufferDescriptor ¶
type MTLIndirectCommandBufferDescriptor struct {
objectivec.Object
}
A configuration you create to customize an indirect command buffer.
Declaring command types to encode ¶
- MTLIndirectCommandBufferDescriptor.CommandTypes: The set of command types that you can encode into the indirect command buffer.
- MTLIndirectCommandBufferDescriptor.SetCommandTypes
Declaring command inheritance ¶
- MTLIndirectCommandBufferDescriptor.InheritBuffers: A Boolean value that determines where commands in the indirect command buffer get their buffer arguments from when you execute them.
- MTLIndirectCommandBufferDescriptor.SetInheritBuffers
- MTLIndirectCommandBufferDescriptor.InheritPipelineState: A Boolean value that determines where commands in the indirect command buffer get their pipeline state from when you execute them.
- MTLIndirectCommandBufferDescriptor.SetInheritPipelineState
Declaring the maximum number of argument buffers per command ¶
- MTLIndirectCommandBufferDescriptor.MaxVertexBufferBindCount: The maximum number of buffers that you can set per command for the vertex stage.
- MTLIndirectCommandBufferDescriptor.SetMaxVertexBufferBindCount
- MTLIndirectCommandBufferDescriptor.MaxFragmentBufferBindCount: The maximum number of buffers that you can set per command for the fragment stage.
- MTLIndirectCommandBufferDescriptor.SetMaxFragmentBufferBindCount
- MTLIndirectCommandBufferDescriptor.MaxKernelBufferBindCount: The maximum number of buffers that you can set per command for the compute kernel.
- MTLIndirectCommandBufferDescriptor.SetMaxKernelBufferBindCount
Instance Properties ¶
- MTLIndirectCommandBufferDescriptor.InheritCullMode: Configures whether the indirect command buffer inherits the cull mode from the encoder.
- MTLIndirectCommandBufferDescriptor.SetInheritCullMode
- MTLIndirectCommandBufferDescriptor.InheritDepthBias: Configures whether the indirect command buffer inherits the depth bias from the encoder.
- MTLIndirectCommandBufferDescriptor.SetInheritDepthBias
- MTLIndirectCommandBufferDescriptor.InheritDepthClipMode: Configures whether the indirect command buffer inherits the depth clip mode from the encoder.
- MTLIndirectCommandBufferDescriptor.SetInheritDepthClipMode
- MTLIndirectCommandBufferDescriptor.InheritDepthStencilState: Configures whether the indirect command buffer inherits the depth stencil state from the encoder.
- MTLIndirectCommandBufferDescriptor.SetInheritDepthStencilState
- MTLIndirectCommandBufferDescriptor.InheritFrontFacingWinding: Configures whether the indirect command buffer inherits the front facing winding from the encoder.
- MTLIndirectCommandBufferDescriptor.SetInheritFrontFacingWinding
- MTLIndirectCommandBufferDescriptor.InheritTriangleFillMode: Configures whether the indirect command buffer inherits the triangle fill mode from the encoder.
- MTLIndirectCommandBufferDescriptor.SetInheritTriangleFillMode
- MTLIndirectCommandBufferDescriptor.MaxKernelThreadgroupMemoryBindCount
- MTLIndirectCommandBufferDescriptor.SetMaxKernelThreadgroupMemoryBindCount
- MTLIndirectCommandBufferDescriptor.MaxMeshBufferBindCount
- MTLIndirectCommandBufferDescriptor.SetMaxMeshBufferBindCount
- MTLIndirectCommandBufferDescriptor.MaxObjectBufferBindCount
- MTLIndirectCommandBufferDescriptor.SetMaxObjectBufferBindCount
- MTLIndirectCommandBufferDescriptor.MaxObjectThreadgroupMemoryBindCount
- MTLIndirectCommandBufferDescriptor.SetMaxObjectThreadgroupMemoryBindCount
- MTLIndirectCommandBufferDescriptor.SupportColorAttachmentMapping: Specifies if the indirect command buffer should support color attachment mapping.
- MTLIndirectCommandBufferDescriptor.SetSupportColorAttachmentMapping
- MTLIndirectCommandBufferDescriptor.SupportDynamicAttributeStride
- MTLIndirectCommandBufferDescriptor.SetSupportDynamicAttributeStride
- MTLIndirectCommandBufferDescriptor.SupportRayTracing
- MTLIndirectCommandBufferDescriptor.SetSupportRayTracing
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferDescriptor
func MTLIndirectCommandBufferDescriptorFromID ¶
func MTLIndirectCommandBufferDescriptorFromID(id objc.ID) MTLIndirectCommandBufferDescriptor
MTLIndirectCommandBufferDescriptorFromID constructs a MTLIndirectCommandBufferDescriptor from an objc.ID.
A configuration you create to customize an indirect command buffer.
func NewMTLIndirectCommandBufferDescriptor ¶
func NewMTLIndirectCommandBufferDescriptor() MTLIndirectCommandBufferDescriptor
NewMTLIndirectCommandBufferDescriptor creates a new MTLIndirectCommandBufferDescriptor instance.
func (MTLIndirectCommandBufferDescriptor) Autorelease ¶
func (i MTLIndirectCommandBufferDescriptor) Autorelease() MTLIndirectCommandBufferDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLIndirectCommandBufferDescriptor) CommandTypes ¶
func (i MTLIndirectCommandBufferDescriptor) CommandTypes() MTLIndirectCommandType
The set of command types that you can encode into the indirect command buffer.
Discussion ¶
When you create the indirect command buffer, Metal allocates memory for each command it can hold. It needs to allocate enough memory to hold any command that you might later encode. To save space, specify only the command types you are going to encode in the indirect command buffer.
You can’t combine rendering and compute commands in the same indirect command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferDescriptor/commandTypes
func (MTLIndirectCommandBufferDescriptor) InheritBuffers ¶
func (i MTLIndirectCommandBufferDescriptor) InheritBuffers() bool
A Boolean value that determines where commands in the indirect command buffer get their buffer arguments from when you execute them.
Discussion ¶
Always set this property explicitly.
If you set the value to true, don’t set buffer arguments when you encode commands into the indirect command buffer. The commands use (inherit) the buffer arguments that you set on the parent encoder.
If you set the value to false, set the buffer arguments when you encode the commands into the indirect command buffer. The commands ignore any buffer arguments set on the parent encoder.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferDescriptor/inheritBuffers
func (MTLIndirectCommandBufferDescriptor) InheritCullMode ¶
func (i MTLIndirectCommandBufferDescriptor) InheritCullMode() bool
Configures whether the indirect command buffer inherits the cull mode from the encoder.
Discussion ¶
The property’s default value is true.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferDescriptor/inheritCullMode
func (MTLIndirectCommandBufferDescriptor) InheritDepthBias ¶
func (i MTLIndirectCommandBufferDescriptor) InheritDepthBias() bool
Configures whether the indirect command buffer inherits the depth bias from the encoder.
Discussion ¶
The property’s default value is true.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferDescriptor/inheritDepthBias
func (MTLIndirectCommandBufferDescriptor) InheritDepthClipMode ¶
func (i MTLIndirectCommandBufferDescriptor) InheritDepthClipMode() bool
Configures whether the indirect command buffer inherits the depth clip mode from the encoder.
Discussion ¶
The property’s default value is true.
func (MTLIndirectCommandBufferDescriptor) InheritDepthStencilState ¶
func (i MTLIndirectCommandBufferDescriptor) InheritDepthStencilState() bool
Configures whether the indirect command buffer inherits the depth stencil state from the encoder.
Discussion ¶
The property’s default value is true.
func (MTLIndirectCommandBufferDescriptor) InheritFrontFacingWinding ¶
func (i MTLIndirectCommandBufferDescriptor) InheritFrontFacingWinding() bool
Configures whether the indirect command buffer inherits the front facing winding from the encoder.
Discussion ¶
The property’s default value is true.
func (MTLIndirectCommandBufferDescriptor) InheritPipelineState ¶
func (i MTLIndirectCommandBufferDescriptor) InheritPipelineState() bool
A Boolean value that determines where commands in the indirect command buffer get their pipeline state from when you execute them.
Discussion ¶
The default value is false. If the value is false, set the pipeline state object when you encode the commands into the indirect command buffer. The commands ignore any pipeline state object set on the parent encoder.
If you set the value to true, don’t set a pipeline state object when you encode commands into the indirect command buffer. The commands use (inherit) the pipeline stage object that you set on the parent encoder.
This property doesn’t exist in iOS 12 and earlier, and tvOS 12 and earlier. If you create an indirect command buffer on those systems, it inherits the pipeline state, exactly as if the property existed, with a value of true. If you need your app to run on earlier versions of iOS, use an availability attribute to set the property conditionally:
func (MTLIndirectCommandBufferDescriptor) InheritTriangleFillMode ¶
func (i MTLIndirectCommandBufferDescriptor) InheritTriangleFillMode() bool
Configures whether the indirect command buffer inherits the triangle fill mode from the encoder.
Discussion ¶
The property’s default value is true.
func (MTLIndirectCommandBufferDescriptor) Init ¶
func (i MTLIndirectCommandBufferDescriptor) Init() MTLIndirectCommandBufferDescriptor
Init initializes the instance.
func (MTLIndirectCommandBufferDescriptor) MaxFragmentBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) MaxFragmentBufferBindCount() uint
The maximum number of buffers that you can set per command for the fragment stage.
Discussion ¶
Metal ignores this property if [InheritBuffers] is true or if you configured [CommandTypes] for compute commands. Metal needs to reserve enough memory in each command to store this many arguments. Use the smallest value that works for all commands you plan to encode into the indirect command buffer.
func (MTLIndirectCommandBufferDescriptor) MaxKernelBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) MaxKernelBufferBindCount() uint
The maximum number of buffers that you can set per command for the compute kernel.
Discussion ¶
Metal ignores this property if [InheritBuffers] is true or if you configured [CommandTypes] for rendering commands. Metal needs to reserve enough memory in each command to store this many arguments. Use the smallest value that works for all commands you plan to encode into the indirect command buffer.
func (MTLIndirectCommandBufferDescriptor) MaxKernelThreadgroupMemoryBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) MaxKernelThreadgroupMemoryBindCount() uint
func (MTLIndirectCommandBufferDescriptor) MaxMeshBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) MaxMeshBufferBindCount() uint
func (MTLIndirectCommandBufferDescriptor) MaxObjectBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) MaxObjectBufferBindCount() uint
func (MTLIndirectCommandBufferDescriptor) MaxObjectThreadgroupMemoryBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) MaxObjectThreadgroupMemoryBindCount() uint
func (MTLIndirectCommandBufferDescriptor) MaxVertexBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) MaxVertexBufferBindCount() uint
The maximum number of buffers that you can set per command for the vertex stage.
Discussion ¶
Metal ignores this property if [InheritBuffers] is true or if you configured [CommandTypes] for compute commands. Metal needs to reserve enough memory in each command to store this many arguments. Use the smallest value that works for all commands you plan to encode into the indirect command buffer.
func (MTLIndirectCommandBufferDescriptor) SetCommandTypes ¶
func (i MTLIndirectCommandBufferDescriptor) SetCommandTypes(value MTLIndirectCommandType)
func (MTLIndirectCommandBufferDescriptor) SetInheritBuffers ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritBuffers(value bool)
func (MTLIndirectCommandBufferDescriptor) SetInheritCullMode ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritCullMode(value bool)
func (MTLIndirectCommandBufferDescriptor) SetInheritDepthBias ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritDepthBias(value bool)
func (MTLIndirectCommandBufferDescriptor) SetInheritDepthClipMode ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritDepthClipMode(value bool)
func (MTLIndirectCommandBufferDescriptor) SetInheritDepthStencilState ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritDepthStencilState(value bool)
func (MTLIndirectCommandBufferDescriptor) SetInheritFrontFacingWinding ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritFrontFacingWinding(value bool)
func (MTLIndirectCommandBufferDescriptor) SetInheritPipelineState ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritPipelineState(value bool)
func (MTLIndirectCommandBufferDescriptor) SetInheritTriangleFillMode ¶
func (i MTLIndirectCommandBufferDescriptor) SetInheritTriangleFillMode(value bool)
func (MTLIndirectCommandBufferDescriptor) SetMaxFragmentBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) SetMaxFragmentBufferBindCount(value uint)
func (MTLIndirectCommandBufferDescriptor) SetMaxKernelBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) SetMaxKernelBufferBindCount(value uint)
func (MTLIndirectCommandBufferDescriptor) SetMaxKernelThreadgroupMemoryBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) SetMaxKernelThreadgroupMemoryBindCount(value uint)
func (MTLIndirectCommandBufferDescriptor) SetMaxMeshBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) SetMaxMeshBufferBindCount(value uint)
func (MTLIndirectCommandBufferDescriptor) SetMaxObjectBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) SetMaxObjectBufferBindCount(value uint)
func (MTLIndirectCommandBufferDescriptor) SetMaxObjectThreadgroupMemoryBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) SetMaxObjectThreadgroupMemoryBindCount(value uint)
func (MTLIndirectCommandBufferDescriptor) SetMaxVertexBufferBindCount ¶
func (i MTLIndirectCommandBufferDescriptor) SetMaxVertexBufferBindCount(value uint)
func (MTLIndirectCommandBufferDescriptor) SetSupportColorAttachmentMapping ¶
func (i MTLIndirectCommandBufferDescriptor) SetSupportColorAttachmentMapping(value bool)
func (MTLIndirectCommandBufferDescriptor) SetSupportDynamicAttributeStride ¶
func (i MTLIndirectCommandBufferDescriptor) SetSupportDynamicAttributeStride(value bool)
func (MTLIndirectCommandBufferDescriptor) SetSupportRayTracing ¶
func (i MTLIndirectCommandBufferDescriptor) SetSupportRayTracing(value bool)
func (MTLIndirectCommandBufferDescriptor) SupportColorAttachmentMapping ¶
func (i MTLIndirectCommandBufferDescriptor) SupportColorAttachmentMapping() bool
Specifies if the indirect command buffer should support color attachment mapping.
func (MTLIndirectCommandBufferDescriptor) SupportDynamicAttributeStride ¶
func (i MTLIndirectCommandBufferDescriptor) SupportDynamicAttributeStride() bool
func (MTLIndirectCommandBufferDescriptor) SupportRayTracing ¶
func (i MTLIndirectCommandBufferDescriptor) SupportRayTracing() bool
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferDescriptor/supportRayTracing
type MTLIndirectCommandBufferDescriptorClass ¶
type MTLIndirectCommandBufferDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLIndirectCommandBufferDescriptorClass ¶
func GetMTLIndirectCommandBufferDescriptorClass() MTLIndirectCommandBufferDescriptorClass
GetMTLIndirectCommandBufferDescriptorClass returns the class object for MTLIndirectCommandBufferDescriptor.
func (MTLIndirectCommandBufferDescriptorClass) Alloc ¶
func (mc MTLIndirectCommandBufferDescriptorClass) Alloc() MTLIndirectCommandBufferDescriptor
Alloc allocates memory for a new instance of the class.
type MTLIndirectCommandBufferExecutionRange ¶
type MTLIndirectCommandBufferExecutionRange struct {
Location uint32 // The first index in the command execution range.
Length uint32 // The number of items in the command execution range.
}
MTLIndirectCommandBufferExecutionRange - A range of commands in an indirect command buffer.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferExecutionRange
type MTLIndirectCommandBufferObject ¶
type MTLIndirectCommandBufferObject struct {
objectivec.Object
}
MTLIndirectCommandBufferObject wraps an existing Objective-C object that conforms to the MTLIndirectCommandBuffer protocol.
func MTLIndirectCommandBufferObjectFromID ¶
func MTLIndirectCommandBufferObjectFromID(id objc.ID) MTLIndirectCommandBufferObject
MTLIndirectCommandBufferObjectFromID constructs a MTLIndirectCommandBufferObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIndirectCommandBufferObject) AllocatedSize ¶
func (o MTLIndirectCommandBufferObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLIndirectCommandBufferObject) BaseObject ¶
func (o MTLIndirectCommandBufferObject) BaseObject() objectivec.Object
func (MTLIndirectCommandBufferObject) CpuCacheMode ¶
func (o MTLIndirectCommandBufferObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLIndirectCommandBufferObject) Device ¶
func (o MTLIndirectCommandBufferObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLIndirectCommandBufferObject) GpuResourceID ¶
func (o MTLIndirectCommandBufferObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/gpuResourceID
func (MTLIndirectCommandBufferObject) HazardTrackingMode ¶
func (o MTLIndirectCommandBufferObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLIndirectCommandBufferObject) Heap ¶
func (o MTLIndirectCommandBufferObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLIndirectCommandBufferObject) HeapOffset ¶
func (o MTLIndirectCommandBufferObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLIndirectCommandBufferObject) IndirectComputeCommandAtIndex ¶
func (o MTLIndirectCommandBufferObject) IndirectComputeCommandAtIndex(commandIndex uint) MTLIndirectComputeCommand
Gets the compute command at the given index.
commandIndex: The index of the command to retrieve.
Discussion ¶
Call this method only if the indirect command buffer contains compute commands.
func (MTLIndirectCommandBufferObject) IndirectRenderCommandAtIndex ¶
func (o MTLIndirectCommandBufferObject) IndirectRenderCommandAtIndex(commandIndex uint) MTLIndirectRenderCommand
Gets the render command at the given index.
commandIndex: The index of the command to retrieve.
Discussion ¶
Call this method only if the indirect command buffer contains rendering commands.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/indirectRenderCommandAt(_:)
func (MTLIndirectCommandBufferObject) IsAliasable ¶
func (o MTLIndirectCommandBufferObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLIndirectCommandBufferObject) Label ¶
func (o MTLIndirectCommandBufferObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLIndirectCommandBufferObject) MakeAliasable ¶
func (o MTLIndirectCommandBufferObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLIndirectCommandBufferObject) ResetWithRange ¶
func (o MTLIndirectCommandBufferObject) ResetWithRange(range_ foundation.NSRange)
Resets a range of commands to their default state.
range: The range of commands to reset. The range needs to fit inside the indirect command buffer’s extents.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/resetWithRange:
func (MTLIndirectCommandBufferObject) ResourceOptions ¶
func (o MTLIndirectCommandBufferObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLIndirectCommandBufferObject) SetLabel ¶
func (o MTLIndirectCommandBufferObject) SetLabel(value string)
func (MTLIndirectCommandBufferObject) SetOwnerWithIdentity ¶
func (o MTLIndirectCommandBufferObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLIndirectCommandBufferObject) SetPurgeableState ¶
func (o MTLIndirectCommandBufferObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLIndirectCommandBufferObject) Size ¶
func (o MTLIndirectCommandBufferObject) Size() uint
The number of commands contained in the indirect command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBuffer/size
func (MTLIndirectCommandBufferObject) StorageMode ¶
func (o MTLIndirectCommandBufferObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
type MTLIndirectCommandType ¶
type MTLIndirectCommandType int
See: https://developer.apple.com/documentation/Metal/MTLIndirectCommandType
const ( // MTLIndirectCommandTypeConcurrentDispatch: A compute command using a grid aligned to threadgroup boundaries. MTLIndirectCommandTypeConcurrentDispatch MTLIndirectCommandType = 32 // MTLIndirectCommandTypeConcurrentDispatchThreads: A compute command using an arbitrarily sized grid. MTLIndirectCommandTypeConcurrentDispatchThreads MTLIndirectCommandType = 64 // MTLIndirectCommandTypeDraw: A draw call command. MTLIndirectCommandTypeDraw MTLIndirectCommandType = 1 // MTLIndirectCommandTypeDrawIndexed: An indexed draw call command. MTLIndirectCommandTypeDrawIndexed MTLIndirectCommandType = 2 // MTLIndirectCommandTypeDrawIndexedPatches: An indexed draw call command for tessellated patches. MTLIndirectCommandTypeDrawIndexedPatches MTLIndirectCommandType = 8 MTLIndirectCommandTypeDrawMeshThreadgroups MTLIndirectCommandType = 128 MTLIndirectCommandTypeDrawMeshThreads MTLIndirectCommandType = 256 // MTLIndirectCommandTypeDrawPatches: A draw call command for tessellated patches. MTLIndirectCommandTypeDrawPatches MTLIndirectCommandType = 4 )
func (MTLIndirectCommandType) String ¶
func (e MTLIndirectCommandType) String() string
type MTLIndirectComputeCommand ¶
type MTLIndirectComputeCommand interface {
objectivec.IObject
// Sets the command’s compute pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setComputePipelineState(_:)
SetComputePipelineState(pipelineState MTLComputePipelineState)
// Sets the size, in pixels, of the imageblock.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setImageblockWidth(_:height:)
SetImageblockWidthHeight(width uint, height uint)
// Sets a buffer for the compute function.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setKernelBuffer(_:offset:at:)
SetKernelBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
// Sets the size of a block of threadgroup memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setThreadgroupMemoryLength(_:index:)
SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
// Sets the region of the stage-in attributes to apply to the compute kernel.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setStageInRegion(_:)
SetStageInRegion(region MTLRegion)
// Adds a barrier to ensure that commands executed prior to this command are complete before this command executes.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setBarrier()
SetBarrier()
// Removes any barrier set on the command.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/clearBarrier()
ClearBarrier()
// Encodes a compute command using a grid aligned to threadgroup boundaries.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/concurrentDispatchThreadgroups(_:threadsPerThreadgroup:)
ConcurrentDispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
// Encodes a compute command using an arbitrarily sized grid.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/concurrentDispatchThreads(_:threadsPerThreadgroup:)
ConcurrentDispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
// Resets the command to its default state.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/reset()
Reset()
// SetKernelBufferOffsetAttributeStrideAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setKernelBuffer(_:offset:attributeStride:at:)
SetKernelBufferOffsetAttributeStrideAtIndex(buffer MTLBuffer, offset uint, stride uint, index uint)
}
A compute command in an indirect command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand
type MTLIndirectComputeCommandObject ¶
type MTLIndirectComputeCommandObject struct {
objectivec.Object
}
MTLIndirectComputeCommandObject wraps an existing Objective-C object that conforms to the MTLIndirectComputeCommand protocol.
func MTLIndirectComputeCommandObjectFromID ¶
func MTLIndirectComputeCommandObjectFromID(id objc.ID) MTLIndirectComputeCommandObject
MTLIndirectComputeCommandObjectFromID constructs a MTLIndirectComputeCommandObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIndirectComputeCommandObject) BaseObject ¶
func (o MTLIndirectComputeCommandObject) BaseObject() objectivec.Object
func (MTLIndirectComputeCommandObject) ClearBarrier ¶
func (o MTLIndirectComputeCommandObject) ClearBarrier()
Removes any barrier set on the command.
Discussion ¶
You need to set or clear barriers (as needed) before executing any of the commands in the indirect command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/clearBarrier()
func (MTLIndirectComputeCommandObject) ConcurrentDispatchThreadgroupsThreadsPerThreadgroup ¶
func (o MTLIndirectComputeCommandObject) ConcurrentDispatchThreadgroupsThreadsPerThreadgroup(threadgroupsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
Encodes a compute command using a grid aligned to threadgroup boundaries.
threadgroupsPerGrid: The number of threadgroups in the grid, in each dimension.
threadsPerThreadgroup: The number of threads in one threadgroup, in each dimension.
Discussion ¶
The command generated by this method is equivalent to calling [DispatchThreadgroupsThreadsPerThreadgroup].
Compute commands encoded into an indirect command buffer don’t automatically serialize access to resources with other commands in the indirect command buffer. Use barriers to serialize access to resources within a range of commands. See [SetBarrier].
When you execute the commands in an indirect command buffer, the [DispatchType] property of the compute command encoder determines whether the compute command encoder adds additional barriers. If [DispatchType] is [DispatchTypeSerial], the compute command encoder adds a barrier before and after the range of commands. If [DispatchType] is [DispatchTypeConcurrent], then the compute command encoder does nothing, and you are responsible for synchronizing access to resources.
func (MTLIndirectComputeCommandObject) ConcurrentDispatchThreadsThreadsPerThreadgroup ¶
func (o MTLIndirectComputeCommandObject) ConcurrentDispatchThreadsThreadsPerThreadgroup(threadsPerGrid MTLSize, threadsPerThreadgroup MTLSize)
Encodes a compute command using an arbitrarily sized grid.
threadsPerGrid: The number of threads in the grid, in each dimension.
threadsPerThreadgroup: The number of threads in one threadgroup, in each dimension.
Discussion ¶
The command generated by this method is equivalent to calling [DispatchThreadsThreadsPerThreadgroup].
Compute commands encoded into an indirect command buffer don’t automatically serialize access to resources with other commands in the indirect command buffer. Use barriers to serialize access to resources within a range of commands. See [SetBarrier].
When you execute the commands in an indirect command buffer, the [DispatchType] property of the compute command encoder determines whether the compute command encoder adds additional barriers. If [DispatchType] is [DispatchTypeSerial], the compute command encoder adds a barrier before and after the range of commands. If [DispatchType] is [DispatchTypeConcurrent], then the compute command encoder does nothing, and you are responsible for synchronizing access to resources.
func (MTLIndirectComputeCommandObject) Reset ¶
func (o MTLIndirectComputeCommandObject) Reset()
Resets the command to its default state.
Discussion ¶
A command that has been reset loses any state that you previously set and does nothing when executed.
See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/reset()
func (MTLIndirectComputeCommandObject) SetBarrier ¶
func (o MTLIndirectComputeCommandObject) SetBarrier()
Adds a barrier to ensure that commands executed prior to this command are complete before this command executes.
Discussion ¶
Set or clear barriers (as needed) before encoding the command.
See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setBarrier()
func (MTLIndirectComputeCommandObject) SetComputePipelineState ¶
func (o MTLIndirectComputeCommandObject) SetComputePipelineState(pipelineState MTLComputePipelineState)
Sets the command’s compute pipeline state.
pipelineState: A compute pipeline state instance.
Discussion ¶
You don’t need to call this method if you create an indirect command buffer with its [InheritPipelineState] property equal to true. The command gets the pipeline state from the parent encoder when you run the command.
If you create an indirect command buffer with its [InheritPipelineState] property equal to false, you need to set the pipeline state prior to encoding a drawing command.
func (MTLIndirectComputeCommandObject) SetImageblockWidthHeight ¶
func (o MTLIndirectComputeCommandObject) SetImageblockWidthHeight(width uint, height uint)
Sets the size, in pixels, of the imageblock.
width: The width of the imageblock.
height: The height of the imageblock.
func (MTLIndirectComputeCommandObject) SetKernelBufferOffsetAtIndex ¶
func (o MTLIndirectComputeCommandObject) SetKernelBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
Sets a buffer for the compute function.
buffer: The buffer to set in the buffer argument table.
offset: Where the data begins, in bytes, from the start of the buffer.
index: An index in the buffer argument table.
Discussion ¶
If you created the indirect command buffer with [InheritBuffers] set to true, don’t call this method. The command gets the arguments from the parent encoder when you execute the command.
If you need to pass other kinds of parameters to your shader, such as textures and samplers, create an argument buffer and pass it to the shader using this method.
func (MTLIndirectComputeCommandObject) SetKernelBufferOffsetAttributeStrideAtIndex ¶
func (o MTLIndirectComputeCommandObject) SetKernelBufferOffsetAttributeStrideAtIndex(buffer MTLBuffer, offset uint, stride uint, index uint)
func (MTLIndirectComputeCommandObject) SetStageInRegion ¶
func (o MTLIndirectComputeCommandObject) SetStageInRegion(region MTLRegion)
Sets the region of the stage-in attributes to apply to the compute kernel.
region: The offset and maximum size of the grid over which compute threads that read per-thread stage-in data are launched.
See: https://developer.apple.com/documentation/Metal/MTLIndirectComputeCommand/setStageInRegion(_:)
func (MTLIndirectComputeCommandObject) SetThreadgroupMemoryLengthAtIndex ¶
func (o MTLIndirectComputeCommandObject) SetThreadgroupMemoryLengthAtIndex(length uint, index uint)
Sets the size of a block of threadgroup memory.
length: The size of the threadgroup memory, in bytes, which needs to be a multiple of 16 bytes.
index: The index in the threadgroup memory argument table.
type MTLIndirectInstanceAccelerationStructureDescriptor ¶
type MTLIndirectInstanceAccelerationStructureDescriptor struct {
MTLAccelerationStructureDescriptor
}
A description of an acceleration structure that Metal derives from instances of primitive acceleration structures that the GPU can populate.
Instance Properties ¶
- MTLIndirectInstanceAccelerationStructureDescriptor.InstanceCountBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceCountBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.InstanceCountBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceCountBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorStride
- MTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride
- MTLIndirectInstanceAccelerationStructureDescriptor.InstanceDescriptorType
- MTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceDescriptorType
- MTLIndirectInstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout
- MTLIndirectInstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout
- MTLIndirectInstanceAccelerationStructureDescriptor.MaxInstanceCount
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMaxInstanceCount
- MTLIndirectInstanceAccelerationStructureDescriptor.MaxMotionTransformCount
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMaxMotionTransformCount
- MTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformCountBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformCountBuffer
- MTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformCountBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformCountBufferOffset
- MTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformStride
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformStride
- MTLIndirectInstanceAccelerationStructureDescriptor.MotionTransformType
- MTLIndirectInstanceAccelerationStructureDescriptor.SetMotionTransformType
See: https://developer.apple.com/documentation/Metal/MTLIndirectInstanceAccelerationStructureDescriptor
func MTLIndirectInstanceAccelerationStructureDescriptorFromID ¶
func MTLIndirectInstanceAccelerationStructureDescriptorFromID(id objc.ID) MTLIndirectInstanceAccelerationStructureDescriptor
MTLIndirectInstanceAccelerationStructureDescriptorFromID constructs a MTLIndirectInstanceAccelerationStructureDescriptor from an objc.ID.
A description of an acceleration structure that Metal derives from instances of primitive acceleration structures that the GPU can populate.
func NewMTLIndirectInstanceAccelerationStructureDescriptor ¶
func NewMTLIndirectInstanceAccelerationStructureDescriptor() MTLIndirectInstanceAccelerationStructureDescriptor
NewMTLIndirectInstanceAccelerationStructureDescriptor creates a new MTLIndirectInstanceAccelerationStructureDescriptor instance.
func (MTLIndirectInstanceAccelerationStructureDescriptor) Autorelease ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) Autorelease() MTLIndirectInstanceAccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLIndirectInstanceAccelerationStructureDescriptor) Init ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) Init() MTLIndirectInstanceAccelerationStructureDescriptor
Init initializes the instance.
func (MTLIndirectInstanceAccelerationStructureDescriptor) InstanceCountBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceCountBuffer() MTLBuffer
func (MTLIndirectInstanceAccelerationStructureDescriptor) InstanceCountBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceCountBufferOffset() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTLBuffer
func (MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorBufferOffset() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorStride ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorType ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
func (MTLIndirectInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
func (MTLIndirectInstanceAccelerationStructureDescriptor) MaxInstanceCount ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MaxInstanceCount() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) MaxMotionTransformCount ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MaxMotionTransformCount() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTLBuffer
func (MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformBufferOffset() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBuffer() MTLBuffer
func (MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformCountBufferOffset() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformStride ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformStride() uint
func (MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformType ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBuffer(value MTLBuffer)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceCountBufferOffset(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTLBuffer)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBufferOffset(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMaxInstanceCount ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMaxInstanceCount(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMaxMotionTransformCount ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMaxMotionTransformCount(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTLBuffer)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformBufferOffset(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBuffer ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBuffer(value MTLBuffer)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBufferOffset ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformCountBufferOffset(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformStride ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
func (MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformType ¶
func (i MTLIndirectInstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
type MTLIndirectInstanceAccelerationStructureDescriptorClass ¶
type MTLIndirectInstanceAccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLIndirectInstanceAccelerationStructureDescriptorClass ¶
func GetMTLIndirectInstanceAccelerationStructureDescriptorClass() MTLIndirectInstanceAccelerationStructureDescriptorClass
GetMTLIndirectInstanceAccelerationStructureDescriptorClass returns the class object for MTLIndirectInstanceAccelerationStructureDescriptor.
func (MTLIndirectInstanceAccelerationStructureDescriptorClass) Alloc ¶
func (mc MTLIndirectInstanceAccelerationStructureDescriptorClass) Alloc() MTLIndirectInstanceAccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLIndirectInstanceAccelerationStructureDescriptorClass) Descriptor ¶
func (_MTLIndirectInstanceAccelerationStructureDescriptorClass MTLIndirectInstanceAccelerationStructureDescriptorClass) Descriptor() MTLIndirectInstanceAccelerationStructureDescriptor
type MTLIndirectRenderCommand ¶
type MTLIndirectRenderCommand interface {
objectivec.IObject
// Sets the render pipeline state for the command.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setRenderPipelineState(_:)
SetRenderPipelineState(pipelineState MTLRenderPipelineState)
// Sets a vertex buffer argument for the command.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setVertexBuffer(_:offset:at:)
SetVertexBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
// Sets a fragment buffer argument for the command.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setFragmentBuffer(_:offset:at:)
SetFragmentBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
// Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements, starting from the base instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/drawPrimitives(_:vertexStart:vertexCount:instanceCount:baseInstance:)
DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint, baseInstance uint)
// Encodes a command to render a number of instances of primitives using an index list specified in a buffer, starting from the base vertex of the base instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/drawIndexedPrimitives(_:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:)
DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, instanceCount uint, baseVertex int, baseInstance uint)
// Encodes a command to render a number of instances of tessellated patches.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/drawPatches(_:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:tessellationFactorBuffer:tessellationFactorBufferOffset:tessellationFactorBufferInstanceStride:)
DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstanceTessellationFactorBufferTessellationFactorBufferOffsetTessellationFactorBufferInstanceStride(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, instanceCount uint, baseInstance uint, buffer MTLBuffer, offset uint, instanceStride uint)
// Resets the command to its default state.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/reset()
Reset()
// ClearBarrier protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/clearBarrier()
ClearBarrier()
// DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/drawMeshThreadgroups(_:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/drawMeshThreads(_:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// SetBarrier protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setBarrier()
SetBarrier()
// SetCullMode protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setCullMode(_:)
SetCullMode(cullMode MTLCullMode)
// SetDepthBiasSlopeScaleClamp protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setDepthBias(_:slopeScale:clamp:)
SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
// SetDepthClipMode protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setDepthClipMode(_:)
SetDepthClipMode(depthClipMode MTLDepthClipMode)
// SetDepthStencilState protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setDepthStencilState(_:)
SetDepthStencilState(depthStencilState MTLDepthStencilState)
// SetFrontFacingWinding protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setFrontFacing(_:)
SetFrontFacingWinding(frontFacingWindning MTLWinding)
// SetMeshBufferOffsetAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setMeshBuffer(_:offset:at:)
SetMeshBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
// SetObjectBufferOffsetAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setObjectBuffer(_:offset:at:)
SetObjectBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
// SetObjectThreadgroupMemoryLengthAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setObjectThreadgroupMemoryLength(_:index:)
SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
// SetTriangleFillMode protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setTriangleFillMode(_:)
SetTriangleFillMode(fillMode MTLTriangleFillMode)
// SetVertexBufferOffsetAttributeStrideAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setVertexBuffer(_:offset:attributeStride:at:)
SetVertexBufferOffsetAttributeStrideAtIndex(buffer MTLBuffer, offset uint, stride uint, index uint)
// Encodes a command to render a number of instances of tessellated patches, using a control point index buffer.
//
// See: /documentation/metal/mtlindirectrendercommand/drawindexedpatches(_:patchstart:patchcount:patchindexbuffer:patchindexbufferoffset:controlpointindexbuffer:controlpointindexbufferoffset:instancecount:baseinstance:tessellationfactorbuffer:tessellationfactorbufferoffset:tessellationfactorbu-4mdz8
DrawIndexedPatches()
}
A render command in an indirect command buffer.
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand
type MTLIndirectRenderCommandObject ¶
type MTLIndirectRenderCommandObject struct {
objectivec.Object
}
MTLIndirectRenderCommandObject wraps an existing Objective-C object that conforms to the MTLIndirectRenderCommand protocol.
func MTLIndirectRenderCommandObjectFromID ¶
func MTLIndirectRenderCommandObjectFromID(id objc.ID) MTLIndirectRenderCommandObject
MTLIndirectRenderCommandObjectFromID constructs a MTLIndirectRenderCommandObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIndirectRenderCommandObject) BaseObject ¶
func (o MTLIndirectRenderCommandObject) BaseObject() objectivec.Object
func (MTLIndirectRenderCommandObject) ClearBarrier ¶
func (o MTLIndirectRenderCommandObject) ClearBarrier()
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/clearBarrier()
func (MTLIndirectRenderCommandObject) DrawIndexedPatches ¶
func (o MTLIndirectRenderCommandObject) DrawIndexedPatches()
Encodes a command to render a number of instances of tessellated patches, using a control point index buffer.
See: /documentation/metal/mtlindirectrendercommand/drawindexedpatches(_:patchstart:patchcount:patchindexbuffer:patchindexbufferoffset:controlpointindexbuffer:controlpointindexbufferoffset:instancecount:baseinstance:tessellationfactorbuffer:tessellationfactorbufferoffset:tessellationfactorbu-4mdz8
func (MTLIndirectRenderCommandObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance ¶
func (o MTLIndirectRenderCommandObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, instanceCount uint, baseVertex int, baseInstance uint)
Encodes a command to render a number of instances of primitives using an index list specified in a buffer, starting from the base vertex of the base instance.
primitiveType: The type of primitive that the vertices are assembled into.
indexCount: For each instance, the number of indices to read from the index buffer.
indexType: The data type of the indices.
indexBuffer: A buffer that contains indices to vertices.
indexBufferOffset: Byte offset within indexBuffer to start reading indices from.
instanceCount: The number of instances to draw.
baseVertex: The first vertex to draw.
baseInstance: The first instance to draw.
Discussion ¶
The command generated by this method is equivalent to calling [DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance].
func (MTLIndirectRenderCommandObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTLIndirectRenderCommandObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
func (MTLIndirectRenderCommandObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTLIndirectRenderCommandObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
func (MTLIndirectRenderCommandObject) DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstanceTessellationFactorBufferTessellationFactorBufferOffsetTessellationFactorBufferInstanceStride ¶
func (o MTLIndirectRenderCommandObject) DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstanceTessellationFactorBufferTessellationFactorBufferOffsetTessellationFactorBufferInstanceStride(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, instanceCount uint, baseInstance uint, buffer MTLBuffer, offset uint, instanceStride uint)
Encodes a command to render a number of instances of tessellated patches.
numberOfPatchControlPoints: The number of control points per patch. This value needs to be between `0` and `32`, inclusive.
patchStart: The first patch to draw.
patchCount: The number of patches in each instance.
patchIndexBuffer: A buffer that contains indices to patches.
patchIndexBufferOffset: The byte offset within `patchIndexBuffer` to start reading indices from.
instanceCount: The number of instances to draw.
baseInstance: The first instance to draw.
buffer: The per-patch tessellation factors buffer.
offset: The distance, in bytes, between the start of the data and the start of the buffer. This value needs to be a multiple of `4` bytes.
instanceStride: The distance, in bytes, between two instances of data in the buffer.
Discussion ¶
The command generated by this method is equivalent to calling [SetTessellationFactorBufferOffsetInstanceStride] followed by [DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstance].
func (MTLIndirectRenderCommandObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance ¶
func (o MTLIndirectRenderCommandObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint, baseInstance uint)
Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements, starting from the base instance.
primitiveType: The type of primitives that the vertices are assembled into.
vertexStart: The first vertex to draw.
vertexCount: The number of vertices to draw.
instanceCount: The number of instances to draw.
baseInstance: The first instance to draw.
Discussion ¶
The command generated by this method is equivalent to calling [DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance].
func (MTLIndirectRenderCommandObject) Reset ¶
func (o MTLIndirectRenderCommandObject) Reset()
Resets the command to its default state.
Discussion ¶
A command that has been reset loses any state that you previously set and does nothing when executed.
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/reset()
func (MTLIndirectRenderCommandObject) SetBarrier ¶
func (o MTLIndirectRenderCommandObject) SetBarrier()
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setBarrier()
func (MTLIndirectRenderCommandObject) SetCullMode ¶
func (o MTLIndirectRenderCommandObject) SetCullMode(cullMode MTLCullMode)
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setCullMode(_:)
func (MTLIndirectRenderCommandObject) SetDepthBiasSlopeScaleClamp ¶
func (o MTLIndirectRenderCommandObject) SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
func (MTLIndirectRenderCommandObject) SetDepthClipMode ¶
func (o MTLIndirectRenderCommandObject) SetDepthClipMode(depthClipMode MTLDepthClipMode)
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setDepthClipMode(_:)
func (MTLIndirectRenderCommandObject) SetDepthStencilState ¶
func (o MTLIndirectRenderCommandObject) SetDepthStencilState(depthStencilState MTLDepthStencilState)
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setDepthStencilState(_:)
func (MTLIndirectRenderCommandObject) SetFragmentBufferOffsetAtIndex ¶
func (o MTLIndirectRenderCommandObject) SetFragmentBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
Sets a fragment buffer argument for the command.
buffer: The buffer to set in the buffer argument table.
offset: The location, in bytes relative to start of `buffer`, of the first byte of data for the fragment shader.
index: An index in the buffer argument table. The maximum index is determined when you created the indirect command buffer.
Discussion ¶
You don’t need to call this method if you create an indirect command buffer with its [InheritBuffers] equal to true. The command gets the arguments from the parent encoder when it runs.
If you need to pass other kinds of parameters to your shader, such as textures and samplers, create an argument buffer and pass it to the shader using this method.
func (MTLIndirectRenderCommandObject) SetFrontFacingWinding ¶
func (o MTLIndirectRenderCommandObject) SetFrontFacingWinding(frontFacingWindning MTLWinding)
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setFrontFacing(_:)
func (MTLIndirectRenderCommandObject) SetMeshBufferOffsetAtIndex ¶
func (o MTLIndirectRenderCommandObject) SetMeshBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setMeshBuffer(_:offset:at:)
func (MTLIndirectRenderCommandObject) SetObjectBufferOffsetAtIndex ¶
func (o MTLIndirectRenderCommandObject) SetObjectBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
func (MTLIndirectRenderCommandObject) SetObjectThreadgroupMemoryLengthAtIndex ¶
func (o MTLIndirectRenderCommandObject) SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
func (MTLIndirectRenderCommandObject) SetRenderPipelineState ¶
func (o MTLIndirectRenderCommandObject) SetRenderPipelineState(pipelineState MTLRenderPipelineState)
Sets the render pipeline state for the command.
pipelineState: The rendering pipeline state object to use.
Discussion ¶
You don’t need to call this method if you create an indirect command buffer with its [InheritPipelineState] property equal to true. The command gets the pipeline state from the parent encoder when it runs.
If you created the indirect command buffer with [InheritPipelineState] set to false, you need to set the pipeline state prior to encoding the drawing command.
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setRenderPipelineState(_:)
func (MTLIndirectRenderCommandObject) SetTriangleFillMode ¶
func (o MTLIndirectRenderCommandObject) SetTriangleFillMode(fillMode MTLTriangleFillMode)
See: https://developer.apple.com/documentation/Metal/MTLIndirectRenderCommand/setTriangleFillMode(_:)
func (MTLIndirectRenderCommandObject) SetVertexBufferOffsetAtIndex ¶
func (o MTLIndirectRenderCommandObject) SetVertexBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
Sets a vertex buffer argument for the command.
buffer: The buffer to set in the buffer argument table.
offset: The location, in bytes relative to start of `buffer`, of the first byte of data for the vertex shader.
index: An index in the buffer argument table. The maximum index is determined when you created the indirect command buffer.
Discussion ¶
You don’t need to call this method if you create an indirect command buffer with its [InheritBuffers] property equal to true. The command gets the arguments from the parent encoder when it runs.
If you need to pass other kinds of parameters to your shader, such as textures and samplers, create an argument buffer and pass it to the shader using this method.
func (MTLIndirectRenderCommandObject) SetVertexBufferOffsetAttributeStrideAtIndex ¶
func (o MTLIndirectRenderCommandObject) SetVertexBufferOffsetAttributeStrideAtIndex(buffer MTLBuffer, offset uint, stride uint, index uint)
type MTLInstanceAccelerationStructureDescriptor ¶
type MTLInstanceAccelerationStructureDescriptor struct {
MTLAccelerationStructureDescriptor
}
A description of an acceleration structure that derives from instances of primitive acceleration structures.
Overview ¶
Metal provides acceleration structures with a two-level hierarchy. The bottom layer consists of primitive acceleration structures, which instance acceleration structures in the top level reference.
Specifying the instance structures ¶
- MTLInstanceAccelerationStructureDescriptor.InstanceDescriptorType: The format of the instance data in the descriptor buffer.
- MTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorType
- MTLInstanceAccelerationStructureDescriptor.InstancedAccelerationStructures: The bottom-level acceleration structures that instances use in the instance acceleration structure .
- MTLInstanceAccelerationStructureDescriptor.SetInstancedAccelerationStructures
Specifying the list of instances ¶
- MTLInstanceAccelerationStructureDescriptor.InstanceCount: The number of instances in the instance descriptor buffer.
- MTLInstanceAccelerationStructureDescriptor.SetInstanceCount
- MTLInstanceAccelerationStructureDescriptor.InstanceDescriptorBuffer: A buffer that contains descriptions of each instance in the acceleration structure.
- MTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBuffer
- MTLInstanceAccelerationStructureDescriptor.InstanceDescriptorBufferOffset: The offset, in bytes, to the descripton of the first instance.
- MTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorBufferOffset
- MTLInstanceAccelerationStructureDescriptor.InstanceDescriptorStride: The stride, in bytes, between instance descriptions.
- MTLInstanceAccelerationStructureDescriptor.SetInstanceDescriptorStride
Specifying motion data ¶
- MTLInstanceAccelerationStructureDescriptor.MotionTransformCount: The number of motion transforms in the motion transform buffer.
- MTLInstanceAccelerationStructureDescriptor.SetMotionTransformCount
- MTLInstanceAccelerationStructureDescriptor.MotionTransformBuffer: A buffer that contains descriptions of each motion transform in the acceleration structure.
- MTLInstanceAccelerationStructureDescriptor.SetMotionTransformBuffer
- MTLInstanceAccelerationStructureDescriptor.MotionTransformBufferOffset: The offset, in bytes, to the descripton of the first motion transform.
- MTLInstanceAccelerationStructureDescriptor.SetMotionTransformBufferOffset
Instance Properties ¶
- MTLInstanceAccelerationStructureDescriptor.InstanceTransformationMatrixLayout
- MTLInstanceAccelerationStructureDescriptor.SetInstanceTransformationMatrixLayout
- MTLInstanceAccelerationStructureDescriptor.MotionTransformStride
- MTLInstanceAccelerationStructureDescriptor.SetMotionTransformStride
- MTLInstanceAccelerationStructureDescriptor.MotionTransformType
- MTLInstanceAccelerationStructureDescriptor.SetMotionTransformType
See: https://developer.apple.com/documentation/Metal/MTLInstanceAccelerationStructureDescriptor
func MTLInstanceAccelerationStructureDescriptorFromID ¶
func MTLInstanceAccelerationStructureDescriptorFromID(id objc.ID) MTLInstanceAccelerationStructureDescriptor
MTLInstanceAccelerationStructureDescriptorFromID constructs a MTLInstanceAccelerationStructureDescriptor from an objc.ID.
A description of an acceleration structure that derives from instances of primitive acceleration structures.
func NewMTLInstanceAccelerationStructureDescriptor ¶
func NewMTLInstanceAccelerationStructureDescriptor() MTLInstanceAccelerationStructureDescriptor
NewMTLInstanceAccelerationStructureDescriptor creates a new MTLInstanceAccelerationStructureDescriptor instance.
func (MTLInstanceAccelerationStructureDescriptor) Autorelease ¶
func (i MTLInstanceAccelerationStructureDescriptor) Autorelease() MTLInstanceAccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLInstanceAccelerationStructureDescriptor) Init ¶
func (i MTLInstanceAccelerationStructureDescriptor) Init() MTLInstanceAccelerationStructureDescriptor
Init initializes the instance.
func (MTLInstanceAccelerationStructureDescriptor) InstanceCount ¶
func (i MTLInstanceAccelerationStructureDescriptor) InstanceCount() uint
The number of instances in the instance descriptor buffer.
func (MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer ¶
func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorBuffer() MTLBuffer
A buffer that contains descriptions of each instance in the acceleration structure.
Discussion ¶
You need to set a buffer before creating the instanced acceleration structure. The buffer needs to contain a list of instance data structures, each defining the characteristics of an instance. The descriptor’s [InstanceDescriptorType] property determines which memory layout to use for the instance data; see MTLAccelerationStructureInstanceDescriptorType for more information.
func (MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorBufferOffset ¶
func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorBufferOffset() uint
The offset, in bytes, to the descripton of the first instance.
Discussion ¶
Specify an offset that is a multiple of 4 bytes and a multiple of the platform’s buffer offset alignment.
func (MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorStride ¶
func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorStride() uint
The stride, in bytes, between instance descriptions.
Discussion ¶
The stride needs to be at least 64 bytes and needs to be a multiple of 4 bytes. Defaults to 64 bytes.
func (MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorType ¶
func (i MTLInstanceAccelerationStructureDescriptor) InstanceDescriptorType() MTLAccelerationStructureInstanceDescriptorType
The format of the instance data in the descriptor buffer.
func (MTLInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout ¶
func (i MTLInstanceAccelerationStructureDescriptor) InstanceTransformationMatrixLayout() MTLMatrixLayout
func (MTLInstanceAccelerationStructureDescriptor) InstancedAccelerationStructures ¶
func (i MTLInstanceAccelerationStructureDescriptor) InstancedAccelerationStructures() []objectivec.IObject
The bottom-level acceleration structures that instances use in the instance acceleration structure .
Discussion ¶
Each instance in the instance descriptor buffer has an index into this array, specifying which acceleration structure to use for that instance.
func (MTLInstanceAccelerationStructureDescriptor) MotionTransformBuffer ¶
func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformBuffer() MTLBuffer
A buffer that contains descriptions of each motion transform in the acceleration structure.
func (MTLInstanceAccelerationStructureDescriptor) MotionTransformBufferOffset ¶
func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformBufferOffset() uint
The offset, in bytes, to the descripton of the first motion transform.
func (MTLInstanceAccelerationStructureDescriptor) MotionTransformCount ¶
func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformCount() uint
The number of motion transforms in the motion transform buffer.
func (MTLInstanceAccelerationStructureDescriptor) MotionTransformStride ¶
func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformStride() uint
func (MTLInstanceAccelerationStructureDescriptor) MotionTransformType ¶
func (i MTLInstanceAccelerationStructureDescriptor) MotionTransformType() MTLTransformType
func (MTLInstanceAccelerationStructureDescriptor) SetInstanceCount ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceCount(value uint)
func (MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBuffer(value MTLBuffer)
func (MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBufferOffset ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorBufferOffset(value uint)
func (MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorStride(value uint)
func (MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceDescriptorType(value MTLAccelerationStructureInstanceDescriptorType)
func (MTLInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetInstanceTransformationMatrixLayout(value MTLMatrixLayout)
func (MTLInstanceAccelerationStructureDescriptor) SetInstancedAccelerationStructures ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetInstancedAccelerationStructures(value []objectivec.IObject)
func (MTLInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformBuffer(value MTLBuffer)
func (MTLInstanceAccelerationStructureDescriptor) SetMotionTransformBufferOffset ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformBufferOffset(value uint)
func (MTLInstanceAccelerationStructureDescriptor) SetMotionTransformCount ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformCount(value uint)
func (MTLInstanceAccelerationStructureDescriptor) SetMotionTransformStride ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformStride(value uint)
func (MTLInstanceAccelerationStructureDescriptor) SetMotionTransformType ¶
func (i MTLInstanceAccelerationStructureDescriptor) SetMotionTransformType(value MTLTransformType)
type MTLInstanceAccelerationStructureDescriptorClass ¶
type MTLInstanceAccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLInstanceAccelerationStructureDescriptorClass ¶
func GetMTLInstanceAccelerationStructureDescriptorClass() MTLInstanceAccelerationStructureDescriptorClass
GetMTLInstanceAccelerationStructureDescriptorClass returns the class object for MTLInstanceAccelerationStructureDescriptor.
func (MTLInstanceAccelerationStructureDescriptorClass) Alloc ¶
func (mc MTLInstanceAccelerationStructureDescriptorClass) Alloc() MTLInstanceAccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLInstanceAccelerationStructureDescriptorClass) Descriptor ¶
func (_MTLInstanceAccelerationStructureDescriptorClass MTLInstanceAccelerationStructureDescriptorClass) Descriptor() MTLInstanceAccelerationStructureDescriptor
Creates an instance descriptor.
type MTLIntersectionFunctionBufferArguments ¶
type MTLIntersectionFunctionBufferArguments struct {
IntersectionFunctionBuffer uint64
IntersectionFunctionBufferSize uint64
IntersectionFunctionStride uint64
}
MTLIntersectionFunctionBufferArguments
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionBufferArguments
type MTLIntersectionFunctionDescriptor ¶
type MTLIntersectionFunctionDescriptor struct {
MTLFunctionDescriptor
}
A description of an intersection function that performs an intersection test.
Overview ¶
This class doesn’t add any additional API over its parent class.
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionDescriptor
func MTLIntersectionFunctionDescriptorFromID ¶
func MTLIntersectionFunctionDescriptorFromID(id objc.ID) MTLIntersectionFunctionDescriptor
MTLIntersectionFunctionDescriptorFromID constructs a MTLIntersectionFunctionDescriptor from an objc.ID.
A description of an intersection function that performs an intersection test.
func NewMTLIntersectionFunctionDescriptor ¶
func NewMTLIntersectionFunctionDescriptor() MTLIntersectionFunctionDescriptor
NewMTLIntersectionFunctionDescriptor creates a new MTLIntersectionFunctionDescriptor instance.
func (MTLIntersectionFunctionDescriptor) Autorelease ¶
func (i MTLIntersectionFunctionDescriptor) Autorelease() MTLIntersectionFunctionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLIntersectionFunctionDescriptor) Init ¶
func (i MTLIntersectionFunctionDescriptor) Init() MTLIntersectionFunctionDescriptor
Init initializes the instance.
type MTLIntersectionFunctionDescriptorClass ¶
type MTLIntersectionFunctionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLIntersectionFunctionDescriptorClass ¶
func GetMTLIntersectionFunctionDescriptorClass() MTLIntersectionFunctionDescriptorClass
GetMTLIntersectionFunctionDescriptorClass returns the class object for MTLIntersectionFunctionDescriptor.
func (MTLIntersectionFunctionDescriptorClass) Alloc ¶
func (mc MTLIntersectionFunctionDescriptorClass) Alloc() MTLIntersectionFunctionDescriptor
Alloc allocates memory for a new instance of the class.
type MTLIntersectionFunctionSignature ¶
type MTLIntersectionFunctionSignature int
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionSignature
const ( MTLIntersectionFunctionSignatureCurveData MTLIntersectionFunctionSignature = 128 MTLIntersectionFunctionSignatureExtendedLimits MTLIntersectionFunctionSignature = 32 MTLIntersectionFunctionSignatureInstanceMotion MTLIntersectionFunctionSignature = 8 // MTLIntersectionFunctionSignatureInstancing: A flag indicating that function signature uses instancing. MTLIntersectionFunctionSignatureInstancing MTLIntersectionFunctionSignature = 1 // MTLIntersectionFunctionSignatureIntersectionFunctionBuffer: # Discussion MTLIntersectionFunctionSignatureIntersectionFunctionBuffer MTLIntersectionFunctionSignature = 256 MTLIntersectionFunctionSignatureMaxLevels MTLIntersectionFunctionSignature = 64 // MTLIntersectionFunctionSignatureNone: A constant indicating that the function uses the default signature. MTLIntersectionFunctionSignatureNone MTLIntersectionFunctionSignature = 0 MTLIntersectionFunctionSignaturePrimitiveMotion MTLIntersectionFunctionSignature = 16 // MTLIntersectionFunctionSignatureTriangleData: A flag indicating that function signature uses triangle data. MTLIntersectionFunctionSignatureTriangleData MTLIntersectionFunctionSignature = 2 // MTLIntersectionFunctionSignatureUserData: # Discussion MTLIntersectionFunctionSignatureUserData MTLIntersectionFunctionSignature = 512 // MTLIntersectionFunctionSignatureWorldSpaceData: A flag indicating that function signature uses world space data. MTLIntersectionFunctionSignatureWorldSpaceData MTLIntersectionFunctionSignature = 4 )
func (MTLIntersectionFunctionSignature) String ¶
func (e MTLIntersectionFunctionSignature) String() string
type MTLIntersectionFunctionTable ¶
type MTLIntersectionFunctionTable interface {
objectivec.IObject
MTLAllocation
MTLResource
// Sets an entry in the table.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setFunction(_:index:)
SetFunctionAtIndex(function MTLFunctionHandle, index uint)
// Sets a buffer for the intersection functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setBuffer(_:offset:index:)
SetBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
// Sets a visible function table for the intersection functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setVisibleFunctionTable(_:bufferIndex:)
SetVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
// Sets an entry in the intersection table to point to a system-defined opaque triangle intersection function.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setOpaqueTriangleIntersectionFunction(signature:index:)
SetOpaqueTriangleIntersectionFunctionWithSignatureAtIndex(signature MTLIntersectionFunctionSignature, index uint)
// Sets a range of entries in the intersection table to point to a system-defined opaque triangle intersection function.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setOpaqueTriangleIntersectionFunction(signature:range:)
SetOpaqueTriangleIntersectionFunctionWithSignatureWithRange(signature MTLIntersectionFunctionSignature, range_ foundation.NSRange)
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/gpuResourceID
GpuResourceID() MTLResourceID
// SetOpaqueCurveIntersectionFunctionWithSignatureAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setOpaqueCurveIntersectionFunction(signature:index:)
SetOpaqueCurveIntersectionFunctionWithSignatureAtIndex(signature MTLIntersectionFunctionSignature, index uint)
// SetOpaqueCurveIntersectionFunctionWithSignatureWithRange protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setOpaqueCurveIntersectionFunction(signature:range:)
SetOpaqueCurveIntersectionFunctionWithSignatureWithRange(signature MTLIntersectionFunctionSignature, range_ foundation.NSRange)
// Sets a range of buffers for the intersection functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setBuffers:offsets:withRange:
SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Sets a range of entries in the table.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setFunctions:withRange:
SetFunctionsWithRange(functions []MTLFunctionHandle, range_ foundation.NSRange)
// Sets a range of visible function tables for the intersection functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setVisibleFunctionTables:withBufferRange:
SetVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, bufferRange foundation.NSRange)
}
A table of intersection functions that Metal calls to perform ray-tracing intersection tests.
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable
type MTLIntersectionFunctionTableDescriptor ¶
type MTLIntersectionFunctionTableDescriptor struct {
objectivec.Object
}
A specification of how to create an intersection function table.
Configuring the table’s size ¶
- MTLIntersectionFunctionTableDescriptor.FunctionCount: The number of entries in the intersection function table.
- MTLIntersectionFunctionTableDescriptor.SetFunctionCount
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTableDescriptor
func MTLIntersectionFunctionTableDescriptorFromID ¶
func MTLIntersectionFunctionTableDescriptorFromID(id objc.ID) MTLIntersectionFunctionTableDescriptor
MTLIntersectionFunctionTableDescriptorFromID constructs a MTLIntersectionFunctionTableDescriptor from an objc.ID.
A specification of how to create an intersection function table.
func NewMTLIntersectionFunctionTableDescriptor ¶
func NewMTLIntersectionFunctionTableDescriptor() MTLIntersectionFunctionTableDescriptor
NewMTLIntersectionFunctionTableDescriptor creates a new MTLIntersectionFunctionTableDescriptor instance.
func (MTLIntersectionFunctionTableDescriptor) Autorelease ¶
func (i MTLIntersectionFunctionTableDescriptor) Autorelease() MTLIntersectionFunctionTableDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLIntersectionFunctionTableDescriptor) FunctionCount ¶
func (i MTLIntersectionFunctionTableDescriptor) FunctionCount() uint
The number of entries in the intersection function table.
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTableDescriptor/functionCount
func (MTLIntersectionFunctionTableDescriptor) SetFunctionCount ¶
func (i MTLIntersectionFunctionTableDescriptor) SetFunctionCount(value uint)
type MTLIntersectionFunctionTableDescriptorClass ¶
type MTLIntersectionFunctionTableDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLIntersectionFunctionTableDescriptorClass ¶
func GetMTLIntersectionFunctionTableDescriptorClass() MTLIntersectionFunctionTableDescriptorClass
GetMTLIntersectionFunctionTableDescriptorClass returns the class object for MTLIntersectionFunctionTableDescriptor.
func (MTLIntersectionFunctionTableDescriptorClass) Alloc ¶
func (mc MTLIntersectionFunctionTableDescriptorClass) Alloc() MTLIntersectionFunctionTableDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLIntersectionFunctionTableDescriptorClass) IntersectionFunctionTableDescriptor ¶
func (_MTLIntersectionFunctionTableDescriptorClass MTLIntersectionFunctionTableDescriptorClass) IntersectionFunctionTableDescriptor() MTLIntersectionFunctionTableDescriptor
Creates an intersection function table descriptor.
type MTLIntersectionFunctionTableObject ¶
type MTLIntersectionFunctionTableObject struct {
objectivec.Object
}
MTLIntersectionFunctionTableObject wraps an existing Objective-C object that conforms to the MTLIntersectionFunctionTable protocol.
func MTLIntersectionFunctionTableObjectFromID ¶
func MTLIntersectionFunctionTableObjectFromID(id objc.ID) MTLIntersectionFunctionTableObject
MTLIntersectionFunctionTableObjectFromID constructs a MTLIntersectionFunctionTableObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLIntersectionFunctionTableObject) AllocatedSize ¶
func (o MTLIntersectionFunctionTableObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLIntersectionFunctionTableObject) BaseObject ¶
func (o MTLIntersectionFunctionTableObject) BaseObject() objectivec.Object
func (MTLIntersectionFunctionTableObject) CpuCacheMode ¶
func (o MTLIntersectionFunctionTableObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLIntersectionFunctionTableObject) Device ¶
func (o MTLIntersectionFunctionTableObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLIntersectionFunctionTableObject) GpuResourceID ¶
func (o MTLIntersectionFunctionTableObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/gpuResourceID
func (MTLIntersectionFunctionTableObject) HazardTrackingMode ¶
func (o MTLIntersectionFunctionTableObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLIntersectionFunctionTableObject) Heap ¶
func (o MTLIntersectionFunctionTableObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLIntersectionFunctionTableObject) HeapOffset ¶
func (o MTLIntersectionFunctionTableObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLIntersectionFunctionTableObject) IsAliasable ¶
func (o MTLIntersectionFunctionTableObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLIntersectionFunctionTableObject) Label ¶
func (o MTLIntersectionFunctionTableObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLIntersectionFunctionTableObject) MakeAliasable ¶
func (o MTLIntersectionFunctionTableObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLIntersectionFunctionTableObject) ResourceOptions ¶
func (o MTLIntersectionFunctionTableObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLIntersectionFunctionTableObject) SetBufferOffsetAtIndex ¶
func (o MTLIntersectionFunctionTableObject) SetBufferOffsetAtIndex(buffer MTLBuffer, offset uint, index uint)
Sets a buffer for the intersection functions.
buffer: The MTLBuffer object to set in the argument table.
offset: Where the data begins, in bytes, from the start of the buffer.
index: An index in the function table’s buffer argument table.
func (MTLIntersectionFunctionTableObject) SetBuffersOffsetsWithRange ¶
func (o MTLIntersectionFunctionTableObject) SetBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Sets a range of buffers for the intersection functions.
buffers: A pointer to an array of buffers.
offsets: A pointer to an array of offsets, measured in bytes, from the start of each buffer.
range: A range of indices in the function table’s buffer argument table.
func (MTLIntersectionFunctionTableObject) SetFunctionAtIndex ¶
func (o MTLIntersectionFunctionTableObject) SetFunctionAtIndex(function MTLFunctionHandle, index uint)
Sets an entry in the table.
function: A function handle for the intersection function.
index: The index of the table entry to change.
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setFunction(_:index:)
func (MTLIntersectionFunctionTableObject) SetFunctionsWithRange ¶
func (o MTLIntersectionFunctionTableObject) SetFunctionsWithRange(functions []MTLFunctionHandle, range_ foundation.NSRange)
Sets a range of entries in the table.
functions: A pointer to an array of function handles.
range: A range of indices to change in the table.
See: https://developer.apple.com/documentation/Metal/MTLIntersectionFunctionTable/setFunctions:withRange:
func (MTLIntersectionFunctionTableObject) SetLabel ¶
func (o MTLIntersectionFunctionTableObject) SetLabel(value string)
func (MTLIntersectionFunctionTableObject) SetOpaqueCurveIntersectionFunctionWithSignatureAtIndex ¶
func (o MTLIntersectionFunctionTableObject) SetOpaqueCurveIntersectionFunctionWithSignatureAtIndex(signature MTLIntersectionFunctionSignature, index uint)
func (MTLIntersectionFunctionTableObject) SetOpaqueCurveIntersectionFunctionWithSignatureWithRange ¶
func (o MTLIntersectionFunctionTableObject) SetOpaqueCurveIntersectionFunctionWithSignatureWithRange(signature MTLIntersectionFunctionSignature, range_ foundation.NSRange)
func (MTLIntersectionFunctionTableObject) SetOpaqueTriangleIntersectionFunctionWithSignatureAtIndex ¶
func (o MTLIntersectionFunctionTableObject) SetOpaqueTriangleIntersectionFunctionWithSignatureAtIndex(signature MTLIntersectionFunctionSignature, index uint)
Sets an entry in the intersection table to point to a system-defined opaque triangle intersection function.
signature: The signature of the function.
index: The index in the table to change.
func (MTLIntersectionFunctionTableObject) SetOpaqueTriangleIntersectionFunctionWithSignatureWithRange ¶
func (o MTLIntersectionFunctionTableObject) SetOpaqueTriangleIntersectionFunctionWithSignatureWithRange(signature MTLIntersectionFunctionSignature, range_ foundation.NSRange)
Sets a range of entries in the intersection table to point to a system-defined opaque triangle intersection function.
signature: The signature of the function.
range: A range of indices to change in the table.
func (MTLIntersectionFunctionTableObject) SetOwnerWithIdentity ¶
func (o MTLIntersectionFunctionTableObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLIntersectionFunctionTableObject) SetPurgeableState ¶
func (o MTLIntersectionFunctionTableObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLIntersectionFunctionTableObject) SetVisibleFunctionTableAtBufferIndex ¶
func (o MTLIntersectionFunctionTableObject) SetVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
Sets a visible function table for the intersection functions.
functionTable: A visible function table.
bufferIndex: An index in the function table’s buffer argument table.
func (MTLIntersectionFunctionTableObject) SetVisibleFunctionTablesWithBufferRange ¶
func (o MTLIntersectionFunctionTableObject) SetVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, bufferRange foundation.NSRange)
Sets a range of visible function tables for the intersection functions.
functionTables: The function tables to insert.
bufferRange: A range of indices in the function table’s buffer argument table.
func (MTLIntersectionFunctionTableObject) StorageMode ¶
func (o MTLIntersectionFunctionTableObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
type MTLLanguageVersion ¶
type MTLLanguageVersion int
See: https://developer.apple.com/documentation/Metal/MTLLanguageVersion
const ( // MTLLanguageVersion1_1: Version 1.1 of the Metal shading language. MTLLanguageVersion1_1 MTLLanguageVersion = 65536 // MTLLanguageVersion1_2: Version 1.2 of the Metal shading language. MTLLanguageVersion1_2 MTLLanguageVersion = 65536 // MTLLanguageVersion2_0: Version 2.0 of the Metal shading language. MTLLanguageVersion2_0 MTLLanguageVersion = 131072 // MTLLanguageVersion2_1: Version 2.1 of the Metal shading language. MTLLanguageVersion2_1 MTLLanguageVersion = 131072 // MTLLanguageVersion2_2: Version 2.2 of the Metal shading language. MTLLanguageVersion2_2 MTLLanguageVersion = 131072 // MTLLanguageVersion2_3: Version 2.3 of the Metal shading language. MTLLanguageVersion2_3 MTLLanguageVersion = 131072 // MTLLanguageVersion2_4: Version 2.4 of the Metal shading language. MTLLanguageVersion2_4 MTLLanguageVersion = 131072 // MTLLanguageVersion3_0: Version 3.0 of the Metal shading language. MTLLanguageVersion3_0 MTLLanguageVersion = 131073 // MTLLanguageVersion3_1: Version 3.1 of the Metal shading language. MTLLanguageVersion3_1 MTLLanguageVersion = 131074 // MTLLanguageVersion3_2: Version 3.2 of the Metal shading language. MTLLanguageVersion3_2 MTLLanguageVersion = 131075 MTLLanguageVersion4_0 MTLLanguageVersion = 131076 // Deprecated. MTLLanguageVersion1_0 MTLLanguageVersion = 65536 )
func (MTLLanguageVersion) String ¶
func (e MTLLanguageVersion) String() string
type MTLLibrary ¶
type MTLLibrary interface {
objectivec.IObject
// The installation name for a dynamic library.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/installName
InstallName() string
// The library’s basic type.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/type
Type() MTLLibraryType
// The names of all public functions in the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/functionNames
FunctionNames() []string
// Creates an instance that represents a shader function in the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(name:)
NewFunctionWithName(functionName string) MTLFunction
// Asynchronously creates a specialized shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(name:constantValues:completionHandler:)
NewFunctionWithNameConstantValuesCompletionHandler(name string, constantValues IMTLFunctionConstantValues, completionHandler MTLFunctionErrorHandler)
// Synchronously creates a specialized shader function.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(name:constantValues:)
NewFunctionWithNameConstantValuesError(name string, constantValues IMTLFunctionConstantValues) (MTLFunction, error)
// Asynchronously creates an object representing a shader function, using the specified descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(descriptor:completionHandler:)
NewFunctionWithDescriptorCompletionHandler(descriptor IMTLFunctionDescriptor, completionHandler MTLFunctionErrorHandler)
// Synchronously creates an object representing a shader function, using the specified descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(descriptor:)
NewFunctionWithDescriptorError(descriptor IMTLFunctionDescriptor) (MTLFunction, error)
// Asynchronously creates an object representing a ray-tracing intersection function, using the specified descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeIntersectionFunction(descriptor:completionHandler:)
NewIntersectionFunctionWithDescriptorCompletionHandler(descriptor IMTLIntersectionFunctionDescriptor, completionHandler MTLFunctionErrorHandler)
// Synchronously creates an object representing a ray-tracing intersection function, using the specified descriptor.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeIntersectionFunction(descriptor:)
NewIntersectionFunctionWithDescriptorError(descriptor IMTLIntersectionFunctionDescriptor) (MTLFunction, error)
// The Metal device object that created the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/device
Device() MTLDevice
// A string that identifies the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/label
Label() string
// Retrieves reflection information for a function in the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/reflection(functionName:)
ReflectionForFunctionWithName(functionName string) IMTLFunctionReflection
// A string that identifies the library.
//
// See: https://developer.apple.com/documentation/Metal/MTLLibrary/label
SetLabel(value string)
}
A collection of Metal shader functions.
See: https://developer.apple.com/documentation/Metal/MTLLibrary
type MTLLibraryError ¶
type MTLLibraryError int
See: https://developer.apple.com/documentation/Metal/MTLLibraryError-swift.struct/Code
const ( // MTLLibraryErrorCompileFailure: The library or function failed to compile. MTLLibraryErrorCompileFailure MTLLibraryError = 3 // MTLLibraryErrorCompileWarning: The library or function compiled successfully but generated warnings. MTLLibraryErrorCompileWarning MTLLibraryError = 4 // MTLLibraryErrorFileNotFound: Metal couldn’t find the Metal source file. MTLLibraryErrorFileNotFound MTLLibraryError = 6 // MTLLibraryErrorFunctionNotFound: Metal couldn’t find the specified Metal function. MTLLibraryErrorFunctionNotFound MTLLibraryError = 5 // MTLLibraryErrorInternal: The action caused an internal error. MTLLibraryErrorInternal MTLLibraryError = 2 // MTLLibraryErrorUnsupported: Metal couldn’t support the requested action. MTLLibraryErrorUnsupported MTLLibraryError = 1 )
func (MTLLibraryError) String ¶
func (e MTLLibraryError) String() string
type MTLLibraryObject ¶
type MTLLibraryObject struct {
objectivec.Object
}
MTLLibraryObject wraps an existing Objective-C object that conforms to the MTLLibrary protocol.
func MTLLibraryObjectFromID ¶
func MTLLibraryObjectFromID(id objc.ID) MTLLibraryObject
MTLLibraryObjectFromID constructs a MTLLibraryObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLLibraryObject) BaseObject ¶
func (o MTLLibraryObject) BaseObject() objectivec.Object
func (MTLLibraryObject) Device ¶
func (o MTLLibraryObject) Device() MTLDevice
The Metal device object that created the library.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/device
func (MTLLibraryObject) FunctionNames ¶
func (o MTLLibraryObject) FunctionNames() []string
The names of all public functions in the library.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/functionNames
func (MTLLibraryObject) InstallName ¶
func (o MTLLibraryObject) InstallName() string
The installation name for a dynamic library.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/installName
func (MTLLibraryObject) Label ¶
func (o MTLLibraryObject) Label() string
A string that identifies the library.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/label
func (MTLLibraryObject) NewFunctionWithDescriptorCompletionHandler ¶
func (o MTLLibraryObject) NewFunctionWithDescriptorCompletionHandler(descriptor IMTLFunctionDescriptor, completionHandler MTLFunctionErrorHandler)
Asynchronously creates an object representing a shader function, using the specified descriptor.
descriptor: The description of the function object to create.
completionHandler: A Swift closure or an Objective-C block that Metal calls after it creates the function.
func (MTLLibraryObject) NewFunctionWithDescriptorError ¶
func (o MTLLibraryObject) NewFunctionWithDescriptorError(descriptor IMTLFunctionDescriptor) (MTLFunction, error)
Synchronously creates an object representing a shader function, using the specified descriptor.
descriptor: The description of the function object to create.
Return Value ¶
A new MTLFunction instance if the method finds the function in the library; otherwise Swift throws an error and Objective-C returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(descriptor:)
func (MTLLibraryObject) NewFunctionWithName ¶
func (o MTLLibraryObject) NewFunctionWithName(functionName string) MTLFunction
Creates an instance that represents a shader function in the library.
functionName: The name of the function.
Return Value ¶
An MTLFunction, or `nil` if the named function isn’t found in the library.
Discussion ¶
If you call this method to retrieve a function that doesn’t use function constants, it returns an MTLFunction instance that you can use to build a render or compute pipeline.
If you call this method to retrieve a function that uses function constants to specialize its behavior, you can only use the returned instance to query the `functionConstants` property for the list of function constants. You can’t use to create a render or compute pipeline. To get a specialized instance that you can use to create a pipeline instance, call the [NewFunctionWithNameConstantValuesCompletionHandler] method or [NewFunctionWithNameConstantValuesError] to generate a specialized function.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(name:)
func (MTLLibraryObject) NewFunctionWithNameConstantValuesCompletionHandler ¶
func (o MTLLibraryObject) NewFunctionWithNameConstantValuesCompletionHandler(name string, constantValues IMTLFunctionConstantValues, completionHandler MTLFunctionErrorHandler)
Asynchronously creates a specialized shader function.
name: The name of the specialized function.
constantValues: The set of constant values assigned to the function constants. Compilation fails if you don’t provide valid constant values for all required function constants.
completionHandler: A block of code that Metal calls after it creates the specialized function.
function: A specialized function, or `nil` if an error occurred. error: An error object that describes compilation problems, if any. This object contains compiler errors if the specialized function is `nil`, and compiler warnings if Metal created the specialized function with warnings. If Metal created the function without errors or warnings, this error object is `nil`.
Discussion ¶
Function constant values are first looked up by their index, then by their name. Metal ignores any values that don’t correspond to a function constant in the named function without generating errors or warnings.
func (MTLLibraryObject) NewFunctionWithNameConstantValuesError ¶
func (o MTLLibraryObject) NewFunctionWithNameConstantValuesError(name string, constantValues IMTLFunctionConstantValues) (MTLFunction, error)
Synchronously creates a specialized shader function.
name: The name of the specialized function.
constantValues: The set of constant values for the function constants. The compiler can’t compile the function if any value is invalid for the function constants it requires.
Return Value ¶
A new MTLFunction instance if the method completes successfully; otherwise Swift throws an error and Objective-C returns `nil`.
Discussion ¶
Function constant values are first looked up by their index, then by their name. The compiler ignores any values that don’t correspond to a function constant in the named function, and doesn’t generate errors or warnings.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeFunction(name:constantValues:)
func (MTLLibraryObject) NewIntersectionFunctionWithDescriptorCompletionHandler ¶
func (o MTLLibraryObject) NewIntersectionFunctionWithDescriptorCompletionHandler(descriptor IMTLIntersectionFunctionDescriptor, completionHandler MTLFunctionErrorHandler)
Asynchronously creates an object representing a ray-tracing intersection function, using the specified descriptor.
func (MTLLibraryObject) NewIntersectionFunctionWithDescriptorError ¶
func (o MTLLibraryObject) NewIntersectionFunctionWithDescriptorError(descriptor IMTLIntersectionFunctionDescriptor) (MTLFunction, error)
Synchronously creates an object representing a ray-tracing intersection function, using the specified descriptor.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/makeIntersectionFunction(descriptor:)
func (MTLLibraryObject) ReflectionForFunctionWithName ¶
func (o MTLLibraryObject) ReflectionForFunctionWithName(functionName string) IMTLFunctionReflection
Retrieves reflection information for a function in the library.
functionName: The name of a GPU function in the library. The name needs to match one of the elements in the string array of library’s [FunctionNames] property.
Return Value ¶
An MTLFunctionReflection instance when the method succeeds; otherwise `nil`.
Discussion ¶
The reflection instance contains metadata information about a specific GPU function, which can include:
- Function parameters - Return types - Bindings - Annotations from a developer, if available
The method only returns reflection information if all of the following conditions apply:
- The library has a function with a name that matches `functionName`. - The deployment target is macOS 13.0 or later, or iOS 16.0 or later, or visionOS 2.0 or later.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/reflection(functionName:)
func (MTLLibraryObject) SetLabel ¶
func (o MTLLibraryObject) SetLabel(value string)
func (MTLLibraryObject) Type ¶
func (o MTLLibraryObject) Type() MTLLibraryType
The library’s basic type.
See: https://developer.apple.com/documentation/Metal/MTLLibrary/type
type MTLLibraryOptimizationLevel ¶
type MTLLibraryOptimizationLevel int
See: https://developer.apple.com/documentation/Metal/MTLLibraryOptimizationLevel
const ( // MTLLibraryOptimizationLevelDefault: An optimization option for the Metal compiler that prioritizes runtime performance. MTLLibraryOptimizationLevelDefault MTLLibraryOptimizationLevel = 0 // MTLLibraryOptimizationLevelSize: An optimization option for the Metal compiler that prioritizes minimizing the size of its output binaries, which may also reduce compile time. MTLLibraryOptimizationLevelSize MTLLibraryOptimizationLevel = 1 )
func (MTLLibraryOptimizationLevel) String ¶
func (e MTLLibraryOptimizationLevel) String() string
type MTLLibraryType ¶
type MTLLibraryType int
See: https://developer.apple.com/documentation/Metal/MTLLibraryType
const ( // MTLLibraryTypeDynamic: A library that you can dynamically link to from other libraries. MTLLibraryTypeDynamic MTLLibraryType = 1 // MTLLibraryTypeExecutable: A library that can create pipeline state objects. MTLLibraryTypeExecutable MTLLibraryType = 0 )
func (MTLLibraryType) String ¶
func (e MTLLibraryType) String() string
type MTLLinkedFunctions ¶
type MTLLinkedFunctions struct {
objectivec.Object
}
A set of related functions that Metal links to when necessary to create the function instance.
Overview ¶
When you create a Metal function instance using an MTLFunctionDescriptor, you specify additional functions that Metal needs to link to when it compiles and links the underlying shader code. Most often, you need to do this if your shader takes a visible function table as one or more of its arguments. For Metal to create the MTLFunction instance, it needs a complete list of functions that your shader can call so that it can resolve any dependencies and generate the correct code to run on the GPU.
Specifying related functions ¶
- MTLLinkedFunctions.Functions: An array of function objects to link to the new function.
- MTLLinkedFunctions.SetFunctions
- MTLLinkedFunctions.BinaryFunctions: An array of function objects already compiled to a binary representation to link.
- MTLLinkedFunctions.SetBinaryFunctions
- MTLLinkedFunctions.Groups: An optional list of groups specifying which functions your shader can call at each call site.
- MTLLinkedFunctions.SetGroups
- MTLLinkedFunctions.PrivateFunctions: An array of function objects to link to the new function, without exporting the functions publicly.
- MTLLinkedFunctions.SetPrivateFunctions
See: https://developer.apple.com/documentation/Metal/MTLLinkedFunctions
func MTLLinkedFunctionsFromID ¶
func MTLLinkedFunctionsFromID(id objc.ID) MTLLinkedFunctions
MTLLinkedFunctionsFromID constructs a MTLLinkedFunctions from an objc.ID.
A set of related functions that Metal links to when necessary to create the function instance.
func NewMTLLinkedFunctions ¶
func NewMTLLinkedFunctions() MTLLinkedFunctions
NewMTLLinkedFunctions creates a new MTLLinkedFunctions instance.
func (MTLLinkedFunctions) Autorelease ¶
func (l MTLLinkedFunctions) Autorelease() MTLLinkedFunctions
Autorelease adds the receiver to the current autorelease pool.
func (MTLLinkedFunctions) BinaryArchives ¶
func (l MTLLinkedFunctions) BinaryArchives() MTLBinaryArchive
The binary archives to search for a previously-compiled version of this function.
See: https://developer.apple.com/documentation/metal/mtlfunctiondescriptor/binaryarchives
func (MTLLinkedFunctions) BinaryFunctions ¶
func (l MTLLinkedFunctions) BinaryFunctions() []objectivec.IObject
An array of function objects already compiled to a binary representation to link.
See: https://developer.apple.com/documentation/Metal/MTLLinkedFunctions/binaryFunctions
func (MTLLinkedFunctions) ConstantValues ¶
func (l MTLLinkedFunctions) ConstantValues() IMTLFunctionConstantValues
The set of constant values assigned to the function constants.
See: https://developer.apple.com/documentation/metal/mtlfunctiondescriptor/constantvalues
func (MTLLinkedFunctions) Functions ¶
func (l MTLLinkedFunctions) Functions() []objectivec.IObject
An array of function objects to link to the new function.
See: https://developer.apple.com/documentation/Metal/MTLLinkedFunctions/functions
func (MTLLinkedFunctions) Groups ¶
func (l MTLLinkedFunctions) Groups() foundation.INSDictionary
An optional list of groups specifying which functions your shader can call at each call site.
Discussion ¶
The default value is `nil`.
The default behavior is conservative and assumes that your shader can call any linked function from every call site. If you know that the shader can only call a limited subset of functions at a call site, you can annotate those sites in the shader with a name of a group and then specify the list of functions for that call site using this property. Specifying call sites and callable functions more precisely can improve performance.
For more information on how to specify call site groups, see Metal Shading Language Specification.
The value of this property is a dictionary whose keys are call site names and values are arrays specifying the list of functions that the shader can call from each site.
See: https://developer.apple.com/documentation/Metal/MTLLinkedFunctions/groups
func (MTLLinkedFunctions) Init ¶
func (l MTLLinkedFunctions) Init() MTLLinkedFunctions
Init initializes the instance.
func (MTLLinkedFunctions) Name ¶
func (l MTLLinkedFunctions) Name() string
The name of the function to fetch from the library.
See: https://developer.apple.com/documentation/metal/mtlfunctiondescriptor/name
func (MTLLinkedFunctions) Options ¶
func (l MTLLinkedFunctions) Options() MTLFunctionOptions
Flags specifying how Metal should create the new function object.
See: https://developer.apple.com/documentation/metal/mtlfunctiondescriptor/options
func (MTLLinkedFunctions) PrivateFunctions ¶
func (l MTLLinkedFunctions) PrivateFunctions() []objectivec.IObject
An array of function objects to link to the new function, without exporting the functions publicly.
Discussion ¶
The pipeline doesn’t export these functions as MTLFunctionHandle instances because the Metal device doesn’t need to support function pointers to link private functions.
See: https://developer.apple.com/documentation/Metal/MTLLinkedFunctions/privateFunctions
func (MTLLinkedFunctions) SetBinaryArchives ¶
func (l MTLLinkedFunctions) SetBinaryArchives(value MTLBinaryArchive)
func (MTLLinkedFunctions) SetBinaryFunctions ¶
func (l MTLLinkedFunctions) SetBinaryFunctions(value []objectivec.IObject)
func (MTLLinkedFunctions) SetConstantValues ¶
func (l MTLLinkedFunctions) SetConstantValues(value IMTLFunctionConstantValues)
func (MTLLinkedFunctions) SetFunctions ¶
func (l MTLLinkedFunctions) SetFunctions(value []objectivec.IObject)
func (MTLLinkedFunctions) SetGroups ¶
func (l MTLLinkedFunctions) SetGroups(value foundation.INSDictionary)
func (MTLLinkedFunctions) SetName ¶
func (l MTLLinkedFunctions) SetName(value string)
func (MTLLinkedFunctions) SetOptions ¶
func (l MTLLinkedFunctions) SetOptions(value MTLFunctionOptions)
func (MTLLinkedFunctions) SetPrivateFunctions ¶
func (l MTLLinkedFunctions) SetPrivateFunctions(value []objectivec.IObject)
func (MTLLinkedFunctions) SetSpecializedName ¶
func (l MTLLinkedFunctions) SetSpecializedName(value string)
func (MTLLinkedFunctions) SpecializedName ¶
func (l MTLLinkedFunctions) SpecializedName() string
A new name for the created function object.
See: https://developer.apple.com/documentation/metal/mtlfunctiondescriptor/specializedname
type MTLLinkedFunctionsClass ¶
type MTLLinkedFunctionsClass struct {
// contains filtered or unexported fields
}
func GetMTLLinkedFunctionsClass ¶
func GetMTLLinkedFunctionsClass() MTLLinkedFunctionsClass
GetMTLLinkedFunctionsClass returns the class object for MTLLinkedFunctions.
func (MTLLinkedFunctionsClass) Alloc ¶
func (mc MTLLinkedFunctionsClass) Alloc() MTLLinkedFunctions
Alloc allocates memory for a new instance of the class.
func (MTLLinkedFunctionsClass) LinkedFunctions ¶
func (_MTLLinkedFunctionsClass MTLLinkedFunctionsClass) LinkedFunctions() MTLLinkedFunctions
Creates an empty linked functions object.
See: https://developer.apple.com/documentation/Metal/MTLLinkedFunctions/linkedFunctions
type MTLLoadAction ¶
type MTLLoadAction int
See: https://developer.apple.com/documentation/Metal/MTLLoadAction
const ( // MTLLoadActionClear: The GPU writes a value to every pixel in the attachment at the start of the render pass. MTLLoadActionClear MTLLoadAction = 2 // MTLLoadActionDontCare: The GPU has permission to discard the existing contents of the attachment at the start of the render pass, replacing them with arbitrary data. MTLLoadActionDontCare MTLLoadAction = 0 // MTLLoadActionLoad: The GPU preserves the existing contents of the attachment at the start of the render pass. MTLLoadActionLoad MTLLoadAction = 1 )
func (MTLLoadAction) String ¶
func (e MTLLoadAction) String() string
type MTLLogContainer ¶
type MTLLogContainer interface {
objectivec.IObject
foundation.NSFastEnumeration
}
A collection of logged messages, created when a Metal device runs a command buffer.
See: https://developer.apple.com/documentation/Metal/MTLLogContainer-c.protocol
type MTLLogContainerObject ¶
type MTLLogContainerObject struct {
foundation.NSFastEnumerationObject
}
MTLLogContainerObject wraps an existing Objective-C object that conforms to the MTLLogContainer protocol.
func MTLLogContainerObjectFromID ¶
func MTLLogContainerObjectFromID(id objc.ID) MTLLogContainerObject
MTLLogContainerObjectFromID constructs a MTLLogContainerObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLLogContainerObject) BaseObject ¶
func (o MTLLogContainerObject) BaseObject() objectivec.Object
type MTLLogLevel ¶
type MTLLogLevel int
See: https://developer.apple.com/documentation/Metal/MTLLogLevel
const ( // MTLLogLevelDebug: The log level that captures diagnostic information. MTLLogLevelDebug MTLLogLevel = 1 // MTLLogLevelError: The log level that captures error information. MTLLogLevelError MTLLogLevel = 4 // MTLLogLevelFault: The log level that captures fault information. MTLLogLevelFault MTLLogLevel = 5 // MTLLogLevelInfo: The log level that captures additional information. MTLLogLevelInfo MTLLogLevel = 2 // MTLLogLevelNotice: The log level that captures notifications. MTLLogLevelNotice MTLLogLevel = 3 // MTLLogLevelUndefined: The log level when the log level hasn’t been configured. MTLLogLevelUndefined MTLLogLevel = 0 )
func (MTLLogLevel) String ¶
func (e MTLLogLevel) String() string
type MTLLogState ¶
type MTLLogState interface {
objectivec.IObject
// Adds a log handler to customize the presentation of shader logging.
//
// See: https://developer.apple.com/documentation/Metal/MTLLogState/addLogHandler(_:)
AddLogHandler(block VoidHandler)
}
A container for shader log messages.
See: https://developer.apple.com/documentation/Metal/MTLLogState
type MTLLogStateDescriptor ¶
type MTLLogStateDescriptor struct {
objectivec.Object
}
An interface that represents a log state configuration.
Overview ¶
Configure the descriptor to create an MTLLogState by calling [NewLogStateWithDescriptorError].
If you’ve set the environment variables `MTL_LOG_BUFFER_SIZE` or `MTL_LOG_LEVEL`, then the system automatically enables logging. If any command buffer or command queue has an attached log state, then the system uses the log state’s settings instead of the environment variable values.
Instance properties ¶
- MTLLogStateDescriptor.BufferSize: The size of the internal buffer the log state uses, specified in bytes.
- MTLLogStateDescriptor.SetBufferSize
- MTLLogStateDescriptor.Level: The minimum level of messages that the shader can log.
- MTLLogStateDescriptor.SetLevel
See: https://developer.apple.com/documentation/Metal/MTLLogStateDescriptor
func MTLLogStateDescriptorFromID ¶
func MTLLogStateDescriptorFromID(id objc.ID) MTLLogStateDescriptor
MTLLogStateDescriptorFromID constructs a MTLLogStateDescriptor from an objc.ID.
An interface that represents a log state configuration.
func NewMTLLogStateDescriptor ¶
func NewMTLLogStateDescriptor() MTLLogStateDescriptor
NewMTLLogStateDescriptor creates a new MTLLogStateDescriptor instance.
func (MTLLogStateDescriptor) Autorelease ¶
func (l MTLLogStateDescriptor) Autorelease() MTLLogStateDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLLogStateDescriptor) BufferSize ¶
func (l MTLLogStateDescriptor) BufferSize() int
The size of the internal buffer the log state uses, specified in bytes.
Discussion ¶
The default value is 1MB. The minimum size of log buffer is 1KB and the maximum size is 1GB.
Carefully consider the size of this buffer based on how many messages you expect your shader to log and be useful to diagnose problems. A smaller size might lead to the shader dropping more messages while a larger size might result in a larger memory footprint and reduced performance due to excessive logging.
See: https://developer.apple.com/documentation/Metal/MTLLogStateDescriptor/bufferSize
func (MTLLogStateDescriptor) Init ¶
func (l MTLLogStateDescriptor) Init() MTLLogStateDescriptor
Init initializes the instance.
func (MTLLogStateDescriptor) Level ¶
func (l MTLLogStateDescriptor) Level() MTLLogLevel
The minimum level of messages that the shader can log.
Discussion ¶
The default value is [LogLevelDebug].
Use this value to limit which logs from your shader the log state stores. The log state doesn’t store messages at a lower level. Increase the level to reduce verbosity of logging.
See: https://developer.apple.com/documentation/Metal/MTLLogStateDescriptor/level
func (MTLLogStateDescriptor) SetBufferSize ¶
func (l MTLLogStateDescriptor) SetBufferSize(value int)
func (MTLLogStateDescriptor) SetLevel ¶
func (l MTLLogStateDescriptor) SetLevel(value MTLLogLevel)
type MTLLogStateDescriptorClass ¶
type MTLLogStateDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLLogStateDescriptorClass ¶
func GetMTLLogStateDescriptorClass() MTLLogStateDescriptorClass
GetMTLLogStateDescriptorClass returns the class object for MTLLogStateDescriptor.
func (MTLLogStateDescriptorClass) Alloc ¶
func (mc MTLLogStateDescriptorClass) Alloc() MTLLogStateDescriptor
Alloc allocates memory for a new instance of the class.
type MTLLogStateError ¶
type MTLLogStateError int
See: https://developer.apple.com/documentation/Metal/MTLLogStateError
const ( MTLLogStateErrorInvalid MTLLogStateError = 2 MTLLogStateErrorInvalidSize MTLLogStateError = 1 )
func (MTLLogStateError) String ¶
func (e MTLLogStateError) String() string
type MTLLogStateObject ¶
type MTLLogStateObject struct {
objectivec.Object
}
MTLLogStateObject wraps an existing Objective-C object that conforms to the MTLLogState protocol.
func MTLLogStateObjectFromID ¶
func MTLLogStateObjectFromID(id objc.ID) MTLLogStateObject
MTLLogStateObjectFromID constructs a MTLLogStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLLogStateObject) AddLogHandler ¶
func (o MTLLogStateObject) AddLogHandler(block VoidHandler)
Adds a log handler to customize the presentation of shader logging.
Discussion ¶
In absence of any log handlers, all messages goes through the unified log system and are available through the console.app, log tool, or Xcode.
Use this method to add your own shader logging presentation or filter messages using subsystem, category and levels. For more details on how to configure your logging, see Generating Log Messages from Your Code.
See: https://developer.apple.com/documentation/Metal/MTLLogState/addLogHandler(_:)
func (MTLLogStateObject) BaseObject ¶
func (o MTLLogStateObject) BaseObject() objectivec.Object
type MTLLogicalToPhysicalColorAttachmentMap ¶
type MTLLogicalToPhysicalColorAttachmentMap struct {
objectivec.Object
}
Allows you to easily specify color attachment remapping from logical to physical indices.
Instance Methods ¶
See: https://developer.apple.com/documentation/Metal/MTLLogicalToPhysicalColorAttachmentMap
func MTLLogicalToPhysicalColorAttachmentMapFromID ¶
func MTLLogicalToPhysicalColorAttachmentMapFromID(id objc.ID) MTLLogicalToPhysicalColorAttachmentMap
MTLLogicalToPhysicalColorAttachmentMapFromID constructs a MTLLogicalToPhysicalColorAttachmentMap from an objc.ID.
Allows you to easily specify color attachment remapping from logical to physical indices.
func NewMTLLogicalToPhysicalColorAttachmentMap ¶
func NewMTLLogicalToPhysicalColorAttachmentMap() MTLLogicalToPhysicalColorAttachmentMap
NewMTLLogicalToPhysicalColorAttachmentMap creates a new MTLLogicalToPhysicalColorAttachmentMap instance.
func (MTLLogicalToPhysicalColorAttachmentMap) Autorelease ¶
func (l MTLLogicalToPhysicalColorAttachmentMap) Autorelease() MTLLogicalToPhysicalColorAttachmentMap
Autorelease adds the receiver to the current autorelease pool.
func (MTLLogicalToPhysicalColorAttachmentMap) GetPhysicalIndexForLogicalIndex ¶
func (l MTLLogicalToPhysicalColorAttachmentMap) GetPhysicalIndexForLogicalIndex(logicalIndex uint) uint
Queries the physical color attachment index corresponding to a logical index.
func (MTLLogicalToPhysicalColorAttachmentMap) Reset ¶
func (l MTLLogicalToPhysicalColorAttachmentMap) Reset()
See: https://developer.apple.com/documentation/Metal/MTLLogicalToPhysicalColorAttachmentMap/reset()
func (MTLLogicalToPhysicalColorAttachmentMap) SetPhysicalIndexForLogicalIndex ¶
func (l MTLLogicalToPhysicalColorAttachmentMap) SetPhysicalIndexForLogicalIndex(physicalIndex uint, logicalIndex uint)
Maps a physical color attachment index to a logical index.
physicalIndex: Index of the color attachment’s physical mapping.
logicalIndex: Index of the color attachment’s logical mapping.
type MTLLogicalToPhysicalColorAttachmentMapClass ¶
type MTLLogicalToPhysicalColorAttachmentMapClass struct {
// contains filtered or unexported fields
}
func GetMTLLogicalToPhysicalColorAttachmentMapClass ¶
func GetMTLLogicalToPhysicalColorAttachmentMapClass() MTLLogicalToPhysicalColorAttachmentMapClass
GetMTLLogicalToPhysicalColorAttachmentMapClass returns the class object for MTLLogicalToPhysicalColorAttachmentMap.
func (MTLLogicalToPhysicalColorAttachmentMapClass) Alloc ¶
func (mc MTLLogicalToPhysicalColorAttachmentMapClass) Alloc() MTLLogicalToPhysicalColorAttachmentMap
Alloc allocates memory for a new instance of the class.
type MTLMapIndirectArguments ¶
type MTLMapIndirectArguments struct {
RegionOriginX uint32 // The x coordinate of the region to change, measured in tile coordinates.
RegionOriginY uint32 // The y coordinate of the region to change, measured in tile coordinates.
RegionOriginZ uint32 // The z coordinate of the region to change, measured in tile coordinates.
RegionSizeWidth uint32 // The width of the region, measured in tile coordinates.
RegionSizeHeight uint32 // The height of the region, measured in tile coordinates.
RegionSizeDepth uint32 // The depth of the region, measured in tile coordinates.
MipMapLevel uint32 // The mipmap to change.
SliceId uint32 // The texture slice to change.
}
MTLMapIndirectArguments - The data layout for mapping sparse texture regions when using indirect commands.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLMapIndirectArguments
type MTLMathFloatingPointFunctions ¶
type MTLMathFloatingPointFunctions int
See: https://developer.apple.com/documentation/Metal/MTLMathFloatingPointFunctions
const ( // MTLMathFloatingPointFunctionsFast: An indication that Metal uses the fast version of the 32b floating-point math functions. MTLMathFloatingPointFunctionsFast MTLMathFloatingPointFunctions = 0 // MTLMathFloatingPointFunctionsPrecise: An indication that Metal uses the precise version of the 32b floating-point math functions. MTLMathFloatingPointFunctionsPrecise MTLMathFloatingPointFunctions = 1 )
func (MTLMathFloatingPointFunctions) String ¶
func (e MTLMathFloatingPointFunctions) String() string
type MTLMathMode ¶
type MTLMathMode int
See: https://developer.apple.com/documentation/Metal/MTLMathMode
const ( // MTLMathModeFast: An indicator of the mode the compiler uses to make aggressive, potentially lossy assumptions about floating-point math. MTLMathModeFast MTLMathMode = 2 // MTLMathModeRelaxed: An indicator of the mode the compiler uses to make aggressive, potentially lossy assumptions about floating-point math, while honoring Inf/NaN. MTLMathModeRelaxed MTLMathMode = 1 // MTLMathModeSafe: An indicator of the mode the compiler uses to disable unsafe floating-point optimizations by preventing the compiler from making any transformations that could affect the results. MTLMathModeSafe MTLMathMode = 0 )
func (MTLMathMode) String ¶
func (e MTLMathMode) String() string
type MTLMatrixLayout ¶
type MTLMatrixLayout int
See: https://developer.apple.com/documentation/Metal/MTLMatrixLayout
const ( MTLMatrixLayoutColumnMajor MTLMatrixLayout = 0 MTLMatrixLayoutRowMajor MTLMatrixLayout = 1 )
func (MTLMatrixLayout) String ¶
func (e MTLMatrixLayout) String() string
type MTLMeshRenderPipelineDescriptor ¶
type MTLMeshRenderPipelineDescriptor struct {
objectivec.Object
}
An object that configures new render pipeline state objects for mesh shading.
Instance Properties ¶
- MTLMeshRenderPipelineDescriptor.BinaryArchives
- MTLMeshRenderPipelineDescriptor.SetBinaryArchives
- MTLMeshRenderPipelineDescriptor.ColorAttachments
- MTLMeshRenderPipelineDescriptor.DepthAttachmentPixelFormat
- MTLMeshRenderPipelineDescriptor.SetDepthAttachmentPixelFormat
- MTLMeshRenderPipelineDescriptor.FragmentBuffers
- MTLMeshRenderPipelineDescriptor.FragmentFunction
- MTLMeshRenderPipelineDescriptor.SetFragmentFunction
- MTLMeshRenderPipelineDescriptor.FragmentLinkedFunctions
- MTLMeshRenderPipelineDescriptor.SetFragmentLinkedFunctions
- MTLMeshRenderPipelineDescriptor.AlphaToCoverageEnabled
- MTLMeshRenderPipelineDescriptor.SetAlphaToCoverageEnabled
- MTLMeshRenderPipelineDescriptor.AlphaToOneEnabled
- MTLMeshRenderPipelineDescriptor.SetAlphaToOneEnabled
- MTLMeshRenderPipelineDescriptor.RasterizationEnabled
- MTLMeshRenderPipelineDescriptor.SetRasterizationEnabled
- MTLMeshRenderPipelineDescriptor.Label
- MTLMeshRenderPipelineDescriptor.SetLabel
- MTLMeshRenderPipelineDescriptor.MaxTotalThreadgroupsPerMeshGrid
- MTLMeshRenderPipelineDescriptor.SetMaxTotalThreadgroupsPerMeshGrid
- MTLMeshRenderPipelineDescriptor.MaxTotalThreadsPerMeshThreadgroup
- MTLMeshRenderPipelineDescriptor.SetMaxTotalThreadsPerMeshThreadgroup
- MTLMeshRenderPipelineDescriptor.MaxTotalThreadsPerObjectThreadgroup
- MTLMeshRenderPipelineDescriptor.SetMaxTotalThreadsPerObjectThreadgroup
- MTLMeshRenderPipelineDescriptor.MaxVertexAmplificationCount
- MTLMeshRenderPipelineDescriptor.SetMaxVertexAmplificationCount
- MTLMeshRenderPipelineDescriptor.MeshBuffers
- MTLMeshRenderPipelineDescriptor.MeshFunction
- MTLMeshRenderPipelineDescriptor.SetMeshFunction
- MTLMeshRenderPipelineDescriptor.MeshLinkedFunctions
- MTLMeshRenderPipelineDescriptor.SetMeshLinkedFunctions
- MTLMeshRenderPipelineDescriptor.MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth
- MTLMeshRenderPipelineDescriptor.SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth
- MTLMeshRenderPipelineDescriptor.ObjectBuffers
- MTLMeshRenderPipelineDescriptor.ObjectFunction
- MTLMeshRenderPipelineDescriptor.SetObjectFunction
- MTLMeshRenderPipelineDescriptor.ObjectLinkedFunctions
- MTLMeshRenderPipelineDescriptor.SetObjectLinkedFunctions
- MTLMeshRenderPipelineDescriptor.ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth
- MTLMeshRenderPipelineDescriptor.SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth
- MTLMeshRenderPipelineDescriptor.PayloadMemoryLength
- MTLMeshRenderPipelineDescriptor.SetPayloadMemoryLength
- MTLMeshRenderPipelineDescriptor.RasterSampleCount
- MTLMeshRenderPipelineDescriptor.SetRasterSampleCount
- MTLMeshRenderPipelineDescriptor.RequiredThreadsPerMeshThreadgroup
- MTLMeshRenderPipelineDescriptor.SetRequiredThreadsPerMeshThreadgroup
- MTLMeshRenderPipelineDescriptor.RequiredThreadsPerObjectThreadgroup
- MTLMeshRenderPipelineDescriptor.SetRequiredThreadsPerObjectThreadgroup
- MTLMeshRenderPipelineDescriptor.ShaderValidation: A value that enables or disables shader validation for the pipeline.
- MTLMeshRenderPipelineDescriptor.SetShaderValidation
- MTLMeshRenderPipelineDescriptor.StencilAttachmentPixelFormat
- MTLMeshRenderPipelineDescriptor.SetStencilAttachmentPixelFormat
- MTLMeshRenderPipelineDescriptor.SupportIndirectCommandBuffers
- MTLMeshRenderPipelineDescriptor.SetSupportIndirectCommandBuffers
Instance Methods ¶
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor
func MTLMeshRenderPipelineDescriptorFromID ¶
func MTLMeshRenderPipelineDescriptorFromID(id objc.ID) MTLMeshRenderPipelineDescriptor
MTLMeshRenderPipelineDescriptorFromID constructs a MTLMeshRenderPipelineDescriptor from an objc.ID.
An object that configures new render pipeline state objects for mesh shading.
func NewMTLMeshRenderPipelineDescriptor ¶
func NewMTLMeshRenderPipelineDescriptor() MTLMeshRenderPipelineDescriptor
NewMTLMeshRenderPipelineDescriptor creates a new MTLMeshRenderPipelineDescriptor instance.
func (MTLMeshRenderPipelineDescriptor) AlphaToCoverageEnabled ¶
func (m MTLMeshRenderPipelineDescriptor) AlphaToCoverageEnabled() bool
func (MTLMeshRenderPipelineDescriptor) AlphaToOneEnabled ¶
func (m MTLMeshRenderPipelineDescriptor) AlphaToOneEnabled() bool
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/isAlphaToOneEnabled
func (MTLMeshRenderPipelineDescriptor) Autorelease ¶
func (m MTLMeshRenderPipelineDescriptor) Autorelease() MTLMeshRenderPipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLMeshRenderPipelineDescriptor) BinaryArchives ¶
func (m MTLMeshRenderPipelineDescriptor) BinaryArchives() []objectivec.IObject
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/binaryArchives
func (MTLMeshRenderPipelineDescriptor) ColorAttachments ¶
func (m MTLMeshRenderPipelineDescriptor) ColorAttachments() IMTLRenderPipelineColorAttachmentDescriptorArray
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/colorAttachments
func (MTLMeshRenderPipelineDescriptor) DepthAttachmentPixelFormat ¶
func (m MTLMeshRenderPipelineDescriptor) DepthAttachmentPixelFormat() MTLPixelFormat
func (MTLMeshRenderPipelineDescriptor) FragmentBuffers ¶
func (m MTLMeshRenderPipelineDescriptor) FragmentBuffers() IMTLPipelineBufferDescriptorArray
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/fragmentBuffers
func (MTLMeshRenderPipelineDescriptor) FragmentFunction ¶
func (m MTLMeshRenderPipelineDescriptor) FragmentFunction() MTLFunction
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/fragmentFunction
func (MTLMeshRenderPipelineDescriptor) FragmentLinkedFunctions ¶
func (m MTLMeshRenderPipelineDescriptor) FragmentLinkedFunctions() IMTLLinkedFunctions
func (MTLMeshRenderPipelineDescriptor) Init ¶
func (m MTLMeshRenderPipelineDescriptor) Init() MTLMeshRenderPipelineDescriptor
Init initializes the instance.
func (MTLMeshRenderPipelineDescriptor) Label ¶
func (m MTLMeshRenderPipelineDescriptor) Label() string
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/label
func (MTLMeshRenderPipelineDescriptor) MaxTotalThreadgroupsPerMeshGrid ¶
func (m MTLMeshRenderPipelineDescriptor) MaxTotalThreadgroupsPerMeshGrid() uint
func (MTLMeshRenderPipelineDescriptor) MaxTotalThreadsPerMeshThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) MaxTotalThreadsPerMeshThreadgroup() uint
func (MTLMeshRenderPipelineDescriptor) MaxTotalThreadsPerObjectThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) MaxTotalThreadsPerObjectThreadgroup() uint
func (MTLMeshRenderPipelineDescriptor) MaxVertexAmplificationCount ¶
func (m MTLMeshRenderPipelineDescriptor) MaxVertexAmplificationCount() uint
func (MTLMeshRenderPipelineDescriptor) MeshBuffers ¶
func (m MTLMeshRenderPipelineDescriptor) MeshBuffers() IMTLPipelineBufferDescriptorArray
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/meshBuffers
func (MTLMeshRenderPipelineDescriptor) MeshFunction ¶
func (m MTLMeshRenderPipelineDescriptor) MeshFunction() MTLFunction
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/meshFunction
func (MTLMeshRenderPipelineDescriptor) MeshLinkedFunctions ¶
func (m MTLMeshRenderPipelineDescriptor) MeshLinkedFunctions() IMTLLinkedFunctions
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/meshLinkedFunctions
func (MTLMeshRenderPipelineDescriptor) MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTLMeshRenderPipelineDescriptor) MeshThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
func (MTLMeshRenderPipelineDescriptor) ObjectBuffers ¶
func (m MTLMeshRenderPipelineDescriptor) ObjectBuffers() IMTLPipelineBufferDescriptorArray
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/objectBuffers
func (MTLMeshRenderPipelineDescriptor) ObjectFunction ¶
func (m MTLMeshRenderPipelineDescriptor) ObjectFunction() MTLFunction
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/objectFunction
func (MTLMeshRenderPipelineDescriptor) ObjectLinkedFunctions ¶
func (m MTLMeshRenderPipelineDescriptor) ObjectLinkedFunctions() IMTLLinkedFunctions
func (MTLMeshRenderPipelineDescriptor) ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTLMeshRenderPipelineDescriptor) ObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth() bool
func (MTLMeshRenderPipelineDescriptor) PayloadMemoryLength ¶
func (m MTLMeshRenderPipelineDescriptor) PayloadMemoryLength() uint
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/payloadMemoryLength
func (MTLMeshRenderPipelineDescriptor) RasterSampleCount ¶
func (m MTLMeshRenderPipelineDescriptor) RasterSampleCount() uint
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/rasterSampleCount
func (MTLMeshRenderPipelineDescriptor) RasterizationEnabled ¶
func (m MTLMeshRenderPipelineDescriptor) RasterizationEnabled() bool
func (MTLMeshRenderPipelineDescriptor) RequiredThreadsPerMeshThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) RequiredThreadsPerMeshThreadgroup() MTLSize
Discussion ¶
Sets the required mesh threads-per-threadgroup during mesh draws. The `threadsPerMeshThreadgroup` argument of any draw must match to this value if it is set. Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set. Setting this to a size of 0 in every dimension disables this property
func (MTLMeshRenderPipelineDescriptor) RequiredThreadsPerObjectThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) RequiredThreadsPerObjectThreadgroup() MTLSize
Discussion ¶
Sets the required object threads-per-threadgroup during mesh draws. The `threadsPerObjectThreadgroup` argument of any draw must match to this value if it is set. Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set. Setting this to a size of 0 in every dimension disables this property
func (MTLMeshRenderPipelineDescriptor) Reset ¶
func (m MTLMeshRenderPipelineDescriptor) Reset()
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/reset()
func (MTLMeshRenderPipelineDescriptor) SetAlphaToCoverageEnabled ¶
func (m MTLMeshRenderPipelineDescriptor) SetAlphaToCoverageEnabled(value bool)
func (MTLMeshRenderPipelineDescriptor) SetAlphaToOneEnabled ¶
func (m MTLMeshRenderPipelineDescriptor) SetAlphaToOneEnabled(value bool)
func (MTLMeshRenderPipelineDescriptor) SetBinaryArchives ¶
func (m MTLMeshRenderPipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
func (MTLMeshRenderPipelineDescriptor) SetDepthAttachmentPixelFormat ¶
func (m MTLMeshRenderPipelineDescriptor) SetDepthAttachmentPixelFormat(value MTLPixelFormat)
func (MTLMeshRenderPipelineDescriptor) SetFragmentFunction ¶
func (m MTLMeshRenderPipelineDescriptor) SetFragmentFunction(value MTLFunction)
func (MTLMeshRenderPipelineDescriptor) SetFragmentLinkedFunctions ¶
func (m MTLMeshRenderPipelineDescriptor) SetFragmentLinkedFunctions(value IMTLLinkedFunctions)
func (MTLMeshRenderPipelineDescriptor) SetLabel ¶
func (m MTLMeshRenderPipelineDescriptor) SetLabel(value string)
func (MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadgroupsPerMeshGrid ¶
func (m MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadgroupsPerMeshGrid(value uint)
func (MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadsPerMeshThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadsPerMeshThreadgroup(value uint)
func (MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadsPerObjectThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) SetMaxTotalThreadsPerObjectThreadgroup(value uint)
func (MTLMeshRenderPipelineDescriptor) SetMaxVertexAmplificationCount ¶
func (m MTLMeshRenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
func (MTLMeshRenderPipelineDescriptor) SetMeshFunction ¶
func (m MTLMeshRenderPipelineDescriptor) SetMeshFunction(value MTLFunction)
func (MTLMeshRenderPipelineDescriptor) SetMeshLinkedFunctions ¶
func (m MTLMeshRenderPipelineDescriptor) SetMeshLinkedFunctions(value IMTLLinkedFunctions)
func (MTLMeshRenderPipelineDescriptor) SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTLMeshRenderPipelineDescriptor) SetMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
func (MTLMeshRenderPipelineDescriptor) SetObjectFunction ¶
func (m MTLMeshRenderPipelineDescriptor) SetObjectFunction(value MTLFunction)
func (MTLMeshRenderPipelineDescriptor) SetObjectLinkedFunctions ¶
func (m MTLMeshRenderPipelineDescriptor) SetObjectLinkedFunctions(value IMTLLinkedFunctions)
func (MTLMeshRenderPipelineDescriptor) SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth ¶
func (m MTLMeshRenderPipelineDescriptor) SetObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(value bool)
func (MTLMeshRenderPipelineDescriptor) SetPayloadMemoryLength ¶
func (m MTLMeshRenderPipelineDescriptor) SetPayloadMemoryLength(value uint)
func (MTLMeshRenderPipelineDescriptor) SetRasterSampleCount ¶
func (m MTLMeshRenderPipelineDescriptor) SetRasterSampleCount(value uint)
func (MTLMeshRenderPipelineDescriptor) SetRasterizationEnabled ¶
func (m MTLMeshRenderPipelineDescriptor) SetRasterizationEnabled(value bool)
func (MTLMeshRenderPipelineDescriptor) SetRequiredThreadsPerMeshThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) SetRequiredThreadsPerMeshThreadgroup(value MTLSize)
func (MTLMeshRenderPipelineDescriptor) SetRequiredThreadsPerObjectThreadgroup ¶
func (m MTLMeshRenderPipelineDescriptor) SetRequiredThreadsPerObjectThreadgroup(value MTLSize)
func (MTLMeshRenderPipelineDescriptor) SetShaderValidation ¶
func (m MTLMeshRenderPipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
func (MTLMeshRenderPipelineDescriptor) SetStencilAttachmentPixelFormat ¶
func (m MTLMeshRenderPipelineDescriptor) SetStencilAttachmentPixelFormat(value MTLPixelFormat)
func (MTLMeshRenderPipelineDescriptor) SetSupportIndirectCommandBuffers ¶
func (m MTLMeshRenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value bool)
func (MTLMeshRenderPipelineDescriptor) ShaderValidation ¶
func (m MTLMeshRenderPipelineDescriptor) ShaderValidation() MTLShaderValidation
A value that enables or disables shader validation for the pipeline.
Discussion ¶
You can override the value using either of these environment variables: `MTL_SHADER_VALIDATION_ENABLE_PIPELINES` or `MTL_SHADER_VALIDATION_DISABLE_PIPELINES.`
See: https://developer.apple.com/documentation/Metal/MTLMeshRenderPipelineDescriptor/shaderValidation
func (MTLMeshRenderPipelineDescriptor) StencilAttachmentPixelFormat ¶
func (m MTLMeshRenderPipelineDescriptor) StencilAttachmentPixelFormat() MTLPixelFormat
func (MTLMeshRenderPipelineDescriptor) SupportIndirectCommandBuffers ¶
func (m MTLMeshRenderPipelineDescriptor) SupportIndirectCommandBuffers() bool
type MTLMeshRenderPipelineDescriptorClass ¶
type MTLMeshRenderPipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLMeshRenderPipelineDescriptorClass ¶
func GetMTLMeshRenderPipelineDescriptorClass() MTLMeshRenderPipelineDescriptorClass
GetMTLMeshRenderPipelineDescriptorClass returns the class object for MTLMeshRenderPipelineDescriptor.
func (MTLMeshRenderPipelineDescriptorClass) Alloc ¶
func (mc MTLMeshRenderPipelineDescriptorClass) Alloc() MTLMeshRenderPipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTLMotionBorderMode ¶
type MTLMotionBorderMode int
See: https://developer.apple.com/documentation/Metal/MTLMotionBorderMode
const ( // MTLMotionBorderModeClamp: A mode that specifies treating times outside the specified endpoint as if they were at the endpoint. MTLMotionBorderModeClamp MTLMotionBorderMode = 0 // MTLMotionBorderModeVanish: A mode that specifies that times outside the specified endpoint need to prevent any ray-intersections with the primitive. MTLMotionBorderModeVanish MTLMotionBorderMode = 1 )
func (MTLMotionBorderMode) String ¶
func (e MTLMotionBorderMode) String() string
type MTLMotionKeyframeData ¶
type MTLMotionKeyframeData struct {
objectivec.Object
}
Geometry data for a specific keyframe to use in a moving instance.
Overview ¶
An MTLMotionKeyframeData instance describes the location of geometry data for a keyframe. The exact type of data can vary, depending on which kind of motion descriptor you create. For an MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor instance, the buffer data is a list of bounding boxes. For an MTLAccelerationStructureMotionTriangleGeometryDescriptor, the buffer data is a list of vertices.
Specifying the keyframe data ¶
- MTLMotionKeyframeData.Buffer: The buffer that holds the geometry data.
- MTLMotionKeyframeData.SetBuffer
- MTLMotionKeyframeData.Offset: The offset, in bytes, to the keyframe data.
- MTLMotionKeyframeData.SetOffset
See: https://developer.apple.com/documentation/Metal/MTLMotionKeyframeData
func MTLMotionKeyframeDataFromID ¶
func MTLMotionKeyframeDataFromID(id objc.ID) MTLMotionKeyframeData
MTLMotionKeyframeDataFromID constructs a MTLMotionKeyframeData from an objc.ID.
Geometry data for a specific keyframe to use in a moving instance.
func NewMTLMotionKeyframeData ¶
func NewMTLMotionKeyframeData() MTLMotionKeyframeData
NewMTLMotionKeyframeData creates a new MTLMotionKeyframeData instance.
func (MTLMotionKeyframeData) Autorelease ¶
func (m MTLMotionKeyframeData) Autorelease() MTLMotionKeyframeData
Autorelease adds the receiver to the current autorelease pool.
func (MTLMotionKeyframeData) Buffer ¶
func (m MTLMotionKeyframeData) Buffer() MTLBuffer
The buffer that holds the geometry data.
See: https://developer.apple.com/documentation/Metal/MTLMotionKeyframeData/buffer
func (MTLMotionKeyframeData) Init ¶
func (m MTLMotionKeyframeData) Init() MTLMotionKeyframeData
Init initializes the instance.
func (MTLMotionKeyframeData) Offset ¶
func (m MTLMotionKeyframeData) Offset() uint
The offset, in bytes, to the keyframe data.
See: https://developer.apple.com/documentation/Metal/MTLMotionKeyframeData/offset
func (MTLMotionKeyframeData) SetBuffer ¶
func (m MTLMotionKeyframeData) SetBuffer(value MTLBuffer)
func (MTLMotionKeyframeData) SetOffset ¶
func (m MTLMotionKeyframeData) SetOffset(value uint)
type MTLMotionKeyframeDataClass ¶
type MTLMotionKeyframeDataClass struct {
// contains filtered or unexported fields
}
func GetMTLMotionKeyframeDataClass ¶
func GetMTLMotionKeyframeDataClass() MTLMotionKeyframeDataClass
GetMTLMotionKeyframeDataClass returns the class object for MTLMotionKeyframeData.
func (MTLMotionKeyframeDataClass) Alloc ¶
func (mc MTLMotionKeyframeDataClass) Alloc() MTLMotionKeyframeData
Alloc allocates memory for a new instance of the class.
func (MTLMotionKeyframeDataClass) Data ¶
func (_MTLMotionKeyframeDataClass MTLMotionKeyframeDataClass) Data() MTLMotionKeyframeData
Creates a new keyframe object.
See: https://developer.apple.com/documentation/Metal/MTLMotionKeyframeData/data
type MTLMultisampleDepthResolveFilter ¶
type MTLMultisampleDepthResolveFilter int
See: https://developer.apple.com/documentation/Metal/MTLMultisampleDepthResolveFilter
const ( // MTLMultisampleDepthResolveFilterMax: The GPU compares all depth samples in the pixel and selects the sample with the largest value. MTLMultisampleDepthResolveFilterMax MTLMultisampleDepthResolveFilter = 2 // MTLMultisampleDepthResolveFilterMin: The GPU compares all depth samples in the pixel and selects the sample with the smallest value. MTLMultisampleDepthResolveFilterMin MTLMultisampleDepthResolveFilter = 1 // MTLMultisampleDepthResolveFilterSample0: No filter is applied. MTLMultisampleDepthResolveFilterSample0 MTLMultisampleDepthResolveFilter = 0 )
func (MTLMultisampleDepthResolveFilter) String ¶
func (e MTLMultisampleDepthResolveFilter) String() string
type MTLMultisampleStencilResolveFilter ¶
type MTLMultisampleStencilResolveFilter int
See: https://developer.apple.com/documentation/Metal/MTLMultisampleStencilResolveFilter
const ( // MTLMultisampleStencilResolveFilterDepthResolvedSample: Chooses the stencil sample corresponding to the depth sample selected by the depth resolve filter. MTLMultisampleStencilResolveFilterDepthResolvedSample MTLMultisampleStencilResolveFilter = 1 // MTLMultisampleStencilResolveFilterSample0: Chooses the first stencil sample in the pixel. MTLMultisampleStencilResolveFilterSample0 MTLMultisampleStencilResolveFilter = 0 )
func (MTLMultisampleStencilResolveFilter) String ¶
func (e MTLMultisampleStencilResolveFilter) String() string
type MTLMutability ¶
type MTLMutability int
See: https://developer.apple.com/documentation/Metal/MTLMutability
const ( // MTLMutabilityDefault: The default behavior, based on the buffer’s type. MTLMutabilityDefault MTLMutability = 0 // MTLMutabilityImmutable: An option that states that you can’t modify the buffer’s contents. MTLMutabilityImmutable MTLMutability = 2 // MTLMutabilityMutable: An option that states that you can modify the buffer’s contents. MTLMutabilityMutable MTLMutability = 1 )
func (MTLMutability) String ¶
func (e MTLMutability) String() string
type MTLNewComputePipelineStateCompletionHandler ¶
type MTLNewComputePipelineStateCompletionHandler = func(MTLComputePipelineState, foundation.NSError)
MTLNewComputePipelineStateCompletionHandler is a completion handler signature a method calls when it finishes creating a compute pipeline.
See: https://developer.apple.com/documentation/Metal/MTLNewComputePipelineStateCompletionHandler
type MTLNewComputePipelineStateWithReflectionCompletionHandler ¶
type MTLNewComputePipelineStateWithReflectionCompletionHandler = func(MTLComputePipelineState, MTLComputePipelineReflection, foundation.NSError)
MTLNewComputePipelineStateWithReflectionCompletionHandler is a completion handler signature a method calls when it finishes creating a compute pipeline and reflection information.
type MTLNewDynamicLibraryCompletionHandler ¶
type MTLNewDynamicLibraryCompletionHandler = func(MTLDynamicLibrary, foundation.NSError)
See: https://developer.apple.com/documentation/Metal/MTLNewDynamicLibraryCompletionHandler
type MTLNewLibraryCompletionHandler ¶
type MTLNewLibraryCompletionHandler = func(MTLLibrary, foundation.NSError)
MTLNewLibraryCompletionHandler is a completion handler signature a method calls when it finishes creating a Metal library.
See: https://developer.apple.com/documentation/Metal/MTLNewLibraryCompletionHandler
type MTLNewRenderPipelineStateCompletionHandler ¶
type MTLNewRenderPipelineStateCompletionHandler = func(MTLRenderPipelineState, foundation.NSError)
MTLNewRenderPipelineStateCompletionHandler is a completion handler signature a method calls when it finishes creating a render pipeline.
See: https://developer.apple.com/documentation/Metal/MTLNewRenderPipelineStateCompletionHandler
type MTLNewRenderPipelineStateWithReflectionCompletionHandler ¶
type MTLNewRenderPipelineStateWithReflectionCompletionHandler = func(MTLRenderPipelineState, MTLRenderPipelineReflection, foundation.NSError)
MTLNewRenderPipelineStateWithReflectionCompletionHandler is a completion handler signature a method calls when it finishes creating a render pipeline and reflection information.
type MTLObjectPayloadBinding ¶
type MTLObjectPayloadBinding interface {
objectivec.IObject
MTLBinding
// ObjectPayloadAlignment protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLObjectPayloadBinding/objectPayloadAlignment
ObjectPayloadAlignment() uint
// ObjectPayloadDataSize protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLObjectPayloadBinding/objectPayloadDataSize
ObjectPayloadDataSize() uint
}
MTLObjectPayloadBinding protocol.
See: https://developer.apple.com/documentation/Metal/MTLObjectPayloadBinding
type MTLObjectPayloadBindingObject ¶
type MTLObjectPayloadBindingObject struct {
objectivec.Object
}
MTLObjectPayloadBindingObject wraps an existing Objective-C object that conforms to the MTLObjectPayloadBinding protocol.
func MTLObjectPayloadBindingObjectFromID ¶
func MTLObjectPayloadBindingObjectFromID(id objc.ID) MTLObjectPayloadBindingObject
MTLObjectPayloadBindingObjectFromID constructs a MTLObjectPayloadBindingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLObjectPayloadBindingObject) Access ¶
func (o MTLObjectPayloadBindingObject) Access() MTLBindingAccess
See: https://developer.apple.com/documentation/Metal/MTLBinding/access
func (MTLObjectPayloadBindingObject) BaseObject ¶
func (o MTLObjectPayloadBindingObject) BaseObject() objectivec.Object
func (MTLObjectPayloadBindingObject) Index ¶
func (o MTLObjectPayloadBindingObject) Index() uint
See: https://developer.apple.com/documentation/Metal/MTLBinding/index
func (MTLObjectPayloadBindingObject) IsArgument ¶
func (o MTLObjectPayloadBindingObject) IsArgument() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isArgument
func (MTLObjectPayloadBindingObject) IsUsed ¶
func (o MTLObjectPayloadBindingObject) IsUsed() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isUsed
func (MTLObjectPayloadBindingObject) Name ¶
func (o MTLObjectPayloadBindingObject) Name() string
See: https://developer.apple.com/documentation/Metal/MTLBinding/name
func (MTLObjectPayloadBindingObject) ObjectPayloadAlignment ¶
func (o MTLObjectPayloadBindingObject) ObjectPayloadAlignment() uint
See: https://developer.apple.com/documentation/Metal/MTLObjectPayloadBinding/objectPayloadAlignment
func (MTLObjectPayloadBindingObject) ObjectPayloadDataSize ¶
func (o MTLObjectPayloadBindingObject) ObjectPayloadDataSize() uint
See: https://developer.apple.com/documentation/Metal/MTLObjectPayloadBinding/objectPayloadDataSize
func (MTLObjectPayloadBindingObject) Type ¶
func (o MTLObjectPayloadBindingObject) Type() MTLBindingType
See: https://developer.apple.com/documentation/Metal/MTLBinding/type
type MTLOrigin ¶
type MTLOrigin struct {
X uint // The x coordinate of the origin.
Y uint // The y coordinate of the origin.
Z uint // The z coordinate of the origin.
}
MTLOrigin - The coordinates for the front upper-left corner of a region.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLOrigin
type MTLPackedFloat3 ¶
MTLPackedFloat3 - A structure that contains three 32-bit floating-point values with no additional padding.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLPackedFloat3-c.struct
type MTLPackedFloat4x3 ¶
type MTLPackedFloat4x3 struct {
Columns [4]MTLPackedFloat3
}
MTLPackedFloat4x3 - A structure that contains the top three rows of a 4x4 matrix of 32-bit floating-point values, in column-major order.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLPackedFloat4x3-c.struct
type MTLPackedFloatQuaternion ¶
MTLPackedFloatQuaternion
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLPackedFloatQuaternion
type MTLParallelRenderCommandEncoder ¶
type MTLParallelRenderCommandEncoder interface {
objectivec.IObject
MTLCommandEncoder
// Create an object that encodes commands that perform graphics rendering operations and may be assigned to a different thread.
//
// See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder/makeRenderCommandEncoder()
RenderCommandEncoder() MTLRenderCommandEncoder
// Specifies a known store action to replace the initial [MTLStoreAction.unknown](<doc://com.apple.metal/documentation/Metal/MTLStoreAction/unknown>) value specified for a given color attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder/setColorStoreAction(_:index:)
SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
// Specifies known store action options for a given color attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder/setColorStoreActionOptions(_:index:)
SetColorStoreActionOptionsAtIndex(storeActionOptions MTLStoreActionOptions, colorAttachmentIndex uint)
// Specifies a known store action to replace the initial [MTLStoreAction.unknown](<doc://com.apple.metal/documentation/Metal/MTLStoreAction/unknown>) value specified for a given depth attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder/setDepthStoreAction(_:)
SetDepthStoreAction(storeAction MTLStoreAction)
// Specifies known store action options for a given depth attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder/setDepthStoreActionOptions(_:)
SetDepthStoreActionOptions(storeActionOptions MTLStoreActionOptions)
// Specifies a known store action to replace the initial [MTLStoreAction.unknown](<doc://com.apple.metal/documentation/Metal/MTLStoreAction/unknown>) value specified for a given stencil attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder/setStencilStoreAction(_:)
SetStencilStoreAction(storeAction MTLStoreAction)
// Specifies known store action options for a given stencil attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder/setStencilStoreActionOptions(_:)
SetStencilStoreActionOptions(storeActionOptions MTLStoreActionOptions)
}
An instance that splits up a single render pass so that it can be simultaneously encoded from multiple threads.
See: https://developer.apple.com/documentation/Metal/MTLParallelRenderCommandEncoder
type MTLParallelRenderCommandEncoderObject ¶
type MTLParallelRenderCommandEncoderObject struct {
objectivec.Object
}
MTLParallelRenderCommandEncoderObject wraps an existing Objective-C object that conforms to the MTLParallelRenderCommandEncoder protocol.
func MTLParallelRenderCommandEncoderObjectFromID ¶
func MTLParallelRenderCommandEncoderObjectFromID(id objc.ID) MTLParallelRenderCommandEncoderObject
MTLParallelRenderCommandEncoderObjectFromID constructs a MTLParallelRenderCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLParallelRenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStages ¶
func (o MTLParallelRenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTLParallelRenderCommandEncoderObject) BaseObject ¶
func (o MTLParallelRenderCommandEncoderObject) BaseObject() objectivec.Object
func (MTLParallelRenderCommandEncoderObject) Device ¶
func (o MTLParallelRenderCommandEncoderObject) Device() MTLDevice
The Metal device from which the command encoder was created.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
func (MTLParallelRenderCommandEncoderObject) EndEncoding ¶
func (o MTLParallelRenderCommandEncoderObject) EndEncoding()
Declares that all command generation from the encoder is completed.
Discussion ¶
After `endEncoding` is called, the command encoder has no further use. You cannot encode any other commands with this encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
func (MTLParallelRenderCommandEncoderObject) InsertDebugSignpost ¶
func (o MTLParallelRenderCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the captured frame data.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
func (MTLParallelRenderCommandEncoderObject) Label ¶
func (o MTLParallelRenderCommandEncoderObject) Label() string
A string that labels the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
func (MTLParallelRenderCommandEncoderObject) PopDebugGroup ¶
func (o MTLParallelRenderCommandEncoderObject) PopDebugGroup()
Pops the latest string off of a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
func (MTLParallelRenderCommandEncoderObject) PushDebugGroup ¶
func (o MTLParallelRenderCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a specific string onto a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
func (MTLParallelRenderCommandEncoderObject) RenderCommandEncoder ¶
func (o MTLParallelRenderCommandEncoderObject) RenderCommandEncoder() MTLRenderCommandEncoder
Create an object that encodes commands that perform graphics rendering operations and may be assigned to a different thread.
Return Value ¶
A graphics rendering command encoder object ¶
Discussion ¶
The rendering commands encoded by MTLRenderCommandEncoder objects are executed in the order in which the MTLRenderCommandEncoder objects are created, not in the order they are ended.
func (MTLParallelRenderCommandEncoderObject) SetColorStoreActionAtIndex ¶
func (o MTLParallelRenderCommandEncoderObject) SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
Specifies a known store action to replace the initial [StoreActionUnknown] value specified for a given color attachment.
storeAction: The desired store action for the color attachment. This value can’t be [StoreActionUnknown].
colorAttachmentIndex: The index of the color attachment.
Discussion ¶
If the store action for the given color attachment was set to [StoreActionUnknown] when the parallel render command encoder was created, you need to call this method to specify another store action before you call the [EndEncoding] method.
func (MTLParallelRenderCommandEncoderObject) SetColorStoreActionOptionsAtIndex ¶
func (o MTLParallelRenderCommandEncoderObject) SetColorStoreActionOptionsAtIndex(storeActionOptions MTLStoreActionOptions, colorAttachmentIndex uint)
Specifies known store action options for a given color attachment.
storeActionOptions: The additional store action options for the color attachment.
colorAttachmentIndex: The index of the color attachment.
func (MTLParallelRenderCommandEncoderObject) SetDepthStoreAction ¶
func (o MTLParallelRenderCommandEncoderObject) SetDepthStoreAction(storeAction MTLStoreAction)
Specifies a known store action to replace the initial [StoreActionUnknown] value specified for a given depth attachment.
storeAction: The desired store action for the depth attachment. This value can’t be [StoreActionUnknown].
Discussion ¶
If the store action for the given depth attachment was set to [StoreActionUnknown] when the parallel render command encoder was created, you need to call this method to specify another store action before you call the [EndEncoding] method.
func (MTLParallelRenderCommandEncoderObject) SetDepthStoreActionOptions ¶
func (o MTLParallelRenderCommandEncoderObject) SetDepthStoreActionOptions(storeActionOptions MTLStoreActionOptions)
Specifies known store action options for a given depth attachment.
storeActionOptions: The additional store action options for the depth attachment.
func (MTLParallelRenderCommandEncoderObject) SetLabel ¶
func (o MTLParallelRenderCommandEncoderObject) SetLabel(value string)
func (MTLParallelRenderCommandEncoderObject) SetStencilStoreAction ¶
func (o MTLParallelRenderCommandEncoderObject) SetStencilStoreAction(storeAction MTLStoreAction)
Specifies a known store action to replace the initial [StoreActionUnknown] value specified for a given stencil attachment.
storeAction: The desired store action for the stencil attachment. This value can’t be [StoreActionUnknown].
Discussion ¶
If the store action for the given stencil attachment was set to [StoreActionUnknown] when the parallel render command encoder was created, you need to call this method to specify another store action before you call the [EndEncoding] method.
func (MTLParallelRenderCommandEncoderObject) SetStencilStoreActionOptions ¶
func (o MTLParallelRenderCommandEncoderObject) SetStencilStoreActionOptions(storeActionOptions MTLStoreActionOptions)
Specifies known store action options for a given stencil attachment.
storeActionOptions: The additional store action options for the stencil attachment.
type MTLPatchType ¶
type MTLPatchType int
See: https://developer.apple.com/documentation/Metal/MTLPatchType
const ( // MTLPatchTypeNone: An option that indicates that this isn’t a post-tessellation vertex function. MTLPatchTypeNone MTLPatchType = 0 // MTLPatchTypeQuad: A quad patch. MTLPatchTypeQuad MTLPatchType = 2 // MTLPatchTypeTriangle: A triangle patch. MTLPatchTypeTriangle MTLPatchType = 1 )
func (MTLPatchType) String ¶
func (e MTLPatchType) String() string
type MTLPipelineBufferDescriptor ¶
type MTLPipelineBufferDescriptor struct {
objectivec.Object
}
The mutability options for a buffer that a render or compute pipeline uses.
Overview ¶
Metal can perform additional optimizations if you guarantee that neither the CPU nor the GPU modify a buffer’s contents before starting a pass. Use immutable buffers as much as possible to take advantage of Metal optimizations.
To declare that a buffer is immutable, set the MTLPipelineBufferDescriptor.Mutability property of their associated MTLPipelineBufferDescriptor object to [MutabilityImmutable].
Setting buffer mutability ¶
- MTLPipelineBufferDescriptor.Mutability: A mutability option that determines whether you can update a buffer’s contents before related commands use the buffer.
- MTLPipelineBufferDescriptor.SetMutability
See: https://developer.apple.com/documentation/Metal/MTLPipelineBufferDescriptor
func MTLPipelineBufferDescriptorFromID ¶
func MTLPipelineBufferDescriptorFromID(id objc.ID) MTLPipelineBufferDescriptor
MTLPipelineBufferDescriptorFromID constructs a MTLPipelineBufferDescriptor from an objc.ID.
The mutability options for a buffer that a render or compute pipeline uses.
func NewMTLPipelineBufferDescriptor ¶
func NewMTLPipelineBufferDescriptor() MTLPipelineBufferDescriptor
NewMTLPipelineBufferDescriptor creates a new MTLPipelineBufferDescriptor instance.
func (MTLPipelineBufferDescriptor) Autorelease ¶
func (p MTLPipelineBufferDescriptor) Autorelease() MTLPipelineBufferDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLPipelineBufferDescriptor) Init ¶
func (p MTLPipelineBufferDescriptor) Init() MTLPipelineBufferDescriptor
Init initializes the instance.
func (MTLPipelineBufferDescriptor) Mutability ¶
func (p MTLPipelineBufferDescriptor) Mutability() MTLMutability
A mutability option that determines whether you can update a buffer’s contents before related commands use the buffer.
Discussion ¶
The default value is [MutabilityDefault].
If you don’t explicitly declare mutability, Metal uses the following default behaviors:
- Regular buffers are mutable by default, and Metal treats [MutabilityDefault] as if it were [MutabilityMutable]. - Argument buffers are immutable by default, and Metal treats [MutabilityDefault] as if it were [MutabilityImmutable].
See: https://developer.apple.com/documentation/Metal/MTLPipelineBufferDescriptor/mutability
func (MTLPipelineBufferDescriptor) SetMutability ¶
func (p MTLPipelineBufferDescriptor) SetMutability(value MTLMutability)
type MTLPipelineBufferDescriptorArray ¶
type MTLPipelineBufferDescriptorArray struct {
objectivec.Object
}
An array of pipeline buffer descriptors.
Accessing array elements ¶
- MTLPipelineBufferDescriptorArray.ObjectAtIndexedSubscript: Returns the pipeline buffer descriptor at the specified array index.
See: https://developer.apple.com/documentation/Metal/MTLPipelineBufferDescriptorArray
func MTLPipelineBufferDescriptorArrayFromID ¶
func MTLPipelineBufferDescriptorArrayFromID(id objc.ID) MTLPipelineBufferDescriptorArray
MTLPipelineBufferDescriptorArrayFromID constructs a MTLPipelineBufferDescriptorArray from an objc.ID.
An array of pipeline buffer descriptors.
func NewMTLPipelineBufferDescriptorArray ¶
func NewMTLPipelineBufferDescriptorArray() MTLPipelineBufferDescriptorArray
NewMTLPipelineBufferDescriptorArray creates a new MTLPipelineBufferDescriptorArray instance.
func (MTLPipelineBufferDescriptorArray) Autorelease ¶
func (p MTLPipelineBufferDescriptorArray) Autorelease() MTLPipelineBufferDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLPipelineBufferDescriptorArray) Init ¶
func (p MTLPipelineBufferDescriptorArray) Init() MTLPipelineBufferDescriptorArray
Init initializes the instance.
func (MTLPipelineBufferDescriptorArray) ObjectAtIndexedSubscript ¶
func (p MTLPipelineBufferDescriptorArray) ObjectAtIndexedSubscript(bufferIndex uint) IMTLPipelineBufferDescriptor
Returns the pipeline buffer descriptor at the specified array index.
bufferIndex: The array index of the requested pipeline buffer descriptor.
Return Value ¶
The descriptor for the buffer bound at this index.
See: https://developer.apple.com/documentation/Metal/MTLPipelineBufferDescriptorArray/subscript(_:)
func (MTLPipelineBufferDescriptorArray) SetObjectAtIndexedSubscript ¶
func (p MTLPipelineBufferDescriptorArray) SetObjectAtIndexedSubscript(buffer IMTLPipelineBufferDescriptor, bufferIndex uint)
Sets a pipeline buffer descriptor at the specified array index.
buffer: The pipeline buffer descriptor to set in the array.
bufferIndex: The array index in which to set the given pipeline buffer descriptor.
type MTLPipelineBufferDescriptorArrayClass ¶
type MTLPipelineBufferDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLPipelineBufferDescriptorArrayClass ¶
func GetMTLPipelineBufferDescriptorArrayClass() MTLPipelineBufferDescriptorArrayClass
GetMTLPipelineBufferDescriptorArrayClass returns the class object for MTLPipelineBufferDescriptorArray.
func (MTLPipelineBufferDescriptorArrayClass) Alloc ¶
func (mc MTLPipelineBufferDescriptorArrayClass) Alloc() MTLPipelineBufferDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLPipelineBufferDescriptorClass ¶
type MTLPipelineBufferDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLPipelineBufferDescriptorClass ¶
func GetMTLPipelineBufferDescriptorClass() MTLPipelineBufferDescriptorClass
GetMTLPipelineBufferDescriptorClass returns the class object for MTLPipelineBufferDescriptor.
func (MTLPipelineBufferDescriptorClass) Alloc ¶
func (mc MTLPipelineBufferDescriptorClass) Alloc() MTLPipelineBufferDescriptor
Alloc allocates memory for a new instance of the class.
type MTLPipelineOption ¶
type MTLPipelineOption int
See: https://developer.apple.com/documentation/Metal/MTLPipelineOption
const ( // MTLPipelineOptionBindingInfo: An option that provides binding information for pipeline state resources. MTLPipelineOptionBindingInfo MTLPipelineOption = 1 // MTLPipelineOptionBufferTypeInfo: An option instance that provides detailed buffer type information for buffer arguments. MTLPipelineOptionBufferTypeInfo MTLPipelineOption = 2 // MTLPipelineOptionFailOnBinaryArchiveMiss: An option that instructs the compiler to return an error when a GPU function isn’t in a binary archive. MTLPipelineOptionFailOnBinaryArchiveMiss MTLPipelineOption = 4 // MTLPipelineOptionNone: Don’t provide any reflection information. MTLPipelineOptionNone MTLPipelineOption = 0 // Deprecated. MTLPipelineOptionArgumentInfo MTLPipelineOption = 1 )
func (MTLPipelineOption) String ¶
func (e MTLPipelineOption) String() string
type MTLPixelFormat ¶
type MTLPixelFormat int
See: https://developer.apple.com/documentation/Metal/MTLPixelFormat
const ( // MTLPixelFormatA1BGR5Unorm: Packed 16-bit format with normalized unsigned integer color components: 5 bits each for BGR and 1 for alpha, packed into 16 bits. MTLPixelFormatA1BGR5Unorm MTLPixelFormat = 41 // MTLPixelFormatA8Unorm: Ordinary format with one 8-bit normalized unsigned integer component. MTLPixelFormatA8Unorm MTLPixelFormat = 1 // MTLPixelFormatABGR4Unorm: Packed 16-bit format with normalized unsigned integer color components: 4 bits each for ABGR, packed into 16 bits. MTLPixelFormatABGR4Unorm MTLPixelFormat = 42 // MTLPixelFormatASTC_10x10_HDR: ASTC-compressed format with high-dynamic range content, a block width of 10, and a block height of 10. MTLPixelFormatASTC_10x10_HDR MTLPixelFormat = 234 // MTLPixelFormatASTC_10x10_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 10, and a block height of 10. MTLPixelFormatASTC_10x10_LDR MTLPixelFormat = 216 // MTLPixelFormatASTC_10x10_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 10, and a block height of 10. MTLPixelFormatASTC_10x10_sRGB MTLPixelFormat = 198 // MTLPixelFormatASTC_10x5_HDR: ASTC-compressed format with high-dynamic range content, a block width of 10, and a block height of 5. MTLPixelFormatASTC_10x5_HDR MTLPixelFormat = 231 // MTLPixelFormatASTC_10x5_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 10, and a block height of 5. MTLPixelFormatASTC_10x5_LDR MTLPixelFormat = 213 // MTLPixelFormatASTC_10x5_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 10, and a block height of 5. MTLPixelFormatASTC_10x5_sRGB MTLPixelFormat = 195 // MTLPixelFormatASTC_10x6_HDR: ASTC-compressed format with high-dynamic range content, a block width of 10, and a block height of 6. MTLPixelFormatASTC_10x6_HDR MTLPixelFormat = 232 // MTLPixelFormatASTC_10x6_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 10, and a block height of 6. MTLPixelFormatASTC_10x6_LDR MTLPixelFormat = 214 // MTLPixelFormatASTC_10x6_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 10, and a block height of 6. MTLPixelFormatASTC_10x6_sRGB MTLPixelFormat = 196 // MTLPixelFormatASTC_10x8_HDR: ASTC-compressed format with high-dynamic range content, a block width of 10, and a block height of 8. MTLPixelFormatASTC_10x8_HDR MTLPixelFormat = 233 // MTLPixelFormatASTC_10x8_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 10, and a block height of 8. MTLPixelFormatASTC_10x8_LDR MTLPixelFormat = 215 // MTLPixelFormatASTC_10x8_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 10, and a block height of 8. MTLPixelFormatASTC_10x8_sRGB MTLPixelFormat = 197 // MTLPixelFormatASTC_12x10_HDR: ASTC-compressed format with high-dynamic range content, a block width of 12, and a block height of 10. MTLPixelFormatASTC_12x10_HDR MTLPixelFormat = 235 // MTLPixelFormatASTC_12x10_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 12, and a block height of 10. MTLPixelFormatASTC_12x10_LDR MTLPixelFormat = 217 // MTLPixelFormatASTC_12x10_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 12, and a block height of 10. MTLPixelFormatASTC_12x10_sRGB MTLPixelFormat = 199 // MTLPixelFormatASTC_12x12_HDR: ASTC-compressed format with high-dynamic range content, a block width of 12, and a block height of 12. MTLPixelFormatASTC_12x12_HDR MTLPixelFormat = 236 // MTLPixelFormatASTC_12x12_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 12, and a block height of 12. MTLPixelFormatASTC_12x12_LDR MTLPixelFormat = 218 // MTLPixelFormatASTC_12x12_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 12, and a block height of 12. MTLPixelFormatASTC_12x12_sRGB MTLPixelFormat = 200 // MTLPixelFormatASTC_4x4_HDR: ASTC-compressed format with high-dynamic-range content, a block width of 4, and a block height of 4. MTLPixelFormatASTC_4x4_HDR MTLPixelFormat = 222 // MTLPixelFormatASTC_4x4_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 4, and a block height of 4. MTLPixelFormatASTC_4x4_LDR MTLPixelFormat = 204 // MTLPixelFormatASTC_4x4_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 4, and a block height of 4. MTLPixelFormatASTC_4x4_sRGB MTLPixelFormat = 186 // MTLPixelFormatASTC_5x4_HDR: ASTC-compressed format with high-dynamic range content, a block width of 5, and a block height of 4. MTLPixelFormatASTC_5x4_HDR MTLPixelFormat = 223 // MTLPixelFormatASTC_5x4_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 5, and a block height of 4. MTLPixelFormatASTC_5x4_LDR MTLPixelFormat = 205 // MTLPixelFormatASTC_5x4_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 5, and a block height of 4. MTLPixelFormatASTC_5x4_sRGB MTLPixelFormat = 187 // MTLPixelFormatASTC_5x5_HDR: ASTC-compressed format with high-dynamic range content, a block width of 5, and a block height of 5. MTLPixelFormatASTC_5x5_HDR MTLPixelFormat = 224 // MTLPixelFormatASTC_5x5_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 5, and a block height of 5. MTLPixelFormatASTC_5x5_LDR MTLPixelFormat = 206 // MTLPixelFormatASTC_5x5_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 5, and a block height of 5. MTLPixelFormatASTC_5x5_sRGB MTLPixelFormat = 188 // MTLPixelFormatASTC_6x5_HDR: ASTC-compressed format with high-dynamic range content, a block width of 6, and a block height of 5. MTLPixelFormatASTC_6x5_HDR MTLPixelFormat = 225 // MTLPixelFormatASTC_6x5_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 6, and a block height of 5. MTLPixelFormatASTC_6x5_LDR MTLPixelFormat = 207 // MTLPixelFormatASTC_6x5_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 6, and a block height of 5. MTLPixelFormatASTC_6x5_sRGB MTLPixelFormat = 189 // MTLPixelFormatASTC_6x6_HDR: ASTC-compressed format with high-dynamic range content, a block width of 6, and a block height of 6. MTLPixelFormatASTC_6x6_HDR MTLPixelFormat = 226 // MTLPixelFormatASTC_6x6_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 6, and a block height of 6. MTLPixelFormatASTC_6x6_LDR MTLPixelFormat = 208 // MTLPixelFormatASTC_6x6_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 6, and a block height of 6. MTLPixelFormatASTC_6x6_sRGB MTLPixelFormat = 190 // MTLPixelFormatASTC_8x5_HDR: ASTC-compressed format with high-dynamic range content, a block width of 8, and a block height of 5. MTLPixelFormatASTC_8x5_HDR MTLPixelFormat = 228 // MTLPixelFormatASTC_8x5_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 8, and a block height of 5. MTLPixelFormatASTC_8x5_LDR MTLPixelFormat = 210 // MTLPixelFormatASTC_8x5_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 8, and a block height of 5. MTLPixelFormatASTC_8x5_sRGB MTLPixelFormat = 192 // MTLPixelFormatASTC_8x6_HDR: ASTC-compressed format with high-dynamic range content, a block width of 8, and a block height of 6. MTLPixelFormatASTC_8x6_HDR MTLPixelFormat = 229 // MTLPixelFormatASTC_8x6_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 8, and a block height of 6. MTLPixelFormatASTC_8x6_LDR MTLPixelFormat = 211 // MTLPixelFormatASTC_8x6_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 8, and a block height of 6. MTLPixelFormatASTC_8x6_sRGB MTLPixelFormat = 193 // MTLPixelFormatASTC_8x8_HDR: ASTC-compressed format with high-dynamic range content, a block width of 8, and a block height of 8. MTLPixelFormatASTC_8x8_HDR MTLPixelFormat = 230 // MTLPixelFormatASTC_8x8_LDR: ASTC-compressed format with low-dynamic-range content, a block width of 8, and a block height of 8. MTLPixelFormatASTC_8x8_LDR MTLPixelFormat = 212 // MTLPixelFormatASTC_8x8_sRGB: ASTC-compressed format with low-dynamic-range content, conversion between sRGB and linear space, a block width of 8, and a block height of 8. MTLPixelFormatASTC_8x8_sRGB MTLPixelFormat = 194 // MTLPixelFormatB5G6R5Unorm: Packed 16-bit format with normalized unsigned integer color components: 5 bits for blue, 6 bits for green, 5 bits for red, packed into 16 bits. MTLPixelFormatB5G6R5Unorm MTLPixelFormat = 40 // MTLPixelFormatBC1_RGBA: Compressed format with two 16-bit color components and one 32-bit descriptor component. MTLPixelFormatBC1_RGBA MTLPixelFormat = 130 // MTLPixelFormatBC1_RGBA_sRGB: Compressed format with two 16-bit color components and one 32-bit descriptor component, with conversion between sRGB and linear space. MTLPixelFormatBC1_RGBA_sRGB MTLPixelFormat = 131 // MTLPixelFormatBC2_RGBA: Compressed format with two 64-bit chunks. MTLPixelFormatBC2_RGBA MTLPixelFormat = 132 // MTLPixelFormatBC2_RGBA_sRGB: Compressed format with two 64-bit chunks, with conversion between sRGB and linear space. MTLPixelFormatBC2_RGBA_sRGB MTLPixelFormat = 133 // MTLPixelFormatBC3_RGBA: Compressed format with two 64-bit chunks. MTLPixelFormatBC3_RGBA MTLPixelFormat = 134 // MTLPixelFormatBC3_RGBA_sRGB: Compressed format with two 64-bit chunks, with conversion between sRGB and linear space. MTLPixelFormatBC3_RGBA_sRGB MTLPixelFormat = 135 // MTLPixelFormatBC4_RSnorm: Compressed format with one normalized signed integer component. MTLPixelFormatBC4_RSnorm MTLPixelFormat = 141 // MTLPixelFormatBC4_RUnorm: Compressed format with one normalized unsigned integer component. MTLPixelFormatBC4_RUnorm MTLPixelFormat = 140 // MTLPixelFormatBC5_RGSnorm: Compressed format with two normalized signed integer components. MTLPixelFormatBC5_RGSnorm MTLPixelFormat = 143 // MTLPixelFormatBC5_RGUnorm: Compressed format with two normalized unsigned integer components. MTLPixelFormatBC5_RGUnorm MTLPixelFormat = 142 // MTLPixelFormatBC6H_RGBFloat: Compressed format with four floating-point components. MTLPixelFormatBC6H_RGBFloat MTLPixelFormat = 150 // MTLPixelFormatBC6H_RGBUfloat: Compressed format with four unsigned floating-point components. MTLPixelFormatBC6H_RGBUfloat MTLPixelFormat = 151 // MTLPixelFormatBC7_RGBAUnorm: Compressed format with four normalized unsigned integer components. MTLPixelFormatBC7_RGBAUnorm MTLPixelFormat = 152 // MTLPixelFormatBC7_RGBAUnorm_sRGB: Compressed format with four normalized unsigned integer components, with conversion between sRGB and linear space. MTLPixelFormatBC7_RGBAUnorm_sRGB MTLPixelFormat = 153 // MTLPixelFormatBGR10A2Unorm: A 32-bit packed pixel format with four normalized unsigned integer components: 10-bit blue, 10-bit green, 10-bit red, and 2-bit alpha. MTLPixelFormatBGR10A2Unorm MTLPixelFormat = 94 // MTLPixelFormatBGR10_XR: A 32-bit extended-range pixel format with three fixed-point components of 10-bit blue, 10-bit green, and 10-bit red. MTLPixelFormatBGR10_XR MTLPixelFormat = 554 // MTLPixelFormatBGR10_XR_sRGB: A 32-bit extended-range pixel format with sRGB conversion and three fixed-point components of 10-bit blue, 10-bit green, and 10-bit red. MTLPixelFormatBGR10_XR_sRGB MTLPixelFormat = 555 // MTLPixelFormatBGR5A1Unorm: Packed 16-bit format with normalized unsigned integer color components: 5 bits each for BGR and 1 for alpha, packed into 16 bits. MTLPixelFormatBGR5A1Unorm MTLPixelFormat = 43 // MTLPixelFormatBGRA10_XR: A 64-bit extended-range pixel format with four fixed-point components of 10-bit blue, 10-bit green, 10-bit red, and 10-bit alpha. MTLPixelFormatBGRA10_XR MTLPixelFormat = 552 // MTLPixelFormatBGRA10_XR_sRGB: A 64-bit extended-range pixel format with sRGB conversion and four fixed-point components of 10-bit blue, 10-bit green, 10-bit red, and 10-bit alpha. MTLPixelFormatBGRA10_XR_sRGB MTLPixelFormat = 553 // MTLPixelFormatBGRA8Unorm: Ordinary format with four 8-bit normalized unsigned integer components in BGRA order. MTLPixelFormatBGRA8Unorm MTLPixelFormat = 80 // MTLPixelFormatBGRA8Unorm_sRGB: Ordinary format with four 8-bit normalized unsigned integer components in BGRA order with conversion between sRGB and linear space. MTLPixelFormatBGRA8Unorm_sRGB MTLPixelFormat = 81 // MTLPixelFormatBGRG422: A pixel format where the red and green components are subsampled horizontally. MTLPixelFormatBGRG422 MTLPixelFormat = 241 // MTLPixelFormatDepth16Unorm: A pixel format for a depth-render target that has a 16-bit normalized, unsigned-integer component. MTLPixelFormatDepth16Unorm MTLPixelFormat = 250 // MTLPixelFormatDepth24Unorm_Stencil8: A 32-bit combined depth and stencil pixel format with a 24-bit normalized unsigned integer for depth and an 8-bit unsigned integer for stencil. MTLPixelFormatDepth24Unorm_Stencil8 MTLPixelFormat = 255 // MTLPixelFormatDepth32Float: A pixel format with one 32-bit floating-point component, used for a depth render target. MTLPixelFormatDepth32Float MTLPixelFormat = 252 // MTLPixelFormatDepth32Float_Stencil8: A 40-bit combined depth and stencil pixel format with a 32-bit floating-point value for depth and an 8-bit unsigned integer for stencil. MTLPixelFormatDepth32Float_Stencil8 MTLPixelFormat = 260 // MTLPixelFormatEAC_R11Snorm: Compressed format using EAC compression with one normalized signed integer component. MTLPixelFormatEAC_R11Snorm MTLPixelFormat = 172 // MTLPixelFormatEAC_R11Unorm: Compressed format using EAC compression with one normalized unsigned integer component. MTLPixelFormatEAC_R11Unorm MTLPixelFormat = 170 // MTLPixelFormatEAC_RG11Snorm: Compressed format using EAC compression with two normalized signed integer components. MTLPixelFormatEAC_RG11Snorm MTLPixelFormat = 176 // MTLPixelFormatEAC_RG11Unorm: Compressed format using EAC compression with two normalized unsigned integer components. MTLPixelFormatEAC_RG11Unorm MTLPixelFormat = 174 // MTLPixelFormatEAC_RGBA8: Compressed format using EAC compression with four 8-bit components. MTLPixelFormatEAC_RGBA8 MTLPixelFormat = 178 // MTLPixelFormatEAC_RGBA8_sRGB: Compressed format using EAC compression with four 8-bit components with conversion between sRGB and linear space. MTLPixelFormatEAC_RGBA8_sRGB MTLPixelFormat = 179 // MTLPixelFormatETC2_RGB8: Compressed format using ETC2 compression with three 8-bit components. MTLPixelFormatETC2_RGB8 MTLPixelFormat = 180 // MTLPixelFormatETC2_RGB8A1: Compressed format using ETC2 compression with four 8-bit components. MTLPixelFormatETC2_RGB8A1 MTLPixelFormat = 182 // MTLPixelFormatETC2_RGB8A1_sRGB: Compressed format using ETC2 compression with four 8-bit components with conversion between sRGB and linear space. MTLPixelFormatETC2_RGB8A1_sRGB MTLPixelFormat = 183 // MTLPixelFormatETC2_RGB8_sRGB: Compressed format using ETC2 compression with three 8-bit components with conversion between sRGB and linear space. MTLPixelFormatETC2_RGB8_sRGB MTLPixelFormat = 181 // MTLPixelFormatGBGR422: A pixel format where the red and green components are subsampled horizontally. MTLPixelFormatGBGR422 MTLPixelFormat = 240 // MTLPixelFormatInvalid: The default value of the pixel format for the [MTLRenderPipelineState]. MTLPixelFormatInvalid MTLPixelFormat = 0 // MTLPixelFormatR16Float: Ordinary format with one 16-bit floating-point component. MTLPixelFormatR16Float MTLPixelFormat = 25 // MTLPixelFormatR16Sint: Ordinary format with one 16-bit signed integer component. MTLPixelFormatR16Sint MTLPixelFormat = 24 // MTLPixelFormatR16Snorm: Ordinary format with one 16-bit normalized signed integer component. MTLPixelFormatR16Snorm MTLPixelFormat = 22 // MTLPixelFormatR16Uint: Ordinary format with one 16-bit unsigned integer component. MTLPixelFormatR16Uint MTLPixelFormat = 23 // MTLPixelFormatR16Unorm: Ordinary format with one 16-bit normalized unsigned integer component. MTLPixelFormatR16Unorm MTLPixelFormat = 20 // MTLPixelFormatR32Float: Ordinary format with one 32-bit floating-point component. MTLPixelFormatR32Float MTLPixelFormat = 55 // MTLPixelFormatR32Sint: Ordinary format with one 32-bit signed integer component. MTLPixelFormatR32Sint MTLPixelFormat = 54 // MTLPixelFormatR32Uint: Ordinary format with one 32-bit unsigned integer component. MTLPixelFormatR32Uint MTLPixelFormat = 53 // MTLPixelFormatR8Sint: Ordinary format with one 8-bit signed integer component. MTLPixelFormatR8Sint MTLPixelFormat = 14 // MTLPixelFormatR8Snorm: Ordinary format with one 8-bit normalized signed integer component. MTLPixelFormatR8Snorm MTLPixelFormat = 12 // MTLPixelFormatR8Uint: Ordinary format with one 8-bit unsigned integer component. MTLPixelFormatR8Uint MTLPixelFormat = 13 // MTLPixelFormatR8Unorm: Ordinary format with one 8-bit normalized unsigned integer component. MTLPixelFormatR8Unorm MTLPixelFormat = 10 // MTLPixelFormatR8Unorm_sRGB: Ordinary format with one 8-bit normalized unsigned integer component with conversion between sRGB and linear space. MTLPixelFormatR8Unorm_sRGB MTLPixelFormat = 11 // MTLPixelFormatRG11B10Float: 32-bit format with floating-point color components, 11 bits each for red and green and 10 bits for blue. MTLPixelFormatRG11B10Float MTLPixelFormat = 92 // MTLPixelFormatRG16Float: Ordinary format with two 16-bit floating-point components. MTLPixelFormatRG16Float MTLPixelFormat = 65 // MTLPixelFormatRG16Sint: Ordinary format with two 16-bit signed integer components. MTLPixelFormatRG16Sint MTLPixelFormat = 64 // MTLPixelFormatRG16Snorm: Ordinary format with two 16-bit normalized signed integer components. MTLPixelFormatRG16Snorm MTLPixelFormat = 62 // MTLPixelFormatRG16Uint: Ordinary format with two 16-bit unsigned integer components. MTLPixelFormatRG16Uint MTLPixelFormat = 63 // MTLPixelFormatRG16Unorm: Ordinary format with two 16-bit normalized unsigned integer components. MTLPixelFormatRG16Unorm MTLPixelFormat = 60 // MTLPixelFormatRG32Float: Ordinary format with two 32-bit floating-point components. MTLPixelFormatRG32Float MTLPixelFormat = 105 // MTLPixelFormatRG32Sint: Ordinary format with two 32-bit signed integer components. MTLPixelFormatRG32Sint MTLPixelFormat = 104 // MTLPixelFormatRG32Uint: Ordinary format with two 32-bit unsigned integer components. MTLPixelFormatRG32Uint MTLPixelFormat = 103 // MTLPixelFormatRG8Sint: Ordinary format with two 8-bit signed integer components. MTLPixelFormatRG8Sint MTLPixelFormat = 34 // MTLPixelFormatRG8Snorm: Ordinary format with two 8-bit normalized signed integer components. MTLPixelFormatRG8Snorm MTLPixelFormat = 32 // MTLPixelFormatRG8Uint: Ordinary format with two 8-bit unsigned integer components. MTLPixelFormatRG8Uint MTLPixelFormat = 33 // MTLPixelFormatRG8Unorm: Ordinary format with two 8-bit normalized unsigned integer components. MTLPixelFormatRG8Unorm MTLPixelFormat = 30 // MTLPixelFormatRG8Unorm_sRGB: Ordinary format with two 8-bit normalized unsigned integer components with conversion between sRGB and linear space. MTLPixelFormatRG8Unorm_sRGB MTLPixelFormat = 31 // MTLPixelFormatRGB10A2Uint: A 32-bit packed pixel format with four unsigned integer components: 10-bit red, 10-bit green, 10-bit blue, and 2-bit alpha. MTLPixelFormatRGB10A2Uint MTLPixelFormat = 91 // MTLPixelFormatRGB10A2Unorm: A 32-bit packed pixel format with four normalized unsigned integer components: 10-bit red, 10-bit green, 10-bit blue, and 2-bit alpha. MTLPixelFormatRGB10A2Unorm MTLPixelFormat = 90 // MTLPixelFormatRGB9E5Float: Packed 32-bit format with floating-point color components: 9 bits each for RGB and 5 bits for an exponent shared by RGB, packed into 32 bits. MTLPixelFormatRGB9E5Float MTLPixelFormat = 93 // MTLPixelFormatRGBA16Float: Ordinary format with four 16-bit floating-point components in RGBA order. MTLPixelFormatRGBA16Float MTLPixelFormat = 115 // MTLPixelFormatRGBA16Sint: Ordinary format with four 16-bit signed integer components in RGBA order. MTLPixelFormatRGBA16Sint MTLPixelFormat = 114 // MTLPixelFormatRGBA16Snorm: Ordinary format with four 16-bit normalized signed integer components in RGBA order. MTLPixelFormatRGBA16Snorm MTLPixelFormat = 112 // MTLPixelFormatRGBA16Uint: Ordinary format with four 16-bit unsigned integer components in RGBA order. MTLPixelFormatRGBA16Uint MTLPixelFormat = 113 // MTLPixelFormatRGBA16Unorm: Ordinary format with four 16-bit normalized unsigned integer components in RGBA order. MTLPixelFormatRGBA16Unorm MTLPixelFormat = 110 // MTLPixelFormatRGBA32Float: Ordinary format with four 32-bit floating-point components in RGBA order. MTLPixelFormatRGBA32Float MTLPixelFormat = 125 // MTLPixelFormatRGBA32Sint: Ordinary format with four 32-bit signed integer components in RGBA order. MTLPixelFormatRGBA32Sint MTLPixelFormat = 124 // MTLPixelFormatRGBA32Uint: Ordinary format with four 32-bit unsigned integer components in RGBA order. MTLPixelFormatRGBA32Uint MTLPixelFormat = 123 // MTLPixelFormatRGBA8Sint: Ordinary format with four 8-bit signed integer components in RGBA order. MTLPixelFormatRGBA8Sint MTLPixelFormat = 74 // MTLPixelFormatRGBA8Snorm: Ordinary format with four 8-bit normalized signed integer components in RGBA order. MTLPixelFormatRGBA8Snorm MTLPixelFormat = 72 // MTLPixelFormatRGBA8Uint: Ordinary format with four 8-bit unsigned integer components in RGBA order. MTLPixelFormatRGBA8Uint MTLPixelFormat = 73 // MTLPixelFormatRGBA8Unorm: Ordinary format with four 8-bit normalized unsigned integer components in RGBA order. MTLPixelFormatRGBA8Unorm MTLPixelFormat = 70 // MTLPixelFormatRGBA8Unorm_sRGB: Ordinary format with four 8-bit normalized unsigned integer components in RGBA order with conversion between sRGB and linear space. MTLPixelFormatRGBA8Unorm_sRGB MTLPixelFormat = 71 // MTLPixelFormatStencil8: A pixel format with an 8-bit unsigned integer component, used for a stencil render target. MTLPixelFormatStencil8 MTLPixelFormat = 253 // MTLPixelFormatUnspecialized: # Discussion MTLPixelFormatUnspecialized MTLPixelFormat = 263 // MTLPixelFormatX24_Stencil8: A stencil pixel format used to read the stencil value from a texture with a combined 24-bit depth and 8-bit stencil value. MTLPixelFormatX24_Stencil8 MTLPixelFormat = 262 // MTLPixelFormatX32_Stencil8: A stencil pixel format used to read the stencil value from a texture with a combined 32-bit depth and 8-bit stencil value. MTLPixelFormatX32_Stencil8 MTLPixelFormat = 261 // Deprecated. MTLPixelFormatPVRTC_RGBA_2BPP MTLPixelFormat = 164 // Deprecated. MTLPixelFormatPVRTC_RGBA_2BPP_sRGB MTLPixelFormat = 165 // Deprecated. MTLPixelFormatPVRTC_RGBA_4BPP MTLPixelFormat = 166 // Deprecated. MTLPixelFormatPVRTC_RGBA_4BPP_sRGB MTLPixelFormat = 167 // Deprecated. MTLPixelFormatPVRTC_RGB_2BPP MTLPixelFormat = 160 // Deprecated. MTLPixelFormatPVRTC_RGB_2BPP_sRGB MTLPixelFormat = 161 // Deprecated. MTLPixelFormatPVRTC_RGB_4BPP MTLPixelFormat = 162 // Deprecated. MTLPixelFormatPVRTC_RGB_4BPP_sRGB MTLPixelFormat = 163 )
func (MTLPixelFormat) String ¶
func (e MTLPixelFormat) String() string
type MTLPointerType ¶
type MTLPointerType struct {
MTLType
}
A description of a pointer.
Describing the pointer elements ¶
- MTLPointerType.Alignment: The required byte alignment in memory for the element data.
- MTLPointerType.DataSize: The size, in bytes, of the element data.
- MTLPointerType.ElementType: The data type of the element data.
- MTLPointerType.Access: The function’s read/write access to the element data.
- MTLPointerType.ElementIsArgumentBuffer: A Boolean value that indicates whether the element is an argument buffer.
Obtaining details for complex pointer elements ¶
- MTLPointerType.ElementArrayType: Provides a description of the underlying array when the pointer points to an array.
- MTLPointerType.ElementStructType: Provides a description of the underlying struct when the pointer points to a struct.
See: https://developer.apple.com/documentation/Metal/MTLPointerType
func MTLPointerTypeFromID ¶
func MTLPointerTypeFromID(id objc.ID) MTLPointerType
MTLPointerTypeFromID constructs a MTLPointerType from an objc.ID.
A description of a pointer.
func NewMTLPointerType ¶
func NewMTLPointerType() MTLPointerType
NewMTLPointerType creates a new MTLPointerType instance.
func (MTLPointerType) Access ¶
func (p MTLPointerType) Access() MTLBindingAccess
The function’s read/write access to the element data.
See: https://developer.apple.com/documentation/Metal/MTLPointerType/access
func (MTLPointerType) Alignment ¶
func (p MTLPointerType) Alignment() uint
The required byte alignment in memory for the element data.
See: https://developer.apple.com/documentation/Metal/MTLPointerType/alignment
func (MTLPointerType) Autorelease ¶
func (p MTLPointerType) Autorelease() MTLPointerType
Autorelease adds the receiver to the current autorelease pool.
func (MTLPointerType) DataSize ¶
func (p MTLPointerType) DataSize() uint
The size, in bytes, of the element data.
See: https://developer.apple.com/documentation/Metal/MTLPointerType/dataSize
func (MTLPointerType) ElementArrayType ¶
func (p MTLPointerType) ElementArrayType() IMTLArrayType
Provides a description of the underlying array when the pointer points to an array.
Return Value ¶
An object that describes the array. If the pointer does not point to an array, this method returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLPointerType/elementArrayType()
func (MTLPointerType) ElementIsArgumentBuffer ¶
func (p MTLPointerType) ElementIsArgumentBuffer() bool
A Boolean value that indicates whether the element is an argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLPointerType/elementIsArgumentBuffer
func (MTLPointerType) ElementStructType ¶
func (p MTLPointerType) ElementStructType() IMTLStructType
Provides a description of the underlying struct when the pointer points to a struct.
Return Value ¶
An object that describes the struct. If the pointer does not point to an struct, this method returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLPointerType/elementStructType()
func (MTLPointerType) ElementType ¶
func (p MTLPointerType) ElementType() MTLDataType
The data type of the element data.
See: https://developer.apple.com/documentation/Metal/MTLPointerType/elementType
func (MTLPointerType) Init ¶
func (p MTLPointerType) Init() MTLPointerType
Init initializes the instance.
type MTLPointerTypeClass ¶
type MTLPointerTypeClass struct {
// contains filtered or unexported fields
}
func GetMTLPointerTypeClass ¶
func GetMTLPointerTypeClass() MTLPointerTypeClass
GetMTLPointerTypeClass returns the class object for MTLPointerType.
func (MTLPointerTypeClass) Alloc ¶
func (mc MTLPointerTypeClass) Alloc() MTLPointerType
Alloc allocates memory for a new instance of the class.
type MTLPrimitiveAccelerationStructureDescriptor ¶
type MTLPrimitiveAccelerationStructureDescriptor struct {
MTLAccelerationStructureDescriptor
}
A description of an acceleration structure that contains geometry primitives.
Overview ¶
Metal provides acceleration structures with a two-level hierarchy. The bottom layer consists of primitive acceleration structures, which instance acceleration structures in the top level reference.
Specifying geometry ¶
- MTLPrimitiveAccelerationStructureDescriptor.GeometryDescriptors: An array that contains the individual pieces of geometry that compose the acceleration structure.
- MTLPrimitiveAccelerationStructureDescriptor.SetGeometryDescriptors
Specifying motion behavior ¶
- MTLPrimitiveAccelerationStructureDescriptor.MotionKeyframeCount: The number of keyframes in the geometry data.
- MTLPrimitiveAccelerationStructureDescriptor.SetMotionKeyframeCount
- MTLPrimitiveAccelerationStructureDescriptor.MotionStartTime: The start time for the range of motion that the keyframe data describes.
- MTLPrimitiveAccelerationStructureDescriptor.SetMotionStartTime
- MTLPrimitiveAccelerationStructureDescriptor.MotionEndTime: The end time for the range of motion that the keyframe data describes.
- MTLPrimitiveAccelerationStructureDescriptor.SetMotionEndTime
- MTLPrimitiveAccelerationStructureDescriptor.MotionStartBorderMode: The mode to use when handling timestamps before the start time.
- MTLPrimitiveAccelerationStructureDescriptor.SetMotionStartBorderMode
- MTLPrimitiveAccelerationStructureDescriptor.MotionEndBorderMode: The mode to use when handling timestamps after the end time.
- MTLPrimitiveAccelerationStructureDescriptor.SetMotionEndBorderMode
See: https://developer.apple.com/documentation/Metal/MTLPrimitiveAccelerationStructureDescriptor
func MTLPrimitiveAccelerationStructureDescriptorFromID ¶
func MTLPrimitiveAccelerationStructureDescriptorFromID(id objc.ID) MTLPrimitiveAccelerationStructureDescriptor
MTLPrimitiveAccelerationStructureDescriptorFromID constructs a MTLPrimitiveAccelerationStructureDescriptor from an objc.ID.
A description of an acceleration structure that contains geometry primitives.
func NewMTLPrimitiveAccelerationStructureDescriptor ¶
func NewMTLPrimitiveAccelerationStructureDescriptor() MTLPrimitiveAccelerationStructureDescriptor
NewMTLPrimitiveAccelerationStructureDescriptor creates a new MTLPrimitiveAccelerationStructureDescriptor instance.
func (MTLPrimitiveAccelerationStructureDescriptor) Autorelease ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) Autorelease() MTLPrimitiveAccelerationStructureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLPrimitiveAccelerationStructureDescriptor) GeometryDescriptors ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) GeometryDescriptors() []MTLAccelerationStructureGeometryDescriptor
An array that contains the individual pieces of geometry that compose the acceleration structure.
Discussion ¶
The value of the [MotionKeyframeCount] property determines what kinds of geometry descriptors you can assign to this property and how you need to configure them.
If the value of [MotionKeyframeCount] is greater than 1, then the geometry descriptors need to be either MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor or MTLAccelerationStructureMotionTriangleGeometryDescriptor objects. Further, you need to provide exactly that many keyframes of data when creating those geometry descriptors. If [MotionKeyframeCount] is 1, use MTLAccelerationStructureBoundingBoxGeometryDescriptor or MTLAccelerationStructureTriangleGeometryDescriptor objects instead.
func (MTLPrimitiveAccelerationStructureDescriptor) Init ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) Init() MTLPrimitiveAccelerationStructureDescriptor
Init initializes the instance.
func (MTLPrimitiveAccelerationStructureDescriptor) MotionEndBorderMode ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) MotionEndBorderMode() MTLMotionBorderMode
The mode to use when handling timestamps after the end time.
Discussion ¶
The default value is [MotionBorderModeClamp].
func (MTLPrimitiveAccelerationStructureDescriptor) MotionEndTime ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) MotionEndTime() float32
The end time for the range of motion that the keyframe data describes.
Discussion ¶
The default value is `1.0f`.
func (MTLPrimitiveAccelerationStructureDescriptor) MotionKeyframeCount ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) MotionKeyframeCount() uint
The number of keyframes in the geometry data.
Discussion ¶
The default value is `1`. If the value is greater than `1`, all geometry descriptors that you attach to this descriptor need to be motion descriptors, and each needs to have exactly that many MTLMotionKeyframeData objects.
func (MTLPrimitiveAccelerationStructureDescriptor) MotionStartBorderMode ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) MotionStartBorderMode() MTLMotionBorderMode
The mode to use when handling timestamps before the start time.
Discussion ¶
The default value is [MotionBorderModeClamp].
func (MTLPrimitiveAccelerationStructureDescriptor) MotionStartTime ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) MotionStartTime() float32
The start time for the range of motion that the keyframe data describes.
Discussion ¶
The default value is `0.0f`.
func (MTLPrimitiveAccelerationStructureDescriptor) SetGeometryDescriptors ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) SetGeometryDescriptors(value []MTLAccelerationStructureGeometryDescriptor)
func (MTLPrimitiveAccelerationStructureDescriptor) SetMotionEndBorderMode ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionEndBorderMode(value MTLMotionBorderMode)
func (MTLPrimitiveAccelerationStructureDescriptor) SetMotionEndTime ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionEndTime(value float32)
func (MTLPrimitiveAccelerationStructureDescriptor) SetMotionKeyframeCount ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionKeyframeCount(value uint)
func (MTLPrimitiveAccelerationStructureDescriptor) SetMotionStartBorderMode ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionStartBorderMode(value MTLMotionBorderMode)
func (MTLPrimitiveAccelerationStructureDescriptor) SetMotionStartTime ¶
func (p MTLPrimitiveAccelerationStructureDescriptor) SetMotionStartTime(value float32)
type MTLPrimitiveAccelerationStructureDescriptorClass ¶
type MTLPrimitiveAccelerationStructureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLPrimitiveAccelerationStructureDescriptorClass ¶
func GetMTLPrimitiveAccelerationStructureDescriptorClass() MTLPrimitiveAccelerationStructureDescriptorClass
GetMTLPrimitiveAccelerationStructureDescriptorClass returns the class object for MTLPrimitiveAccelerationStructureDescriptor.
func (MTLPrimitiveAccelerationStructureDescriptorClass) Alloc ¶
func (mc MTLPrimitiveAccelerationStructureDescriptorClass) Alloc() MTLPrimitiveAccelerationStructureDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLPrimitiveAccelerationStructureDescriptorClass) Descriptor ¶
func (_MTLPrimitiveAccelerationStructureDescriptorClass MTLPrimitiveAccelerationStructureDescriptorClass) Descriptor() MTLPrimitiveAccelerationStructureDescriptor
Creates a new primitive descriptor.
type MTLPrimitiveTopologyClass ¶
type MTLPrimitiveTopologyClass int
See: https://developer.apple.com/documentation/Metal/MTLPrimitiveTopologyClass
const ( // MTLPrimitiveTopologyClassLine: A line primitive. MTLPrimitiveTopologyClassLine MTLPrimitiveTopologyClass = 2 // MTLPrimitiveTopologyClassPoint: A point primitive. MTLPrimitiveTopologyClassPoint MTLPrimitiveTopologyClass = 1 // MTLPrimitiveTopologyClassTriangle: A triangle primitive. MTLPrimitiveTopologyClassTriangle MTLPrimitiveTopologyClass = 3 // MTLPrimitiveTopologyClassUnspecified: An unspecified primitive. MTLPrimitiveTopologyClassUnspecified MTLPrimitiveTopologyClass = 0 )
func (MTLPrimitiveTopologyClass) String ¶
func (e MTLPrimitiveTopologyClass) String() string
type MTLPrimitiveType ¶
type MTLPrimitiveType int
See: https://developer.apple.com/documentation/Metal/MTLPrimitiveType
const ( // MTLPrimitiveTypeLine: Rasterize a line between each separate pair of vertices, resulting in a series of unconnected lines. MTLPrimitiveTypeLine MTLPrimitiveType = 1 // MTLPrimitiveTypeLineStrip: Rasterize a line between each pair of adjacent vertices, resulting in a series of connected lines (also called a polyline). MTLPrimitiveTypeLineStrip MTLPrimitiveType = 2 // MTLPrimitiveTypePoint: Rasterize a point at each vertex. MTLPrimitiveTypePoint MTLPrimitiveType = 0 // MTLPrimitiveTypeTriangle: For every separate set of three vertices, rasterize a triangle. MTLPrimitiveTypeTriangle MTLPrimitiveType = 3 // MTLPrimitiveTypeTriangleStrip: For every three adjacent vertices, rasterize a triangle. MTLPrimitiveTypeTriangleStrip MTLPrimitiveType = 4 )
func (MTLPrimitiveType) String ¶
func (e MTLPrimitiveType) String() string
type MTLPurgeableState ¶
type MTLPurgeableState int
See: https://developer.apple.com/documentation/Metal/MTLPurgeableState
const ( // MTLPurgeableStateEmpty: A state that indicates to the system that it needs to consider the contents of a resource as invalid, typically because you’re discarding it. MTLPurgeableStateEmpty MTLPurgeableState = 4 // MTLPurgeableStateKeepCurrent: The current state is queried but doesn’t change. MTLPurgeableStateKeepCurrent MTLPurgeableState = 1 // MTLPurgeableStateNonVolatile: The contents of the resource aren’t allowed to be discarded. MTLPurgeableStateNonVolatile MTLPurgeableState = 2 // MTLPurgeableStateVolatile: The system is allowed to discard the resource to free up memory. MTLPurgeableStateVolatile MTLPurgeableState = 3 )
func (MTLPurgeableState) String ¶
func (e MTLPurgeableState) String() string
type MTLQuadTessellationFactorsHalf ¶
type MTLQuadTessellationFactorsHalf struct {
EdgeTessellationFactor uint16 // The edge tessellation factors, with each index value providing the tessellation factor for a particular edge.
InsideTessellationFactor uint16 // The inside tessellation factors, with the value in index 0 providing the horizontal tessellation factor and the value in index 1 providing the vertical tessellation factor.
}
MTLQuadTessellationFactorsHalf - The per-patch tessellation factors for a quad patch.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLQuadTessellationFactorsHalf
type MTLRasterizationRateLayerArray ¶
type MTLRasterizationRateLayerArray struct {
objectivec.Object
}
Descriptions for the rasterization rates to apply to the set of layers in a rate map.
Accessing members of the array ¶
- MTLRasterizationRateLayerArray.ObjectAtIndexedSubscript: Retrieves the sample value at the specified index.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerArray
func MTLRasterizationRateLayerArrayFromID ¶
func MTLRasterizationRateLayerArrayFromID(id objc.ID) MTLRasterizationRateLayerArray
MTLRasterizationRateLayerArrayFromID constructs a MTLRasterizationRateLayerArray from an objc.ID.
Descriptions for the rasterization rates to apply to the set of layers in a rate map.
func NewMTLRasterizationRateLayerArray ¶
func NewMTLRasterizationRateLayerArray() MTLRasterizationRateLayerArray
NewMTLRasterizationRateLayerArray creates a new MTLRasterizationRateLayerArray instance.
func (MTLRasterizationRateLayerArray) Autorelease ¶
func (r MTLRasterizationRateLayerArray) Autorelease() MTLRasterizationRateLayerArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLRasterizationRateLayerArray) Init ¶
func (r MTLRasterizationRateLayerArray) Init() MTLRasterizationRateLayerArray
Init initializes the instance.
func (MTLRasterizationRateLayerArray) LayerCount ¶
func (r MTLRasterizationRateLayerArray) LayerCount() int
The number of layers in the rate map.
See: https://developer.apple.com/documentation/metal/mtlrasterizationratemapdescriptor/layercount
func (MTLRasterizationRateLayerArray) Layers ¶
func (r MTLRasterizationRateLayerArray) Layers() IMTLRasterizationRateLayerArray
The rasterization rates for one or more layers in the rate map.
See: https://developer.apple.com/documentation/metal/mtlrasterizationratemapdescriptor/layers
func (MTLRasterizationRateLayerArray) ObjectAtIndexedSubscript ¶
func (r MTLRasterizationRateLayerArray) ObjectAtIndexedSubscript(layerIndex uint) IMTLRasterizationRateLayerDescriptor
Retrieves the sample value at the specified index.
layerIndex: The index of the sample you want to retrieve.
Return Value ¶
An NSNumber instance describing the value of the sample at the specified index, or `0` if the index is out of range.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerArray/subscript(_:)
func (MTLRasterizationRateLayerArray) SetLayerCount ¶
func (r MTLRasterizationRateLayerArray) SetLayerCount(value int)
func (MTLRasterizationRateLayerArray) SetLayers ¶
func (r MTLRasterizationRateLayerArray) SetLayers(value IMTLRasterizationRateLayerArray)
func (MTLRasterizationRateLayerArray) SetObjectAtIndexedSubscript ¶
func (r MTLRasterizationRateLayerArray) SetObjectAtIndexedSubscript(layer IMTLRasterizationRateLayerDescriptor, layerIndex uint)
Stores a sample value at the specified index.
layer: The layer descriptor to set
layerIndex: The index of the sample you want to set.
Discussion ¶
The method converts the value to a single precision floating point value.
type MTLRasterizationRateLayerArrayClass ¶
type MTLRasterizationRateLayerArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLRasterizationRateLayerArrayClass ¶
func GetMTLRasterizationRateLayerArrayClass() MTLRasterizationRateLayerArrayClass
GetMTLRasterizationRateLayerArrayClass returns the class object for MTLRasterizationRateLayerArray.
func (MTLRasterizationRateLayerArrayClass) Alloc ¶
func (mc MTLRasterizationRateLayerArrayClass) Alloc() MTLRasterizationRateLayerArray
Alloc allocates memory for a new instance of the class.
type MTLRasterizationRateLayerDescriptor ¶
type MTLRasterizationRateLayerDescriptor struct {
objectivec.Object
}
The minimum rasterization rates to apply to sections of a layer in the render target.
Overview ¶
Use a layer map to divide the logical viewport coordinate system into a 2D grid of equal-sized rectangles, and choose different rasterization rates for each cell.
Specify rasterization rates using floating-point numbers between `0.0` and `1.0`, inclusive. A rate of `1.0` represents the normal rasterization rate, where each logical unit is equal to a physical pixel; a rate of `0.5` means that two logical units equate to one physical pixel, and so on. A value of `0.0` means that the GPU renders at its lowest quality level. When you create the map, the device object chooses the nearest rasterization rate supported by the GPU that meets or exceeds the rate you specified.
In the layer map, you provide separate rasterization rates for the grid’s rows and columns. The horizontal rates specify a horizontal rasterization rate for each column, and the vertical rates specify a vertical rasterization rate for each row. Each cell calculates its physical size in pixels by using the logical size of cells in the map, the horizontal rate from the cell’s column, and the vertical rate from its row.
Creating a layer rasterization rate descriptor ¶
- MTLRasterizationRateLayerDescriptor.InitWithSampleCount: Initializes the layer map with an empty grid.
Inspecting the layer rate function parameters ¶
- MTLRasterizationRateLayerDescriptor.SampleCount: The number of rows and columns in the layer map.
- MTLRasterizationRateLayerDescriptor.MaxSampleCount: The maximum number of rows and columns in the layer map.
- MTLRasterizationRateLayerDescriptor.Horizontal: The horizontal rasterization rates for the layer map’s rows.
- MTLRasterizationRateLayerDescriptor.Vertical: The vertical rasterization rates for the layer map’s rows.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerDescriptor
func MTLRasterizationRateLayerDescriptorFromID ¶
func MTLRasterizationRateLayerDescriptorFromID(id objc.ID) MTLRasterizationRateLayerDescriptor
MTLRasterizationRateLayerDescriptorFromID constructs a MTLRasterizationRateLayerDescriptor from an objc.ID.
The minimum rasterization rates to apply to sections of a layer in the render target.
func NewMTLRasterizationRateLayerDescriptor ¶
func NewMTLRasterizationRateLayerDescriptor() MTLRasterizationRateLayerDescriptor
NewMTLRasterizationRateLayerDescriptor creates a new MTLRasterizationRateLayerDescriptor instance.
func NewRasterizationRateLayerDescriptorWithSampleCount ¶
func NewRasterizationRateLayerDescriptorWithSampleCount(sampleCount MTLSize) MTLRasterizationRateLayerDescriptor
Initializes the layer map with an empty grid.
sampleCount: The size of the grid. Specify the width and height to determine the number of columns and rows in the layer map. The initializer ignores the depth component.
Return Value ¶
A layer descriptor with a grid of the specified size. All of the rasterization rates are set to `0.0`.
func NewRasterizationRateLayerDescriptorWithSampleCountHorizontalVertical ¶
func NewRasterizationRateLayerDescriptorWithSampleCountHorizontalVertical(sampleCount MTLSize, horizontal unsafe.Pointer, vertical unsafe.Pointer) MTLRasterizationRateLayerDescriptor
Initializes the layer map with the provided grid size and rasterization rates.
sampleCount: The size of the grid. Specify the width and height to determine the number of columns and rows in the layer map. The initializer ignores the depth component.
horizontal: The rasterization rates for the layer map’s columns. There needs to be at least as many samples as the width you specified in `sampleCount`.
vertical: The rasterization rates for the layer map’s columns. There needs to be at least as many samples as the height you specified in `sampleCount`.
Return Value ¶
A layer descriptor with a grid of the specified size. The layer descriptor copies the rasterization rates.
func (MTLRasterizationRateLayerDescriptor) Autorelease ¶
func (r MTLRasterizationRateLayerDescriptor) Autorelease() MTLRasterizationRateLayerDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRasterizationRateLayerDescriptor) Horizontal ¶
func (r MTLRasterizationRateLayerDescriptor) Horizontal() IMTLRasterizationRateSampleArray
The horizontal rasterization rates for the layer map’s rows.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerDescriptor/horizontal
func (MTLRasterizationRateLayerDescriptor) HorizontalSampleStorage ¶
func (r MTLRasterizationRateLayerDescriptor) HorizontalSampleStorage() unsafe.Pointer
A pointer to the storage for the layer map’s horizontal rasterization rates.
Discussion ¶
Points to the first element in the array of horizontal rasterization rates. The number of elements is equal to the width value of [SampleCount].
func (MTLRasterizationRateLayerDescriptor) InitWithSampleCount ¶
func (r MTLRasterizationRateLayerDescriptor) InitWithSampleCount(sampleCount MTLSize) MTLRasterizationRateLayerDescriptor
Initializes the layer map with an empty grid.
sampleCount: The size of the grid. Specify the width and height to determine the number of columns and rows in the layer map. The initializer ignores the depth component.
Return Value ¶
A layer descriptor with a grid of the specified size. All of the rasterization rates are set to `0.0`.
func (MTLRasterizationRateLayerDescriptor) InitWithSampleCountHorizontalVertical ¶
func (r MTLRasterizationRateLayerDescriptor) InitWithSampleCountHorizontalVertical(sampleCount MTLSize, horizontal unsafe.Pointer, vertical unsafe.Pointer) MTLRasterizationRateLayerDescriptor
Initializes the layer map with the provided grid size and rasterization rates.
sampleCount: The size of the grid. Specify the width and height to determine the number of columns and rows in the layer map. The initializer ignores the depth component.
horizontal: The rasterization rates for the layer map’s columns. There needs to be at least as many samples as the width you specified in `sampleCount`.
vertical: The rasterization rates for the layer map’s columns. There needs to be at least as many samples as the height you specified in `sampleCount`.
Return Value ¶
A layer descriptor with a grid of the specified size. The layer descriptor copies the rasterization rates.
func (MTLRasterizationRateLayerDescriptor) MaxSampleCount ¶
func (r MTLRasterizationRateLayerDescriptor) MaxSampleCount() MTLSize
The maximum number of rows and columns in the layer map.
Discussion ¶
Its depth value is always `0`.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerDescriptor/maxSampleCount
func (MTLRasterizationRateLayerDescriptor) SampleCount ¶
func (r MTLRasterizationRateLayerDescriptor) SampleCount() MTLSize
The number of rows and columns in the layer map.
Discussion ¶
The [SampleCount] property splits the logical viewport coordinate space into a 2D grid of equal-sized cells. Its depth value is always `0`.
The default value is the same as [MaxSampleCount].
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerDescriptor/sampleCount
func (MTLRasterizationRateLayerDescriptor) Vertical ¶
func (r MTLRasterizationRateLayerDescriptor) Vertical() IMTLRasterizationRateSampleArray
The vertical rasterization rates for the layer map’s rows.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateLayerDescriptor/vertical
func (MTLRasterizationRateLayerDescriptor) VerticalSampleStorage ¶
func (r MTLRasterizationRateLayerDescriptor) VerticalSampleStorage() unsafe.Pointer
A pointer to the storage for the layer map’s vertical rasterization rates.
Discussion ¶
Points to the first element in the array of vertical rasterization rates. The number of elements is equal to the height value of [SampleCount].
type MTLRasterizationRateLayerDescriptorClass ¶
type MTLRasterizationRateLayerDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRasterizationRateLayerDescriptorClass ¶
func GetMTLRasterizationRateLayerDescriptorClass() MTLRasterizationRateLayerDescriptorClass
GetMTLRasterizationRateLayerDescriptorClass returns the class object for MTLRasterizationRateLayerDescriptor.
func (MTLRasterizationRateLayerDescriptorClass) Alloc ¶
func (mc MTLRasterizationRateLayerDescriptorClass) Alloc() MTLRasterizationRateLayerDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRasterizationRateMap ¶
type MTLRasterizationRateMap interface {
objectivec.IObject
// The device object that created the rate map.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/device
Device() MTLDevice
// A string that identifies the rate map.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/label
Label() string
// The number of layers in the rate map.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/layerCount
LayerCount() uint
// The logical size, in pixels, of the viewport coordinate system.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/screenSize
ScreenSize() MTLSize
// Returns the dimensions, in pixels, of the area in the render target affected by the rasterization rate map.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/physicalSize(layer:)
PhysicalSizeForLayer(layerIndex uint) MTLSize
// The granularity, in physical pixels, at which the rasterization rate varies.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/physicalGranularity
PhysicalGranularity() MTLSize
// Converts a point in logical viewport coordinates to the corresponding physical coordinates in a render layer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/physicalCoordinates(screenCoordinates:layer:)
MapScreenToPhysicalCoordinatesForLayer(screenCoordinates MTLCoordinate2D, layerIndex uint) MTLCoordinate2D
// Converts a point in physical coordinates inside a layer to its corresponding logical viewport coordinates.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/screenCoordinates(physicalCoordinates:layer:)
MapPhysicalToScreenCoordinatesForLayer(physicalCoordinates MTLCoordinate2D, layerIndex uint) MTLCoordinate2D
// The size and alignment requirements to contain the coordinate transformation information in this rate map.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/parameterDataSizeAndAlign
ParameterBufferSizeAndAlign() MTLSizeAndAlign
// Copies the parameter data into the provided buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/copyParameterData(buffer:offset:)
CopyParameterDataToBufferOffset(buffer MTLBuffer, offset uint)
}
A compiled read-only instance that determines how to apply variable rasterization rates when rendering.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap
type MTLRasterizationRateMapDescriptor ¶
type MTLRasterizationRateMapDescriptor struct {
objectivec.Object
}
An object that you use to configure new rasterization rate maps.
Overview ¶
To create a new rate map, first create an MTLRasterizationRateMapDescriptor instance and set its property values. Then, create a new rasterization rate-map by calling an MTLDevice instance’s [NewRasterizationRateMapWithDescriptor] method.
When creating a rate map, Metal copies into it property values from the descriptor. You can reuse a descrptor by modifying its property values, which doesn’t affect the other rate-map instances that already exist.
Identifying the rate map ¶
- MTLRasterizationRateMapDescriptor.Label: A string used to identify the rate map you create with the descriptor.
- MTLRasterizationRateMapDescriptor.SetLabel
Configuring the viewport size ¶
- MTLRasterizationRateMapDescriptor.ScreenSize: The size of the viewport coordinate system, in logical pixels.
- MTLRasterizationRateMapDescriptor.SetScreenSize
Configuring the rate map layers ¶
- MTLRasterizationRateMapDescriptor.LayerCount: The number of layers in the rate map.
- MTLRasterizationRateMapDescriptor.LayerAtIndex: Returns the layer description for a layer in the rate map.
- MTLRasterizationRateMapDescriptor.SetLayerAtIndex: Sets a configuration for a layer rate map.
- MTLRasterizationRateMapDescriptor.Layers: The rasterization rates for one or more layers in the rate map.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor
func MTLRasterizationRateMapDescriptorFromID ¶
func MTLRasterizationRateMapDescriptorFromID(id objc.ID) MTLRasterizationRateMapDescriptor
MTLRasterizationRateMapDescriptorFromID constructs a MTLRasterizationRateMapDescriptor from an objc.ID.
An object that you use to configure new rasterization rate maps.
func NewMTLRasterizationRateMapDescriptor ¶
func NewMTLRasterizationRateMapDescriptor() MTLRasterizationRateMapDescriptor
NewMTLRasterizationRateMapDescriptor creates a new MTLRasterizationRateMapDescriptor instance.
func (MTLRasterizationRateMapDescriptor) Autorelease ¶
func (r MTLRasterizationRateMapDescriptor) Autorelease() MTLRasterizationRateMapDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRasterizationRateMapDescriptor) Init ¶
func (r MTLRasterizationRateMapDescriptor) Init() MTLRasterizationRateMapDescriptor
Init initializes the instance.
func (MTLRasterizationRateMapDescriptor) Label ¶
func (r MTLRasterizationRateMapDescriptor) Label() string
A string used to identify the rate map you create with the descriptor.
Discussion ¶
Object and command labels are useful identifiers at runtime or when profiling and debugging your app using any Metal tool. See Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor/label
func (MTLRasterizationRateMapDescriptor) LayerAtIndex ¶
func (r MTLRasterizationRateMapDescriptor) LayerAtIndex(layerIndex uint) IMTLRasterizationRateLayerDescriptor
Returns the layer description for a layer in the rate map.
layerIndex: The entry to return.
Return Value ¶
The MTLRasterizationRateLayerDescriptor instance for the given index, or `nil` if you haven’t set an instance for this index.
Discussion ¶
Calling this method is equivalent to using array subscript syntax.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor/layer(at:)
func (MTLRasterizationRateMapDescriptor) LayerCount ¶
func (r MTLRasterizationRateMapDescriptor) LayerCount() uint
The number of layers in the rate map.
Discussion ¶
The value of this property is dynamically determined based on how many layers you’ve added to the descriptor. To add a new layer, call [SetLayerAtIndex] or use the subscripting operator to assign a layer.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor/layerCount
func (MTLRasterizationRateMapDescriptor) Layers ¶
func (r MTLRasterizationRateMapDescriptor) Layers() IMTLRasterizationRateLayerArray
The rasterization rates for one or more layers in the rate map.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor/layers
func (MTLRasterizationRateMapDescriptor) ScreenSize ¶
func (r MTLRasterizationRateMapDescriptor) ScreenSize() MTLSize
The size of the viewport coordinate system, in logical pixels.
Discussion ¶
Metal ignores the depth component of this property.
The viewport coordinate system’s origin is always at `(0,0)` and this property determines its size.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor/screenSize
func (MTLRasterizationRateMapDescriptor) SetLabel ¶
func (r MTLRasterizationRateMapDescriptor) SetLabel(value string)
func (MTLRasterizationRateMapDescriptor) SetLayerAtIndex ¶
func (r MTLRasterizationRateMapDescriptor) SetLayerAtIndex(layer IMTLRasterizationRateLayerDescriptor, layerIndex uint)
Sets a configuration for a layer rate map.
layer: A description of a layer to add to the rate map descriptor. Use `nil` to remove the layer at that index.
layerIndex: The index to put the new layer description in.
Discussion ¶
Calling this method is equivalent to using array subscript syntax.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMapDescriptor/setLayer(_:at:)
func (MTLRasterizationRateMapDescriptor) SetScreenSize ¶
func (r MTLRasterizationRateMapDescriptor) SetScreenSize(value MTLSize)
type MTLRasterizationRateMapDescriptorClass ¶
type MTLRasterizationRateMapDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRasterizationRateMapDescriptorClass ¶
func GetMTLRasterizationRateMapDescriptorClass() MTLRasterizationRateMapDescriptorClass
GetMTLRasterizationRateMapDescriptorClass returns the class object for MTLRasterizationRateMapDescriptor.
func (MTLRasterizationRateMapDescriptorClass) Alloc ¶
func (mc MTLRasterizationRateMapDescriptorClass) Alloc() MTLRasterizationRateMapDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSize ¶
func (_MTLRasterizationRateMapDescriptorClass MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSize(screenSize MTLSize) MTLRasterizationRateMapDescriptor
Creates a rate map descriptor with a given size and identifier.
screenSize: The logical size, in pixels, of the viewport coordinate system.
Return Value ¶
A descriptor object whose [ScreenSize] is set to the provided size. You need to add at least one layer rate map to the descriptor.
func (MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSizeLayer ¶
func (_MTLRasterizationRateMapDescriptorClass MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSizeLayer(screenSize MTLSize, layer IMTLRasterizationRateLayerDescriptor) MTLRasterizationRateMapDescriptor
Creates a rate map descriptor with a single rate layer.
screenSize: The logical size, in pixels, of the viewport coordinate system.
layer: A descriptor for the rate layer to create.
Return Value ¶
A descriptor object whose [ScreenSize] is set to the provided size. Layer 0 in the rate map is set to the provided layer descriptor.
func (MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSizeLayerCountLayers ¶
func (_MTLRasterizationRateMapDescriptorClass MTLRasterizationRateMapDescriptorClass) RasterizationRateMapDescriptorWithScreenSizeLayerCountLayers(screenSize MTLSize, layerCount uint, layers IMTLRasterizationRateLayerDescriptor) MTLRasterizationRateMapDescriptor
Creates a rate map descriptor with a set of layer descriptors.
screenSize: The logical size, in pixels, of the viewport coordinate system.
layerCount: The number of array elements in `layers`.
layers: An array of rate layer descriptors for the rate map’s layers.
Return Value ¶
A descriptor object whose [ScreenSize] is set to the provided size and whose rate map layers are set to the array you provided.
type MTLRasterizationRateMapObject ¶
type MTLRasterizationRateMapObject struct {
objectivec.Object
}
MTLRasterizationRateMapObject wraps an existing Objective-C object that conforms to the MTLRasterizationRateMap protocol.
func MTLRasterizationRateMapObjectFromID ¶
func MTLRasterizationRateMapObjectFromID(id objc.ID) MTLRasterizationRateMapObject
MTLRasterizationRateMapObjectFromID constructs a MTLRasterizationRateMapObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLRasterizationRateMapObject) BaseObject ¶
func (o MTLRasterizationRateMapObject) BaseObject() objectivec.Object
func (MTLRasterizationRateMapObject) CopyParameterDataToBufferOffset ¶
func (o MTLRasterizationRateMapObject) CopyParameterDataToBufferOffset(buffer MTLBuffer, offset uint)
Copies the parameter data into the provided buffer.
buffer: The buffer instance to copy the data into. It needs to have an [StorageModeShared] storage mode, and there needs to be enough room in the buffer to store the data.
offset: The location in the buffer to copy the data to. The offset needs to be a multiple of the parameter alignment.
Discussion ¶
To convert coordinate values inside your shader, pass the rate map data into the shader in an MTLBuffer instance. The [ParameterBufferSizeAndAlign] property provides the size and alignment requirements for the buffer.
You can convert between screen space and physical fragment space by binding the buffer to the shader with type `rasterization_rate_map_data`, then constructing `rasterization_rate_map_decoder` with the buffer data. For more details, see the “Variable Rasterization Rate” section of the Metal Shading Language Specification.
func (MTLRasterizationRateMapObject) Device ¶
func (o MTLRasterizationRateMapObject) Device() MTLDevice
The device object that created the rate map.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/device
func (MTLRasterizationRateMapObject) Label ¶
func (o MTLRasterizationRateMapObject) Label() string
A string that identifies the rate map.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/label
func (MTLRasterizationRateMapObject) LayerCount ¶
func (o MTLRasterizationRateMapObject) LayerCount() uint
The number of layers in the rate map.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/layerCount
func (MTLRasterizationRateMapObject) MapPhysicalToScreenCoordinatesForLayer ¶
func (o MTLRasterizationRateMapObject) MapPhysicalToScreenCoordinatesForLayer(physicalCoordinates MTLCoordinate2D, layerIndex uint) MTLCoordinate2D
Converts a point in physical coordinates inside a layer to its corresponding logical viewport coordinates.
physicalCoordinates: A point in layer coordinates.
layerIndex: The index of the rate map to use.
Return Value ¶
A point in the view coordinates corresponding to the source point.
Discussion ¶
The returned coordinates are always greater than or equal to the input coordinates because the rasterization rate never exceeds 1:1 in any region.
func (MTLRasterizationRateMapObject) MapScreenToPhysicalCoordinatesForLayer ¶
func (o MTLRasterizationRateMapObject) MapScreenToPhysicalCoordinatesForLayer(screenCoordinates MTLCoordinate2D, layerIndex uint) MTLCoordinate2D
Converts a point in logical viewport coordinates to the corresponding physical coordinates in a render layer.
screenCoordinates: A point in viewport coordinates.
layerIndex: The index of the rate map to use.
Return Value ¶
A point in the layer’s physical coordinate system corresponding to the source point.
Discussion ¶
The returned coordinates are always less than or equal to the input coordinates because the rasterization rate never exceeds 1:1 in any region.
func (MTLRasterizationRateMapObject) ParameterBufferSizeAndAlign ¶
func (o MTLRasterizationRateMapObject) ParameterBufferSizeAndAlign() MTLSizeAndAlign
The size and alignment requirements to contain the coordinate transformation information in this rate map.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/parameterDataSizeAndAlign
func (MTLRasterizationRateMapObject) PhysicalGranularity ¶
func (o MTLRasterizationRateMapObject) PhysicalGranularity() MTLSize
The granularity, in physical pixels, at which the rasterization rate varies.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/physicalGranularity
func (MTLRasterizationRateMapObject) PhysicalSizeForLayer ¶
func (o MTLRasterizationRateMapObject) PhysicalSizeForLayer(layerIndex uint) MTLSize
Returns the dimensions, in pixels, of the area in the render target affected by the rasterization rate map.
layerIndex: The index of the layer.
Return Value ¶
The dimensions, in pixels, of the area in the render target affected by the rasterization rate map.
Discussion ¶
Your render targets should be at least as large as the physical size returned by this method. Each layer may have different rasterization rates and therefore different physical size requirements.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/physicalSize(layer:)
func (MTLRasterizationRateMapObject) ScreenSize ¶
func (o MTLRasterizationRateMapObject) ScreenSize() MTLSize
The logical size, in pixels, of the viewport coordinate system.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateMap/screenSize
type MTLRasterizationRateSampleArray ¶
type MTLRasterizationRateSampleArray struct {
objectivec.Object
}
An array instance that contains rasterization rates.
Overview ¶
The MTLRasterizationRateSampleArray.Horizontal and MTLRasterizationRateSampleArray.Vertical properties of an MTLRasterizationRateLayerDescriptor point to MTLRasterizationRateSampleArray instances that contains rasterization rates for the layer map. You can use array subscript syntax to access the samples. MTLRasterizationRateSampleArray instances perform bounds checking on any memory operations you make to their sample data.
See: https://developer.apple.com/documentation/Metal/MTLRasterizationRateSampleArray
func MTLRasterizationRateSampleArrayFromID ¶
func MTLRasterizationRateSampleArrayFromID(id objc.ID) MTLRasterizationRateSampleArray
MTLRasterizationRateSampleArrayFromID constructs a MTLRasterizationRateSampleArray from an objc.ID.
An array instance that contains rasterization rates.
func NewMTLRasterizationRateSampleArray ¶
func NewMTLRasterizationRateSampleArray() MTLRasterizationRateSampleArray
NewMTLRasterizationRateSampleArray creates a new MTLRasterizationRateSampleArray instance.
func (MTLRasterizationRateSampleArray) Autorelease ¶
func (r MTLRasterizationRateSampleArray) Autorelease() MTLRasterizationRateSampleArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLRasterizationRateSampleArray) Horizontal ¶
func (r MTLRasterizationRateSampleArray) Horizontal() IMTLRasterizationRateSampleArray
The horizontal rasterization rates for the layer map’s rows.
See: https://developer.apple.com/documentation/metal/mtlrasterizationratelayerdescriptor/horizontal
func (MTLRasterizationRateSampleArray) Init ¶
func (r MTLRasterizationRateSampleArray) Init() MTLRasterizationRateSampleArray
Init initializes the instance.
func (MTLRasterizationRateSampleArray) MaxSampleCount ¶
func (r MTLRasterizationRateSampleArray) MaxSampleCount() MTLSize
The maximum number of rows and columns in the layer map.
See: https://developer.apple.com/documentation/metal/mtlrasterizationratelayerdescriptor/maxsamplecount
func (MTLRasterizationRateSampleArray) ObjectAtIndexedSubscript ¶
func (r MTLRasterizationRateSampleArray) ObjectAtIndexedSubscript(index uint) foundation.NSNumber
Retrieves the sample value at the specified index.
index: The index of the element to retrieve.
Return Value ¶
An NSNumber object. It contains the value of the sample at the specified index or `0` if the index you specified is out of bounds.
func (MTLRasterizationRateSampleArray) SampleCount ¶
func (r MTLRasterizationRateSampleArray) SampleCount() MTLSize
The number of rows and columns in the layer map.
See: https://developer.apple.com/documentation/metal/mtlrasterizationratelayerdescriptor/samplecount
func (MTLRasterizationRateSampleArray) SetHorizontal ¶
func (r MTLRasterizationRateSampleArray) SetHorizontal(value IMTLRasterizationRateSampleArray)
func (MTLRasterizationRateSampleArray) SetMaxSampleCount ¶
func (r MTLRasterizationRateSampleArray) SetMaxSampleCount(value MTLSize)
func (MTLRasterizationRateSampleArray) SetObjectAtIndexedSubscript ¶
func (r MTLRasterizationRateSampleArray) SetObjectAtIndexedSubscript(value foundation.NSNumber, index uint)
Stores a sample value at the specified index.
value: The new value to set.
index: The index of the element you want to set.
Discussion ¶
The method converts the value to a single precision floating-point value. If the index you specified is out of bounds, this method does nothing.
func (MTLRasterizationRateSampleArray) SetSampleCount ¶
func (r MTLRasterizationRateSampleArray) SetSampleCount(value MTLSize)
func (MTLRasterizationRateSampleArray) SetVertical ¶
func (r MTLRasterizationRateSampleArray) SetVertical(value IMTLRasterizationRateSampleArray)
func (MTLRasterizationRateSampleArray) Vertical ¶
func (r MTLRasterizationRateSampleArray) Vertical() IMTLRasterizationRateSampleArray
The vertical rasterization rates for the layer map’s rows.
See: https://developer.apple.com/documentation/metal/mtlrasterizationratelayerdescriptor/vertical
type MTLRasterizationRateSampleArrayClass ¶
type MTLRasterizationRateSampleArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLRasterizationRateSampleArrayClass ¶
func GetMTLRasterizationRateSampleArrayClass() MTLRasterizationRateSampleArrayClass
GetMTLRasterizationRateSampleArrayClass returns the class object for MTLRasterizationRateSampleArray.
func (MTLRasterizationRateSampleArrayClass) Alloc ¶
func (mc MTLRasterizationRateSampleArrayClass) Alloc() MTLRasterizationRateSampleArray
Alloc allocates memory for a new instance of the class.
type MTLReadWriteTextureTier ¶
type MTLReadWriteTextureTier int
See: https://developer.apple.com/documentation/Metal/MTLReadWriteTextureTier
const ( // MTLReadWriteTextureTier1: Indicates the system supports tier 1 read-write textures. MTLReadWriteTextureTier1 MTLReadWriteTextureTier = 1 // MTLReadWriteTextureTier2: Indicates the system supports tier 2 read-write textures. MTLReadWriteTextureTier2 MTLReadWriteTextureTier = 2 // MTLReadWriteTextureTierNone: Indicates the system doesn’t support read-write textures. MTLReadWriteTextureTierNone MTLReadWriteTextureTier = 0 )
func (MTLReadWriteTextureTier) String ¶
func (e MTLReadWriteTextureTier) String() string
type MTLRegion ¶
type MTLRegion struct {
Origin MTLOrigin // The coordinates of the front upper-left corner of the region.
Size MTLSize // The dimensions of the region.
}
MTLRegion - The bounds for a subset of an instance’s elements.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLRegion
type MTLRenderCommandEncoder ¶
type MTLRenderCommandEncoder interface {
objectivec.IObject
MTLCommandEncoder
// Encodes a draw command that renders an instance of a geometric primitive.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawPrimitives(type:vertexStart:vertexCount:)
DrawPrimitivesVertexStartVertexCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint)
// Encodes a draw command that renders multiple instances of a geometric primitive.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawPrimitives(type:vertexStart:vertexCount:instanceCount:)
DrawPrimitivesVertexStartVertexCountInstanceCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint)
// Encodes a draw command that renders multiple instances of a geometric primitive that starts with a custom instance identification number.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawPrimitives(type:vertexStart:vertexCount:instanceCount:baseInstance:)
DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint, baseInstance uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawPrimitives(type:indirectBuffer:indirectBufferOffset:)
DrawPrimitivesIndirectBufferIndirectBufferOffset(primitiveType MTLPrimitiveType, indirectBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes a draw command that renders an instance of a geometric primitive with indexed vertices.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawIndexedPrimitives(type:indexCount:indexType:indexBuffer:indexBufferOffset:)
DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffset(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawIndexedPrimitives(type:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:)
DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCount(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, instanceCount uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices, starting with a custom vertex and instance.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawIndexedPrimitives(type:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:)
DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, instanceCount uint, baseVertex int, baseInstance uint)
// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices and indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawIndexedPrimitives(type:indexType:indexBuffer:indexBufferOffset:indirectBuffer:indirectBufferOffset:)
DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferOffsetIndirectBufferIndirectBufferOffset(primitiveType MTLPrimitiveType, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, indirectBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threads.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawMeshThreads(_:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threadgroups.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawMeshThreadgroups(_:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// Encodes a draw command that invokes a mesh shader and, optionally, an object shader with indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawMeshThreadgroups(indirectBuffer:indirectBufferOffset:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)
DrawMeshThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(indirectBuffer MTLBuffer, indirectBufferOffset uint, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
// Encodes a draw command that renders multiple instances of tessellated patches.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawPatches(numberOfPatchControlPoints:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:)
DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstance(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, instanceCount uint, baseInstance uint)
// Encodes a draw command that renders multiple instances of tessellated patches with indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawPatches(numberOfPatchControlPoints:patchIndexBuffer:patchIndexBufferOffset:indirectBuffer:indirectBufferOffset:)
DrawPatchesPatchIndexBufferPatchIndexBufferOffsetIndirectBufferIndirectBufferOffset(numberOfPatchControlPoints uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, indirectBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes a draw command that renders multiple instances of tessellated patches with a control point index buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawIndexedPatches(numberOfPatchControlPoints:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:)
DrawIndexedPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetInstanceCountBaseInstance(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, controlPointIndexBuffer MTLBuffer, controlPointIndexBufferOffset uint, instanceCount uint, baseInstance uint)
// Encodes a draw command that renders multiple instances of tessellated patches with a control point index buffer and indirect arguments.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/drawIndexedPatches(numberOfPatchControlPoints:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:indirectBuffer:indirectBufferOffset:)
DrawIndexedPatchesPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetIndirectBufferIndirectBufferOffset(numberOfPatchControlPoints uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, controlPointIndexBuffer MTLBuffer, controlPointIndexBufferOffset uint, indirectBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes a command that invokes GPU functions from the encoder’s current tile render pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/dispatchThreadsPerTile(_:)
DispatchThreadsPerTile(threadsPerTile MTLSize)
// The width of the tiles, in pixels, for the render command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/tileWidth
TileWidth() uint
// The height of the tiles, in pixels, for the render command encoder.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/tileHeight
TileHeight() uint
// Encodes a command that instructs the GPU to pause before starting one or more stages of the render pass until a pass updates a fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/waitForFence(_:before:)
WaitForFenceBeforeStages(fence MTLFence, stages MTLRenderStages)
// Encodes a command that instructs the GPU to update a fence after one or more stages, which can unblock other passes waiting for the fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/updateFence(_:after:)
UpdateFenceAfterStages(fence MTLFence, stages MTLRenderStages)
// Creates a memory barrier that enforces the order of write and read operations for specific resource types.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/memoryBarrier(scope:after:before:)
MemoryBarrierWithScopeAfterStagesBeforeStages(scope MTLBarrierScope, after MTLRenderStages, before MTLRenderStages)
// Encodes a command that samples hardware counters during the render pass and stores the data into a counter sample buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/sampleCounters(sampleBuffer:sampleIndex:barrier:)
SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
// Encodes a command that runs an indirect range of commands from an indirect command buffer (ICB).
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:
ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes a command that runs a range of commands from an indirect command buffer (ICB).
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/executeCommandsInBuffer:withRange:
ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
// Creates a memory barrier that enforces the order of write and read operations for specific resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/memoryBarrierWithResources:count:afterStages:beforeStages:
MemoryBarrierWithResourcesCountAfterStagesBeforeStages(resources []MTLResource, count uint, after MTLRenderStages, before MTLRenderStages)
// Configures each pixel component value, including alpha, for the render pipeline’s constant blend color.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setBlendColor(red:green:blue:alpha:)
SetBlendColorRedGreenBlueAlpha(red float32, green float32, blue float32, alpha float32)
// Sets the mapping from logical shader color output to physical render pass color attachments.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setColorAttachmentMap(_:)
SetColorAttachmentMap(mapping IMTLLogicalToPhysicalColorAttachmentMap)
// Configures the store action for a color attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setColorStoreAction(_:index:)
SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
// Configures the store action options for a color attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setColorStoreActionOptions(_:index:)
SetColorStoreActionOptionsAtIndex(storeActionOptions MTLStoreActionOptions, colorAttachmentIndex uint)
// Configures how the render pipeline determines which primitives to remove.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setCullMode(_:)
SetCullMode(cullMode MTLCullMode)
// Configures the adjustments a render pass applies to depth values from fragment functions by a scaling factor and bias.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthBias(_:slopeScale:clamp:)
SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
// Configures how the render pipeline handles fragments outside the near and far planes of the view frustum.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthClipMode(_:)
SetDepthClipMode(depthClipMode MTLDepthClipMode)
// Configures the combined depth and stencil state.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthStencilState(_:)
SetDepthStencilState(depthStencilState MTLDepthStencilState)
// Configures the store action for the depth attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthStoreAction(_:)
SetDepthStoreAction(storeAction MTLStoreAction)
// Configures the store action options for the depth attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthStoreActionOptions(_:)
SetDepthStoreActionOptions(storeActionOptions MTLStoreActionOptions)
// Configures the minimum and maximum bounds for depth bounds testing.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthTestMinBound:maxBound:
SetDepthTestMinBoundMaxBound(minBound float32, maxBound float32)
// Assigns an acceleration structure to an entry in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentAccelerationStructure(_:bufferIndex:)
SetFragmentAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
// Updates an entry in the fragment shader argument table with a new location within the entry’s current buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentBufferOffset(_:index:)
SetFragmentBufferOffsetAtIndex(offset uint, index uint)
// Assigns multiple buffers to a range of entries in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentBuffers:offsets:withRange:
SetFragmentBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Creates a buffer from bytes and assigns it to an entry in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentBytes(_:length:index:)
SetFragmentBytesLengthAtIndex(bytes []byte, index uint)
// Assigns an intersection function table to an entry in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentIntersectionFunctionTable(_:bufferIndex:)
SetFragmentIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
// Assigns multiple intersection function tables to a range of entries in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentIntersectionFunctionTables:withBufferRange:
SetFragmentIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
// Assigns a sampler state to an entry in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentSamplerState(_:index:)
SetFragmentSamplerStateAtIndex(sampler MTLSamplerState, index uint)
// Assigns a sampler state and clamp values to an entry in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentSamplerState(_:lodMinClamp:lodMaxClamp:index:)
SetFragmentSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
// Assigns multiple sampler states and clamp values to a range of entries in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange:
SetFragmentSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
// Assigns multiple sampler states to a range of entries in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentSamplerStates:withRange:
SetFragmentSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
// Assigns a texture to an entry in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentTexture(_:index:)
SetFragmentTextureAtIndex(texture MTLTexture, index uint)
// Assigns multiple textures to a range of entries in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentTextures:withRange:
SetFragmentTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
// Assigns a visible function table to an entry in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentVisibleFunctionTable(_:bufferIndex:)
SetFragmentVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
// Assigns multiple visible function tables to a range of entries in the fragment shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentVisibleFunctionTables:withBufferRange:
SetFragmentVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
// Configures which face of a primitive, such as a triangle, is the front.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFrontFacing(_:)
SetFrontFacingWinding(frontFacingWinding MTLWinding)
// Updates an entry in the mesh shader argument table with a new location within the entry’s current buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshBufferOffset(_:index:)
SetMeshBufferOffsetAtIndex(offset uint, index uint)
// Assigns multiple buffers to a range of entries in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshBuffers:offsets:withRange:
SetMeshBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Creates a buffer from bytes and assigns it to an entry in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshBytes(_:length:index:)
SetMeshBytesLengthAtIndex(bytes []byte, index uint)
// Assigns a sampler state to an entry in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshSamplerState(_:index:)
SetMeshSamplerStateAtIndex(sampler MTLSamplerState, index uint)
// Assigns a sampler state and clamp values to an entry in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshSamplerState(_:lodMinClamp:lodMaxClamp:index:)
SetMeshSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
// Assigns multiple sampler states and clamp values to a range of entries in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange:
SetMeshSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
// Assigns multiple sampler states to a range of entries in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshSamplerStates:withRange:
SetMeshSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
// Assigns a texture to an entry in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshTexture(_:index:)
SetMeshTextureAtIndex(texture MTLTexture, index uint)
// Assigns multiple textures to a range of entries in the mesh shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshTextures:withRange:
SetMeshTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
// Updates an entry in the object shader argument table with a new location within the entry’s current buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectBufferOffset(_:index:)
SetObjectBufferOffsetAtIndex(offset uint, index uint)
// Encodes a command that assigns multiple buffers to a range of entries in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectBuffers:offsets:withRange:
SetObjectBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Creates a buffer from bytes and assigns it to an entry in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectBytes(_:length:index:)
SetObjectBytesLengthAtIndex(bytes []byte, index uint)
// Assigns a sampler state to an entry in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectSamplerState(_:index:)
SetObjectSamplerStateAtIndex(sampler MTLSamplerState, index uint)
// Assigns a sampler state and clamp values to an entry in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectSamplerState(_:lodMinClamp:lodMaxClamp:index:)
SetObjectSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
// Assigns multiple sampler states and clamp values to a range of entries in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectSamplerStates:lodMinClamps:lodMaxClamps:withRange:
SetObjectSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
// Assigns multiple sampler states to a range of entries in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectSamplerStates:withRange:
SetObjectSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
// Assigns a texture to an entry in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectTexture(_:index:)
SetObjectTextureAtIndex(texture MTLTexture, index uint)
// Assigns multiple textures to a range of entries in the object shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectTextures:withRange:
SetObjectTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
// Configures the size of a threadgroup memory buffer for an entry in the object argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectThreadgroupMemoryLength(_:index:)
SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
// Configures the encoder with a render or tile pipeline state that applies to your subsequent draw commands.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setRenderPipelineState(_:)
SetRenderPipelineState(pipelineState MTLRenderPipelineState)
// Configures a rectangle for the fragment scissor test.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setScissorRect(_:)
SetScissorRect(rect MTLScissorRect)
// Configures multiple rectangles for the fragment scissor test.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setScissorRects:count:
SetScissorRectsCount(scissorRects []MTLScissorRect, count uint)
// Configures different comparison values for front- and back-facing primitives.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setStencilReferenceValues(front:back:)
SetStencilFrontReferenceValueBackReferenceValue(frontReferenceValue uint32, backReferenceValue uint32)
// Configures the same comparison value for front- and back-facing primitives.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setStencilReferenceValue(_:)
SetStencilReferenceValue(referenceValue uint32)
// Configures the store action for the stencil attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setStencilStoreAction(_:)
SetStencilStoreAction(storeAction MTLStoreAction)
// Configures the store action options for the stencil attachment.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setStencilStoreActionOptions(_:)
SetStencilStoreActionOptions(storeActionOptions MTLStoreActionOptions)
// Configures the per-patch tessellation factors for any subsequent patch-drawing commands.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTessellationFactorBuffer(_:offset:instanceStride:)
SetTessellationFactorBufferOffsetInstanceStride(buffer MTLBuffer, offset uint, instanceStride uint)
// Configures the scale factor for per-patch tessellation factors.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTessellationFactorScale(_:)
SetTessellationFactorScale(scale float32)
// Configures the size of a threadgroup memory buffer for an entry in the fragment or tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setThreadgroupMemoryLength(_:offset:index:)
SetThreadgroupMemoryLengthOffsetAtIndex(length uint, offset uint, index uint)
// Assigns an acceleration structure to an entry in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileAccelerationStructure(_:bufferIndex:)
SetTileAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
// Updates an entry in the tile shader argument table with a new location within the entry’s current buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileBufferOffset(_:index:)
SetTileBufferOffsetAtIndex(offset uint, index uint)
// Assigns multiple buffers to a range of entries in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileBuffers:offsets:withRange:
SetTileBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Creates a buffer from bytes and assigns it to an entry in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileBytes(_:length:index:)
SetTileBytesLengthAtIndex(bytes []byte, index uint)
// Assigns an intersection function table to an entry in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileIntersectionFunctionTable(_:bufferIndex:)
SetTileIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
// Assigns multiple intersection function tables to a range of entries in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileIntersectionFunctionTables:withBufferRange:
SetTileIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
// Assigns a sampler state to an entry in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileSamplerState(_:index:)
SetTileSamplerStateAtIndex(sampler MTLSamplerState, index uint)
// Assigns a sampler state and clamp values to an entry in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileSamplerState(_:lodMinClamp:lodMaxClamp:index:)
SetTileSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
// Assigns multiple sampler states and clamp values to a range of entries in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileSamplerStates:lodMinClamps:lodMaxClamps:withRange:
SetTileSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
// Assigns multiple sampler states to a range of entries in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileSamplerStates:withRange:
SetTileSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
// Assigns a texture to an entry in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileTexture(_:index:)
SetTileTextureAtIndex(texture MTLTexture, index uint)
// Assigns multiple textures to a range of entries in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileTextures:withRange:
SetTileTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
// Assigns a visible function table to an entry in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileVisibleFunctionTable(_:bufferIndex:)
SetTileVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
// Assigns multiple visible function tables to a range of entries in the tile shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileVisibleFunctionTables:withBufferRange:
SetTileVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
// Configures how subsequent draw commands rasterize triangle and triangle strip primitives.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTriangleFillMode(_:)
SetTriangleFillMode(fillMode MTLTriangleFillMode)
// Assigns an acceleration structure to an entry in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexAccelerationStructure(_:bufferIndex:)
SetVertexAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
// Configures the number of output vertices the render pipeline produces for each input vertex, optionally with render target and viewport offsets.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexAmplificationCount(_:viewMappings:)
SetVertexAmplificationCountViewMappings(count uint, viewMappings *MTLVertexAmplificationViewMapping)
// Updates an entry in the vertex shader argument table with a new location within the entry’s current buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBufferOffset(_:index:)
SetVertexBufferOffsetAtIndex(offset uint, index uint)
// SetVertexBufferOffsetAttributeStrideAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBufferOffset(offset:attributeStride:index:)
SetVertexBufferOffsetAttributeStrideAtIndex(offset uint, stride uint, index uint)
// SetVertexBuffersOffsetsAttributeStridesWithRange protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffers:offsets:attributeStrides:withRange:
SetVertexBuffersOffsetsAttributeStridesWithRange(buffers []MTLBuffer, offsets uint, strides uint, range_ foundation.NSRange)
// Assigns multiple buffers to a range of entries in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffers:offsets:withRange:
SetVertexBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
// Creates a buffer from bytes and assigns it to an entry in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBytes(_:length:index:)
SetVertexBytesLengthAtIndex(bytes []byte, index uint)
// SetVertexBytesLengthAttributeStrideAtIndex protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBytes(_:length:attributeStride:index:)
SetVertexBytesLengthAttributeStrideAtIndex(bytes []byte, stride uint, index uint)
// Assigns an intersection function table to an entry in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexIntersectionFunctionTable(_:bufferIndex:)
SetVertexIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
// Assigns multiple intersection function tables to a range of entries in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexIntersectionFunctionTables:withBufferRange:
SetVertexIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
// Assigns a sampler state to an entry in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexSamplerState(_:index:)
SetVertexSamplerStateAtIndex(sampler MTLSamplerState, index uint)
// Assigns a sampler state and clamp values to an entry in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexSamplerState(_:lodMinClamp:lodMaxClamp:index:)
SetVertexSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
// Assigns multiple sampler states and clamp values to a range of entries in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexSamplerStates:lodMinClamps:lodMaxClamps:withRange:
SetVertexSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
// Assigns multiple sampler states to a range of entries in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexSamplerStates:withRange:
SetVertexSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
// Assigns a texture to an entry in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexTexture(_:index:)
SetVertexTextureAtIndex(texture MTLTexture, index uint)
// Assigns multiple textures to a range of entries in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexTextures:withRange:
SetVertexTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
// Assigns a visible function table to an entry in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexVisibleFunctionTable(_:bufferIndex:)
SetVertexVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
// Assigns multiple visible function tables to a range of entries in the vertex shader argument table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexVisibleFunctionTables:withBufferRange:
SetVertexVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
// Configures the render pipeline with a viewport that applies a transformation and a clipping rectangle.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setViewport(_:)
SetViewport(viewport MTLViewport)
// Configures the render pipeline with multiple viewports that apply transformations and clipping rectangles.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setViewports:count:
SetViewportsCount(viewports []MTLViewport, count uint)
// Configures which visibility test the GPU runs and the destination for any results it generates.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVisibilityResultMode(_:offset:)
SetVisibilityResultModeOffset(mode MTLVisibilityResultMode, offset uint)
// Ensures the shaders in the render pass’s subsequent draw commands have access to the resources you allocate from a heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/useHeap(_:stages:)
UseHeapStages(heap MTLHeap, stages MTLRenderStages)
// Ensures the shaders in the render pass’s subsequent draw commands have access to the resources you allocate from multiple heaps.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/useHeaps:count:stages:
UseHeapsCountStages(heaps []MTLHeap, count uint, stages MTLRenderStages)
// Ensures the shaders in the render pass’s subsequent draw commands have access to a resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/useResource(_:usage:stages:)
UseResourceUsageStages(resource MTLResource, usage MTLResourceUsage, stages MTLRenderStages)
// Ensures the shaders in the render pass’s subsequent draw commands have access to multiple resources.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/useResources:count:usage:stages:
UseResourcesCountUsageStages(resources []MTLResource, count uint, usage MTLResourceUsage, stages MTLRenderStages)
}
Encodes configuration and draw commands for a single render pass into a command buffer.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder
type MTLRenderCommandEncoderObject ¶
type MTLRenderCommandEncoderObject struct {
objectivec.Object
}
MTLRenderCommandEncoderObject wraps an existing Objective-C object that conforms to the MTLRenderCommandEncoder protocol.
func MTLRenderCommandEncoderObjectFromID ¶
func MTLRenderCommandEncoderObjectFromID(id objc.ID) MTLRenderCommandEncoderObject
MTLRenderCommandEncoderObjectFromID constructs a MTLRenderCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLRenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStages ¶
func (o MTLRenderCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTLRenderCommandEncoderObject) BaseObject ¶
func (o MTLRenderCommandEncoderObject) BaseObject() objectivec.Object
func (MTLRenderCommandEncoderObject) Device ¶
func (o MTLRenderCommandEncoderObject) Device() MTLDevice
The Metal device from which the command encoder was created.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
func (MTLRenderCommandEncoderObject) DispatchThreadsPerTile ¶
func (o MTLRenderCommandEncoderObject) DispatchThreadsPerTile(threadsPerTile MTLSize)
Encodes a command that invokes GPU functions from the encoder’s current tile render pipeline state.
threadsPerTile: An MTLSize instance that represents the number of threads the render pass uses per tile.
Set the size’s [width] and [height] properties to values that are less than or equal to [TileWidth] and [TileHeight], respectively. Some GPU families only support square tile dispatches and require the same value for [width] and [height]. See the [Metal feature set tables (PDF)] to check which GPU families support nonsquare dispatches.
Set the [depth] property to `1`. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf [depth]: https://developer.apple.com/documentation/Metal/MTLSize/depth [height]: https://developer.apple.com/documentation/Metal/MTLSize/height [width]: https://developer.apple.com/documentation/Metal/MTLSize/width
Discussion ¶
The command invokes the GPU function that’s in the encoder’s current tile render pipeline state. You can configure that state with the following steps:
- Configure an MTLTileRenderPipelineDescriptor instance. - Create a tile render pipeline state by calling one of the applicable methods of an MTLDevice instance, including [NewRenderPipelineStateWithTileDescriptorOptionsReflectionError]. - Apply that tile render pipeline state by calling the [SetRenderPipelineState] method.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/dispatchThreadsPerTile(_:)
func (MTLRenderCommandEncoderObject) DrawIndexedPatchesPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetIndirectBufferIndirectBufferOffset ¶
func (o MTLRenderCommandEncoderObject) DrawIndexedPatchesPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetIndirectBufferIndirectBufferOffset(numberOfPatchControlPoints uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, controlPointIndexBuffer MTLBuffer, controlPointIndexBufferOffset uint, indirectBuffer MTLBuffer, indirectBufferOffset uint)
Encodes a draw command that renders multiple instances of tessellated patches with a control point index buffer and indirect arguments.
numberOfPatchControlPoints: The number of control points for each patch, which needs to be in the range `[0, 32]`.
patchIndexBuffer: An MTLBuffer instance that contains the indices to patches.
patchIndexBufferOffset: An integer that represents the location, in bytes, from the start of `patchIndexBuffer` where the patch indices begin.
controlPointIndexBuffer: An MTLBuffer instance that contains the indices to control points.
controlPointIndexBufferOffset: An integer that represents the location, in bytes, from the start of `controlPointIndexBuffer` where the control point indices begin.
indirectBuffer: An MTLBuffer instance with data that matches the layout of the MTLDrawPatchIndirectArguments structure. // MTLDrawPatchIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDrawPatchIndirectArguments
indirectBufferOffset: An integer that represents the location, in bytes, from the start of `indirectBuffer` where the indirect arguments structure begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
Discussion ¶
Indirect drawing methods may help your app avoid expensive latency costs. This is because the command reads arguments from an MTLBuffer instance instead of using the CPU to pass parameters to the command.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawIndexedPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetInstanceCountBaseInstance ¶
func (o MTLRenderCommandEncoderObject) DrawIndexedPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetControlPointIndexBufferControlPointIndexBufferOffsetInstanceCountBaseInstance(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, controlPointIndexBuffer MTLBuffer, controlPointIndexBufferOffset uint, instanceCount uint, baseInstance uint)
Encodes a draw command that renders multiple instances of tessellated patches with a control point index buffer.
numberOfPatchControlPoints: The number of control points for each patch, which needs to be in the range `[0, 32]`.
patchStart: The patch start index.
patchCount: The number of patches in each instance.
patchIndexBuffer: An MTLBuffer instance that contains the indices to patches.
patchIndexBufferOffset: An integer that represents the location, in bytes, from the start of `patchIndexBuffer` where the patch indices begin.
controlPointIndexBuffer: An MTLBuffer instance that contains the indices to control points.
controlPointIndexBufferOffset: An integer that represents the location, in bytes, from the start of `controlPointIndexBuffer` where the control point indices begin.
instanceCount: The number of times the command draws `patchCount` patches.
baseInstance: The lowest value the command passes to your vertex shader’s parameter with the `instance_id` attribute.
The command assigns each drawing instance a unique `instance_id` value that increases from `baseInstance` through `(baseInstance + instanceCount - 1)`. Your shader can use that value to identify which instance the vertex belongs to.
For more information about the `instance_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
Discussion ¶
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffset ¶
func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffset(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint)
Encodes a draw command that renders an instance of a geometric primitive with indexed vertices.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
indexCount: An integer that represents the number of vertices the command reads from `indexBuffer`.
indexType: An MTLIndexType instance that represents the index’s format, including [IndexTypeUInt16] and [IndexTypeUInt32]. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: An MTLBuffer instance that contains the `indexCount` vertex indices of the `indexType` format.
indexBufferOffset: An integer that represents the location that’s a multiple of the index size from the start of `indexBuffer` where the vertex indices begin.
Discussion ¶
You can complete a primitive and start a new one by passing a sentinel index value that’s the largest unsigned integer possible for `indexType`. For example, the largest unsigned integer for [IndexTypeUInt16] and [IndexTypeUInt32] is `0xFFFF` and `0xFFFFFFFF`, respectively. The command finishes the current primitive and begins drawing a new one each time the command reads a sentinel index value.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCount ¶
func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCount(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, instanceCount uint)
Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
indexCount: An integer that represents the number of vertices the command reads from `indexBuffer` for each instance.
indexType: An MTLIndexType instance that represents the index’s format, including [IndexTypeUInt16] and [IndexTypeUInt32]. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: An MTLBuffer instance that contains the `indexCount` vertex indices of the `indexType` format.
indexBufferOffset: An integer that represents the location that’s a multiple of the index size from the start of `indexBuffer` where the vertex indices begin.
instanceCount: An integer that represents the number of times the command draws `primitiveType` with `indexCount` vertices.
Discussion ¶
You can complete a primitive and start a new one by passing a sentinel index value that’s the largest unsigned integer possible for `indexType`. For example, the largest unsigned integer for [IndexTypeUInt16] and [IndexTypeUInt32] is `0xFFFF` and `0xFFFFFFFF`, respectively. The command finishes the current primitive and begins drawing a new one each time the command reads a sentinel index value.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance ¶
func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexCountIndexTypeIndexBufferIndexBufferOffsetInstanceCountBaseVertexBaseInstance(primitiveType MTLPrimitiveType, indexCount uint, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, instanceCount uint, baseVertex int, baseInstance uint)
Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices, starting with a custom vertex and instance.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
indexCount: An integer that represents the number of vertices the command reads from `indexBuffer` for each instance.
indexType: An MTLIndexType instance that represents the index’s format, including [IndexTypeUInt16] and [IndexTypeUInt32]. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: An MTLBuffer instance that contains the `indexCount` vertex indices of the `indexType` format.
indexBufferOffset: An integer that represents the location that’s a multiple of the index size from the start of `indexBuffer` where the vertex indices begin.
instanceCount: An integer that represents the number of times the command draws `primitiveType` with `indexCount` vertices.
baseVertex: The lowest value the command passes to your vertex shader’s parameter with the `vertex_id` attribute. The command assigns each vertex a unique `vertex_id` value that increases from `baseVertex` through `(baseVertex + indexCount - 1)`. Your shader can use that value to identify each vertex in the `primitiveType` instance.
For more information about the `vertex_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
baseInstance: The lowest value the command passes to your vertex shader’s parameter with the `instance_id` attribute.
The command assigns each drawing instance a unique `instance_id` value that increases from `baseInstance` through `(baseInstance + instanceCount - 1)`. Your shader can use that value to identify which instance the vertex belongs to.
For more information about the `instance_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
Discussion ¶
You can complete a primitive and start a new one by passing a sentinel index value that’s the largest unsigned integer possible for `indexType`. For example, the largest unsigned integer for [IndexTypeUInt16] and [IndexTypeUInt32] is `0xFFFF` and `0xFFFFFFFF`, respectively. The command finishes the current primitive and begins drawing a new one each time the command reads a sentinel index value.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferOffsetIndirectBufferIndirectBufferOffset ¶
func (o MTLRenderCommandEncoderObject) DrawIndexedPrimitivesIndexTypeIndexBufferIndexBufferOffsetIndirectBufferIndirectBufferOffset(primitiveType MTLPrimitiveType, indexType MTLIndexType, indexBuffer MTLBuffer, indexBufferOffset uint, indirectBuffer MTLBuffer, indirectBufferOffset uint)
Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices and indirect arguments.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
indexType: An MTLIndexType instance that represents the index’s format, including [IndexTypeUInt16] and [IndexTypeUInt32]. // MTLIndexType: https://developer.apple.com/documentation/Metal/MTLIndexType
indexBuffer: An MTLBuffer instance that contains the vertex indices of the `indexType` format.
indexBufferOffset: An integer that represents the location that’s a multiple of the index size from the start of `indexBuffer` where the vertex indices begin.
indirectBuffer: An MTLBuffer instance with data that matches the layout of the MTLDrawIndexedPrimitivesIndirectArguments structure. // MTLDrawIndexedPrimitivesIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDrawIndexedPrimitivesIndirectArguments
indirectBufferOffset: An integer that represents the location, in bytes, from the start of `indirectBuffer` where the indirect arguments structure begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
Discussion ¶
Indirect drawing methods may help your app avoid expensive latency costs. This is because the command reads arguments from an MTLBuffer instance instead of using the CPU to pass parameters to the command.
You can complete a primitive and start a new one by passing a sentinel index value that’s the largest unsigned integer possible for `indexType`. For example, the largest unsigned integer for [IndexTypeUInt16] and [IndexTypeUInt32] is `0xFFFF` and `0xFFFFFFFF`, respectively. The command finishes the current primitive and begins drawing a new one each time the command reads a sentinel index value.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTLRenderCommandEncoderObject) DrawMeshThreadgroupsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadgroupsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threadgroups.
threadgroupsPerGrid: An MTLSize instance that represents the number of threadgroups for each grid dimension. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerObjectThreadgroup: An MTLSize instance that represents the number of threads in an object shader threadgroup, if applicable. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerMeshThreadgroup: An MTLSize instance that represents the number of threads in a mesh shader threadgroup. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
func (MTLRenderCommandEncoderObject) DrawMeshThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTLRenderCommandEncoderObject) DrawMeshThreadgroupsWithIndirectBufferIndirectBufferOffsetThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(indirectBuffer MTLBuffer, indirectBufferOffset uint, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
Encodes a draw command that invokes a mesh shader and, optionally, an object shader with indirect arguments.
indirectBuffer: An MTLBuffer instance with data that matches the layout of the MTLDispatchThreadgroupsIndirectArguments structure. // MTLDispatchThreadgroupsIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDispatchThreadgroupsIndirectArguments
indirectBufferOffset: An integer that represents the location, in bytes, from the start of `indirectBuffer` where the indirect arguments structure begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
threadsPerObjectThreadgroup: An MTLSize instance that represents the number of threads in an object shader threadgroup, if applicable. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerMeshThreadgroup: An MTLSize instance that represents the number of threads in a mesh shader threadgroup. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
func (MTLRenderCommandEncoderObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup ¶
func (o MTLRenderCommandEncoderObject) DrawMeshThreadsThreadsPerObjectThreadgroupThreadsPerMeshThreadgroup(threadsPerGrid MTLSize, threadsPerObjectThreadgroup MTLSize, threadsPerMeshThreadgroup MTLSize)
Encodes a draw command that invokes a mesh shader and, optionally, an object shader with a grid of threads.
threadsPerGrid: An MTLSize instance that represents the number of threads for each grid dimension.
For mesh shaders, the command rounds the value down to the nearest multiple of `threadsPerMeshThreadgroup` for each dimension.
For object shaders, the value doesn’t need to be a multiple of `threadsPerObjectThreadgroup`. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerObjectThreadgroup: An MTLSize instance that represents the number of threads in an object shader threadgroup, if applicable. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
threadsPerMeshThreadgroup: An MTLSize instance that represents the number of threads in a mesh shader threadgroup. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
func (MTLRenderCommandEncoderObject) DrawPatchesPatchIndexBufferPatchIndexBufferOffsetIndirectBufferIndirectBufferOffset ¶
func (o MTLRenderCommandEncoderObject) DrawPatchesPatchIndexBufferPatchIndexBufferOffsetIndirectBufferIndirectBufferOffset(numberOfPatchControlPoints uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, indirectBuffer MTLBuffer, indirectBufferOffset uint)
Encodes a draw command that renders multiple instances of tessellated patches with indirect arguments.
numberOfPatchControlPoints: The number of control points for each patch, which needs to be in the range `[0, 32]`.
patchIndexBuffer: An MTLBuffer instance that contains the indices to patches.
patchIndexBufferOffset: An integer that represents the location, in bytes, from the start of `patchIndexBuffer` where the patch indices begin.
indirectBuffer: An MTLBuffer instance with data that matches the layout of the MTLDrawPatchIndirectArguments structure. // MTLDrawPatchIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDrawPatchIndirectArguments
indirectBufferOffset: An integer that represents the location, in bytes, from the start of `indirectBuffer` where the indirect arguments structure begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
Discussion ¶
Indirect drawing methods may help your app avoid expensive latency costs. This is because the command reads arguments from an MTLBuffer instance instead of using the CPU to pass parameters to the command.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstance ¶
func (o MTLRenderCommandEncoderObject) DrawPatchesPatchStartPatchCountPatchIndexBufferPatchIndexBufferOffsetInstanceCountBaseInstance(numberOfPatchControlPoints uint, patchStart uint, patchCount uint, patchIndexBuffer MTLBuffer, patchIndexBufferOffset uint, instanceCount uint, baseInstance uint)
Encodes a draw command that renders multiple instances of tessellated patches.
numberOfPatchControlPoints: The number of control points for each patch, which needs to be in the range `[0, 32]`.
patchStart: The first patch the command draws.
patchCount: The number of patches the command draws for each instance.
patchIndexBuffer: An MTLBuffer instance that contains the indices to patches.
patchIndexBufferOffset: An integer that represents the location, in bytes, from the start of `patchIndexBuffer` where the patch indices begin.
instanceCount: The number of times the command draws `patchCount` patches.
baseInstance: The lowest value the command passes to your vertex shader’s parameter with the `instance_id` attribute.
The command assigns each drawing instance a unique `instance_id` value that increases from `baseInstance` through `(baseInstance + instanceCount - 1)`. Your shader can use that value to identify which instance the vertex belongs to.
For more information about the `instance_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
Discussion ¶
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawPrimitivesIndirectBufferIndirectBufferOffset ¶
func (o MTLRenderCommandEncoderObject) DrawPrimitivesIndirectBufferIndirectBufferOffset(primitiveType MTLPrimitiveType, indirectBuffer MTLBuffer, indirectBufferOffset uint)
Encodes a draw command that renders multiple instances of a geometric primitive with indirect arguments.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
indirectBuffer: An MTLBuffer instance with data that matches the layout of the MTLDrawPrimitivesIndirectArguments structure. // MTLDrawPrimitivesIndirectArguments: https://developer.apple.com/documentation/Metal/MTLDrawPrimitivesIndirectArguments
indirectBufferOffset: An integer that represents the location, in bytes, from the start of `indirectBuffer` where the indirect arguments structure begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
Discussion ¶
Indirect drawing methods may help your app avoid expensive latency costs. This is because the command reads arguments from an MTLBuffer instance instead of using the CPU to pass parameters to the command.
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCount ¶
func (o MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint)
Encodes a draw command that renders an instance of a geometric primitive.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
vertexStart: The lowest value the command passes to your vertex shader’s parameter with the `vertex_id` attribute. The command assigns each vertex a unique `vertex_id` value within its drawing instance that increases from `vertexStart` through `(vertexStart + vertexCount - 1)`. Your shader can use that value to identify a vertex in each drawing instance.
For more information about the `vertex_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
vertexCount: An integer that represents the number of vertices of `primitiveType` the command draws.
Discussion ¶
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCount ¶
func (o MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCount(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint)
Encodes a draw command that renders multiple instances of a geometric primitive.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
vertexStart: The lowest value the command passes to your vertex shader’s parameter with the `vertex_id` attribute. The command assigns each vertex a unique `vertex_id` value within its drawing instance that increases from `vertexStart` through `(vertexStart + vertexCount - 1)`. Your shader can use that value to identify a vertex in each drawing instance.
For more information about the `vertex_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
vertexCount: An integer that represents the number of vertices of `primitiveType` the command draws per instance.
instanceCount: An integer that represents the number of times the command draws `primitiveType` with `vertexCount` vertices.
The command assigns each drawing instance a unique `instance_id` value that increases from `0` through `(instanceCount - 1)`. Your shader can use that value to identify which instance the vertex belongs to.
For more information about the `instance_id` argument attribute for vertex shaders, the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
Discussion ¶
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance ¶
func (o MTLRenderCommandEncoderObject) DrawPrimitivesVertexStartVertexCountInstanceCountBaseInstance(primitiveType MTLPrimitiveType, vertexStart uint, vertexCount uint, instanceCount uint, baseInstance uint)
Encodes a draw command that renders multiple instances of a geometric primitive that starts with a custom instance identification number.
primitiveType: An MTLPrimitiveType instance that represents how the command interprets vertex argument data.
See the [setVertexBuffer(_:offset:index:)] method and its siblings for more information about setting an entry in the vertex shader argument table for buffers. // MTLPrimitiveType: https://developer.apple.com/documentation/Metal/MTLPrimitiveType [setVertexBuffer(_:offset:index:)]: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:)
vertexStart: The lowest value the command passes to your vertex shader’s parameter with the `vertex_id` attribute. The command assigns each vertex a unique `vertex_id` value within its drawing instance that increases from `vertexStart` through `(vertexStart + vertexCount - 1)`. Your shader can use that value to identify a vertex in each drawing instance.
For more information about the `vertex_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
vertexCount: An integer that represents the number of vertices of `primitiveType` the command draws per instance.
instanceCount: An integer that represents the number of times the command draws `primitiveType` with `vertexCount` vertices.
baseInstance: The lowest value the command passes to your vertex shader’s parameter with the `instance_id` attribute.
The command assigns each drawing instance a unique `instance_id` value that increases from `baseInstance` through `(baseInstance + instanceCount - 1)`. Your shader can use that value to identify which instance the vertex belongs to.
For more information about the `instance_id` argument attribute for vertex shaders, see the [Metal Shading Language Specification (PDF)]. // [Metal Shading Language Specification (PDF)]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
Discussion ¶
The method records the encoder’s current rendering state and resources the command needs as it runs. You can safely change the encoder’s render pipeline state to encode other commands after calling this method. Subsequent changes to the state don’t affect the commands already in the encoder’s MTLCommandBuffer.
func (MTLRenderCommandEncoderObject) EndEncoding ¶
func (o MTLRenderCommandEncoderObject) EndEncoding()
Declares that all command generation from the encoder is completed.
Discussion ¶
After `endEncoding` is called, the command encoder has no further use. You cannot encode any other commands with this encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
func (MTLRenderCommandEncoderObject) ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset ¶
func (o MTLRenderCommandEncoderObject) ExecuteCommandsInBufferIndirectBufferIndirectBufferOffset(indirectCommandbuffer MTLIndirectCommandBuffer, indirectRangeBuffer MTLBuffer, indirectBufferOffset uint)
Encodes a command that runs an indirect range of commands from an indirect command buffer (ICB).
indirectCommandbuffer: An MTLIndirectCommandBuffer instance that contains other commands the current command runs.
indirectRangeBuffer: An MTLBuffer instance with data that matches the layout of the MTLIndirectCommandBufferExecutionRange structure.
The [length] property of that structure needs to be less than or equal to `0x4000` (`16,384`). // MTLIndirectCommandBufferExecutionRange: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferExecutionRange [length]: https://developer.apple.com/documentation/Metal/MTLIndirectCommandBufferExecutionRange/length
indirectBufferOffset: An integer that represents the location, in bytes, from the start of `indirectRangeBuffer` where the execution range structure begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
func (MTLRenderCommandEncoderObject) ExecuteCommandsInBufferWithRange ¶
func (o MTLRenderCommandEncoderObject) ExecuteCommandsInBufferWithRange(indirectCommandBuffer MTLIndirectCommandBuffer, executionRange foundation.NSRange)
Encodes a command that runs a range of commands from an indirect command buffer (ICB).
indirectCommandBuffer: An MTLIndirectCommandBuffer instance that contains other commands the current command runs.
executionRange: A span of integers that represent the command entries in `buffer` the current command runs. The number of commands needs to be less than or equal to `0x4000` (`16,384`).
func (MTLRenderCommandEncoderObject) InsertDebugSignpost ¶
func (o MTLRenderCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the captured frame data.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
func (MTLRenderCommandEncoderObject) Label ¶
func (o MTLRenderCommandEncoderObject) Label() string
A string that labels the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
func (MTLRenderCommandEncoderObject) MemoryBarrierWithResourcesCountAfterStagesBeforeStages ¶
func (o MTLRenderCommandEncoderObject) MemoryBarrierWithResourcesCountAfterStagesBeforeStages(resources []MTLResource, count uint, after MTLRenderStages, before MTLRenderStages)
Creates a memory barrier that enforces the order of write and read operations for specific resources.
resources: A C array of MTLResource instances the barrier applies to.
count: The number of elements in the resources array.
after: The render stages of previous draw commands that modify `resources`.
before: The render stages of subsequent draw commands that read or modify `resources`.
Discussion ¶
Memory barriers ensure the relevant stages of prior draw commands finish modifying resources before starting the stages of subsequent commands that depend on those resources.
To determine whether a GPU supports memory barriers, see the Metal feature set tables (PDF).
func (MTLRenderCommandEncoderObject) MemoryBarrierWithScopeAfterStagesBeforeStages ¶
func (o MTLRenderCommandEncoderObject) MemoryBarrierWithScopeAfterStagesBeforeStages(scope MTLBarrierScope, after MTLRenderStages, before MTLRenderStages)
Creates a memory barrier that enforces the order of write and read operations for specific resource types.
scope: An MTLBarrierScope instance that represents the resource types the barrier synchronizes operations on. // MTLBarrierScope: https://developer.apple.com/documentation/Metal/MTLBarrierScope
after: The render stages of previous draw commands that modify resources of the types that `scope` defines.
before: The render stages of subsequent draw commands that read or modify resources of the types that `scope` defines.
Discussion ¶
Memory barriers ensure the relevant stages of prior draw commands finish updating resources before starting the stages of subsequent commands that depend on those resources.
To determine whether a GPU supports memory barriers, see the Metal feature set tables (PDF).
func (MTLRenderCommandEncoderObject) PopDebugGroup ¶
func (o MTLRenderCommandEncoderObject) PopDebugGroup()
Pops the latest string off of a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
func (MTLRenderCommandEncoderObject) PushDebugGroup ¶
func (o MTLRenderCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a specific string onto a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
func (MTLRenderCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier ¶
func (o MTLRenderCommandEncoderObject) SampleCountersInBufferAtSampleIndexWithBarrier(sampleBuffer MTLCounterSampleBuffer, sampleIndex uint, barrier bool)
Encodes a command that samples hardware counters during the render pass and stores the data into a counter sample buffer.
sampleBuffer: An MTLCounterSampleBuffer instance that stores the GPU hardware data.
sampleIndex: An index within `sampleBuffer` the command stores the data to.
barrier: A Boolean value that indicates whether the command inserts a barrier before sampling the counter’s data.
A barrier ensures that the commands you encode before this one complete before the GPU samples the hardware counters, but can negatively impact runtime performance.
Running this command without a barrier means the GPU can sample counters concurrently with other commands from the encoder.
Either way, the `barrier` parameter for the command has no impact on sampling commands from other passes.
func (MTLRenderCommandEncoderObject) SetBlendColorRedGreenBlueAlpha ¶
func (o MTLRenderCommandEncoderObject) SetBlendColorRedGreenBlueAlpha(red float32, green float32, blue float32, alpha float32)
Configures each pixel component value, including alpha, for the render pipeline’s constant blend color.
red: A value for the red component for the blend color constant.
green: A value for the green component for the blend color constant.
blue: A value for the blue component for the blend color constant.
alpha: A value for the alpha component for the blend color constant.
Discussion ¶
The alpha and color values apply to all the render pass’s attachments. The `red`, `green`, and `blue` color parameters apply to the [BlendFactorBlendColor] and [BlendFactorOneMinusBlendColor] blend factors.
The `alpha` parameter applies to the [BlendFactorBlendAlpha] and [BlendFactorOneMinusBlendAlpha] blend factors.
The render pipeline’s default blend color value is `0.0` for each parameter, which is equivalent to [BlendFactorZero]. For other blending factor values, see MTLBlendFactor.
func (MTLRenderCommandEncoderObject) SetColorAttachmentMap ¶
func (o MTLRenderCommandEncoderObject) SetColorAttachmentMap(mapping IMTLLogicalToPhysicalColorAttachmentMap)
Sets the mapping from logical shader color output to physical render pass color attachments.
mapping: Mapping from logical shader outputs to physical outputs.
Discussion ¶
Use this method to define how the physical color attachments you specify via [ColorAttachments] map to the logical color output the fragment shader writes to.
To use this feature, make sure to set [SupportColorAttachmentMapping] to true.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setColorAttachmentMap(_:)
func (MTLRenderCommandEncoderObject) SetColorStoreActionAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetColorStoreActionAtIndex(storeAction MTLStoreAction, colorAttachmentIndex uint)
Configures the store action for a color attachment.
storeAction: A store action for the color attachment that can’t be [StoreActionUnknown].
colorAttachmentIndex: The index of a color attachment.
Discussion ¶
This method changes the render command encoder’s store action for a color attachment. You can assign the default store action for a color attachment by configuring the [StoreAction] property of its MTLRenderPassColorAttachmentDescriptor (see MTLRenderPassDescriptor and its [ColorAttachments] property).
func (MTLRenderCommandEncoderObject) SetColorStoreActionOptionsAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetColorStoreActionOptionsAtIndex(storeActionOptions MTLStoreActionOptions, colorAttachmentIndex uint)
Configures the store action options for a color attachment.
storeActionOptions: Additional options for the store action of a color attachment.
colorAttachmentIndex: The index of a color attachment.
func (MTLRenderCommandEncoderObject) SetCullMode ¶
func (o MTLRenderCommandEncoderObject) SetCullMode(cullMode MTLCullMode)
Configures how the render pipeline determines which primitives to remove.
cullMode: An MTLCullMode value that configures how the render pipeline determines which primitives to remove from the pipeline. // MTLCullMode: https://developer.apple.com/documentation/Metal/MTLCullMode
Discussion ¶
This method configures which primitives the render pipeline removes, if any, based on the direction of each primitive’s face relative to the scene’s camera. For example, you can correctly cull hidden surfaces on some geometric models, such as a sphere made of filled triangles, if it uses orientable surfaces. A surface is if its primitives consistently use the same ordering for its vertices. Metal defines vertex ordering with the MTLWinding type, which includes [WindingClockwise] and [WindingCounterClockwise]. You can tell the render pipeline which direction your primitives face by calling the [SetFrontFacingWinding] method, which affects the primitives the culling mode removes.
The render pass’s default culling mode is [CullModeNone].
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setCullMode(_:)
func (MTLRenderCommandEncoderObject) SetDepthBiasSlopeScaleClamp ¶
func (o MTLRenderCommandEncoderObject) SetDepthBiasSlopeScaleClamp(depthBias float32, slopeScale float32, clamp float32)
Configures the adjustments a render pass applies to depth values from fragment functions by a scaling factor and bias.
depthBias: A constant bias the render pipeline applies to all fragments.
slopeScale: A bias coefficient that scales with the depth of the primitive relative to the camera.
clamp: A value that limits the bias value the render pipeline can apply to a fragment. Pass a positive or negative value to limit the largest magnitude of a positive or negative bias, respectively.
You can disable the bias clamping functionality by passing `0.0`.
Discussion ¶
Call this method to have the render pipeline apply a bias to the rasterized depth after the clipping stage. The bias affects both depth testing and the values the render pipeline writes to the depth render target. If you don’t explicitly call this method, the pipeline doesn’t apply a scale or a bias to a depth value.
Set a depth bias to improve the quality of techniques such as shadow mapping and avoid depth artifacts like shadow acne.
func (MTLRenderCommandEncoderObject) SetDepthClipMode ¶
func (o MTLRenderCommandEncoderObject) SetDepthClipMode(depthClipMode MTLDepthClipMode)
Configures how the render pipeline handles fragments outside the near and far planes of the view frustum.
depthClipMode: The mode that determines how to handle fragments outside the near and far planes.
Discussion ¶
You can use depth clipping to ignore fragments outside the z-axis boundaries of a viewing volume.
The render pass’s default clip mode is [DepthClipModeClip].
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthClipMode(_:)
func (MTLRenderCommandEncoderObject) SetDepthStencilState ¶
func (o MTLRenderCommandEncoderObject) SetDepthStencilState(depthStencilState MTLDepthStencilState)
Configures the combined depth and stencil state.
depthStencilState: An instance that conforms to the MTLDepthStencilState protocol.
Discussion ¶
This method changes the combined depth and stencil state for the render command encoder that’s compatible with its depth and stencil attachment configuration. For example, if the new state enables depth testing or depth writing, the render pass needs to have a depth attachment. Similarly, if the new state enables stencil testing or stencil writing, the render pass’s stencil needs to have a stencil attachment. You create depth and stencil attachments for a render pass by assigning the [DepthAttachment] and [StencilAttachment] properties of the MTLRenderPassDescriptor instance that creates it.
Pass `nil` to clear the state from the previous call, which restores a state that’s equivalent to the default values of an MTLDepthStencilDescriptor instance’s properties.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthStencilState(_:)
func (MTLRenderCommandEncoderObject) SetDepthStoreAction ¶
func (o MTLRenderCommandEncoderObject) SetDepthStoreAction(storeAction MTLStoreAction)
Configures the store action for the depth attachment.
storeAction: A store action for the depth attachment that can’t be [StoreActionUnknown].
Discussion ¶
This method changes the render command encoder’s store action for the depth attachment. You can assign the default store action for the depth attachment by configuring the [StoreAction] property of its MTLRenderPassDepthAttachmentDescriptor (see MTLRenderPassDescriptor and its [DepthAttachment] property).
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setDepthStoreAction(_:)
func (MTLRenderCommandEncoderObject) SetDepthStoreActionOptions ¶
func (o MTLRenderCommandEncoderObject) SetDepthStoreActionOptions(storeActionOptions MTLStoreActionOptions)
Configures the store action options for the depth attachment.
storeActionOptions: Additional options for the store action of the depth attachment.
func (MTLRenderCommandEncoderObject) SetDepthTestMinBoundMaxBound ¶
func (o MTLRenderCommandEncoderObject) SetDepthTestMinBoundMaxBound(minBound float32, maxBound float32)
Configures the minimum and maximum bounds for depth bounds testing.
minBound: A minimum bound for depth testing, which discards fragments with a stored depth that is less than `minBound`.
maxBound: A maximum bound for depth testing, which discards fragments with a stored depth that is greater than `maxBound`.
Discussion ¶
The render command encoder disables depth bounds testing by default. The render command encoder also disables depth bounds testing when all of the following properties equal a specific value:
- The `minBound` property is equal to `0.0f`. - The `maxBound` property is equal to `1.0f`. Both `minBound` and `maxBound` need to be within `[0.0f, 1.0f]`, and `minBound` needs to be less than or equal to `maxBound`.
func (MTLRenderCommandEncoderObject) SetFragmentAccelerationStructureAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
Assigns an acceleration structure to an entry in the fragment shader argument table.
accelerationStructure: An MTLAccelerationStructure instance the command assigns to an entry in the fragment shader argument table for acceleration structures.
bufferIndex: An integer that represents the entry in the fragment shader argument table for acceleration structures that stores a record of `accelerationStructure`.
Discussion ¶
By default, the acceleration structure at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentBufferOffsetAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentBufferOffsetAtIndex(offset uint, index uint)
Updates an entry in the fragment shader argument table with a new location within the entry’s current buffer.
offset: An integer that represents the location, in bytes, from the start of `buffer` where the fragment shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
index: An integer that represents the entry in the fragment shader argument table for buffers that already stores a record of an MTLBuffer.
Discussion ¶
The command this method encodes changes the offset for a fragment buffer that already has a previous assignment from one of your earlier commands.
For more information, see:
- setFragmentBuffer(_:offset:index:) - setFragmentBuffers(_:offsets:range:) (Swift) - [SetFragmentBuffersOffsetsWithRange] (Objective-C)
The command can also adjust the offset for an entry that you previously set with the [SetFragmentBytesLengthAtIndex] method.
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentBuffersOffsetsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetFragmentBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Assigns multiple buffers to a range of entries in the fragment shader argument table.
buffers: A pointer to a C array of MTLBuffer instances the command assigns to entries in the fragment shader argument table for buffers.
offsets: A pointer to a C array of unsigned integers. Each element represents the location, in bytes, from the start of the corresponding MTLBuffer element in `buffers` where the fragment shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
range: A span of integers that represent the entries in the fragment shader argument table for buffers. Each entry stores a record of the corresponding element in `buffers` and `offsets`.
Discussion ¶
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentBytesLengthAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentBytesLengthAtIndex(bytes []byte, index uint)
Creates a buffer from bytes and assigns it to an entry in the fragment shader argument table.
bytes: A pointer to argument data the method copies to an MTLBuffer and assigns to an entry in the fragment shader argument table for buffers.
length: The number of bytes the method copies from the `bytes` pointer.
index: An integer that represents the entry in the fragment shader argument table for buffers that stores a record of the MTLBuffer the method creates from `bytes`.
Discussion ¶
The method is equivalent to creating an MTLBuffer instance that contains the same data as `bytes` and calling the setFragmentBuffer(_:offset:index:) method. However, this method avoids the overhead of creating a buffer to store your data; instead, Metal manages the data.
For data that’s more than 4 KB, create an MTLBuffer instance and pass it to setFragmentBuffer(_:offset:index:).
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentIntersectionFunctionTableAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
Assigns an intersection function table to an entry in the fragment shader argument table.
intersectionFunctionTable: An MTLIntersectionFunctionTable instance the command assigns to an entry in the fragment shader argument table for intersection function tables.
bufferIndex: An integer that represents the entry in the fragment shader argument table for intersection function tables that stores a record of `intersectionFunctionTable`.
Discussion ¶
By default, the intersection function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentIntersectionFunctionTablesWithBufferRange ¶
func (o MTLRenderCommandEncoderObject) SetFragmentIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
Assigns multiple intersection function tables to a range of entries in the fragment shader argument table.
intersectionFunctionTables: A pointer to a C array of MTLIntersectionFunctionTable instances the command assigns to entries in the fragment shader argument table for intersection function tables.
range: A span of integers that represent the entries in the fragment shader argument table for intersection function tables. Each entry stores a record of the corresponding element in `intersectionFunctionTables`.
Discussion ¶
By default, the intersection function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentSamplerStateAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStateAtIndex(sampler MTLSamplerState, index uint)
Assigns a sampler state to an entry in the fragment shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the fragment shader argument table for sampler states.
index: An integer that represents the entry in the fragment shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentSamplerStateLodMinClampLodMaxClampAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
Assigns a sampler state and clamp values to an entry in the fragment shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the fragment shader argument table for sampler states.
lodMinClamp: The smallest level of detail value a fragment shader can use when it samples a texture.
lodMaxClamp: The largest level of detail value a fragment shader can use when it samples a texture.
index: An integer that represents the entry in the fragment shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
The method’s `lodMinClamp` and `lodMaxClamp` parameters override the default values for `sampler`. You can set the sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentSamplerStatesLodMinClampsLodMaxClampsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
Assigns multiple sampler states and clamp values to a range of entries in the fragment shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the fragment shader argument table for sampler states.
lodMinClamps: A pointer to a C array of floating-point values. Each element is the smallest level of detail value a fragment shader can use when it samples a texture with the corresponding element in `samplers`.
lodMaxClamps: A pointer to a C array of floating-point values. Each element is the largest level of detail value a fragment shader can use when it samples a texture with the corresponding element in `samplers`.
range: A span of integers that represent the entries in the fragment shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
Each element of the method’s `lodMinClamps` and `lodMaxClamps` parameters overrides the default values for the corresponding sampler in `samplers`. You can set a sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentSamplerStatesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetFragmentSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
Assigns multiple sampler states to a range of entries in the fragment shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the fragment shader argument table for sampler states.
range: A span of integers that represent the entries in the fragment shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentTextureAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentTextureAtIndex(texture MTLTexture, index uint)
Assigns a texture to an entry in the fragment shader argument table.
texture: An MTLTexture instance the command assigns to an entry in the fragment shader argument table for textures.
index: An integer that represents the entry in the fragment shader argument table for textures that stores a record of `texture`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFragmentTexture(_:index:)
func (MTLRenderCommandEncoderObject) SetFragmentTexturesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetFragmentTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
Assigns multiple textures to a range of entries in the fragment shader argument table.
textures: A pointer to a C array of MTLTexture instances the command assigns to entries in the fragment shader argument table for textures.
range: A span of integers that represent the entries in the fragment shader argument table for textures. Each entry stores a record of the corresponding element in `textures`.
Discussion ¶
By default, the texture at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentVisibleFunctionTableAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetFragmentVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
Assigns a visible function table to an entry in the fragment shader argument table.
functionTable: An MTLVisibleFunctionTable instance the command assigns to an entry in the fragment shader argument table for visible function tables.
bufferIndex: An integer that represents the entry in the fragment shader argument table for visible function tables that stores a record of `functionTable`.
Discussion ¶
By default, the visible function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFragmentVisibleFunctionTablesWithBufferRange ¶
func (o MTLRenderCommandEncoderObject) SetFragmentVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
Assigns multiple visible function tables to a range of entries in the fragment shader argument table.
functionTables: A pointer to a C array of MTLVisibleFunctionTable instances the command assigns to entries in the fragment shader argument table for visible function tables.
range: A span of integers that represent the entries in the fragment shader argument table for visible function tables. Each entry stores a record of the corresponding element in `functionTables`.
Discussion ¶
By default, the visible function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetFrontFacingWinding ¶
func (o MTLRenderCommandEncoderObject) SetFrontFacingWinding(frontFacingWinding MTLWinding)
Configures which face of a primitive, such as a triangle, is the front.
frontFacingWinding: An MTLWinding value that configures how the render pipeline defines which side of a primitive is its front. // MTLWinding: https://developer.apple.com/documentation/Metal/MTLWinding
Discussion ¶
The render pass’s default front-facing mode is [WindingClockwise].
The winding direction of a primitive determines whether the render pass culls it (see [SetCullMode]).
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setFrontFacing(_:)
func (MTLRenderCommandEncoderObject) SetLabel ¶
func (o MTLRenderCommandEncoderObject) SetLabel(value string)
func (MTLRenderCommandEncoderObject) SetMeshBufferOffsetAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetMeshBufferOffsetAtIndex(offset uint, index uint)
Updates an entry in the mesh shader argument table with a new location within the entry’s current buffer.
offset: An integer that represents the location, in bytes, from the start of `buffer` where the mesh shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
index: An integer that represents the entry in the mesh shader argument table for buffers that already stores a record of an MTLBuffer.
Discussion ¶
The command this method encodes changes the offset for a mesh buffer that already has a previous assignment from one of your earlier commands.
For more information, see:
- setMeshBuffer(_:offset:index:) - setMeshBuffers(_:offsets:range:) (Swift) - [SetMeshBuffersOffsetsWithRange] (Objective-C)
The command can also adjust the offset for an entry that you previously set with the [SetMeshBytesLengthAtIndex] method.
func (MTLRenderCommandEncoderObject) SetMeshBuffersOffsetsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetMeshBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Assigns multiple buffers to a range of entries in the mesh shader argument table.
buffers: A pointer to a C array of MTLBuffer instances the command assigns to entries in the mesh shader argument table for buffers.
offsets: A pointer to a C array of unsigned integers. Each element represents the location, in bytes, from the start of the corresponding MTLBuffer element in `buffers` where the mesh shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
range: A span of integers that represent the entries in the mesh shader argument table for buffers. Each entry stores a record of the corresponding element in `buffers` and `offsets`.
Discussion ¶
By default, the texture at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetMeshBytesLengthAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetMeshBytesLengthAtIndex(bytes []byte, index uint)
Creates a buffer from bytes and assigns it to an entry in the mesh shader argument table.
bytes: A pointer to argument data the method copies to an MTLBuffer and assigns to an entry in the mesh shader argument table for buffers.
length: The number of bytes the method copies from the `bytes` pointer.
index: An integer that represents the entry in the mesh shader argument table for buffers that stores a record of the MTLBuffer the method creates from `bytes`.
Discussion ¶
The method is equivalent to creating an MTLBuffer instance that contains the same data as `bytes` and calling the setMeshBuffer(_:offset:index:) method. However, this method avoids the overhead of creating a buffer to store your data; instead, Metal manages the data.
For data that’s more than 4 KB, create an MTLBuffer instance and pass it to [SetMeshBufferOffsetAtIndex].
func (MTLRenderCommandEncoderObject) SetMeshSamplerStateAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetMeshSamplerStateAtIndex(sampler MTLSamplerState, index uint)
Assigns a sampler state to an entry in the mesh shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the mesh shader argument table for sampler states.
index: An integer that represents the entry in the mesh shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetMeshSamplerStateLodMinClampLodMaxClampAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetMeshSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
Assigns a sampler state and clamp values to an entry in the mesh shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the mesh shader argument table for sampler states.
lodMinClamp: The smallest level of detail value a mesh shader can use when it samples a texture.
lodMaxClamp: The largest level of detail value a mesh shader can use when it samples a texture.
index: An integer that represents the entry in the mesh shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
The method’s `lodMinClamp` and `lodMaxClamp` parameters override the default values for `sampler`. You can set the sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetMeshSamplerStatesLodMinClampsLodMaxClampsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetMeshSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
Assigns multiple sampler states and clamp values to a range of entries in the mesh shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the mesh shader argument table for sampler states.
lodMinClamps: A pointer to a C array of floating-point values. Each element is the smallest level of detail value a mesh shader can use when it samples a texture with the corresponding element in `samplers`.
lodMaxClamps: A pointer to a C array of floating-point values. Each element is the largest level of detail value a mesh shader can use when it samples a texture with the corresponding element in `samplers`.
range: A span of integers that represent the entries in the mesh shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
Each element of the method’s `lodMinClamps` and `lodMaxClamps` parameters overrides the default values for the corresponding sampler in `samplers`. You can set a sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetMeshSamplerStatesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetMeshSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
Assigns multiple sampler states to a range of entries in the mesh shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the mesh shader argument table for sampler states.
range: A span of integers that represent the entries in the mesh shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetMeshTextureAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetMeshTextureAtIndex(texture MTLTexture, index uint)
Assigns a texture to an entry in the mesh shader argument table.
texture: An MTLTexture instance the command assigns to an entry in the mesh shader argument table for textures.
index: An integer that represents the entry in the mesh shader argument table for textures that stores a record of `texture`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshTexture(_:index:)
func (MTLRenderCommandEncoderObject) SetMeshTexturesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetMeshTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
Assigns multiple textures to a range of entries in the mesh shader argument table.
textures: A pointer to a C array of MTLTexture instances the command assigns to entries in the mesh shader argument table for textures.
range: A span of integers that represent the entries in the mesh shader argument table for textures. Each entry stores a record of the corresponding element in `textures`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setMeshTextures:withRange:
func (MTLRenderCommandEncoderObject) SetObjectBufferOffsetAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetObjectBufferOffsetAtIndex(offset uint, index uint)
Updates an entry in the object shader argument table with a new location within the entry’s current buffer.
offset: An integer that represents the location, in bytes, from the start of `buffer` where the object shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
index: An integer that represents the entry in the object shader argument table for buffers that already stores a record of an MTLBuffer.
Discussion ¶
The command this method encodes changes the offset for a mesh buffer that already has a previous assignment from one of your earlier commands.
For more information, see:
- setObjectBuffer(_:offset:index:) - setObjectBuffers(_:offsets:range:) (Swift) - [SetObjectBuffersOffsetsWithRange] (Objective-C)
The command can also adjust the offset for an entry that you previously set with the [SetObjectBytesLengthAtIndex] method.
func (MTLRenderCommandEncoderObject) SetObjectBuffersOffsetsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetObjectBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Encodes a command that assigns multiple buffers to a range of entries in the object shader argument table.
buffers: A pointer to a C array of MTLBuffer instances the command assigns to entries in the object shader argument table for buffers.
offsets: A pointer to a C array of unsigned integers. Each element represents the location, in bytes, from the start of the corresponding MTLBuffer element in `buffers` where the object shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
range: A span of integers that represent the entries in the object shader argument table for buffers. Each entry stores a record of the corresponding element in `buffers` and `offsets`.
Discussion ¶
By default, the texture at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetObjectBytesLengthAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetObjectBytesLengthAtIndex(bytes []byte, index uint)
Creates a buffer from bytes and assigns it to an entry in the object shader argument table.
bytes: A pointer to argument data the method copies to an MTLBuffer and assigns to an entry in the object shader argument table for buffers.
length: The number of bytes the method copies from the `bytes` pointer.
index: An integer that represents the entry in the object shader argument table for buffers that stores a record of the MTLBuffer the method creates from `bytes`.
Discussion ¶
The method is equivalent to creating an MTLBuffer instance that contains the same data as `bytes` and calling the [SetObjectBufferOffsetAtIndex] method. However, this method avoids the overhead of creating a buffer to store your data; instead, Metal manages the data.
For data that’s more than 4 KB, create an MTLBuffer instance and pass it to setObjectBuffer(_:offset:index:).
func (MTLRenderCommandEncoderObject) SetObjectSamplerStateAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetObjectSamplerStateAtIndex(sampler MTLSamplerState, index uint)
Assigns a sampler state to an entry in the object shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the object shader argument table for sampler states.
index: An integer that represents the entry in the object argument table for sampler states that stores a record of `sampler`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetObjectSamplerStateLodMinClampLodMaxClampAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetObjectSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
Assigns a sampler state and clamp values to an entry in the object shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the object shader argument table for sampler states.
lodMinClamp: The smallest level of detail value an object shader can use when it samples a texture.
lodMaxClamp: The largest level of detail value an object shader can use when it samples a texture.
index: An integer that represents the entry in the object argument table for sampler states that stores a record of `sampler`.
Discussion ¶
The method’s `lodMinClamp` and `lodMaxClamp` parameters override the default values for `sampler`. You can set the sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetObjectSamplerStatesLodMinClampsLodMaxClampsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetObjectSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
Assigns multiple sampler states and clamp values to a range of entries in the object shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the object shader argument table for sampler states.
lodMinClamps: A pointer to a C array of floating-point values. Each element is the smallest level of detail value an object shader can use when it samples a texture with the corresponding element in `samplers`.
lodMaxClamps: A pointer to a C array of floating-point values. Each element is the largest level of detail value an object shader can use when it samples a texture with the corresponding element in `samplers`.
range: A span of integers that represent the entries in the object shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
Each element of the method’s `lodMinClamps` and `lodMaxClamps` parameters overrides the default values for the corresponding sampler in `samplers`. You can set a sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetObjectSamplerStatesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetObjectSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
Assigns multiple sampler states to a range of entries in the object shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the object shader argument table for sampler states.
range: A span of integers that represent the entries in the object shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetObjectTextureAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetObjectTextureAtIndex(texture MTLTexture, index uint)
Assigns a texture to an entry in the object shader argument table.
texture: An MTLTexture instance the command assigns to an entry in the object shader argument table for textures.
index: An integer that represents the entry in the object shader argument table for textures that stores a record of `texture`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectTexture(_:index:)
func (MTLRenderCommandEncoderObject) SetObjectTexturesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetObjectTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
Assigns multiple textures to a range of entries in the object shader argument table.
textures: A pointer to a C array of MTLTexture instances the command assigns to entries in the object shader argument table for textures.
range: A span of integers that represent the entries in the object shader argument table for textures. Each entry stores a record of the corresponding element in `textures`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setObjectTextures:withRange:
func (MTLRenderCommandEncoderObject) SetObjectThreadgroupMemoryLengthAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetObjectThreadgroupMemoryLengthAtIndex(length uint, index uint)
Configures the size of a threadgroup memory buffer for an entry in the object argument table.
length: The threadgroup memory length, in bytes.
index: An integer that represents an entry in the object argument table.
func (MTLRenderCommandEncoderObject) SetRenderPipelineState ¶
func (o MTLRenderCommandEncoderObject) SetRenderPipelineState(pipelineState MTLRenderPipelineState)
Configures the encoder with a render or tile pipeline state that applies to your subsequent draw commands.
pipelineState: A render pipeline state that you create by calling an MTLDevice methods (see [Pipeline state creation]). // [Pipeline state creation]: https://developer.apple.com/documentation/Metal/pipeline-state-creation
Discussion ¶
Set the render pass’s render pipeline state before encoding any draw or tile commands by calling this method because the default pipeline state is `nil`.
You can change which pipeline state the encoder uses multiple times during its lifetime. For example, your app may want render some things with a vertex shader, and render others with an object and mesh shader. Changing the pipeline state only affects the subsequent commands and has no effect on the commands you encode before changing the state.
The render pipeline you pass to this method needs to be compatible with the render pass’s attachments. You configure these attachments with the properties of an MTLRenderPassDescriptor instance, including [ColorAttachments], [DepthAttachment], and [StencilAttachment].
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setRenderPipelineState(_:)
func (MTLRenderCommandEncoderObject) SetScissorRect ¶
func (o MTLRenderCommandEncoderObject) SetScissorRect(rect MTLScissorRect)
Configures a rectangle for the fragment scissor test.
rect: An MTLScissorRect instance that represents a rectangle that needs to lie completely within the current render attachment. // MTLScissorRect: https://developer.apple.com/documentation/Metal/MTLScissorRect
Discussion ¶
The rendering pipeline discards any fragments that lie outside the scissor rectangle.
The default scissor rectangle is the same size as the current render attachment, with its origin coordinates in the upper-left corner at `(0, 0)`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setScissorRect(_:)
func (MTLRenderCommandEncoderObject) SetScissorRectsCount ¶
func (o MTLRenderCommandEncoderObject) SetScissorRectsCount(scissorRects []MTLScissorRect, count uint)
Configures multiple rectangles for the fragment scissor test.
scissorRects: An array of MTLScissorRect instances the command applies to the render pipeline for clipping. // MTLScissorRect: https://developer.apple.com/documentation/Metal/MTLScissorRect
count: The number of elements in the `scissorRects` array.
Discussion ¶
The rendering pipeline discards any fragments that lie outside the scissor rectangle. The default scissor rectangle is the same size as the current render attachment, with its origin coordinates in the upper-left corner at `(0, 0)`.
Use this method to configure a different scissor rectangle for multiple viewports you configure with the setViewports(_:) method. Multiple viewports give your app the ability to draw into separate areas of an image with a single draw call. You can either set a single scissor rectangle for all viewports with the [SetScissorRect] method, or set each viewport’s rectangle with this method.
The maximum number of viewports and scissor rectangles a GPU supports varies by device family. For more information, see MTLGPUFamily and Detecting GPU features and Metal software versions.
The rendering pipeline sends each primitive to a single viewport and its associated scissor rectangle. You can select which viewport each primitive uses in your vertex shader by adding the `[[viewport_array_index]]` attribute to an output value.
The [SetScissorRect] method is equivalent to calling this method with a single element in the `scissorRects` array.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setScissorRects:count:
func (MTLRenderCommandEncoderObject) SetStencilFrontReferenceValueBackReferenceValue ¶
func (o MTLRenderCommandEncoderObject) SetStencilFrontReferenceValueBackReferenceValue(frontReferenceValue uint32, backReferenceValue uint32)
Configures different comparison values for front- and back-facing primitives.
frontReferenceValue: A stencil test comparison value the render pipeline applies to only front-facing primitives.
backReferenceValue: A stencil test comparison value the render pipeline applies to only back-facing primitives.
Discussion ¶
The command sets separate reference values for front- and back-facing primitives (see [StencilCompareFunction], [FrontFaceStencil], and [BackFaceStencil]). These reference values apply to the stencil state you set with the [SetDepthStencilState] method.
The render pass’s default reference value for the front and back stencil compare function is `0`.
func (MTLRenderCommandEncoderObject) SetStencilReferenceValue ¶
func (o MTLRenderCommandEncoderObject) SetStencilReferenceValue(referenceValue uint32)
Configures the same comparison value for front- and back-facing primitives.
referenceValue: A stencil test comparison value the render pipeline applies to both front- and back-facing primitives.
Discussion ¶
The command sets the same reference value for front- and back-facing primitives (see [StencilCompareFunction], [FrontFaceStencil], and [BackFaceStencil]). This reference value applies to the stencil state you set with the [SetDepthStencilState] method.
The render pass’s default reference value for the front and back stencil compare function is `0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setStencilReferenceValue(_:)
func (MTLRenderCommandEncoderObject) SetStencilStoreAction ¶
func (o MTLRenderCommandEncoderObject) SetStencilStoreAction(storeAction MTLStoreAction)
Configures the store action for the stencil attachment.
storeAction: A store action for the stencil attachment that can’t be [StoreActionUnknown].
Discussion ¶
This method changes the render command encoder’s store action for the stencil attachment. You can assign the default store action for the stencil attachment by configuring the [StoreAction] property of its MTLRenderPassStencilAttachmentDescriptor (see MTLRenderPassDescriptor and its [StencilAttachment] property).
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setStencilStoreAction(_:)
func (MTLRenderCommandEncoderObject) SetStencilStoreActionOptions ¶
func (o MTLRenderCommandEncoderObject) SetStencilStoreActionOptions(storeActionOptions MTLStoreActionOptions)
Configures the store action options for the stencil attachment.
storeActionOptions: Additional options for the store action of the stencil attachment.
func (MTLRenderCommandEncoderObject) SetTessellationFactorBufferOffsetInstanceStride ¶
func (o MTLRenderCommandEncoderObject) SetTessellationFactorBufferOffsetInstanceStride(buffer MTLBuffer, offset uint, instanceStride uint)
Configures the per-patch tessellation factors for any subsequent patch-drawing commands.
buffer: An MTLBuffer instance that stores the per-patch tessellation factors, which can’t be empty or `nil`.
offset: The distance, in bytes, between the start of the data and the start of the buffer, which needs to be a multiple of `4`.
instanceStride: The number of bytes between two instances of data in `buffer`, which needs to be a multiple of `4`.
Discussion ¶
Call this method before encoding patch-drawing commands.
func (MTLRenderCommandEncoderObject) SetTessellationFactorScale ¶
func (o MTLRenderCommandEncoderObject) SetTessellationFactorScale(scale float32)
Configures the scale factor for per-patch tessellation factors.
scale: A positive, normal floating-point scale factor the render pass applies to the per-patch tessellation factors.
The value of `scale` can’t be negative, infinite, equal to [NaN] (not a number), or a denormalized number.
Discussion ¶
The command converts `scale` to a half-precision floating-point value before it applies it to the per-patch tessellation factors (see [SetTessellationFactorBufferOffsetInstanceStride]).
func (MTLRenderCommandEncoderObject) SetThreadgroupMemoryLengthOffsetAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetThreadgroupMemoryLengthOffsetAtIndex(length uint, offset uint, index uint)
Configures the size of a threadgroup memory buffer for an entry in the fragment or tile shader argument table.
length: The threadgroup memory length, in bytes.
offset: An integer that represents the location, in bytes, from the start of the buffer at `index` where the threadgroup memory begins.
index: An integer that represents an entry in the buffer argument table.
Discussion ¶
You can only change the threadgroup memory’s size between tile dispatches (see [DispatchThreadsPerTile]).
func (MTLRenderCommandEncoderObject) SetTileAccelerationStructureAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
Assigns an acceleration structure to an entry in the tile shader argument table.
accelerationStructure: An MTLAccelerationStructure instance the command assigns to an entry in the tile shader argument table for acceleration structures.
bufferIndex: An integer that represents the entry in the tile shader argument table for acceleration structures that stores a record of `accelerationStructure`.
Discussion ¶
By default, the acceleration structure at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileBufferOffsetAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileBufferOffsetAtIndex(offset uint, index uint)
Updates an entry in the tile shader argument table with a new location within the entry’s current buffer.
offset: An integer that represents the location, in bytes, from the start of `buffer` where the tile shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
index: An integer that represents the entry in the tile shader argument table for buffers that already stores a record of an MTLBuffer.
Discussion ¶
The command this method encodes changes the offset for a fragment buffer that already has a previous assignment from one of your earlier commands.
For more information, see:
- setTileBuffer(_:offset:index:) - setTileBuffers(_:offsets:range:) (Swift) - [SetTileBuffersOffsetsWithRange] (Objective-C)
The command can also adjust the offset for an entry that you previously set with the [SetTileBytesLengthAtIndex] method.
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileBuffersOffsetsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetTileBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Assigns multiple buffers to a range of entries in the tile shader argument table.
buffers: A pointer to a C array of MTLBuffer instances the command assigns to entries in the tile shader argument table for buffers.
offsets: A pointer to a C array of unsigned integers. Each element represents the location, in bytes, from the start of the corresponding MTLBuffer element in `buffers` where the tile shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
range: A span of integers that represent the entries in the tile shader argument table for buffers. Each entry stores a record of the corresponding element in `buffers` and `offsets`.
Discussion ¶
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileBytesLengthAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileBytesLengthAtIndex(bytes []byte, index uint)
Creates a buffer from bytes and assigns it to an entry in the tile shader argument table.
bytes: A pointer to argument data the method copies to an MTLBuffer and assigns to an entry in the tile shader argument table for buffers.
length: The number of bytes the method copies from the `bytes` pointer.
index: An integer that represents the entry in the tile shader argument table for buffers that stores a record of the MTLBuffer the method creates from `bytes`.
Discussion ¶
The method is equivalent to creating an MTLBuffer instance that contains the same data as `bytes` and calling the setTileBuffer(_:offset:index:) method. However, this method avoids the overhead of creating a buffer to store your data; instead, Metal manages the data.
For data that’s more than 4 KB, create an MTLBuffer instance and pass it to setTileBuffer(_:offset:index:).
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileIntersectionFunctionTableAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
Assigns an intersection function table to an entry in the tile shader argument table.
intersectionFunctionTable: An MTLIntersectionFunctionTable instance the command assigns to an entry in the tile shader argument table for intersection function tables.
bufferIndex: An integer that represents the entry in the tile shader argument table for intersection function tables that stores a record of `intersectionFunctionTable`.
Discussion ¶
By default, the intersection function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileIntersectionFunctionTablesWithBufferRange ¶
func (o MTLRenderCommandEncoderObject) SetTileIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
Assigns multiple intersection function tables to a range of entries in the tile shader argument table.
intersectionFunctionTables: A pointer to a C array of MTLIntersectionFunctionTable instances the command assigns to entries in the tile shader argument table for intersection function tables.
range: A span of integers that represent the entries in the tile shader argument table for intersection function tables. Each entry stores a record of the corresponding element in `intersectionFunctionTables`.
Discussion ¶
By default, the intersection function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileSamplerStateAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileSamplerStateAtIndex(sampler MTLSamplerState, index uint)
Assigns a sampler state to an entry in the tile shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the tile shader argument table for sampler states.
index: An integer that represents the entry in the tile shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileSamplerStateLodMinClampLodMaxClampAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
Assigns a sampler state and clamp values to an entry in the tile shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the tile shader argument table for sampler states.
lodMinClamp: The smallest level of detail value a tile shader can use when it samples a texture.
lodMaxClamp: The largest level of detail value a tile shader can use when it samples a texture.
index: An integer that represents the entry in the tile shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
The method’s `lodMinClamp` and `lodMaxClamp` parameters override the default values for `sampler`. You can set the sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileSamplerStatesLodMinClampsLodMaxClampsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetTileSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
Assigns multiple sampler states and clamp values to a range of entries in the tile shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the tile shader argument table for sampler states.
lodMinClamps: A pointer to a C array of floating-point values. Each element is the smallest level of detail value a tile shader can use when it samples a texture with the corresponding element in `samplers`.
lodMaxClamps: A pointer to a C array of floating-point values. Each element is the largest level of detail value a tile shader can use when it samples a texture with the corresponding element in `samplers`.
range: A span of integers that represent the entries in the tile shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
Each element of the method’s `lodMinClamps` and `lodMaxClamps` parameters overrides the default values for the corresponding sampler in `samplers`. You can set a sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileSamplerStatesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetTileSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
Assigns multiple sampler states to a range of entries in the tile shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the tile shader argument table for sampler states.
range: A span of integers that represent the entries in the tile shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileTextureAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileTextureAtIndex(texture MTLTexture, index uint)
Assigns a texture to an entry in the tile shader argument table.
texture: An MTLTexture instance the command assigns to an entry in the tile shader argument table for textures.
index: An integer that represents the entry in the tile shader argument table for textures that stores a record of `texture`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileTexture(_:index:)
func (MTLRenderCommandEncoderObject) SetTileTexturesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetTileTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
Assigns multiple textures to a range of entries in the tile shader argument table.
textures: A pointer to a C array of MTLTexture instances the command assigns to entries in the tile shader argument table for textures.
range: A span of integers that represent the entries in the tile shader argument table for textures. Each entry stores a record of the corresponding element in `textures`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTileTextures:withRange:
func (MTLRenderCommandEncoderObject) SetTileVisibleFunctionTableAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetTileVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
Assigns a visible function table to an entry in the tile shader argument table.
functionTable: An MTLVisibleFunctionTable instance the command assigns to an entry in the tile shader argument table for visible function tables.
bufferIndex: An integer that represents the entry in the tile shader argument table for visible function tables that stores a record of `functionTable`.
Discussion ¶
By default, the visible function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTileVisibleFunctionTablesWithBufferRange ¶
func (o MTLRenderCommandEncoderObject) SetTileVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
Assigns multiple visible function tables to a range of entries in the tile shader argument table.
functionTables: A pointer to a C array of MTLVisibleFunctionTable instances the command assigns to entries in the tile shader argument table for visible function tables.
range: A span of integers that represent the entries in the tile shader argument table for visible function tables. Each entry stores a record of the corresponding element in `functionTables`.
Discussion ¶
By default, the visible function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetTriangleFillMode ¶
func (o MTLRenderCommandEncoderObject) SetTriangleFillMode(fillMode MTLTriangleFillMode)
Configures how subsequent draw commands rasterize triangle and triangle strip primitives.
fillMode: A triangle filling mode the render pass applies to draw commands that rasterize triangles or triangle strips.
Discussion ¶
The render pass’s default mode is [TriangleFillModeFill].
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setTriangleFillMode(_:)
func (MTLRenderCommandEncoderObject) SetVertexAccelerationStructureAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexAccelerationStructureAtBufferIndex(accelerationStructure MTLAccelerationStructure, bufferIndex uint)
Assigns an acceleration structure to an entry in the vertex shader argument table.
accelerationStructure: An MTLAccelerationStructure instance the command assigns to an entry in the vertex shader argument table for acceleration structures.
bufferIndex: An integer that represents the entry in the vertex shader argument table for acceleration structures that stores a record of `accelerationStructure`.
Discussion ¶
By default, the acceleration structure at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexAmplificationCountViewMappings ¶
func (o MTLRenderCommandEncoderObject) SetVertexAmplificationCountViewMappings(count uint, viewMappings *MTLVertexAmplificationViewMapping)
Configures the number of output vertices the render pipeline produces for each input vertex, optionally with render target and viewport offsets.
count: The number of outputs to create.
viewMappings: An optional pointer to a C array that has at least `count` MTLVertexAmplificationViewMapping elements. Each element in the array provides per-output offsets to a specific render target and viewport. // MTLVertexAmplificationViewMapping: https://developer.apple.com/documentation/Metal/MTLVertexAmplificationViewMapping
Discussion ¶
With , you can encode drawing commands that process the same vertex multiple times, one per render target. You can configure the render pipeline’s vertex amplification multiplier by calling this method with a `count` argument that’s greater than `1`.
For more information about vertex amplification and how to use the `viewMappings` parameter, see Improving rendering performance with vertex amplification.
func (MTLRenderCommandEncoderObject) SetVertexBufferOffsetAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexBufferOffsetAtIndex(offset uint, index uint)
Updates an entry in the vertex shader argument table with a new location within the entry’s current buffer.
offset: An integer that represents the location, in bytes, from the start of `buffer` where the vertex shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
index: An integer that represents the entry in the vertex shader argument table for buffers that already stores a record of an MTLBuffer.
Discussion ¶
The command this method encodes changes the offset for a fragment buffer that already has a previous assignment from one of your earlier commands.
For more information, see:
- setVertexBuffer(_:offset:index:) - setVertexBuffers(_:offsets:range:) (Swift) - [SetVertexBuffersOffsetsWithRange] (Objective-C)
The command can also adjust the offset for an entry that you previously set with the [SetVertexBytesLengthAtIndex] method.
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexBufferOffsetAttributeStrideAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexBufferOffsetAttributeStrideAtIndex(offset uint, stride uint, index uint)
func (MTLRenderCommandEncoderObject) SetVertexBuffersOffsetsAttributeStridesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetVertexBuffersOffsetsAttributeStridesWithRange(buffers []MTLBuffer, offsets uint, strides uint, range_ foundation.NSRange)
func (MTLRenderCommandEncoderObject) SetVertexBuffersOffsetsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetVertexBuffersOffsetsWithRange(buffers []MTLBuffer, offsets uint, range_ foundation.NSRange)
Assigns multiple buffers to a range of entries in the vertex shader argument table.
buffers: A pointer to a C array of MTLBuffer instances the command assigns to entries in the vertex shader argument table for buffers.
offsets: A pointer to a C array of unsigned integers. Each element represents the location, in bytes, from the start of the corresponding MTLBuffer element in `buffers` where the vertex shader argument data begins.
See the [Metal feature set tables (PDF)] to check for offset alignment requirements for buffers in `device` and `constant` address space. // [Metal feature set tables (PDF)]: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
range: A span of integers that represent the entries in the vertex shader argument table for buffers. Each entry stores a record of the corresponding element in `buffers` and `offsets`.
Discussion ¶
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexBytesLengthAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexBytesLengthAtIndex(bytes []byte, index uint)
Creates a buffer from bytes and assigns it to an entry in the vertex shader argument table.
bytes: A pointer to argument data the method copies to an MTLBuffer and assigns to an entry in the vertex shader argument table for buffers.
length: The number of bytes the method copies from the `bytes` pointer.
index: An integer that represents the entry in the vertex shader argument table for buffers that stores a record of the MTLBuffer the method creates from `bytes`.
Discussion ¶
The method is equivalent to creating an MTLBuffer instance that contains the same data as `bytes` and calling the setVertexBuffer(_:offset:index:) method. However, this method avoids the overhead of creating a buffer to store your data; instead, Metal manages the data.
For data that’s more than 4 KB, create an MTLBuffer instance and pass it to setVertexBuffer(_:offset:index:).
By default, the buffer at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexBytesLengthAttributeStrideAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexBytesLengthAttributeStrideAtIndex(bytes []byte, stride uint, index uint)
func (MTLRenderCommandEncoderObject) SetVertexIntersectionFunctionTableAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexIntersectionFunctionTableAtBufferIndex(intersectionFunctionTable MTLIntersectionFunctionTable, bufferIndex uint)
Assigns an intersection function table to an entry in the vertex shader argument table.
intersectionFunctionTable: An MTLIntersectionFunctionTable instance the command assigns to an entry in the vertex shader argument table for intersection function tables.
bufferIndex: An integer that represents the entry in the vertex shader argument table for intersection function tables that stores a record of `intersectionFunctionTable`.
Discussion ¶
By default, the intersection function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexIntersectionFunctionTablesWithBufferRange ¶
func (o MTLRenderCommandEncoderObject) SetVertexIntersectionFunctionTablesWithBufferRange(intersectionFunctionTables []MTLIntersectionFunctionTable, range_ foundation.NSRange)
Assigns multiple intersection function tables to a range of entries in the vertex shader argument table.
intersectionFunctionTables: A pointer to a C array of MTLIntersectionFunctionTable instances the command assigns to entries in the vertex shader argument table for intersection function tables.
range: A span of integers that represent the entries in the vertex shader argument table for intersection function tables. Each entry stores a record of the corresponding element in `intersectionFunctionTables`.
Discussion ¶
By default, the intersection function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexSamplerStateAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexSamplerStateAtIndex(sampler MTLSamplerState, index uint)
Assigns a sampler state to an entry in the vertex shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the vertex shader argument table for sampler states.
index: An integer that represents the entry in the vertex shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexSamplerStateLodMinClampLodMaxClampAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexSamplerStateLodMinClampLodMaxClampAtIndex(sampler MTLSamplerState, lodMinClamp float32, lodMaxClamp float32, index uint)
Assigns a sampler state and clamp values to an entry in the vertex shader argument table.
sampler: An MTLSamplerState instance the command assigns to an entry in the vertex shader argument table for sampler states.
lodMinClamp: The smallest level of detail value a vertex shader can use when it samples a texture.
lodMaxClamp: The largest level of detail value a vertex shader can use when it samples a texture.
index: An integer that represents the entry in the vertex shader argument table for sampler states that stores a record of `sampler`.
Discussion ¶
The method’s `lodMinClamp` and `lodMaxClamp` parameters override the default values for `sampler`. You can set the sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexSamplerStatesLodMinClampsLodMaxClampsWithRange ¶
func (o MTLRenderCommandEncoderObject) SetVertexSamplerStatesLodMinClampsLodMaxClampsWithRange(samplers []MTLSamplerState, lodMinClamps []float32, lodMaxClamps []float32, range_ foundation.NSRange)
Assigns multiple sampler states and clamp values to a range of entries in the vertex shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the vertex shader argument table for sampler states.
lodMinClamps: A pointer to a C array of floating-point values. Each element is the smallest level of detail value a vertex shader can use when it samples a texture with the corresponding element in `samplers`.
lodMaxClamps: A pointer to a C array of floating-point values. Each element is the largest level of detail value a vertex shader can use when it samples a texture with the corresponding element in `samplers`.
range: A span of integers that represent the entries in the vertex shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
Each element of the method’s `lodMinClamps` and `lodMaxClamps` parameters overrides the default values for the corresponding sampler in `samplers`. You can set a sampler’s default values by configuring the [LodMinClamp] and [LodMaxClamp] properties of MTLSamplerDescriptor before you create the sampler.
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexSamplerStatesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetVertexSamplerStatesWithRange(samplers []MTLSamplerState, range_ foundation.NSRange)
Assigns multiple sampler states to a range of entries in the vertex shader argument table.
samplers: A pointer to a C array of MTLSamplerState instances the command assigns to entries in the vertex shader argument table for sampler states.
range: A span of integers that represent the entries in the vertex shader argument table for sampler states. Each entry stores a record of the corresponding element in `samplers`.
Discussion ¶
By default, the sampler state at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexTextureAtIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexTextureAtIndex(texture MTLTexture, index uint)
Assigns a texture to an entry in the vertex shader argument table.
texture: An MTLTexture instance the command assigns to an entry in the vertex shader argument table for textures.
index: An integer that represents the entry in the vertex shader argument table for textures that stores a record of `texture`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexTexture(_:index:)
func (MTLRenderCommandEncoderObject) SetVertexTexturesWithRange ¶
func (o MTLRenderCommandEncoderObject) SetVertexTexturesWithRange(textures []MTLTexture, range_ foundation.NSRange)
Assigns multiple textures to a range of entries in the vertex shader argument table.
textures: A pointer to a C array of MTLTexture instances the command assigns to entries in the vertex shader argument table for textures.
range: A span of integers that represent the entries in the vertex shader argument table for textures. Each entry stores a record of the corresponding element in `textures`.
Discussion ¶
By default, the texture at each index is `nil`.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setVertexTextures:withRange:
func (MTLRenderCommandEncoderObject) SetVertexVisibleFunctionTableAtBufferIndex ¶
func (o MTLRenderCommandEncoderObject) SetVertexVisibleFunctionTableAtBufferIndex(functionTable MTLVisibleFunctionTable, bufferIndex uint)
Assigns a visible function table to an entry in the vertex shader argument table.
functionTable: An MTLVisibleFunctionTable instance the command assigns to an entry in the vertex shader argument table for visible function tables.
bufferIndex: An integer that represents the entry in the vertex shader argument table for visible function tables that stores a record of `functionTable`.
Discussion ¶
By default, the visible function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetVertexVisibleFunctionTablesWithBufferRange ¶
func (o MTLRenderCommandEncoderObject) SetVertexVisibleFunctionTablesWithBufferRange(functionTables []MTLVisibleFunctionTable, range_ foundation.NSRange)
Assigns multiple visible function tables to a range of entries in the vertex shader argument table.
functionTables: A pointer to a C array of MTLVisibleFunctionTable instances the command assigns to entries in the vertex shader argument table for visible function tables.
range: A span of integers that represent the entries in the vertex shader argument table for visible function tables. Each entry stores a record of the corresponding element in `functionTables`.
Discussion ¶
By default, the visible function table at each index is `nil`.
func (MTLRenderCommandEncoderObject) SetViewport ¶
func (o MTLRenderCommandEncoderObject) SetViewport(viewport MTLViewport)
Configures the render pipeline with a viewport that applies a transformation and a clipping rectangle.
viewport: An MTLViewport instance the command applies to the render pipeline for transformations and clipping. // MTLViewport: https://developer.apple.com/documentation/Metal/MTLViewport
Discussion ¶
The render pipeline linearly maps vertex positions from normalized device coordinates to viewport coordinates by applying a viewport during the rasterization stage. It applies the transform first and then rasterizes the primitive while clipping any fragments outside the scissor rectangle (see [SetScissorRect]) or the render target’s extents.
The viewport’s originX and originY properties, which default to `0.0`, represent the number of pixels from the top-left corner of the render target. Positive originX values go to the right and positive originY values go downward. The default values for its width and height properties are the render target’s width and height, respectively. The default values for its znear and zfar properties are `0.0` and `1.0`, respectively, which you can flip.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setViewport(_:)
func (MTLRenderCommandEncoderObject) SetViewportsCount ¶
func (o MTLRenderCommandEncoderObject) SetViewportsCount(viewports []MTLViewport, count uint)
Configures the render pipeline with multiple viewports that apply transformations and clipping rectangles.
viewports: An array of MTLViewport instances the command applies to the render pipeline for transformations and clipping. // MTLViewport: https://developer.apple.com/documentation/Metal/MTLViewport
count: The number of elements in the `viewports` array.
Discussion ¶
Use this method to configure multiple active viewports and corresponding scissor rectangles. Multiple viewports give your app the ability to draw into separate areas of an image with a single draw call. You can either set a single scissor rectangle for all viewports with the [SetScissorRect] method, or set each viewport’s rectangle with the setScissorRects(_:) method.
The maximum number of viewports and scissor rectangles a GPU supports varies by device family. For more information, see MTLGPUFamily and Detecting GPU features and Metal software versions.
The rendering pipeline sends each primitive to a single viewport and its associated scissor rectangle. You can select which viewport each primitive uses in your vertex shader by adding the `[[viewport_array_index]]` attribute to an output value.
The render pipeline linearly maps vertex positions from normalized device coordinates to viewport coordinates by applying a viewport during the rasterization stage. It applies the transform first and then rasterizes the primitive while clipping any fragments outside the scissor rectangle (see [SetScissorRect]) or the render target’s extents.
The viewport’s originX and originY properties, which default to `0.0`, represent the number of pixels from the top-left corner of the render target. Positive originX values go to the right and positive originY values go downward. The default values for its width and height properties are the render target’s width and height, respectively. The default values for its znear and zfar properties are `0.0` and `1.0`, respectively, which you can flip.
The [SetViewport] method is equivalent to calling this method with a single viewport element in the `viewports` array.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/setViewports:count:
func (MTLRenderCommandEncoderObject) SetVisibilityResultModeOffset ¶
func (o MTLRenderCommandEncoderObject) SetVisibilityResultModeOffset(mode MTLVisibilityResultMode, offset uint)
Configures which visibility test the GPU runs and the destination for any results it generates.
mode: An MTLVisibilityResultMode that configures which visibility test results the render pass saves to a buffer, or disables visibility testing. // MTLVisibilityResultMode: https://developer.apple.com/documentation/Metal/MTLVisibilityResultMode
offset: A location, in bytes, relative to the start of the render pass’s [VisibilityResultBuffer]. The GPU stores the result of a visibility test at `offset`, which needs to be a multiple of 8.
Discussion ¶
To create a render pass that can enable visibility testing, assign an MTLBuffer instance to the [VisibilityResultBuffer] property of an MTLRenderPassDescriptor.
You can monitor one or more drawing commands with a visibility test by calling this method before the drawing commands. The encoder uses the new visibility mode and offset for subsequent drawing commands until you change the configuration by calling the method again. For example, you can change the offset or entirely disable visibility tests for subsequent commands by passing [VisibilityResultModeDisabled].
The default mode for a render pass is [VisibilityResultModeDisabled].
func (MTLRenderCommandEncoderObject) TileHeight ¶
func (o MTLRenderCommandEncoderObject) TileHeight() uint
The height of the tiles, in pixels, for the render command encoder.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/tileHeight
func (MTLRenderCommandEncoderObject) TileWidth ¶
func (o MTLRenderCommandEncoderObject) TileWidth() uint
The width of the tiles, in pixels, for the render command encoder.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/tileWidth
func (MTLRenderCommandEncoderObject) UpdateFenceAfterStages ¶
func (o MTLRenderCommandEncoderObject) UpdateFenceAfterStages(fence MTLFence, stages MTLRenderStages)
Encodes a command that instructs the GPU to update a fence after one or more stages, which can unblock other passes waiting for the fence.
fence: A fence the pass updates after the stages in `stages` complete.
stages: The render stages that need to complete before the pass updates `fence`.
Discussion ¶
You can synchronize memory operations of a render pass that access resources with an MTLFence. This method instructs the pass to update `fence` after the stages you pass to the `stages` run all their memory store operations to the resources it accesses. The fence indicates when other passes can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a render pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/updateFence(_:after:)
func (MTLRenderCommandEncoderObject) UseHeapStages ¶
func (o MTLRenderCommandEncoderObject) UseHeapStages(heap MTLHeap, stages MTLRenderStages)
Ensures the shaders in the render pass’s subsequent draw commands have access to the resources you allocate from a heap.
heap: An MTLHeap instance with resources that subsequent draw commands depend on.
stages: All the render stages that depend on resources within `heap`, including [RenderStageObject], [RenderStageMesh], [RenderStageVertex], [RenderStageFragment], and [RenderStageTile].
Discussion ¶
You can make the resources in `heap` (available in GPU memory) for the remaining duration of the render pass by calling this method. Call the method before encoding draw calls that may access resources within `heap` through an argument buffer. The method ensures each resource is in a format that’s compatible with the shaders that depend on it.
The method’s applies the [ResourceUsageRead] resource usage option to all of the resources within `heap`, except for textures. The method ignores any texture that has [TextureUsageRenderTarget], [TextureUsageShaderWrite], or both in its [Usage] property. For all other textures in `heap`, the method optimizes each texture’s memory layout for rendering with a sampler. However, your shaders can’t read from those textures by calling this method because the texture needs a different memory layout that’s suitable for reading.
Methods that apply a usage option for resources (see Argument buffer resource preparation commands) override any previous calls that apply to a resource. For example, you can change the usage option for buffer in `heap` to [ResourceUsageWrite] by passing it to [UseResourceUsageStages] after calling this method. However, you can’t reverse the call order because this method resets the usage for all resources within `heap` to [ResourceUsageRead], overriding previous calls to [UseResourceUsageStages].
The method instructs Metal to apply hazard tracking for resources you allocate from a heap that you create with [HazardTrackingModeTracked]. However, for untracked resources — which come from heaps you create with [HazardTrackingModeUntracked] — you need to account for hazards by applying MTLFence or MTLEvent instances.
Apps typically call the method for heaps that have resources in argument buffers for a implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/useHeap(_:stages:)
func (MTLRenderCommandEncoderObject) UseHeapsCountStages ¶
func (o MTLRenderCommandEncoderObject) UseHeapsCountStages(heaps []MTLHeap, count uint, stages MTLRenderStages)
Ensures the shaders in the render pass’s subsequent draw commands have access to the resources you allocate from multiple heaps.
heaps: A pointer to a C array of MTLHeap instances with resources that subsequent draw commands depend on.
count: The number of elements in `heaps`.
stages: All the render stages that depend on resources within `heaps`, including [RenderStageObject], [RenderStageMesh], [RenderStageVertex], [RenderStageFragment], and [RenderStageTile].
Discussion ¶
You can make the resources in `heaps` (available in GPU memory) for the remaining duration of the render pass by calling this method. Call the method before encoding draw calls that may access resources within `heaps` through an argument buffer. The method ensures each resource is in a format that’s compatible with the shaders that depend on it.
The method’s applies the [ResourceUsageRead] resource usage option to all of the resources within `heaps`, except for textures. The method ignores any texture that has [TextureUsageRenderTarget], [TextureUsageShaderWrite], or both in its [Usage] property. For all other textures in `heaps`, the method optimizes each texture’s memory layout for rendering with a sampler. However, your shaders can’t read from those textures by calling this method because the texture needs a different memory layout that’s suitable for reading.
Methods that apply a usage option for resources (see Argument buffer resource preparation commands) override any previous calls that apply to a resource. For example, you can change the usage option for a buffer to [ResourceUsageWrite] by passing it to [UseResourceUsageStages] after calling this method. However, you can’t reverse the call order because this method resets the usage for all resources within `heaps` to [ResourceUsageRead], overriding previous calls to [UseResourceUsageStages].
The method instructs Metal to apply hazard tracking for resources you allocate from a heap that you create with [HazardTrackingModeTracked]. However, for untracked resources — which come from heaps you create with [HazardTrackingModeUntracked] — you need to account for hazards by applying MTLFence or MTLEvent instances.
Apps typically call the method for heaps that have resources in argument buffers for a implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/useHeaps:count:stages:
func (MTLRenderCommandEncoderObject) UseResourceUsageStages ¶
func (o MTLRenderCommandEncoderObject) UseResourceUsageStages(resource MTLResource, usage MTLResourceUsage, stages MTLRenderStages)
Ensures the shaders in the render pass’s subsequent draw commands have access to a resource.
resource: An MTLResource instance that subsequent draw commands depend on.
usage: All the applicable access types the render pass’s shaders use for the resource, including [ResourceUsageRead] and [ResourceUsageWrite].
For applicable resources, you may be able to prevent the GPU from unnecessarily decompressing color attachments on some devices by setting `usage` to [ResourceUsageRead].
stages: All the render stages that depend on `resource`, including [RenderStageObject], [RenderStageMesh], [RenderStageVertex], [RenderStageFragment], and [RenderStageTile].
Discussion ¶
You can make a resource (available in GPU memory) for the remaining duration of the render pass by calling this method. Call the method before encoding draw calls that may access `resource` through an argument buffer. The method ensures the resource is in a format that’s compatible with the shaders that depend on it.
For example, you can explicitly bind resources for the vertex stage with the methods in the Vertex shader resource preparation commands collection.
The method also informs Metal when to apply hazard tracking for a resource you create with [HazardTrackingModeTracked]. For a resource you create with [HazardTrackingModeUntracked], you need to apply an MTLFence or an MTLEvent to account for potential reading and writing hazards.
You can reconfigure an individual resource’s `usage` options for subsequent draw calls in the same render pass by calling this method again.
Apps typically call the method for a resource in an argument buffer as a part of their implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/useResource(_:usage:stages:)
func (MTLRenderCommandEncoderObject) UseResourcesCountUsageStages ¶
func (o MTLRenderCommandEncoderObject) UseResourcesCountUsageStages(resources []MTLResource, count uint, usage MTLResourceUsage, stages MTLRenderStages)
Ensures the shaders in the render pass’s subsequent draw commands have access to multiple resources.
resources: A pointer to a C array of MTLResource instances that subsequent draw commands depend on.
count: The number of elements in `resources`.
usage: All the applicable access types the render pass’s shaders use for `resource`, including [ResourceUsageRead] and [ResourceUsageWrite].
For applicable resources, you may be able to prevent the GPU from unnecessarily decompressing color attachments on some devices by setting `usage` to [ResourceUsageRead].
stages: All the render stages that depend on elements in `resources`, including [RenderStageObject], [RenderStageMesh], [RenderStageVertex], [RenderStageFragment], and [RenderStageTile].
Discussion ¶
You can make multiple resources (available in GPU memory) for the remaining duration of the render pass by calling this method. Call the method before encoding draw calls that may access the elements of `resources` through an argument buffer. The method ensures each resource is in a format that’s compatible with the shaders that depend on it.
For example, you can explicitly bind resources for the vertex stage with the methods in the Vertex shader resource preparation commands collection.
The method also informs Metal when to apply hazard tracking for the resources you create with [HazardTrackingModeTracked]. For resources you create with [HazardTrackingModeUntracked], you need to apply an MTLFence or an MTLEvent to account for potential reading and writing hazards.
You can reconfigure an individual resource’s `usage` options for subsequent draw calls in the same render pass by calling this method again.
Apps typically call the method for resources in an argument buffer as a part of their implementation. For more information about argument buffers and bindless implementations, see Improving CPU performance by using argument buffers and Go bindless with Metal 3, respectively.
func (MTLRenderCommandEncoderObject) WaitForFenceBeforeStages ¶
func (o MTLRenderCommandEncoderObject) WaitForFenceBeforeStages(fence MTLFence, stages MTLRenderStages)
Encodes a command that instructs the GPU to pause before starting one or more stages of the render pass until a pass updates a fence.
fence: A fence that the pass waits for before running the stages you pass to `stages`.
stages: The render stages that need to wait for another pass to update `fence` before they run.
Discussion ¶
Synchronize memory operations of a render pass that access resources with an MTLFence. This method instructs the GPU to wait until another pass updates `fence` before running the stages you pass to the `stages` parameter. The fence indicates when the pass can access those resources without a race condition.
For more information about synchronization with fences, see:
- Resource synchronization - Synchronizing passes with a fence
Reuse a fence by waiting first and updating second ¶
When encoding a render pass that reuses a fence, wait for other passes to update the fence before repurposing that fence to notify subsequent passes with an update:
- Call the [WaitForFenceBeforeStages] method before encoding commands that need to wait for other passes. - Call the [UpdateFenceAfterStages] method after encoding commands that later passes depend on.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
To synchronize different stages within a single pass, create an because a fence can only synchronize memory operations between different passes. For more information, see Synchronizing stages within a pass.
See: https://developer.apple.com/documentation/Metal/MTLRenderCommandEncoder/waitForFence(_:before:)
type MTLRenderPassAttachmentDescriptor ¶
type MTLRenderPassAttachmentDescriptor struct {
objectivec.Object
}
A render target that serves as the output destination for pixels generated by a render pass.
Overview ¶
Use an MTLRenderPassAttachmentDescriptor instance to configure an individual render target of a framebuffer. Each MTLRenderPassAttachmentDescriptor instance specifies one texture that a graphics rendering pass can write into.
Typically, you don’t directly create MTLRenderPassAttachmentDescriptor instances. Instead, the MTLRenderPassDescriptor instance creates a default set of attachment instances. For each attachment that you intend to use as a render target, retrieve the MTLRenderPassAttachmentDescriptor instance from the render pass descriptor and configure its properties for use during this rendering pass.
You need to set the attachment’s MTLRenderPassAttachmentDescriptor.Texture property. The MTLRenderPassAttachmentDescriptor.Level, MTLRenderPassAttachmentDescriptor.Slice, and MTLRenderPassAttachmentDescriptor.DepthPlane properties specify the mipmap level, slice, and depth plane (for 3D textures) of the texture, respectively.
The MTLRenderPassAttachmentDescriptor.LoadAction and MTLRenderPassAttachmentDescriptor.StoreAction properties specify actions to perform at the start and end of a rendering pass for the attachment, respectively. For example, if you set the MTLRenderPassAttachmentDescriptor.LoadAction property of an attachment to [LoadActionClear], then the contents of the texture fill with a value for the type of attachment at the start of the rendering pass.
There are specific MTLRenderPassAttachmentDescriptor subclasses for color, depth, and stencil attachments. Each subclass provides additional properties to configure for that kind of attachment. The table below provides the list of subclasses.
[Table data omitted]
Multisampling ¶
To perform multisampled antialiased rendering, you use two textures. Attach to the MTLRenderPassAttachmentDescriptor.Texture property a [TextureType2DMultisample] texture, and a 2D or cube texture to the MTLRenderPassAttachmentDescriptor.ResolveTexture property. When a rendering command executes, it renders to the multisample texture. At the end of the render pass, the GPU resolves the contents of the multisample texture and writes the results into the resolve texture. The MTLRenderPassAttachmentDescriptor.ResolveLevel, MTLRenderPassAttachmentDescriptor.ResolveSlice, and MTLRenderPassAttachmentDescriptor.ResolveDepthPlane properties specify where the resolved image is written to. The attachment’s MTLRenderPassAttachmentDescriptor.StoreAction property determines what happens to the multisample texture after the GPU resolves its data.
Specifying the texture for the attachment ¶
- MTLRenderPassAttachmentDescriptor.Texture: The texture object associated with this attachment.
- MTLRenderPassAttachmentDescriptor.SetTexture
- MTLRenderPassAttachmentDescriptor.Level: The mipmap level of the texture used for rendering to the attachment.
- MTLRenderPassAttachmentDescriptor.SetLevel
- MTLRenderPassAttachmentDescriptor.Slice: The slice of the texture used for rendering to the attachment.
- MTLRenderPassAttachmentDescriptor.SetSlice
- MTLRenderPassAttachmentDescriptor.DepthPlane: The depth plane of the texture used for rendering to the attachment.
- MTLRenderPassAttachmentDescriptor.SetDepthPlane
Specifying rendering pass actions ¶
- MTLRenderPassAttachmentDescriptor.LoadAction: The action performed by this attachment at the start of a rendering pass for a render command encoder.
- MTLRenderPassAttachmentDescriptor.SetLoadAction
- MTLRenderPassAttachmentDescriptor.StoreAction: The action performed by this attachment at the end of a rendering pass for a render command encoder.
- MTLRenderPassAttachmentDescriptor.SetStoreAction
- MTLRenderPassAttachmentDescriptor.StoreActionOptions: The options that modify the store action performed by this attachment.
- MTLRenderPassAttachmentDescriptor.SetStoreActionOptions
Specifying the texture to resolve multisample data ¶
- MTLRenderPassAttachmentDescriptor.ResolveTexture: The destination texture used when resolving multisampled texture data into single sample values.
- MTLRenderPassAttachmentDescriptor.SetResolveTexture
- MTLRenderPassAttachmentDescriptor.ResolveLevel: The mipmap level of the texture used for the multisample resolve action.
- MTLRenderPassAttachmentDescriptor.SetResolveLevel
- MTLRenderPassAttachmentDescriptor.ResolveSlice: The slice of the texture used for the multisample resolve action.
- MTLRenderPassAttachmentDescriptor.SetResolveSlice
- MTLRenderPassAttachmentDescriptor.ResolveDepthPlane: The depth plane of the texture used for the multisample resolve action.
- MTLRenderPassAttachmentDescriptor.SetResolveDepthPlane
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor
func MTLRenderPassAttachmentDescriptorFromID ¶
func MTLRenderPassAttachmentDescriptorFromID(id objc.ID) MTLRenderPassAttachmentDescriptor
MTLRenderPassAttachmentDescriptorFromID constructs a MTLRenderPassAttachmentDescriptor from an objc.ID.
A render target that serves as the output destination for pixels generated by a render pass.
func NewMTLRenderPassAttachmentDescriptor ¶
func NewMTLRenderPassAttachmentDescriptor() MTLRenderPassAttachmentDescriptor
NewMTLRenderPassAttachmentDescriptor creates a new MTLRenderPassAttachmentDescriptor instance.
func (MTLRenderPassAttachmentDescriptor) Autorelease ¶
func (r MTLRenderPassAttachmentDescriptor) Autorelease() MTLRenderPassAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassAttachmentDescriptor) DepthPlane ¶
func (r MTLRenderPassAttachmentDescriptor) DepthPlane() uint
The depth plane of the texture used for rendering to the attachment.
Discussion ¶
If the texture isn’t a 3D texture, then Metal ignores this property.
The default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/depthPlane
func (MTLRenderPassAttachmentDescriptor) Init ¶
func (r MTLRenderPassAttachmentDescriptor) Init() MTLRenderPassAttachmentDescriptor
Init initializes the instance.
func (MTLRenderPassAttachmentDescriptor) Level ¶
func (r MTLRenderPassAttachmentDescriptor) Level() uint
The mipmap level of the texture used for rendering to the attachment.
Discussion ¶
The default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/level
func (MTLRenderPassAttachmentDescriptor) LoadAction ¶
func (r MTLRenderPassAttachmentDescriptor) LoadAction() MTLLoadAction
The action performed by this attachment at the start of a rendering pass for a render command encoder.
Discussion ¶
If your app renders all pixels of the render target for a given frame, use the [LoadActionDontCare] action, which allows the GPU to avoid loading the existing contents of the texture. Otherwise, use the [LoadActionClear] action to clear the previous contents of the render target or the [LoadActionLoad] action to preserve them. The [LoadActionClear] action also avoids the cost of loading the existing texture contents, but it still incurs the cost of filling the destination with a clear color.
For color render targets, the default value is [LoadActionDontCare]. For depth or stencil render targets, the default value is [LoadActionClear].
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/loadAction
func (MTLRenderPassAttachmentDescriptor) ResolveDepthPlane ¶
func (r MTLRenderPassAttachmentDescriptor) ResolveDepthPlane() uint
The depth plane of the texture used for the multisample resolve action.
Discussion ¶
If the value of [StoreAction] is set to [StoreActionMultisampleResolve] or [StoreActionStoreAndMultisampleResolve], set this property to point to a depth plane in the resolve texture.
The default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveDepthPlane
func (MTLRenderPassAttachmentDescriptor) ResolveLevel ¶
func (r MTLRenderPassAttachmentDescriptor) ResolveLevel() uint
The mipmap level of the texture used for the multisample resolve action.
Discussion ¶
If the value of [StoreAction] is set to [StoreActionMultisampleResolve] or [StoreActionStoreAndMultisampleResolve], set this property to point to a mipmap in the resolve texture.
The default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveLevel
func (MTLRenderPassAttachmentDescriptor) ResolveSlice ¶
func (r MTLRenderPassAttachmentDescriptor) ResolveSlice() uint
The slice of the texture used for the multisample resolve action.
Discussion ¶
If the value of [StoreAction] is set to [StoreActionMultisampleResolve] or [StoreActionStoreAndMultisampleResolve], set this property to point to a slice in the resolve texture.
The default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveSlice
func (MTLRenderPassAttachmentDescriptor) ResolveTexture ¶
func (r MTLRenderPassAttachmentDescriptor) ResolveTexture() MTLTexture
The destination texture used when resolving multisampled texture data into single sample values.
Discussion ¶
If the [StoreAction] value is set to [StoreActionMultisampleResolve] or [StoreActionStoreAndMultisampleResolve], then the [ResolveTexture] value needs to point to a valid texture. Otherwise, Metal ignores this property.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveTexture
func (MTLRenderPassAttachmentDescriptor) SetDepthPlane ¶
func (r MTLRenderPassAttachmentDescriptor) SetDepthPlane(value uint)
func (MTLRenderPassAttachmentDescriptor) SetLevel ¶
func (r MTLRenderPassAttachmentDescriptor) SetLevel(value uint)
func (MTLRenderPassAttachmentDescriptor) SetLoadAction ¶
func (r MTLRenderPassAttachmentDescriptor) SetLoadAction(value MTLLoadAction)
func (MTLRenderPassAttachmentDescriptor) SetResolveDepthPlane ¶
func (r MTLRenderPassAttachmentDescriptor) SetResolveDepthPlane(value uint)
func (MTLRenderPassAttachmentDescriptor) SetResolveLevel ¶
func (r MTLRenderPassAttachmentDescriptor) SetResolveLevel(value uint)
func (MTLRenderPassAttachmentDescriptor) SetResolveSlice ¶
func (r MTLRenderPassAttachmentDescriptor) SetResolveSlice(value uint)
func (MTLRenderPassAttachmentDescriptor) SetResolveTexture ¶
func (r MTLRenderPassAttachmentDescriptor) SetResolveTexture(value MTLTexture)
func (MTLRenderPassAttachmentDescriptor) SetSlice ¶
func (r MTLRenderPassAttachmentDescriptor) SetSlice(value uint)
func (MTLRenderPassAttachmentDescriptor) SetStoreAction ¶
func (r MTLRenderPassAttachmentDescriptor) SetStoreAction(value MTLStoreAction)
func (MTLRenderPassAttachmentDescriptor) SetStoreActionOptions ¶
func (r MTLRenderPassAttachmentDescriptor) SetStoreActionOptions(value MTLStoreActionOptions)
func (MTLRenderPassAttachmentDescriptor) SetTexture ¶
func (r MTLRenderPassAttachmentDescriptor) SetTexture(value MTLTexture)
func (MTLRenderPassAttachmentDescriptor) Slice ¶
func (r MTLRenderPassAttachmentDescriptor) Slice() uint
The slice of the texture used for rendering to the attachment.
Discussion ¶
The default value is `0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/slice
func (MTLRenderPassAttachmentDescriptor) StoreAction ¶
func (r MTLRenderPassAttachmentDescriptor) StoreAction() MTLStoreAction
The action performed by this attachment at the end of a rendering pass for a render command encoder.
Discussion ¶
If your app doesn’t need the data in the texture after completing the rendering pass, use the [StoreActionDontCare] action. Otherwise, use the [StoreActionStore] action if the texture is directly stored or the [StoreActionMultisampleResolve] action if the texture is a multisampled texture. In some feature sets, you can use the [StoreActionStoreAndMultisampleResolve] action to store and resolve the texture in a single rendering pass. For more information, see:
- Metal feature set tables (PDF) - Metal feature set tables (Numbers)
When the store action is either [StoreActionMultisampleResolve] or [StoreActionStoreAndMultisampleResolve], the [ResolveTexture] property needs to be set to the texture to use as the target for the resolve action. Use the [ResolveLevel], [ResolveSlice], and [ResolveDepthPlane] properties to specify the mipmap level, cube slice, and depth plane of the resolve texture, respectively.
For color render targets, the default value is [StoreActionStore]. For depth or stencil render targets, the default value is [StoreActionDontCare].
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/storeAction
func (MTLRenderPassAttachmentDescriptor) StoreActionOptions ¶
func (r MTLRenderPassAttachmentDescriptor) StoreActionOptions() MTLStoreActionOptions
The options that modify the store action performed by this attachment.
Discussion ¶
This property specifies additional behavior for the store action specified by the [StoreAction] property.
The default value is [StoreActionOptionNone].
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/storeActionOptions
func (MTLRenderPassAttachmentDescriptor) Texture ¶
func (r MTLRenderPassAttachmentDescriptor) Texture() MTLTexture
The texture object associated with this attachment.
Discussion ¶
You need to set the attachment’s `texture` property, choosing an appropriate pixel format for the texture.
- To store color values in an attachment, use a texture with a color-renderable pixel format. - To store depth values, use a texture with a depth-renderable pixel format, such as [PixelFormatDepth32Float]. - To store stencil values, use a texture with a stencil-renderable pixel format, such as [PixelFormatStencil8].
See: https://developer.apple.com/documentation/Metal/MTLRenderPassAttachmentDescriptor/texture
type MTLRenderPassAttachmentDescriptorClass ¶
type MTLRenderPassAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassAttachmentDescriptorClass ¶
func GetMTLRenderPassAttachmentDescriptorClass() MTLRenderPassAttachmentDescriptorClass
GetMTLRenderPassAttachmentDescriptorClass returns the class object for MTLRenderPassAttachmentDescriptor.
func (MTLRenderPassAttachmentDescriptorClass) Alloc ¶
func (mc MTLRenderPassAttachmentDescriptorClass) Alloc() MTLRenderPassAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRenderPassColorAttachmentDescriptor ¶
type MTLRenderPassColorAttachmentDescriptor struct {
MTLRenderPassAttachmentDescriptor
}
A color render target that serves as the output destination for color pixels generated by a render pass.
Specifying clearing value ¶
- MTLRenderPassColorAttachmentDescriptor.ClearColor: The color to use when clearing the color attachment.
- MTLRenderPassColorAttachmentDescriptor.SetClearColor
See: https://developer.apple.com/documentation/Metal/MTLRenderPassColorAttachmentDescriptor
func MTLRenderPassColorAttachmentDescriptorFromID ¶
func MTLRenderPassColorAttachmentDescriptorFromID(id objc.ID) MTLRenderPassColorAttachmentDescriptor
MTLRenderPassColorAttachmentDescriptorFromID constructs a MTLRenderPassColorAttachmentDescriptor from an objc.ID.
A color render target that serves as the output destination for color pixels generated by a render pass.
func NewMTLRenderPassColorAttachmentDescriptor ¶
func NewMTLRenderPassColorAttachmentDescriptor() MTLRenderPassColorAttachmentDescriptor
NewMTLRenderPassColorAttachmentDescriptor creates a new MTLRenderPassColorAttachmentDescriptor instance.
func (MTLRenderPassColorAttachmentDescriptor) Autorelease ¶
func (r MTLRenderPassColorAttachmentDescriptor) Autorelease() MTLRenderPassColorAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassColorAttachmentDescriptor) ClearColor ¶
func (r MTLRenderPassColorAttachmentDescriptor) ClearColor() MTLClearColor
The color to use when clearing the color attachment.
Discussion ¶
If the [LoadAction] property of the attachment is set to [LoadActionClear], then at the start of a render pass, the GPU fills the texture with the value stored in the [ClearColor] property. Otherwise, the GPU ignores the [ClearColor] property.
The [ClearColor] property represents a set of RGBA components. The default value is `(0.0, 0.0, 0.0, 1.0)` (black). Use the [MTLClearColorMake] function to construct an MTLClearColor value.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassColorAttachmentDescriptor/clearColor
func (MTLRenderPassColorAttachmentDescriptor) SetClearColor ¶
func (r MTLRenderPassColorAttachmentDescriptor) SetClearColor(value MTLClearColor)
type MTLRenderPassColorAttachmentDescriptorArray ¶
type MTLRenderPassColorAttachmentDescriptorArray struct {
objectivec.Object
}
An array of render pass color attachment descriptor objects.
Accessing the description of a color attachment ¶
- MTLRenderPassColorAttachmentDescriptorArray.ObjectAtIndexedSubscript: Returns the descriptor object for the specified color attachment.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassColorAttachmentDescriptorArray
func MTLRenderPassColorAttachmentDescriptorArrayFromID ¶
func MTLRenderPassColorAttachmentDescriptorArrayFromID(id objc.ID) MTLRenderPassColorAttachmentDescriptorArray
MTLRenderPassColorAttachmentDescriptorArrayFromID constructs a MTLRenderPassColorAttachmentDescriptorArray from an objc.ID.
An array of render pass color attachment descriptor objects.
func NewMTLRenderPassColorAttachmentDescriptorArray ¶
func NewMTLRenderPassColorAttachmentDescriptorArray() MTLRenderPassColorAttachmentDescriptorArray
NewMTLRenderPassColorAttachmentDescriptorArray creates a new MTLRenderPassColorAttachmentDescriptorArray instance.
func (MTLRenderPassColorAttachmentDescriptorArray) Autorelease ¶
func (r MTLRenderPassColorAttachmentDescriptorArray) Autorelease() MTLRenderPassColorAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassColorAttachmentDescriptorArray) Init ¶
func (r MTLRenderPassColorAttachmentDescriptorArray) Init() MTLRenderPassColorAttachmentDescriptorArray
Init initializes the instance.
func (MTLRenderPassColorAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (r MTLRenderPassColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPassColorAttachmentDescriptor
Returns the descriptor object for the specified color attachment.
attachmentIndex: An index in the color attachment array.
Return Value ¶
A descriptor object that contains color attachment information.
func (MTLRenderPassColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (r MTLRenderPassColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLRenderPassColorAttachmentDescriptor, attachmentIndex uint)
Sets the descriptor for the specified color attachment.
attachment: A descriptor that contains color attachment information. Specify `nil` to reset the attachment to its default values.
attachmentIndex: An index in the color attachment array.
Discussion ¶
This method copies the color attachment information from the descriptor into the specified attachment in the array. Because the method copies the information, you can modify and reuse the descriptor without affecting a previously set attachment.
type MTLRenderPassColorAttachmentDescriptorArrayClass ¶
type MTLRenderPassColorAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassColorAttachmentDescriptorArrayClass ¶
func GetMTLRenderPassColorAttachmentDescriptorArrayClass() MTLRenderPassColorAttachmentDescriptorArrayClass
GetMTLRenderPassColorAttachmentDescriptorArrayClass returns the class object for MTLRenderPassColorAttachmentDescriptorArray.
func (MTLRenderPassColorAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLRenderPassColorAttachmentDescriptorArrayClass) Alloc() MTLRenderPassColorAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLRenderPassColorAttachmentDescriptorClass ¶
type MTLRenderPassColorAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassColorAttachmentDescriptorClass ¶
func GetMTLRenderPassColorAttachmentDescriptorClass() MTLRenderPassColorAttachmentDescriptorClass
GetMTLRenderPassColorAttachmentDescriptorClass returns the class object for MTLRenderPassColorAttachmentDescriptor.
func (MTLRenderPassColorAttachmentDescriptorClass) Alloc ¶
func (mc MTLRenderPassColorAttachmentDescriptorClass) Alloc() MTLRenderPassColorAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRenderPassDepthAttachmentDescriptor ¶
type MTLRenderPassDepthAttachmentDescriptor struct {
MTLRenderPassAttachmentDescriptor
}
A depth render target that serves as the output destination for depth pixels generated by a render pass.
Specifying clearing value ¶
- MTLRenderPassDepthAttachmentDescriptor.ClearDepth: The depth to use when clearing the depth attachment.
- MTLRenderPassDepthAttachmentDescriptor.SetClearDepth
MSAA depth resolve ¶
- MTLRenderPassDepthAttachmentDescriptor.DepthResolveFilter: The filter used for an MSAA depth resolve operation.
- MTLRenderPassDepthAttachmentDescriptor.SetDepthResolveFilter
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDepthAttachmentDescriptor
func MTLRenderPassDepthAttachmentDescriptorFromID ¶
func MTLRenderPassDepthAttachmentDescriptorFromID(id objc.ID) MTLRenderPassDepthAttachmentDescriptor
MTLRenderPassDepthAttachmentDescriptorFromID constructs a MTLRenderPassDepthAttachmentDescriptor from an objc.ID.
A depth render target that serves as the output destination for depth pixels generated by a render pass.
func NewMTLRenderPassDepthAttachmentDescriptor ¶
func NewMTLRenderPassDepthAttachmentDescriptor() MTLRenderPassDepthAttachmentDescriptor
NewMTLRenderPassDepthAttachmentDescriptor creates a new MTLRenderPassDepthAttachmentDescriptor instance.
func (MTLRenderPassDepthAttachmentDescriptor) Autorelease ¶
func (r MTLRenderPassDepthAttachmentDescriptor) Autorelease() MTLRenderPassDepthAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassDepthAttachmentDescriptor) ClearDepth ¶
func (r MTLRenderPassDepthAttachmentDescriptor) ClearDepth() float64
The depth to use when clearing the depth attachment.
Discussion ¶
If the [LoadAction] property of the attachment is set to [LoadActionClear], then at the start of a render pass, the GPU fills the contents of the attachment with the value stored in the [ClearDepth] property. Otherwise, the GPU ignores [ClearDepth].
The default value is `1.0`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDepthAttachmentDescriptor/clearDepth
func (MTLRenderPassDepthAttachmentDescriptor) DepthResolveFilter ¶
func (r MTLRenderPassDepthAttachmentDescriptor) DepthResolveFilter() MTLMultisampleDepthResolveFilter
The filter used for an MSAA depth resolve operation.
Discussion ¶
The default value is [MultisampleDepthResolveFilterSample0].
func (MTLRenderPassDepthAttachmentDescriptor) SetClearDepth ¶
func (r MTLRenderPassDepthAttachmentDescriptor) SetClearDepth(value float64)
func (MTLRenderPassDepthAttachmentDescriptor) SetDepthResolveFilter ¶
func (r MTLRenderPassDepthAttachmentDescriptor) SetDepthResolveFilter(value MTLMultisampleDepthResolveFilter)
type MTLRenderPassDepthAttachmentDescriptorClass ¶
type MTLRenderPassDepthAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassDepthAttachmentDescriptorClass ¶
func GetMTLRenderPassDepthAttachmentDescriptorClass() MTLRenderPassDepthAttachmentDescriptorClass
GetMTLRenderPassDepthAttachmentDescriptorClass returns the class object for MTLRenderPassDepthAttachmentDescriptor.
func (MTLRenderPassDepthAttachmentDescriptorClass) Alloc ¶
func (mc MTLRenderPassDepthAttachmentDescriptorClass) Alloc() MTLRenderPassDepthAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRenderPassDescriptor ¶
type MTLRenderPassDescriptor struct {
objectivec.Object
}
A group of render targets that hold the results of a render pass.
Overview ¶
An MTLRenderPassDescriptor instance contains a collection of attachments used as the rendering destination for pixels generated by a rendering pass. The MTLRenderPassDescriptor instance also sets the destination buffer for visibility information generated by a rendering pass.
Specifying the attachments for a rendering pass ¶
- MTLRenderPassDescriptor.ColorAttachments: An array of state information for attachments that store color data.
- MTLRenderPassDescriptor.DepthAttachment: State information for an attachment that stores depth data.
- MTLRenderPassDescriptor.SetDepthAttachment
- MTLRenderPassDescriptor.StencilAttachment: State information for an attachment that stores stencil data.
- MTLRenderPassDescriptor.SetStencilAttachment
Specifying the visibility result buffer ¶
- MTLRenderPassDescriptor.VisibilityResultBuffer: A buffer where the GPU writes visibility test results when fragments pass depth and stencil tests.
- MTLRenderPassDescriptor.SetVisibilityResultBuffer
Layered rendering ¶
- MTLRenderPassDescriptor.RenderTargetArrayLength: The number of active layers that all attachments need to have for layered rendering.
- MTLRenderPassDescriptor.SetRenderTargetArrayLength
- MTLRenderPassDescriptor.RenderTargetWidth: The width, in pixels, to constrain the render target to.
- MTLRenderPassDescriptor.SetRenderTargetWidth
- MTLRenderPassDescriptor.RenderTargetHeight: The height, in pixels, to constrain the render target to.
- MTLRenderPassDescriptor.SetRenderTargetHeight
Specifying tile shading parameters ¶
- MTLRenderPassDescriptor.ImageblockSampleLength: The per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
- MTLRenderPassDescriptor.SetImageblockSampleLength
- MTLRenderPassDescriptor.ThreadgroupMemoryLength: The per-tile size, in bytes, of the persistent threadgroup memory allocation.
- MTLRenderPassDescriptor.SetThreadgroupMemoryLength
- MTLRenderPassDescriptor.TileWidth: The tile width, in pixels.
- MTLRenderPassDescriptor.SetTileWidth
- MTLRenderPassDescriptor.TileHeight: The tile height, in pixels.
- MTLRenderPassDescriptor.SetTileHeight
Specifying sample counts ¶
- MTLRenderPassDescriptor.DefaultRasterSampleCount: The raster sample count for the render pass when the render pass doesn’t have explicit attachments.
- MTLRenderPassDescriptor.SetDefaultRasterSampleCount
Specifying a rasterization rate map ¶
- MTLRenderPassDescriptor.RasterizationRateMap: The rasterization rate map to use when executing the render pass.
- MTLRenderPassDescriptor.SetRasterizationRateMap
Specifying sample buffers for GPU counters ¶
- MTLRenderPassDescriptor.SampleBufferAttachments: The array of sample buffers that the render pass can access.
Instance Properties ¶
- MTLRenderPassDescriptor.SupportColorAttachmentMapping: Specifies if the render pass should support color attachment mapping.
- MTLRenderPassDescriptor.SetSupportColorAttachmentMapping
- MTLRenderPassDescriptor.VisibilityResultType: Specifies if Metal accumulates visibility results between render encoders or resets them.
- MTLRenderPassDescriptor.SetVisibilityResultType
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor
func MTLRenderPassDescriptorFromID ¶
func MTLRenderPassDescriptorFromID(id objc.ID) MTLRenderPassDescriptor
MTLRenderPassDescriptorFromID constructs a MTLRenderPassDescriptor from an objc.ID.
A group of render targets that hold the results of a render pass.
func NewMTLRenderPassDescriptor ¶
func NewMTLRenderPassDescriptor() MTLRenderPassDescriptor
NewMTLRenderPassDescriptor creates a new MTLRenderPassDescriptor instance.
func (MTLRenderPassDescriptor) Autorelease ¶
func (r MTLRenderPassDescriptor) Autorelease() MTLRenderPassDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassDescriptor) ColorAttachments ¶
func (r MTLRenderPassDescriptor) ColorAttachments() IMTLRenderPassColorAttachmentDescriptorArray
An array of state information for attachments that store color data.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/colorAttachments
func (MTLRenderPassDescriptor) DefaultRasterSampleCount ¶
func (r MTLRenderPassDescriptor) DefaultRasterSampleCount() uint
The raster sample count for the render pass when the render pass doesn’t have explicit attachments.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/defaultRasterSampleCount
func (MTLRenderPassDescriptor) DepthAttachment ¶
func (r MTLRenderPassDescriptor) DepthAttachment() IMTLRenderPassDepthAttachmentDescriptor
State information for an attachment that stores depth data.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/depthAttachment
func (MTLRenderPassDescriptor) GetSamplePositionsCount ¶
func (r MTLRenderPassDescriptor) GetSamplePositionsCount(positions []MTLSamplePosition, count uint) uint
Retrieves the programmable sample positions set for a render pass.
positions: A pointer to a destination array of sample positions where Metal writes the programmable sample positions.
count: The number of programmable sample positions to retrieve.
Return Value ¶
The total number of programmable sample positions set for the render pass.
Discussion ¶
The value of `count` needs to be equal to the number of programmable sample positions set by a previous call to the [SetSamplePositionsCount] method (the `count` parameter). Also, the `positions` array needs to contain at least as many elements as the value of `count`.
If you don’t know the correct value for `count`, you may query this method by passing a `nil` array for `positions` and a `0` value for `count`. This method returns the number of programmable sample positions that are currently set.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/getSamplePositions:count:
func (MTLRenderPassDescriptor) ImageblockSampleLength ¶
func (r MTLRenderPassDescriptor) ImageblockSampleLength() uint
The per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.
Discussion ¶
If `imageBlockSampleLength` isn’t specified, Metal determines the imageblock sample length from the render pass attachment formats. If any render pipelines bound to the encoder reference imageblocks with explicit layout, you need to set this property.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/imageblockSampleLength
func (MTLRenderPassDescriptor) Init ¶
func (r MTLRenderPassDescriptor) Init() MTLRenderPassDescriptor
Init initializes the instance.
func (MTLRenderPassDescriptor) RasterizationRateMap ¶
func (r MTLRenderPassDescriptor) RasterizationRateMap() MTLRasterizationRateMap
The rasterization rate map to use when executing the render pass.
Discussion ¶
The default value is `nil`, which means that viewport coordinates are in the same coordinate system as the physical coordinates in the render target. Otherwise, Metal uses the rate map to convert between viewport coordinates and physical coordinates in the render target.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/rasterizationRateMap
func (MTLRenderPassDescriptor) RenderTarget ¶
func (r MTLRenderPassDescriptor) RenderTarget() MTLTextureUsage
An option for rendering to the texture in a render pass.
See: https://developer.apple.com/documentation/metal/mtltextureusage/rendertarget
func (MTLRenderPassDescriptor) RenderTargetArrayLength ¶
func (r MTLRenderPassDescriptor) RenderTargetArrayLength() uint
The number of active layers that all attachments need to have for layered rendering.
Discussion ¶
The default value is `0`, indicating that the GPU does not use layered rendering on this render pass.
The table below gives typical values you might set, depending on the type of texture being used as attachments in the render pass. Your vertex shader need to select the render target array index between `0` and the array length minus `1`.
[Table data omitted]
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/renderTargetArrayLength
func (MTLRenderPassDescriptor) RenderTargetHeight ¶
func (r MTLRenderPassDescriptor) RenderTargetHeight() uint
The height, in pixels, to constrain the render target to.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/renderTargetHeight
func (MTLRenderPassDescriptor) RenderTargetWidth ¶
func (r MTLRenderPassDescriptor) RenderTargetWidth() uint
The width, in pixels, to constrain the render target to.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/renderTargetWidth
func (MTLRenderPassDescriptor) SampleBufferAttachments ¶
func (r MTLRenderPassDescriptor) SampleBufferAttachments() IMTLRenderPassSampleBufferAttachmentDescriptorArray
The array of sample buffers that the render pass can access.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/sampleBufferAttachments
func (MTLRenderPassDescriptor) SetDefaultRasterSampleCount ¶
func (r MTLRenderPassDescriptor) SetDefaultRasterSampleCount(value uint)
func (MTLRenderPassDescriptor) SetDepthAttachment ¶
func (r MTLRenderPassDescriptor) SetDepthAttachment(value IMTLRenderPassDepthAttachmentDescriptor)
func (MTLRenderPassDescriptor) SetImageblockSampleLength ¶
func (r MTLRenderPassDescriptor) SetImageblockSampleLength(value uint)
func (MTLRenderPassDescriptor) SetRasterizationRateMap ¶
func (r MTLRenderPassDescriptor) SetRasterizationRateMap(value MTLRasterizationRateMap)
func (MTLRenderPassDescriptor) SetRenderTarget ¶
func (r MTLRenderPassDescriptor) SetRenderTarget(value MTLTextureUsage)
func (MTLRenderPassDescriptor) SetRenderTargetArrayLength ¶
func (r MTLRenderPassDescriptor) SetRenderTargetArrayLength(value uint)
func (MTLRenderPassDescriptor) SetRenderTargetHeight ¶
func (r MTLRenderPassDescriptor) SetRenderTargetHeight(value uint)
func (MTLRenderPassDescriptor) SetRenderTargetWidth ¶
func (r MTLRenderPassDescriptor) SetRenderTargetWidth(value uint)
func (MTLRenderPassDescriptor) SetSamplePositionsCount ¶
func (r MTLRenderPassDescriptor) SetSamplePositionsCount(positions []MTLSamplePosition, count uint)
Sets the programmable sample positions for a render pass.
positions: An array of programmable sample positions for the render pass.
count: The number of elements, which needs to match the render pass sample count, or `0` to disable custom sample positions.
Discussion ¶
Programmable sample positions need to be floating-point values in the `[0.0, 1.0)` range along each axis, with the origin `(0,0)` defined at the top-left corner. Values can be set from `0/16` up to `15/16`, inclusive, in 1`/16` increments along each axis.
If the value of `count` is `0`, the GPU uses the default sample positions for the render pass.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/setSamplePositions:count:
func (MTLRenderPassDescriptor) SetStencilAttachment ¶
func (r MTLRenderPassDescriptor) SetStencilAttachment(value IMTLRenderPassStencilAttachmentDescriptor)
func (MTLRenderPassDescriptor) SetSupportColorAttachmentMapping ¶
func (r MTLRenderPassDescriptor) SetSupportColorAttachmentMapping(value bool)
func (MTLRenderPassDescriptor) SetThreadgroupMemoryLength ¶
func (r MTLRenderPassDescriptor) SetThreadgroupMemoryLength(value uint)
func (MTLRenderPassDescriptor) SetTileHeight ¶
func (r MTLRenderPassDescriptor) SetTileHeight(value uint)
func (MTLRenderPassDescriptor) SetTileWidth ¶
func (r MTLRenderPassDescriptor) SetTileWidth(value uint)
func (MTLRenderPassDescriptor) SetUsage ¶
func (r MTLRenderPassDescriptor) SetUsage(value MTLTextureUsage)
func (MTLRenderPassDescriptor) SetVisibilityResultBuffer ¶
func (r MTLRenderPassDescriptor) SetVisibilityResultBuffer(value MTLBuffer)
func (MTLRenderPassDescriptor) SetVisibilityResultType ¶
func (r MTLRenderPassDescriptor) SetVisibilityResultType(value MTLVisibilityResultType)
func (MTLRenderPassDescriptor) StencilAttachment ¶
func (r MTLRenderPassDescriptor) StencilAttachment() IMTLRenderPassStencilAttachmentDescriptor
State information for an attachment that stores stencil data.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/stencilAttachment
func (MTLRenderPassDescriptor) SupportColorAttachmentMapping ¶
func (r MTLRenderPassDescriptor) SupportColorAttachmentMapping() bool
Specifies if the render pass should support color attachment mapping.
func (MTLRenderPassDescriptor) ThreadgroupMemoryLength ¶
func (r MTLRenderPassDescriptor) ThreadgroupMemoryLength() uint
The per-tile size, in bytes, of the persistent threadgroup memory allocation.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/threadgroupMemoryLength
func (MTLRenderPassDescriptor) TileHeight ¶
func (r MTLRenderPassDescriptor) TileHeight() uint
The tile height, in pixels.
Discussion ¶
The valid tile sizes are `32 x 32`, `32 x 16`, and `16 x 16`. The Metal driver chooses a default size when your app doesn’t set a tile size.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/tileHeight
func (MTLRenderPassDescriptor) TileWidth ¶
func (r MTLRenderPassDescriptor) TileWidth() uint
The tile width, in pixels.
Discussion ¶
The valid tile sizes are `32 x 32`, `32 x 16`, and `16 x 16`. The Metal driver chooses a default size when your app doesn’t set a tile size.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/tileWidth
func (MTLRenderPassDescriptor) Usage ¶
func (r MTLRenderPassDescriptor) Usage() MTLTextureUsage
Options that determine how you can use the texture.
See: https://developer.apple.com/documentation/metal/mtltexturedescriptor/usage
func (MTLRenderPassDescriptor) VisibilityResultBuffer ¶
func (r MTLRenderPassDescriptor) VisibilityResultBuffer() MTLBuffer
A buffer where the GPU writes visibility test results when fragments pass depth and stencil tests.
Discussion ¶
When encoding a render pass, you can tell the GPU to record data about fragments that pass depth and stencil tests. Typically, you use visibility testing to track whether a particular piece of geometry is visible in the current frame, so you can omit drawing calls for hidden objects when encoding future frames. This technique is sometimes called . You can record separate tests for different pieces of geometry.
Set this property to provide the buffer for the GPU to store visibility results when it executes the render pass. The GPU stores visibility results as 64-bit integers, so you need to reserve `8` bytes for each visibility result that you want to track. After creating the render command encoder, call [SetVisibilityResultModeOffset] to start each visibility test.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/visibilityResultBuffer
func (MTLRenderPassDescriptor) VisibilityResultType ¶
func (r MTLRenderPassDescriptor) VisibilityResultType() MTLVisibilityResultType
Specifies if Metal accumulates visibility results between render encoders or resets them.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/visibilityResultType
type MTLRenderPassDescriptorClass ¶
type MTLRenderPassDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassDescriptorClass ¶
func GetMTLRenderPassDescriptorClass() MTLRenderPassDescriptorClass
GetMTLRenderPassDescriptorClass returns the class object for MTLRenderPassDescriptor.
func (MTLRenderPassDescriptorClass) Alloc ¶
func (mc MTLRenderPassDescriptorClass) Alloc() MTLRenderPassDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLRenderPassDescriptorClass) RenderPassDescriptor ¶
func (_MTLRenderPassDescriptorClass MTLRenderPassDescriptorClass) RenderPassDescriptor() MTLRenderPassDescriptor
Creates a default render pass descriptor.
Return Value ¶
A new render pass descriptor with no attachments at all.
Discussion ¶
Set the desired color attachments with the [SetObjectAtIndexedSubscript] method of the [ColorAttachments] property. Set the desired depth and stencil attachments with the [DepthAttachment] and [StencilAttachment] properties, respectively.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassDescriptor/renderPassDescriptor
type MTLRenderPassSampleBufferAttachmentDescriptor ¶
type MTLRenderPassSampleBufferAttachmentDescriptor struct {
objectivec.Object
}
A description of where to store GPU counter information at the start and end of a render pass.
Configuring the sample buffer attachment ¶
- MTLRenderPassSampleBufferAttachmentDescriptor.SampleBuffer: A specialized memory buffer that the GPU uses to store its counter data during the render pass.
- MTLRenderPassSampleBufferAttachmentDescriptor.SetSampleBuffer
- MTLRenderPassSampleBufferAttachmentDescriptor.StartOfVertexSampleIndex: The index the Metal device object should use to store GPU counters when starting the render pass’s vertex stage.
- MTLRenderPassSampleBufferAttachmentDescriptor.SetStartOfVertexSampleIndex
- MTLRenderPassSampleBufferAttachmentDescriptor.EndOfVertexSampleIndex: The index the Metal device object should use to store GPU counters when ending the render pass’s vertex stage.
- MTLRenderPassSampleBufferAttachmentDescriptor.SetEndOfVertexSampleIndex
- MTLRenderPassSampleBufferAttachmentDescriptor.StartOfFragmentSampleIndex: The index the Metal device object should use to store GPU counters when starting the render pass’s fragment stage.
- MTLRenderPassSampleBufferAttachmentDescriptor.SetStartOfFragmentSampleIndex
- MTLRenderPassSampleBufferAttachmentDescriptor.EndOfFragmentSampleIndex: The index the Metal device object should use to store GPU counters when ending the render pass’s fragment stage.
- MTLRenderPassSampleBufferAttachmentDescriptor.SetEndOfFragmentSampleIndex
See: https://developer.apple.com/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptor
func MTLRenderPassSampleBufferAttachmentDescriptorFromID ¶
func MTLRenderPassSampleBufferAttachmentDescriptorFromID(id objc.ID) MTLRenderPassSampleBufferAttachmentDescriptor
MTLRenderPassSampleBufferAttachmentDescriptorFromID constructs a MTLRenderPassSampleBufferAttachmentDescriptor from an objc.ID.
A description of where to store GPU counter information at the start and end of a render pass.
func NewMTLRenderPassSampleBufferAttachmentDescriptor ¶
func NewMTLRenderPassSampleBufferAttachmentDescriptor() MTLRenderPassSampleBufferAttachmentDescriptor
NewMTLRenderPassSampleBufferAttachmentDescriptor creates a new MTLRenderPassSampleBufferAttachmentDescriptor instance.
func (MTLRenderPassSampleBufferAttachmentDescriptor) Autorelease ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) Autorelease() MTLRenderPassSampleBufferAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassSampleBufferAttachmentDescriptor) EndOfFragmentSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) EndOfFragmentSampleIndex() uint
The index the Metal device object should use to store GPU counters when ending the render pass’s fragment stage.
Discussion ¶
Specify MTLCounterDontSample if you don’t want to sample GPU counters at the end of the fragment stage. Otherwise, specify an index within the sample buffer where you want the GPU to write the sample data.
On devices that don’t support [CounterSamplingPointAtStageBoundary] you need to set the value to MTLCounterDontSample.
func (MTLRenderPassSampleBufferAttachmentDescriptor) EndOfVertexSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) EndOfVertexSampleIndex() uint
The index the Metal device object should use to store GPU counters when ending the render pass’s vertex stage.
Discussion ¶
Specify MTLCounterDontSample if you don’t want to sample GPU counters at the end of the vertex stage. Otherwise, specify an index within the sample buffer where you want the GPU to write the sample data.
On devices that don’t support [CounterSamplingPointAtStageBoundary] you need to set the value to MTLCounterDontSample.
func (MTLRenderPassSampleBufferAttachmentDescriptor) Init ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) Init() MTLRenderPassSampleBufferAttachmentDescriptor
Init initializes the instance.
func (MTLRenderPassSampleBufferAttachmentDescriptor) SampleBuffer ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
A specialized memory buffer that the GPU uses to store its counter data during the render pass.
Discussion ¶
The property defaults to `nil`, which means the GPU doesn’t save any GPU counter information during the render pass. For more information, see Creating a counter sample buffer to store a GPU’s counter data during a pass and Sampling GPU data into counter sample buffers.
func (MTLRenderPassSampleBufferAttachmentDescriptor) SetEndOfFragmentSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetEndOfFragmentSampleIndex(value uint)
func (MTLRenderPassSampleBufferAttachmentDescriptor) SetEndOfVertexSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetEndOfVertexSampleIndex(value uint)
func (MTLRenderPassSampleBufferAttachmentDescriptor) SetSampleBuffer ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
func (MTLRenderPassSampleBufferAttachmentDescriptor) SetStartOfFragmentSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetStartOfFragmentSampleIndex(value uint)
func (MTLRenderPassSampleBufferAttachmentDescriptor) SetStartOfVertexSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) SetStartOfVertexSampleIndex(value uint)
func (MTLRenderPassSampleBufferAttachmentDescriptor) StartOfFragmentSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) StartOfFragmentSampleIndex() uint
The index the Metal device object should use to store GPU counters when starting the render pass’s fragment stage.
Discussion ¶
Specify MTLCounterDontSample if you don’t want to sample GPU counters at the start of the fragment stage. Otherwise, specify an index within the sample buffer where you want the GPU to write the sample data.
On devices that don’t support [CounterSamplingPointAtStageBoundary] you need to set the value to MTLCounterDontSample.
func (MTLRenderPassSampleBufferAttachmentDescriptor) StartOfVertexSampleIndex ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptor) StartOfVertexSampleIndex() uint
The index the Metal device object should use to store GPU counters when starting the render pass’s vertex stage.
Discussion ¶
Specify MTLCounterDontSample if you don’t want to sample GPU counters at the start of the vertex stage. Otherwise, specify an index within the sample buffer where you want the GPU to write the sample data.
On devices that don’t support [CounterSamplingPointAtStageBoundary] you need to set the value to MTLCounterDontSample.
type MTLRenderPassSampleBufferAttachmentDescriptorArray ¶
type MTLRenderPassSampleBufferAttachmentDescriptorArray struct {
objectivec.Object
}
An array of sample buffer attachments for a render pass.
Accessing a sample buffer attachment ¶
- MTLRenderPassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript: Returns the descriptor object for the specified sample buffer attachment.
See: https://developer.apple.com/documentation/Metal/MTLRenderPassSampleBufferAttachmentDescriptorArray
func MTLRenderPassSampleBufferAttachmentDescriptorArrayFromID ¶
func MTLRenderPassSampleBufferAttachmentDescriptorArrayFromID(id objc.ID) MTLRenderPassSampleBufferAttachmentDescriptorArray
MTLRenderPassSampleBufferAttachmentDescriptorArrayFromID constructs a MTLRenderPassSampleBufferAttachmentDescriptorArray from an objc.ID.
An array of sample buffer attachments for a render pass.
func NewMTLRenderPassSampleBufferAttachmentDescriptorArray ¶
func NewMTLRenderPassSampleBufferAttachmentDescriptorArray() MTLRenderPassSampleBufferAttachmentDescriptorArray
NewMTLRenderPassSampleBufferAttachmentDescriptorArray creates a new MTLRenderPassSampleBufferAttachmentDescriptorArray instance.
func (MTLRenderPassSampleBufferAttachmentDescriptorArray) Autorelease ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) Autorelease() MTLRenderPassSampleBufferAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassSampleBufferAttachmentDescriptorArray) Init ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) Init() MTLRenderPassSampleBufferAttachmentDescriptorArray
Init initializes the instance.
func (MTLRenderPassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPassSampleBufferAttachmentDescriptor
Returns the descriptor object for the specified sample buffer attachment.
attachmentIndex: An index for the object to fetch.
Return Value ¶
The MTLRenderPassSampleBufferAttachmentDescriptor at the specified index.
func (MTLRenderPassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (r MTLRenderPassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLRenderPassSampleBufferAttachmentDescriptor, attachmentIndex uint)
Sets the descriptor object for the specified sample buffer attachment.
attachment: A sample buffer attachment descriptor. Specify `nil` to resets the attachment to default values.
attachmentIndex: The item in the array to replace.
Discussion ¶
The method copies the parameter contents into the attachment.
type MTLRenderPassSampleBufferAttachmentDescriptorArrayClass ¶
type MTLRenderPassSampleBufferAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassSampleBufferAttachmentDescriptorArrayClass ¶
func GetMTLRenderPassSampleBufferAttachmentDescriptorArrayClass() MTLRenderPassSampleBufferAttachmentDescriptorArrayClass
GetMTLRenderPassSampleBufferAttachmentDescriptorArrayClass returns the class object for MTLRenderPassSampleBufferAttachmentDescriptorArray.
func (MTLRenderPassSampleBufferAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLRenderPassSampleBufferAttachmentDescriptorArrayClass) Alloc() MTLRenderPassSampleBufferAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLRenderPassSampleBufferAttachmentDescriptorClass ¶
type MTLRenderPassSampleBufferAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassSampleBufferAttachmentDescriptorClass ¶
func GetMTLRenderPassSampleBufferAttachmentDescriptorClass() MTLRenderPassSampleBufferAttachmentDescriptorClass
GetMTLRenderPassSampleBufferAttachmentDescriptorClass returns the class object for MTLRenderPassSampleBufferAttachmentDescriptor.
func (MTLRenderPassSampleBufferAttachmentDescriptorClass) Alloc ¶
func (mc MTLRenderPassSampleBufferAttachmentDescriptorClass) Alloc() MTLRenderPassSampleBufferAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRenderPassStencilAttachmentDescriptor ¶
type MTLRenderPassStencilAttachmentDescriptor struct {
MTLRenderPassAttachmentDescriptor
}
A stencil render target that serves as the output destination for stencil pixels generated by a render pass.
Specifying the resolve filter ¶
- MTLRenderPassStencilAttachmentDescriptor.StencilResolveFilter: The filter used for stencil multisample resolve.
- MTLRenderPassStencilAttachmentDescriptor.SetStencilResolveFilter
Specifying the stencil clear value ¶
- MTLRenderPassStencilAttachmentDescriptor.ClearStencil: The value to use when clearing the stencil attachment.
- MTLRenderPassStencilAttachmentDescriptor.SetClearStencil
See: https://developer.apple.com/documentation/Metal/MTLRenderPassStencilAttachmentDescriptor
func MTLRenderPassStencilAttachmentDescriptorFromID ¶
func MTLRenderPassStencilAttachmentDescriptorFromID(id objc.ID) MTLRenderPassStencilAttachmentDescriptor
MTLRenderPassStencilAttachmentDescriptorFromID constructs a MTLRenderPassStencilAttachmentDescriptor from an objc.ID.
A stencil render target that serves as the output destination for stencil pixels generated by a render pass.
func NewMTLRenderPassStencilAttachmentDescriptor ¶
func NewMTLRenderPassStencilAttachmentDescriptor() MTLRenderPassStencilAttachmentDescriptor
NewMTLRenderPassStencilAttachmentDescriptor creates a new MTLRenderPassStencilAttachmentDescriptor instance.
func (MTLRenderPassStencilAttachmentDescriptor) Autorelease ¶
func (r MTLRenderPassStencilAttachmentDescriptor) Autorelease() MTLRenderPassStencilAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPassStencilAttachmentDescriptor) ClearStencil ¶
func (r MTLRenderPassStencilAttachmentDescriptor) ClearStencil() uint32
The value to use when clearing the stencil attachment.
Discussion ¶
If the [LoadAction] property of the attachment is set to [LoadActionClear], then at the start of a render pass, the GPU fills the contents of the attachment with the value stored in the [ClearStencil] property. Otherwise, the GPU ignores [ClearStencil].
The default value is `0`.
func (MTLRenderPassStencilAttachmentDescriptor) SetClearStencil ¶
func (r MTLRenderPassStencilAttachmentDescriptor) SetClearStencil(value uint32)
func (MTLRenderPassStencilAttachmentDescriptor) SetStencilResolveFilter ¶
func (r MTLRenderPassStencilAttachmentDescriptor) SetStencilResolveFilter(value MTLMultisampleStencilResolveFilter)
func (MTLRenderPassStencilAttachmentDescriptor) StencilResolveFilter ¶
func (r MTLRenderPassStencilAttachmentDescriptor) StencilResolveFilter() MTLMultisampleStencilResolveFilter
The filter used for stencil multisample resolve.
Discussion ¶
The default value is [MultisampleStencilResolveFilterSample0].
type MTLRenderPassStencilAttachmentDescriptorClass ¶
type MTLRenderPassStencilAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPassStencilAttachmentDescriptorClass ¶
func GetMTLRenderPassStencilAttachmentDescriptorClass() MTLRenderPassStencilAttachmentDescriptorClass
GetMTLRenderPassStencilAttachmentDescriptorClass returns the class object for MTLRenderPassStencilAttachmentDescriptor.
func (MTLRenderPassStencilAttachmentDescriptorClass) Alloc ¶
func (mc MTLRenderPassStencilAttachmentDescriptorClass) Alloc() MTLRenderPassStencilAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRenderPipelineColorAttachmentDescriptor ¶
type MTLRenderPipelineColorAttachmentDescriptor struct {
objectivec.Object
}
A color render target that specifies the color configuration and color operations for a render pipeline.
Overview ¶
An MTLRenderPipelineColorAttachmentDescriptor instance defines the configuration of a color attachment associated with a rendering pipeline.
The MTLRenderPipelineColorAttachmentDescriptor.PixelFormat property needs to be specified for the rendering pipeline state at the color attachment.
Blend operations determine how a source fragment is combined with a destination value in a color attachment to determine the pixel value to be written. The following properties define whether and how blending is performed:
- The MTLRenderPipelineColorAttachmentDescriptor.BlendingEnabled property enables blending. The default value is false. - The MTLRenderPipelineColorAttachmentDescriptor.WriteMask property identifies which color channels are blended. The default value is [ColorWriteMaskAll], which allows all color channels to be blended. - The MTLRenderPipelineColorAttachmentDescriptor.RgbBlendOperation and MTLRenderPipelineColorAttachmentDescriptor.AlphaBlendOperation properties assign the blend operations for RGB and alpha pixel data. The default value for both properties is [BlendOperationAdd]. - The MTLRenderPipelineColorAttachmentDescriptor.SourceRGBBlendFactor, MTLRenderPipelineColorAttachmentDescriptor.SourceAlphaBlendFactor, MTLRenderPipelineColorAttachmentDescriptor.DestinationRGBBlendFactor, and MTLRenderPipelineColorAttachmentDescriptor.DestinationAlphaBlendFactor properties assign the source and destination blend factors. The default value for MTLRenderPipelineColorAttachmentDescriptor.SourceRGBBlendFactor and MTLRenderPipelineColorAttachmentDescriptor.SourceAlphaBlendFactor is [BlendFactorOne]. The default value for MTLRenderPipelineColorAttachmentDescriptor.DestinationRGBBlendFactor and MTLRenderPipelineColorAttachmentDescriptor.DestinationAlphaBlendFactor is [BlendFactorZero].
Configuring render pipeline states ¶
- MTLRenderPipelineColorAttachmentDescriptor.PixelFormat: The pixel format of the color attachment’s texture.
- MTLRenderPipelineColorAttachmentDescriptor.SetPixelFormat
- MTLRenderPipelineColorAttachmentDescriptor.WriteMask: A bitmask that restricts which color channels are written into the texture.
- MTLRenderPipelineColorAttachmentDescriptor.SetWriteMask
Controlling blend operations ¶
- MTLRenderPipelineColorAttachmentDescriptor.BlendingEnabled: A Boolean value that determines whether blending is enabled.
- MTLRenderPipelineColorAttachmentDescriptor.SetBlendingEnabled
- MTLRenderPipelineColorAttachmentDescriptor.AlphaBlendOperation: The blend operation assigned for the alpha data.
- MTLRenderPipelineColorAttachmentDescriptor.SetAlphaBlendOperation
- MTLRenderPipelineColorAttachmentDescriptor.RgbBlendOperation: The blend operation assigned for the RGB data.
- MTLRenderPipelineColorAttachmentDescriptor.SetRgbBlendOperation
Configuring blend factors ¶
- MTLRenderPipelineColorAttachmentDescriptor.DestinationAlphaBlendFactor: The destination blend factor (DBF) used by the alpha blend operation.
- MTLRenderPipelineColorAttachmentDescriptor.SetDestinationAlphaBlendFactor
- MTLRenderPipelineColorAttachmentDescriptor.DestinationRGBBlendFactor: The destination blend factor (DBF) used by the RGB blend operation.
- MTLRenderPipelineColorAttachmentDescriptor.SetDestinationRGBBlendFactor
- MTLRenderPipelineColorAttachmentDescriptor.SourceAlphaBlendFactor: The source blend factor (SBF) used by the alpha blend operation.
- MTLRenderPipelineColorAttachmentDescriptor.SetSourceAlphaBlendFactor
- MTLRenderPipelineColorAttachmentDescriptor.SourceRGBBlendFactor: The source blend factor (SBF) used by the RGB blend operation.
- MTLRenderPipelineColorAttachmentDescriptor.SetSourceRGBBlendFactor
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineColorAttachmentDescriptor
func MTLRenderPipelineColorAttachmentDescriptorFromID ¶
func MTLRenderPipelineColorAttachmentDescriptorFromID(id objc.ID) MTLRenderPipelineColorAttachmentDescriptor
MTLRenderPipelineColorAttachmentDescriptorFromID constructs a MTLRenderPipelineColorAttachmentDescriptor from an objc.ID.
A color render target that specifies the color configuration and color operations for a render pipeline.
func NewMTLRenderPipelineColorAttachmentDescriptor ¶
func NewMTLRenderPipelineColorAttachmentDescriptor() MTLRenderPipelineColorAttachmentDescriptor
NewMTLRenderPipelineColorAttachmentDescriptor creates a new MTLRenderPipelineColorAttachmentDescriptor instance.
func (MTLRenderPipelineColorAttachmentDescriptor) All ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) All() MTLColorWriteMask
All color channels are enabled.
See: https://developer.apple.com/documentation/metal/mtlcolorwritemask/all
func (MTLRenderPipelineColorAttachmentDescriptor) AlphaBlendOperation ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) AlphaBlendOperation() MTLBlendOperation
The blend operation assigned for the alpha data.
Discussion ¶
The default value is [BlendOperationAdd].
func (MTLRenderPipelineColorAttachmentDescriptor) Autorelease ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) Autorelease() MTLRenderPipelineColorAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPipelineColorAttachmentDescriptor) BlendingEnabled ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) BlendingEnabled() bool
A Boolean value that determines whether blending is enabled.
Discussion ¶
The default value is false, meaning blending is disabled and pixel values are unaffected by blending. Disabled blending is effectively the same as the MTLBlendOperationAdd blend operation with a source blend factor of `1.0` and a destination blend factor of `0.0` for both RGB and alpha.
If the value is true, blending is enabled and the blend descriptor property values are used to determine how source and destination color values are combined.
func (MTLRenderPipelineColorAttachmentDescriptor) DestinationAlphaBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) DestinationAlphaBlendFactor() MTLBlendFactor
The destination blend factor (DBF) used by the alpha blend operation.
Discussion ¶
The default value is [BlendFactorZero].
func (MTLRenderPipelineColorAttachmentDescriptor) DestinationRGBBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) DestinationRGBBlendFactor() MTLBlendFactor
The destination blend factor (DBF) used by the RGB blend operation.
Discussion ¶
The default value is [BlendFactorZero].
func (MTLRenderPipelineColorAttachmentDescriptor) Init ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) Init() MTLRenderPipelineColorAttachmentDescriptor
Init initializes the instance.
func (MTLRenderPipelineColorAttachmentDescriptor) PixelFormat ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) PixelFormat() MTLPixelFormat
The pixel format of the color attachment’s texture.
Discussion ¶
The pixel format of the rendering pipeline state needs to be set to match the pixel format of the texture used by the selected color attachment; otherwise, an error occurs.
func (MTLRenderPipelineColorAttachmentDescriptor) RgbBlendOperation ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) RgbBlendOperation() MTLBlendOperation
The blend operation assigned for the RGB data.
Discussion ¶
The default value is [BlendOperationAdd].
func (MTLRenderPipelineColorAttachmentDescriptor) SetAll ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetAll(value MTLColorWriteMask)
func (MTLRenderPipelineColorAttachmentDescriptor) SetAlphaBlendOperation ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetAlphaBlendOperation(value MTLBlendOperation)
func (MTLRenderPipelineColorAttachmentDescriptor) SetBlendingEnabled ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetBlendingEnabled(value bool)
func (MTLRenderPipelineColorAttachmentDescriptor) SetDestinationAlphaBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetDestinationAlphaBlendFactor(value MTLBlendFactor)
func (MTLRenderPipelineColorAttachmentDescriptor) SetDestinationRGBBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetDestinationRGBBlendFactor(value MTLBlendFactor)
func (MTLRenderPipelineColorAttachmentDescriptor) SetPixelFormat ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetPixelFormat(value MTLPixelFormat)
func (MTLRenderPipelineColorAttachmentDescriptor) SetRgbBlendOperation ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetRgbBlendOperation(value MTLBlendOperation)
func (MTLRenderPipelineColorAttachmentDescriptor) SetSourceAlphaBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetSourceAlphaBlendFactor(value MTLBlendFactor)
func (MTLRenderPipelineColorAttachmentDescriptor) SetSourceRGBBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetSourceRGBBlendFactor(value MTLBlendFactor)
func (MTLRenderPipelineColorAttachmentDescriptor) SetWriteMask ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SetWriteMask(value MTLColorWriteMask)
func (MTLRenderPipelineColorAttachmentDescriptor) SourceAlphaBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SourceAlphaBlendFactor() MTLBlendFactor
The source blend factor (SBF) used by the alpha blend operation.
Discussion ¶
The default value is [BlendFactorOne].
func (MTLRenderPipelineColorAttachmentDescriptor) SourceRGBBlendFactor ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) SourceRGBBlendFactor() MTLBlendFactor
The source blend factor (SBF) used by the RGB blend operation.
Discussion ¶
The default value is [BlendFactorOne].
func (MTLRenderPipelineColorAttachmentDescriptor) WriteMask ¶
func (r MTLRenderPipelineColorAttachmentDescriptor) WriteMask() MTLColorWriteMask
A bitmask that restricts which color channels are written into the texture.
Discussion ¶
The default value of `writeMask` is all ones, [ColorWriteMaskAll], which allows all color channels to be blended. The MTLColorWriteMask values MTLColorWriteMaskRed, MTLColorWriteMaskGreen, MTLColorWriteMaskBlue, and MTLColorWriteMaskAlpha limit blending to one color channel, and these values can be bitwise combined. MTLColorWriteMaskNone does not allow any color channels to be blended.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineColorAttachmentDescriptor/writeMask
type MTLRenderPipelineColorAttachmentDescriptorArray ¶
type MTLRenderPipelineColorAttachmentDescriptorArray struct {
objectivec.Object
}
An array of render pipeline color attachment descriptor objects.
Accessing render pipeline state for a color attachment ¶
- MTLRenderPipelineColorAttachmentDescriptorArray.ObjectAtIndexedSubscript: Returns the render pipeline state for the specified color attachment.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineColorAttachmentDescriptorArray
func MTLRenderPipelineColorAttachmentDescriptorArrayFromID ¶
func MTLRenderPipelineColorAttachmentDescriptorArrayFromID(id objc.ID) MTLRenderPipelineColorAttachmentDescriptorArray
MTLRenderPipelineColorAttachmentDescriptorArrayFromID constructs a MTLRenderPipelineColorAttachmentDescriptorArray from an objc.ID.
An array of render pipeline color attachment descriptor objects.
func NewMTLRenderPipelineColorAttachmentDescriptorArray ¶
func NewMTLRenderPipelineColorAttachmentDescriptorArray() MTLRenderPipelineColorAttachmentDescriptorArray
NewMTLRenderPipelineColorAttachmentDescriptorArray creates a new MTLRenderPipelineColorAttachmentDescriptorArray instance.
func (MTLRenderPipelineColorAttachmentDescriptorArray) Autorelease ¶
func (r MTLRenderPipelineColorAttachmentDescriptorArray) Autorelease() MTLRenderPipelineColorAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPipelineColorAttachmentDescriptorArray) Init ¶
func (r MTLRenderPipelineColorAttachmentDescriptorArray) Init() MTLRenderPipelineColorAttachmentDescriptorArray
Init initializes the instance.
func (MTLRenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (r MTLRenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLRenderPipelineColorAttachmentDescriptor
Returns the render pipeline state for the specified color attachment.
attachmentIndex: An index in the color attachment array.
Return Value ¶
An MTLRenderPipelineColorAttachmentDescriptor instance that describes the render pipeline information for a color attachment.
func (MTLRenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (r MTLRenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLRenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
Sets the render pipeline state for a specified color attachment.
attachment: A descriptor that contains the render pipeline description for a color attachment.
attachmentIndex: An index in the color attachment array.
Discussion ¶
This method copies the pipeline state from the descriptor into the specified attachment in the array. The descriptor passed into this method can be modified and reused without affecting a previously set attachment.
If this method is called with `nil` for `attachment` for any legal index, its attachment descriptor state is set to the default values.
type MTLRenderPipelineColorAttachmentDescriptorArrayClass ¶
type MTLRenderPipelineColorAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPipelineColorAttachmentDescriptorArrayClass ¶
func GetMTLRenderPipelineColorAttachmentDescriptorArrayClass() MTLRenderPipelineColorAttachmentDescriptorArrayClass
GetMTLRenderPipelineColorAttachmentDescriptorArrayClass returns the class object for MTLRenderPipelineColorAttachmentDescriptorArray.
func (MTLRenderPipelineColorAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLRenderPipelineColorAttachmentDescriptorArrayClass) Alloc() MTLRenderPipelineColorAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLRenderPipelineColorAttachmentDescriptorClass ¶
type MTLRenderPipelineColorAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPipelineColorAttachmentDescriptorClass ¶
func GetMTLRenderPipelineColorAttachmentDescriptorClass() MTLRenderPipelineColorAttachmentDescriptorClass
GetMTLRenderPipelineColorAttachmentDescriptorClass returns the class object for MTLRenderPipelineColorAttachmentDescriptor.
func (MTLRenderPipelineColorAttachmentDescriptorClass) Alloc ¶
func (mc MTLRenderPipelineColorAttachmentDescriptorClass) Alloc() MTLRenderPipelineColorAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRenderPipelineDescriptor ¶
type MTLRenderPipelineDescriptor struct {
objectivec.Object
}
An argument of options you pass to a GPU device to get a render pipeline state.
Overview ¶
An MTLRenderPipelineDescriptor instance configures the state of the pipeline to use during a rendering pass, including rasterization (such as multisampling), visibility, blending, tessellation, and graphics function state. Use standard allocation and initialization techniques to create an MTLRenderPipelineDescriptor object. Then configure and use the descriptor to create an MTLRenderPipelineState object.
To specify the vertex or fragment function in the rendering pipeline descriptor, set the MTLRenderPipelineDescriptor.VertexFunction or MTLRenderPipelineDescriptor.FragmentFunction property, respectively, to the desired MTLFunction object. The system ignores the tessellation stage properties if you don’t set the MTLRenderPipelineDescriptor.VertexFunction property to a post-tessellation vertex function. A vertex function is a post-tessellation vertex function if the `[[ patch(patch-type, N) ]]` attribute precedes the function’s signature in your Metal Shading Language source. See the “Post-Tessellation Vertex Functions” section of Metal Shading Language Specification for more information.
Setting the MTLRenderPipelineDescriptor.FragmentFunction property to `nil` disables the rasterization of pixels into the color attachment. This action is typically for outputting vertex function data into a buffer object, or for depth-only rendering.
If the vertex shader has an argument with per-vertex input attributes, set the [VertexDescriptor] property to an MTLVertexDescriptor object that describes the organization of that vertex data.
Multisampling and the render pipeline ¶
If a color attachment supports multisampling (essentially, the attachment is an [TextureType2DMultisample] type color texture), you can create multiple samples per fragment, and the following rendering pipeline descriptor properties determine coverage:
- MTLRenderPipelineDescriptor.RasterSampleCount is the number of samples for each pixel. - If MTLRenderPipelineDescriptor.AlphaToCoverageEnabled is true, the GPU uses the alpha channel fragment output for MTLRenderPipelineDescriptor.ColorAttachments to compute a coverage mask that affects the values the GPU writes to all attachments (color, depth, and stencil). - If MTLRenderPipelineDescriptor.AlphaToOneEnabled is true, the GPU changes alpha channel fragment values for MTLRenderPipelineDescriptor.ColorAttachments to `1.0`, which is the largest representable value.
If MTLRenderPipelineDescriptor.AlphaToCoverageEnabled is true, an implementation-defined `coverageToMask` function uses the alpha channel fragment output from MTLRenderPipelineDescriptor.ColorAttachments to create an intermediate coverage mask, which sets a number of bits in its output proportionally to the value of the floating-point input. For example, if the input is `0.0f`, the function sets the output to `0x0`. If the input is `1.0f`, the function sets all output bits (in effect, `~0x0`). If the input is `0.5f`, the function sets half of the bits, according to the implementation, which often uses dither patterns.
To determine a final coverage mask, the function performs a logical [AND] on the resulting coverage mask `alphaCoverageMask` with the masks from the rasterizer and fragment shader, as the following code shows:
Identifying the render pipeline state object ¶
- MTLRenderPipelineDescriptor.Label: A string that identifies the render pipeline descriptor.
- MTLRenderPipelineDescriptor.SetLabel
Specifying graphics functions and associated data ¶
- MTLRenderPipelineDescriptor.VertexFunction: The vertex function the pipeline calls to process vertices.
- MTLRenderPipelineDescriptor.SetVertexFunction
- MTLRenderPipelineDescriptor.FragmentFunction: The fragment function the pipeline calls to process fragments.
- MTLRenderPipelineDescriptor.SetFragmentFunction
- MTLRenderPipelineDescriptor.MaxVertexCallStackDepth: The maximum function call depth from the top-most vertex shader function.
- MTLRenderPipelineDescriptor.SetMaxVertexCallStackDepth
- MTLRenderPipelineDescriptor.MaxFragmentCallStackDepth: The maximum function call depth from the top-most fragment shader function.
- MTLRenderPipelineDescriptor.SetMaxFragmentCallStackDepth
Specifying buffer layouts and fetch behavior ¶
- MTLRenderPipelineDescriptor.VertexDescriptor: The organization of vertex data in an attribute’s argument table.
- MTLRenderPipelineDescriptor.SetVertexDescriptor
Specifying buffer mutability ¶
- MTLRenderPipelineDescriptor.VertexBuffers: An array that contains the buffer mutability options for a render pipeline’s vertex function.
- MTLRenderPipelineDescriptor.FragmentBuffers: An array that contains the buffer mutability options for a render pipeline’s fragment function.
Specifying rendering pipeline state ¶
- MTLRenderPipelineDescriptor.Reset: Specifies the default rendering pipeline state values for the descriptor.
- MTLRenderPipelineDescriptor.ColorAttachments: An array of attachments that store color data.
- MTLRenderPipelineDescriptor.DepthAttachmentPixelFormat: The pixel format of the attachment that stores depth data.
- MTLRenderPipelineDescriptor.SetDepthAttachmentPixelFormat
- MTLRenderPipelineDescriptor.StencilAttachmentPixelFormat: The pixel format of the attachment that stores stencil data.
- MTLRenderPipelineDescriptor.SetStencilAttachmentPixelFormat
Specifying rasterization and visibility state ¶
- MTLRenderPipelineDescriptor.AlphaToCoverageEnabled: A Boolean value that indicates whether to read and use the alpha channel fragment output for color attachments to compute a sample coverage mask.
- MTLRenderPipelineDescriptor.SetAlphaToCoverageEnabled
- MTLRenderPipelineDescriptor.AlphaToOneEnabled: A Boolean value that indicates whether to force alpha channel values for color attachments to the largest representable value.
- MTLRenderPipelineDescriptor.SetAlphaToOneEnabled
- MTLRenderPipelineDescriptor.RasterizationEnabled: A Boolean value that determines whether the pipeline rasterizes primitives.
- MTLRenderPipelineDescriptor.SetRasterizationEnabled
- MTLRenderPipelineDescriptor.InputPrimitiveTopology: The type of primitive topology the pipeline renders.
- MTLRenderPipelineDescriptor.SetInputPrimitiveTopology
- MTLRenderPipelineDescriptor.RasterSampleCount: The number of samples the pipeline applies for each fragment.
- MTLRenderPipelineDescriptor.SetRasterSampleCount
Specifying tessellation state ¶
- MTLRenderPipelineDescriptor.MaxTessellationFactor: The maximum tessellation factor that the tessellator uses when tessellating patches.
- MTLRenderPipelineDescriptor.SetMaxTessellationFactor
- MTLRenderPipelineDescriptor.TessellationFactorScaleEnabled: A Boolean value that determines whether the pipeline scales the tessellation factor.
- MTLRenderPipelineDescriptor.SetTessellationFactorScaleEnabled
- MTLRenderPipelineDescriptor.TessellationFactorFormat: The format of the tessellation factors in the tessellation factor buffer.
- MTLRenderPipelineDescriptor.SetTessellationFactorFormat
- MTLRenderPipelineDescriptor.TessellationControlPointIndexType: The size of the control point indices in a control point index buffer.
- MTLRenderPipelineDescriptor.SetTessellationControlPointIndexType
- MTLRenderPipelineDescriptor.TessellationFactorStepFunction: The step function for determining the tessellation factors for a patch from the tessellation factor buffer.
- MTLRenderPipelineDescriptor.SetTessellationFactorStepFunction
- MTLRenderPipelineDescriptor.TessellationOutputWindingOrder: The winding order of triangles from the tessellator.
- MTLRenderPipelineDescriptor.SetTessellationOutputWindingOrder
- MTLRenderPipelineDescriptor.TessellationPartitionMode: The partitioning mode that the tessellator uses to derive the number and spacing of segments for subdividing a corresponding edge.
- MTLRenderPipelineDescriptor.SetTessellationPartitionMode
Specifying indirect command buffers usage ¶
- MTLRenderPipelineDescriptor.SupportIndirectCommandBuffers: A Boolean value that determines whether you can encode commands into an indirect command buffer using the render pipeline.
- MTLRenderPipelineDescriptor.SetSupportIndirectCommandBuffers
Specifying the maximum vertex amplification count ¶
- MTLRenderPipelineDescriptor.MaxVertexAmplificationCount: The maximum vertex amplification count you can set when encoding render commands.
- MTLRenderPipelineDescriptor.SetMaxVertexAmplificationCount
Specifying precompiled shader binaries ¶
- MTLRenderPipelineDescriptor.SupportAddingVertexBinaryFunctions: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the vertex shader’s callable functions list.
- MTLRenderPipelineDescriptor.SetSupportAddingVertexBinaryFunctions
- MTLRenderPipelineDescriptor.SupportAddingFragmentBinaryFunctions: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader’s callable functions list.
- MTLRenderPipelineDescriptor.SetSupportAddingFragmentBinaryFunctions
- MTLRenderPipelineDescriptor.BinaryArchives: An array of binary archives to search for precompiled versions of the shader.
- MTLRenderPipelineDescriptor.SetBinaryArchives
Specifying callable functions for the pipeline ¶
- MTLRenderPipelineDescriptor.VertexLinkedFunctions: Functions that you can specify as function arguments for the vertex shader when encoding commands that use the pipeline.
- MTLRenderPipelineDescriptor.SetVertexLinkedFunctions
- MTLRenderPipelineDescriptor.FragmentLinkedFunctions: Functions that you can specify as function arguments for the fragment shader when encoding commands that use the pipeline.
- MTLRenderPipelineDescriptor.SetFragmentLinkedFunctions
Specifying shader validation ¶
- MTLRenderPipelineDescriptor.ShaderValidation: A value that enables or disables shader validation for the pipeline.
- MTLRenderPipelineDescriptor.SetShaderValidation
Instance Properties ¶
- MTLRenderPipelineDescriptor.FragmentPreloadedLibraries
- MTLRenderPipelineDescriptor.SetFragmentPreloadedLibraries
- MTLRenderPipelineDescriptor.VertexPreloadedLibraries
- MTLRenderPipelineDescriptor.SetVertexPreloadedLibraries
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor
func MTLRenderPipelineDescriptorFromID ¶
func MTLRenderPipelineDescriptorFromID(id objc.ID) MTLRenderPipelineDescriptor
MTLRenderPipelineDescriptorFromID constructs a MTLRenderPipelineDescriptor from an objc.ID.
An argument of options you pass to a GPU device to get a render pipeline state.
func NewMTLRenderPipelineDescriptor ¶
func NewMTLRenderPipelineDescriptor() MTLRenderPipelineDescriptor
NewMTLRenderPipelineDescriptor creates a new MTLRenderPipelineDescriptor instance.
func (MTLRenderPipelineDescriptor) AlphaToCoverageEnabled ¶
func (r MTLRenderPipelineDescriptor) AlphaToCoverageEnabled() bool
A Boolean value that indicates whether to read and use the alpha channel fragment output for color attachments to compute a sample coverage mask.
Discussion ¶
The default value is false.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/isAlphaToCoverageEnabled
func (MTLRenderPipelineDescriptor) AlphaToOneEnabled ¶
func (r MTLRenderPipelineDescriptor) AlphaToOneEnabled() bool
A Boolean value that indicates whether to force alpha channel values for color attachments to the largest representable value.
Discussion ¶
The default value is false.
If enabled, alpha channel fragment values are only forced for `colorAttachments[0]`. Other attachments are unaffected.
You may use `alphaToOneEnabled` when you want to write an alpha value that represents partial coverage of the pixel, but also want to disable blending (by forcing alpha to one).
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/isAlphaToOneEnabled
func (MTLRenderPipelineDescriptor) Autorelease ¶
func (r MTLRenderPipelineDescriptor) Autorelease() MTLRenderPipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPipelineDescriptor) BinaryArchives ¶
func (r MTLRenderPipelineDescriptor) BinaryArchives() []objectivec.IObject
An array of binary archives to search for precompiled versions of the shader.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/binaryArchives
func (MTLRenderPipelineDescriptor) ColorAttachments ¶
func (r MTLRenderPipelineDescriptor) ColorAttachments() IMTLRenderPipelineColorAttachmentDescriptorArray
An array of attachments that store color data.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/colorAttachments
func (MTLRenderPipelineDescriptor) DepthAttachmentPixelFormat ¶
func (r MTLRenderPipelineDescriptor) DepthAttachmentPixelFormat() MTLPixelFormat
The pixel format of the attachment that stores depth data.
Discussion ¶
By default, the pixel format of the rendering pipeline state for each attachment is MTLPixelFormatInvalid.
func (MTLRenderPipelineDescriptor) FragmentBuffers ¶
func (r MTLRenderPipelineDescriptor) FragmentBuffers() IMTLPipelineBufferDescriptorArray
An array that contains the buffer mutability options for a render pipeline’s fragment function.
Discussion ¶
This property returns an array of MTLPipelineBufferDescriptor instances, where each element corresponds to the index in the buffer argument table for the render pipeline’s fragment function.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/fragmentBuffers
func (MTLRenderPipelineDescriptor) FragmentFunction ¶
func (r MTLRenderPipelineDescriptor) FragmentFunction() MTLFunction
The fragment function the pipeline calls to process fragments.
Discussion ¶
The default value is `nil`. If this value is `nil`, then there is no fragment function and therefore no writes to the color render target occur. Depth and stencil writes and visibility result counting can still proceed.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/fragmentFunction
func (MTLRenderPipelineDescriptor) FragmentLinkedFunctions ¶
func (r MTLRenderPipelineDescriptor) FragmentLinkedFunctions() IMTLLinkedFunctions
Functions that you can specify as function arguments for the fragment shader when encoding commands that use the pipeline.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/fragmentLinkedFunctions
func (MTLRenderPipelineDescriptor) FragmentPreloadedLibraries ¶
func (r MTLRenderPipelineDescriptor) FragmentPreloadedLibraries() []objectivec.IObject
func (MTLRenderPipelineDescriptor) Init ¶
func (r MTLRenderPipelineDescriptor) Init() MTLRenderPipelineDescriptor
Init initializes the instance.
func (MTLRenderPipelineDescriptor) InputPrimitiveTopology ¶
func (r MTLRenderPipelineDescriptor) InputPrimitiveTopology() MTLPrimitiveTopologyClass
The type of primitive topology the pipeline renders.
Discussion ¶
Your app needs to specify this value when layered rendering is enabled.
The default value is MTLPrimitiveTopologyClassUnspecified.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/inputPrimitiveTopology
func (MTLRenderPipelineDescriptor) Label ¶
func (r MTLRenderPipelineDescriptor) Label() string
A string that identifies the render pipeline descriptor.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/label
func (MTLRenderPipelineDescriptor) MaxFragmentCallStackDepth ¶
func (r MTLRenderPipelineDescriptor) MaxFragmentCallStackDepth() uint
The maximum function call depth from the top-most fragment shader function.
Discussion ¶
The default value is 1.
func (MTLRenderPipelineDescriptor) MaxTessellationFactor ¶
func (r MTLRenderPipelineDescriptor) MaxTessellationFactor() uint
The maximum tessellation factor that the tessellator uses when tessellating patches.
Discussion ¶
The default value is `16` and the maximum value is `64`. Any value in between needs to be set according to the partitioning mode specified by the [TessellationPartitionMode] property:
- For the [TessellationPartitionModePow2] partitioning mode, the value needs to be a power of two. - For the [TessellationPartitionModeInteger] partitioning mode, the value can be an even or odd number. - For the [TessellationPartitionModeFractionalOdd] or [TessellationPartitionModeFractionalEven] partitioning mode, the value needs to be an even number.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/maxTessellationFactor
func (MTLRenderPipelineDescriptor) MaxVertexAmplificationCount ¶
func (r MTLRenderPipelineDescriptor) MaxVertexAmplificationCount() uint
The maximum vertex amplification count you can set when encoding render commands.
Discussion ¶
Before setting this property, call the [SupportsVertexAmplificationCount] method on the device object to determine whether that amplification count is supported.
func (MTLRenderPipelineDescriptor) MaxVertexCallStackDepth ¶
func (r MTLRenderPipelineDescriptor) MaxVertexCallStackDepth() uint
The maximum function call depth from the top-most vertex shader function.
Discussion ¶
The default value is 1.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/maxVertexCallStackDepth
func (MTLRenderPipelineDescriptor) RasterSampleCount ¶
func (r MTLRenderPipelineDescriptor) RasterSampleCount() uint
The number of samples the pipeline applies for each fragment.
Discussion ¶
The render pipeline state honors this property only if the pipeline render targets support multisampling.
When your create an MTLRenderCommandEncoder instance, this property’s value needs to be equal to the number of render target textures. Furthermore, the texture type of all render target textures need to be [TextureType2DMultisample].
The number of samples a GPU supports varies by device. You can check whether an MTLDevice instance supports a specific sample count by calling its [SupportsTextureSampleCount] method.
The default value for this property is `1`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/rasterSampleCount
func (MTLRenderPipelineDescriptor) RasterizationEnabled ¶
func (r MTLRenderPipelineDescriptor) RasterizationEnabled() bool
A Boolean value that determines whether the pipeline rasterizes primitives.
Discussion ¶
The default value is true, indicating that primitives are rasterized. If the value is false, then primitives are dropped prior to rasterization (i.e. rasterization is disabled). Disabling rasterization may be useful to gather data from vertex-only transformations.
When this value is false, no fragments are processed and the vertex shader function needs to return `void`.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/isRasterizationEnabled
func (MTLRenderPipelineDescriptor) Reset ¶
func (r MTLRenderPipelineDescriptor) Reset()
Specifies the default rendering pipeline state values for the descriptor.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/reset()
func (MTLRenderPipelineDescriptor) SetAlphaToCoverageEnabled ¶
func (r MTLRenderPipelineDescriptor) SetAlphaToCoverageEnabled(value bool)
func (MTLRenderPipelineDescriptor) SetAlphaToOneEnabled ¶
func (r MTLRenderPipelineDescriptor) SetAlphaToOneEnabled(value bool)
func (MTLRenderPipelineDescriptor) SetBinaryArchives ¶
func (r MTLRenderPipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
func (MTLRenderPipelineDescriptor) SetDepthAttachmentPixelFormat ¶
func (r MTLRenderPipelineDescriptor) SetDepthAttachmentPixelFormat(value MTLPixelFormat)
func (MTLRenderPipelineDescriptor) SetFragmentFunction ¶
func (r MTLRenderPipelineDescriptor) SetFragmentFunction(value MTLFunction)
func (MTLRenderPipelineDescriptor) SetFragmentLinkedFunctions ¶
func (r MTLRenderPipelineDescriptor) SetFragmentLinkedFunctions(value IMTLLinkedFunctions)
func (MTLRenderPipelineDescriptor) SetFragmentPreloadedLibraries ¶
func (r MTLRenderPipelineDescriptor) SetFragmentPreloadedLibraries(value []objectivec.IObject)
func (MTLRenderPipelineDescriptor) SetInputPrimitiveTopology ¶
func (r MTLRenderPipelineDescriptor) SetInputPrimitiveTopology(value MTLPrimitiveTopologyClass)
func (MTLRenderPipelineDescriptor) SetLabel ¶
func (r MTLRenderPipelineDescriptor) SetLabel(value string)
func (MTLRenderPipelineDescriptor) SetMaxFragmentCallStackDepth ¶
func (r MTLRenderPipelineDescriptor) SetMaxFragmentCallStackDepth(value uint)
func (MTLRenderPipelineDescriptor) SetMaxTessellationFactor ¶
func (r MTLRenderPipelineDescriptor) SetMaxTessellationFactor(value uint)
func (MTLRenderPipelineDescriptor) SetMaxVertexAmplificationCount ¶
func (r MTLRenderPipelineDescriptor) SetMaxVertexAmplificationCount(value uint)
func (MTLRenderPipelineDescriptor) SetMaxVertexCallStackDepth ¶
func (r MTLRenderPipelineDescriptor) SetMaxVertexCallStackDepth(value uint)
func (MTLRenderPipelineDescriptor) SetRasterSampleCount ¶
func (r MTLRenderPipelineDescriptor) SetRasterSampleCount(value uint)
func (MTLRenderPipelineDescriptor) SetRasterizationEnabled ¶
func (r MTLRenderPipelineDescriptor) SetRasterizationEnabled(value bool)
func (MTLRenderPipelineDescriptor) SetShaderValidation ¶
func (r MTLRenderPipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
func (MTLRenderPipelineDescriptor) SetStencilAttachmentPixelFormat ¶
func (r MTLRenderPipelineDescriptor) SetStencilAttachmentPixelFormat(value MTLPixelFormat)
func (MTLRenderPipelineDescriptor) SetSupportAddingFragmentBinaryFunctions ¶
func (r MTLRenderPipelineDescriptor) SetSupportAddingFragmentBinaryFunctions(value bool)
func (MTLRenderPipelineDescriptor) SetSupportAddingVertexBinaryFunctions ¶
func (r MTLRenderPipelineDescriptor) SetSupportAddingVertexBinaryFunctions(value bool)
func (MTLRenderPipelineDescriptor) SetSupportIndirectCommandBuffers ¶
func (r MTLRenderPipelineDescriptor) SetSupportIndirectCommandBuffers(value bool)
func (MTLRenderPipelineDescriptor) SetTessellationControlPointIndexType ¶
func (r MTLRenderPipelineDescriptor) SetTessellationControlPointIndexType(value MTLTessellationControlPointIndexType)
func (MTLRenderPipelineDescriptor) SetTessellationFactorFormat ¶
func (r MTLRenderPipelineDescriptor) SetTessellationFactorFormat(value MTLTessellationFactorFormat)
func (MTLRenderPipelineDescriptor) SetTessellationFactorScaleEnabled ¶
func (r MTLRenderPipelineDescriptor) SetTessellationFactorScaleEnabled(value bool)
func (MTLRenderPipelineDescriptor) SetTessellationFactorStepFunction ¶
func (r MTLRenderPipelineDescriptor) SetTessellationFactorStepFunction(value MTLTessellationFactorStepFunction)
func (MTLRenderPipelineDescriptor) SetTessellationOutputWindingOrder ¶
func (r MTLRenderPipelineDescriptor) SetTessellationOutputWindingOrder(value MTLWinding)
func (MTLRenderPipelineDescriptor) SetTessellationPartitionMode ¶
func (r MTLRenderPipelineDescriptor) SetTessellationPartitionMode(value MTLTessellationPartitionMode)
func (MTLRenderPipelineDescriptor) SetVertexDescriptor ¶
func (r MTLRenderPipelineDescriptor) SetVertexDescriptor(value IMTLVertexDescriptor)
func (MTLRenderPipelineDescriptor) SetVertexFunction ¶
func (r MTLRenderPipelineDescriptor) SetVertexFunction(value MTLFunction)
func (MTLRenderPipelineDescriptor) SetVertexLinkedFunctions ¶
func (r MTLRenderPipelineDescriptor) SetVertexLinkedFunctions(value IMTLLinkedFunctions)
func (MTLRenderPipelineDescriptor) SetVertexPreloadedLibraries ¶
func (r MTLRenderPipelineDescriptor) SetVertexPreloadedLibraries(value []objectivec.IObject)
func (MTLRenderPipelineDescriptor) ShaderValidation ¶
func (r MTLRenderPipelineDescriptor) ShaderValidation() MTLShaderValidation
A value that enables or disables shader validation for the pipeline.
Discussion ¶
You can override the value using either of these environment variables: `MTL_SHADER_VALIDATION_ENABLE_PIPELINES` or `MTL_SHADER_VALIDATION_DISABLE_PIPELINES.`
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/shaderValidation
func (MTLRenderPipelineDescriptor) StencilAttachmentPixelFormat ¶
func (r MTLRenderPipelineDescriptor) StencilAttachmentPixelFormat() MTLPixelFormat
The pixel format of the attachment that stores stencil data.
Discussion ¶
By default, the pixel format of the rendering pipeline state for each attachment is MTLPixelFormatInvalid.
func (MTLRenderPipelineDescriptor) SupportAddingFragmentBinaryFunctions ¶
func (r MTLRenderPipelineDescriptor) SupportAddingFragmentBinaryFunctions() bool
A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader’s callable functions list.
func (MTLRenderPipelineDescriptor) SupportAddingVertexBinaryFunctions ¶
func (r MTLRenderPipelineDescriptor) SupportAddingVertexBinaryFunctions() bool
A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the vertex shader’s callable functions list.
func (MTLRenderPipelineDescriptor) SupportIndirectCommandBuffers ¶
func (r MTLRenderPipelineDescriptor) SupportIndirectCommandBuffers() bool
A Boolean value that determines whether you can encode commands into an indirect command buffer using the render pipeline.
func (MTLRenderPipelineDescriptor) TessellationControlPointIndexType ¶
func (r MTLRenderPipelineDescriptor) TessellationControlPointIndexType() MTLTessellationControlPointIndexType
The size of the control point indices in a control point index buffer.
Discussion ¶
The default value is [TessellationControlPointIndexTypeNone]; use this value when drawing patches without a control point index buffer. This value needs to be either [TessellationControlPointIndexTypeUInt16] or [TessellationControlPointIndexTypeUInt32] when drawing patches with indexed control points.
func (MTLRenderPipelineDescriptor) TessellationFactorFormat ¶
func (r MTLRenderPipelineDescriptor) TessellationFactorFormat() MTLTessellationFactorFormat
The format of the tessellation factors in the tessellation factor buffer.
Discussion ¶
The default value is [TessellationFactorFormatHalf].
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/tessellationFactorFormat
func (MTLRenderPipelineDescriptor) TessellationFactorScaleEnabled ¶
func (r MTLRenderPipelineDescriptor) TessellationFactorScaleEnabled() bool
A Boolean value that determines whether the pipeline scales the tessellation factor.
Discussion ¶
The default value is false.
If this value is true, a scale factor is applied to the tessellation factors after the patch cull check is performed but before the tessellation factors are clamped to the value of [MaxTessellationFactor]. The scale factor is applied only if the patch is not culled.
func (MTLRenderPipelineDescriptor) TessellationFactorStepFunction ¶
func (r MTLRenderPipelineDescriptor) TessellationFactorStepFunction() MTLTessellationFactorStepFunction
The step function for determining the tessellation factors for a patch from the tessellation factor buffer.
Discussion ¶
The default value is [TessellationFactorStepFunctionConstant].
func (MTLRenderPipelineDescriptor) TessellationOutputWindingOrder ¶
func (r MTLRenderPipelineDescriptor) TessellationOutputWindingOrder() MTLWinding
The winding order of triangles from the tessellator.
Discussion ¶
The default value is [WindingClockwise].
func (MTLRenderPipelineDescriptor) TessellationPartitionMode ¶
func (r MTLRenderPipelineDescriptor) TessellationPartitionMode() MTLTessellationPartitionMode
The partitioning mode that the tessellator uses to derive the number and spacing of segments for subdividing a corresponding edge.
Discussion ¶
The default value is [TessellationPartitionModePow2].
func (MTLRenderPipelineDescriptor) VertexBuffers ¶
func (r MTLRenderPipelineDescriptor) VertexBuffers() IMTLPipelineBufferDescriptorArray
An array that contains the buffer mutability options for a render pipeline’s vertex function.
Discussion ¶
This property returns an array of MTLPipelineBufferDescriptor instances, where each element corresponds to the same index in the buffer argument table for the render pipeline’s vertex function.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/vertexBuffers
func (MTLRenderPipelineDescriptor) VertexDescriptor ¶
func (r MTLRenderPipelineDescriptor) VertexDescriptor() IMTLVertexDescriptor
The organization of vertex data in an attribute’s argument table.
Discussion ¶
An MTLVertexDescriptor instance is used to describe the organization of per-vertex input structs passed in an argument of a vertex shader function.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/vertexDescriptor
func (MTLRenderPipelineDescriptor) VertexFunction ¶
func (r MTLRenderPipelineDescriptor) VertexFunction() MTLFunction
The vertex function the pipeline calls to process vertices.
Discussion ¶
The default value is `nil`. The vertex function needs to be specified. The vertex function can be either a regular vertex function or a post-tessellation vertex function.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/vertexFunction
func (MTLRenderPipelineDescriptor) VertexLinkedFunctions ¶
func (r MTLRenderPipelineDescriptor) VertexLinkedFunctions() IMTLLinkedFunctions
Functions that you can specify as function arguments for the vertex shader when encoding commands that use the pipeline.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/vertexLinkedFunctions
func (MTLRenderPipelineDescriptor) VertexPreloadedLibraries ¶
func (r MTLRenderPipelineDescriptor) VertexPreloadedLibraries() []objectivec.IObject
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineDescriptor/vertexPreloadedLibraries
type MTLRenderPipelineDescriptorClass ¶
type MTLRenderPipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPipelineDescriptorClass ¶
func GetMTLRenderPipelineDescriptorClass() MTLRenderPipelineDescriptorClass
GetMTLRenderPipelineDescriptorClass returns the class object for MTLRenderPipelineDescriptor.
func (MTLRenderPipelineDescriptorClass) Alloc ¶
func (mc MTLRenderPipelineDescriptorClass) Alloc() MTLRenderPipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTLRenderPipelineFunctionsDescriptor ¶
type MTLRenderPipelineFunctionsDescriptor struct {
objectivec.Object
}
A collection of functions for updating a render pipeline.
Overview ¶
When you create a render pipeline that takes visible functions as parameters, you need to specify all possible functions that the render pipeline can call. If you already have a pipeline, you can create a new render pipeline with the same configuration but additional callable functions. To create the new pipeline state, configure an MTLRenderPipelineFunctionsDescriptor instance with the additional callable functions to add, and then call the pipeline state’s [NewRenderPipelineStateWithAdditionalBinaryFunctionsError] method, passing the descriptor.
Configuring the descriptor’s functions ¶
- MTLRenderPipelineFunctionsDescriptor.VertexAdditionalBinaryFunctions: The vertex functions to add to the render pipeline.
- MTLRenderPipelineFunctionsDescriptor.SetVertexAdditionalBinaryFunctions
- MTLRenderPipelineFunctionsDescriptor.FragmentAdditionalBinaryFunctions: The fragment functions to add to the render pipeline.
- MTLRenderPipelineFunctionsDescriptor.SetFragmentAdditionalBinaryFunctions
- MTLRenderPipelineFunctionsDescriptor.TileAdditionalBinaryFunctions: The tile functions to add to the render pipeline.
- MTLRenderPipelineFunctionsDescriptor.SetTileAdditionalBinaryFunctions
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineFunctionsDescriptor
func MTLRenderPipelineFunctionsDescriptorFromID ¶
func MTLRenderPipelineFunctionsDescriptorFromID(id objc.ID) MTLRenderPipelineFunctionsDescriptor
MTLRenderPipelineFunctionsDescriptorFromID constructs a MTLRenderPipelineFunctionsDescriptor from an objc.ID.
A collection of functions for updating a render pipeline.
func NewMTLRenderPipelineFunctionsDescriptor ¶
func NewMTLRenderPipelineFunctionsDescriptor() MTLRenderPipelineFunctionsDescriptor
NewMTLRenderPipelineFunctionsDescriptor creates a new MTLRenderPipelineFunctionsDescriptor instance.
func (MTLRenderPipelineFunctionsDescriptor) Autorelease ¶
func (r MTLRenderPipelineFunctionsDescriptor) Autorelease() MTLRenderPipelineFunctionsDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPipelineFunctionsDescriptor) FragmentAdditionalBinaryFunctions ¶
func (r MTLRenderPipelineFunctionsDescriptor) FragmentAdditionalBinaryFunctions() []objectivec.IObject
The fragment functions to add to the render pipeline.
func (MTLRenderPipelineFunctionsDescriptor) SetFragmentAdditionalBinaryFunctions ¶
func (r MTLRenderPipelineFunctionsDescriptor) SetFragmentAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTLRenderPipelineFunctionsDescriptor) SetTileAdditionalBinaryFunctions ¶
func (r MTLRenderPipelineFunctionsDescriptor) SetTileAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTLRenderPipelineFunctionsDescriptor) SetVertexAdditionalBinaryFunctions ¶
func (r MTLRenderPipelineFunctionsDescriptor) SetVertexAdditionalBinaryFunctions(value []objectivec.IObject)
func (MTLRenderPipelineFunctionsDescriptor) TileAdditionalBinaryFunctions ¶
func (r MTLRenderPipelineFunctionsDescriptor) TileAdditionalBinaryFunctions() []objectivec.IObject
The tile functions to add to the render pipeline.
func (MTLRenderPipelineFunctionsDescriptor) VertexAdditionalBinaryFunctions ¶
func (r MTLRenderPipelineFunctionsDescriptor) VertexAdditionalBinaryFunctions() []objectivec.IObject
The vertex functions to add to the render pipeline.
type MTLRenderPipelineFunctionsDescriptorClass ¶
type MTLRenderPipelineFunctionsDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPipelineFunctionsDescriptorClass ¶
func GetMTLRenderPipelineFunctionsDescriptorClass() MTLRenderPipelineFunctionsDescriptorClass
GetMTLRenderPipelineFunctionsDescriptorClass returns the class object for MTLRenderPipelineFunctionsDescriptor.
type MTLRenderPipelineReflection ¶
type MTLRenderPipelineReflection struct {
objectivec.Object
}
Information about the arguments of a graphics function.
Overview ¶
The MTLRenderPipelineReflection class is an interface that represents the parameters for the shaders in a render pipeline state (see MTLRenderPipelineState). Each pipeline state can include object, mesh, vertex, fragment, and tile shaders.
You create a reflection instance at the same time as the pipeline state that it represents by calling the appropriate MTLDevice method. For example, the [NewRenderPipelineStateWithDescriptorOptionsReflectionError] and [NewRenderPipelineStateWithDescriptorOptionsCompletionHandler] methods create the pipeline state and the reflection instances at the same time.
For more information, see Pipeline state creation.
Inspecting a shader’s parameter ¶
- MTLRenderPipelineReflection.FragmentBindings: An array of binding instances, each of which represents a parameter of the pipeline state’s fragment shader.
- MTLRenderPipelineReflection.MeshBindings: An array of binding instances, each of which represents a parameter of the pipeline state’s mesh shader.
- MTLRenderPipelineReflection.ObjectBindings: An array of binding instances, each of which represents a parameter of the pipeline state’s object shader.
- MTLRenderPipelineReflection.TileBindings: An array of binding instances, each of which represents a parameter of the pipeline state’s tile shader.
- MTLRenderPipelineReflection.VertexBindings: An array of binding instances, each of which represents a parameter of the pipeline state’s vertex shader.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineReflection
func MTLRenderPipelineReflectionFromID ¶
func MTLRenderPipelineReflectionFromID(id objc.ID) MTLRenderPipelineReflection
MTLRenderPipelineReflectionFromID constructs a MTLRenderPipelineReflection from an objc.ID.
Information about the arguments of a graphics function.
func NewMTLRenderPipelineReflection ¶
func NewMTLRenderPipelineReflection() MTLRenderPipelineReflection
NewMTLRenderPipelineReflection creates a new MTLRenderPipelineReflection instance.
func (MTLRenderPipelineReflection) Autorelease ¶
func (r MTLRenderPipelineReflection) Autorelease() MTLRenderPipelineReflection
Autorelease adds the receiver to the current autorelease pool.
func (MTLRenderPipelineReflection) FragmentBindings ¶
func (r MTLRenderPipelineReflection) FragmentBindings() []objectivec.IObject
An array of binding instances, each of which represents a parameter of the pipeline state’s fragment shader.
Discussion ¶
The MTLBinding elements in the array are in the same order as the fragment shader’s declaration signature.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineReflection/fragmentBindings
func (MTLRenderPipelineReflection) Init ¶
func (r MTLRenderPipelineReflection) Init() MTLRenderPipelineReflection
Init initializes the instance.
func (MTLRenderPipelineReflection) MeshBindings ¶
func (r MTLRenderPipelineReflection) MeshBindings() []objectivec.IObject
An array of binding instances, each of which represents a parameter of the pipeline state’s mesh shader.
Discussion ¶
The MTLBinding elements in the array are in the same order as the mesh shader’s declaration signature.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineReflection/meshBindings
func (MTLRenderPipelineReflection) ObjectBindings ¶
func (r MTLRenderPipelineReflection) ObjectBindings() []objectivec.IObject
An array of binding instances, each of which represents a parameter of the pipeline state’s object shader.
Discussion ¶
The MTLBinding elements in the array are in the same order as the object shader’s declaration signature.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineReflection/objectBindings
func (MTLRenderPipelineReflection) TileBindings ¶
func (r MTLRenderPipelineReflection) TileBindings() []objectivec.IObject
An array of binding instances, each of which represents a parameter of the pipeline state’s tile shader.
Discussion ¶
The MTLBinding elements in the array are in the same order as the tile shader’s declaration signature.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineReflection/tileBindings
func (MTLRenderPipelineReflection) VertexBindings ¶
func (r MTLRenderPipelineReflection) VertexBindings() []objectivec.IObject
An array of binding instances, each of which represents a parameter of the pipeline state’s vertex shader.
Discussion ¶
The MTLBinding elements in the array are in the same order as the vertex shader’s declaration signature.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineReflection/vertexBindings
type MTLRenderPipelineReflectionClass ¶
type MTLRenderPipelineReflectionClass struct {
// contains filtered or unexported fields
}
func GetMTLRenderPipelineReflectionClass ¶
func GetMTLRenderPipelineReflectionClass() MTLRenderPipelineReflectionClass
GetMTLRenderPipelineReflectionClass returns the class object for MTLRenderPipelineReflection.
func (MTLRenderPipelineReflectionClass) Alloc ¶
func (mc MTLRenderPipelineReflectionClass) Alloc() MTLRenderPipelineReflection
Alloc allocates memory for a new instance of the class.
type MTLRenderPipelineState ¶
type MTLRenderPipelineState interface {
objectivec.IObject
MTLAllocation
// The device instance that creates the pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/device
Device() MTLDevice
// A string that helps you identify the render pipeline state during debugging.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/label
Label() string
// An unique identifier that represents the pipeline state, which you can add to an argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/gpuResourceID
GpuResourceID() MTLResourceID
// The largest number of threads the pipeline state can have in a single object shader threadgroup.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/maxTotalThreadsPerObjectThreadgroup
MaxTotalThreadsPerObjectThreadgroup() uint
// The number of threads the render pass applies to a SIMD group for an object shader.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/objectThreadExecutionWidth
ObjectThreadExecutionWidth() uint
// The largest number of threads the pipeline state can have in a single mesh shader threadgroup.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/maxTotalThreadsPerMeshThreadgroup
MaxTotalThreadsPerMeshThreadgroup() uint
// The largest number of threadgroups the pipeline state can have in a single mesh shader grid.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/maxTotalThreadgroupsPerMeshGrid
MaxTotalThreadgroupsPerMeshGrid() uint
// The number of threads the render pass applies to a SIMD group for a mesh shader.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/meshThreadExecutionWidth
MeshThreadExecutionWidth() uint
// The largest number of threads the pipeline state can have in a single tile shader threadgroup.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/maxTotalThreadsPerThreadgroup
MaxTotalThreadsPerThreadgroup() uint
// A Boolean value that indicates whether the pipeline state needs a threadgroup’s size to equal a tile’s size.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/threadgroupSizeMatchesTileSize
ThreadgroupSizeMatchesTileSize() bool
// The memory size, in byes, of the render pipeline’s imageblock for a single sample.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/imageblockSampleLength
ImageblockSampleLength() uint
// Returns the length of an imageblock’s memory for the specified imageblock dimensions.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/imageblockMemoryLength(forDimensions:)
ImageblockMemoryLengthForDimensions(imageblockDimensions MTLSize) uint
// A Boolean value that indicates whether the render pipeline supports encoding commands into an indirect command buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/supportIndirectCommandBuffers
SupportIndirectCommandBuffers() bool
// The current state of shader validation for the pipeline.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/shaderValidation
ShaderValidation() MTLShaderValidation
// Creates a function handle for a shader.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/functionHandle(function:stage:)-7uvul
FunctionHandleWithFunctionStage(function MTLFunction, stage MTLRenderStages) MTLFunctionHandle
// Creates a new visible function table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/makeVisibleFunctionTable(descriptor:stage:)
NewVisibleFunctionTableWithDescriptorStage(descriptor IMTLVisibleFunctionTableDescriptor, stage MTLRenderStages) MTLVisibleFunctionTable
// Creates a new intersection function table.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/makeIntersectionFunctionTable(descriptor:stage:)
NewIntersectionFunctionTableWithDescriptorStage(descriptor IMTLIntersectionFunctionTableDescriptor, stage MTLRenderStages) MTLIntersectionFunctionTable
// Creates a new pipeline state that’s a copy of the current pipeline state with additional shaders.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/makeRenderPipelineState(additionalBinaryFunctions:)-84te1
NewRenderPipelineStateWithAdditionalBinaryFunctionsError(additionalBinaryFunctions IMTLRenderPipelineFunctionsDescriptor) (MTLRenderPipelineState, error)
// Obtains a reflection object for this render pipeline.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/reflection
Reflection() IMTLRenderPipelineReflection
// RequiredThreadsPerMeshThreadgroup protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/requiredThreadsPerMeshThreadgroup
RequiredThreadsPerMeshThreadgroup() MTLSize
// RequiredThreadsPerObjectThreadgroup protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/requiredThreadsPerObjectThreadgroup
RequiredThreadsPerObjectThreadgroup() MTLSize
// RequiredThreadsPerTileThreadgroup protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/requiredThreadsPerTileThreadgroup
RequiredThreadsPerTileThreadgroup() MTLSize
// Obtains the function handle for a specific function this pipeline state links at the binary level.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/functionHandle(function:stage:)-1pgxo
FunctionHandleWithBinaryFunctionStage(function MTL4BinaryFunction, stage MTLRenderStages) MTLFunctionHandle
// Obtains a function handle for the a specific function this pipeline links at the Metal IR level.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/functionHandle(withName:stage:)
FunctionHandleWithNameStage(name string, stage MTLRenderStages) MTLFunctionHandle
// Creates a render pipeline descriptor from this pipeline that you can use for pipeline specialization.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/makeRenderPipelineDescriptorForSpecialization()
NewRenderPipelineDescriptorForSpecialization() IMTL4PipelineDescriptor
// Creates a new render pipeline state by adding binary functions to each stage of this pipeline state.
//
// See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/makeRenderPipelineState(additionalBinaryFunctions:)-49r1w
NewRenderPipelineStateWithBinaryFunctionsError(binaryFunctionsDescriptor IMTL4RenderPipelineBinaryFunctionsDescriptor) (MTLRenderPipelineState, error)
}
An interface that represents a graphics pipeline configuration for a render pass, which the pass applies to the draw commands you encode.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState
type MTLRenderPipelineStateObject ¶
type MTLRenderPipelineStateObject struct {
objectivec.Object
}
MTLRenderPipelineStateObject wraps an existing Objective-C object that conforms to the MTLRenderPipelineState protocol.
func MTLRenderPipelineStateObjectFromID ¶
func MTLRenderPipelineStateObjectFromID(id objc.ID) MTLRenderPipelineStateObject
MTLRenderPipelineStateObjectFromID constructs a MTLRenderPipelineStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLRenderPipelineStateObject) AllocatedSize ¶
func (o MTLRenderPipelineStateObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLRenderPipelineStateObject) BaseObject ¶
func (o MTLRenderPipelineStateObject) BaseObject() objectivec.Object
func (MTLRenderPipelineStateObject) Device ¶
func (o MTLRenderPipelineStateObject) Device() MTLDevice
The device instance that creates the pipeline state.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/device
func (MTLRenderPipelineStateObject) FunctionHandleWithBinaryFunctionStage ¶
func (o MTLRenderPipelineStateObject) FunctionHandleWithBinaryFunctionStage(function MTL4BinaryFunction, stage MTLRenderStages) MTLFunctionHandle
Obtains the function handle for a specific function this pipeline state links at the binary level.
function: A binary function to retrieve the handle.
stage: The shader stage that uses the function.
Return Value ¶
A function handle representing the function if present, otherwise `nil`.
func (MTLRenderPipelineStateObject) FunctionHandleWithFunctionStage ¶
func (o MTLRenderPipelineStateObject) FunctionHandleWithFunctionStage(function MTLFunction, stage MTLRenderStages) MTLFunctionHandle
Creates a function handle for a shader.
function: An MTLFunction instance that represents the shader the method creates a handle for.
stage: An MTLRenderStages instance that represents the rendering stage that invokes the shader that `function` represents. // MTLRenderStages: https://developer.apple.com/documentation/Metal/MTLRenderStages
func (MTLRenderPipelineStateObject) FunctionHandleWithNameStage ¶
func (o MTLRenderPipelineStateObject) FunctionHandleWithNameStage(name string, stage MTLRenderStages) MTLFunctionHandle
Obtains a function handle for the a specific function this pipeline links at the Metal IR level.
name: A string containing the name of the function.
stage: The shader stage that uses the function.
Return Value ¶
A function handle representing the function if present, otherwise `nil`.
func (MTLRenderPipelineStateObject) GpuResourceID ¶
func (o MTLRenderPipelineStateObject) GpuResourceID() MTLResourceID
An unique identifier that represents the pipeline state, which you can add to an argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/gpuResourceID
func (MTLRenderPipelineStateObject) ImageblockMemoryLengthForDimensions ¶
func (o MTLRenderPipelineStateObject) ImageblockMemoryLengthForDimensions(imageblockDimensions MTLSize) uint
Returns the length of an imageblock’s memory for the specified imageblock dimensions.
imageblockDimensions: An MTLSize instance that represent the dimensions of an imageblock. // MTLSize: https://developer.apple.com/documentation/Metal/MTLSize
Discussion ¶
The imageblock dimensions need to match a valid tile size, such as one of the following:
- 32 x 32 - 32 x 16 - 16 x 16
The GPU partitions tile memory between imageblocks and threadgroup memory,
For information about identifying tile memory limits for GPU devices, see either of the following:
- Metal Feature Set Tables (PDF) - Metal Feature Set Tables (Numbers)
func (MTLRenderPipelineStateObject) ImageblockSampleLength ¶
func (o MTLRenderPipelineStateObject) ImageblockSampleLength() uint
The memory size, in byes, of the render pipeline’s imageblock for a single sample.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/imageblockSampleLength
func (MTLRenderPipelineStateObject) Label ¶
func (o MTLRenderPipelineStateObject) Label() string
A string that helps you identify the render pipeline state during debugging.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/label
func (MTLRenderPipelineStateObject) MaxTotalThreadgroupsPerMeshGrid ¶
func (o MTLRenderPipelineStateObject) MaxTotalThreadgroupsPerMeshGrid() uint
The largest number of threadgroups the pipeline state can have in a single mesh shader grid.
func (MTLRenderPipelineStateObject) MaxTotalThreadsPerMeshThreadgroup ¶
func (o MTLRenderPipelineStateObject) MaxTotalThreadsPerMeshThreadgroup() uint
The largest number of threads the pipeline state can have in a single mesh shader threadgroup.
func (MTLRenderPipelineStateObject) MaxTotalThreadsPerObjectThreadgroup ¶
func (o MTLRenderPipelineStateObject) MaxTotalThreadsPerObjectThreadgroup() uint
The largest number of threads the pipeline state can have in a single object shader threadgroup.
func (MTLRenderPipelineStateObject) MaxTotalThreadsPerThreadgroup ¶
func (o MTLRenderPipelineStateObject) MaxTotalThreadsPerThreadgroup() uint
The largest number of threads the pipeline state can have in a single tile shader threadgroup.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/maxTotalThreadsPerThreadgroup
func (MTLRenderPipelineStateObject) MeshThreadExecutionWidth ¶
func (o MTLRenderPipelineStateObject) MeshThreadExecutionWidth() uint
The number of threads the render pass applies to a SIMD group for a mesh shader.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/meshThreadExecutionWidth
func (MTLRenderPipelineStateObject) NewIntersectionFunctionTableWithDescriptorStage ¶
func (o MTLRenderPipelineStateObject) NewIntersectionFunctionTableWithDescriptorStage(descriptor IMTLIntersectionFunctionTableDescriptor, stage MTLRenderStages) MTLIntersectionFunctionTable
Creates a new intersection function table.
descriptor: An MTLIntersectionFunctionTableDescriptor instance that configures the visible function table the method creates.
stage: An MTLRenderStages instance that represents the render pass stage the intersection function table applies to. // MTLRenderStages: https://developer.apple.com/documentation/Metal/MTLRenderStages
func (MTLRenderPipelineStateObject) NewRenderPipelineDescriptorForSpecialization ¶
func (o MTLRenderPipelineStateObject) NewRenderPipelineDescriptorForSpecialization() IMTL4PipelineDescriptor
Creates a render pipeline descriptor from this pipeline that you can use for pipeline specialization.
Return Value ¶
A new pipeline descriptor that you use for pipeline state specialization.
Discussion ¶
Use this method to obtain a new MTL4PipelineDescriptor instance that you can use to specialize any unspecialized properties in this pipeline state object.
The returned descriptor contains every unspecialized field in the current pipeline state object, set to unspecialized. It may, however, not contain valid or accurate properties in any other field.
This descriptor is only valid for the purpose of calling specialization functions on the MTL4Compiler to specialize this pipeline, for example: [NewRenderPipelineStateBySpecializationWithDescriptorPipelineError].
Although this method returns the MTL4PipelineDescriptor base class, the concrete instance this method returns corresponds to the specific descriptor type for the creation of this pipeline state, for example if a MTL4Compiler instance creates this current pipeline form a MTLTileRenderPipelineDescriptor, this method returns a concrete MTLTileRenderPipelineDescriptor instance.
func (MTLRenderPipelineStateObject) NewRenderPipelineStateWithAdditionalBinaryFunctionsError ¶
func (o MTLRenderPipelineStateObject) NewRenderPipelineStateWithAdditionalBinaryFunctionsError(additionalBinaryFunctions IMTLRenderPipelineFunctionsDescriptor) (MTLRenderPipelineState, error)
Creates a new pipeline state that’s a copy of the current pipeline state with additional shaders.
additionalBinaryFunctions: An MTLRenderPipelineFunctionsDescriptor instance, which contains MTLFunction arrays for vertex, fragment, and tile shaders.
func (MTLRenderPipelineStateObject) NewRenderPipelineStateWithBinaryFunctionsError ¶
func (o MTLRenderPipelineStateObject) NewRenderPipelineStateWithBinaryFunctionsError(binaryFunctionsDescriptor IMTL4RenderPipelineBinaryFunctionsDescriptor) (MTLRenderPipelineState, error)
Creates a new render pipeline state by adding binary functions to each stage of this pipeline state.
binaryFunctionsDescriptor: A non-`nil` dynamic linking descriptor.
Return Value ¶
A new render pipeline state upon success, otherwise `nil`.
func (MTLRenderPipelineStateObject) NewVisibleFunctionTableWithDescriptorStage ¶
func (o MTLRenderPipelineStateObject) NewVisibleFunctionTableWithDescriptorStage(descriptor IMTLVisibleFunctionTableDescriptor, stage MTLRenderStages) MTLVisibleFunctionTable
Creates a new visible function table.
descriptor: An MTLVisibleFunctionTableDescriptor instance that configures the visible function table the method creates.
stage: An MTLRenderStages instance that represents the render pass stage the visible function table applies to. // MTLRenderStages: https://developer.apple.com/documentation/Metal/MTLRenderStages
func (MTLRenderPipelineStateObject) ObjectThreadExecutionWidth ¶
func (o MTLRenderPipelineStateObject) ObjectThreadExecutionWidth() uint
The number of threads the render pass applies to a SIMD group for an object shader.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/objectThreadExecutionWidth
func (MTLRenderPipelineStateObject) Reflection ¶
func (o MTLRenderPipelineStateObject) Reflection() IMTLRenderPipelineReflection
Obtains a reflection object for this render pipeline.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/reflection
func (MTLRenderPipelineStateObject) RequiredThreadsPerMeshThreadgroup ¶
func (o MTLRenderPipelineStateObject) RequiredThreadsPerMeshThreadgroup() MTLSize
func (MTLRenderPipelineStateObject) RequiredThreadsPerObjectThreadgroup ¶
func (o MTLRenderPipelineStateObject) RequiredThreadsPerObjectThreadgroup() MTLSize
func (MTLRenderPipelineStateObject) RequiredThreadsPerTileThreadgroup ¶
func (o MTLRenderPipelineStateObject) RequiredThreadsPerTileThreadgroup() MTLSize
func (MTLRenderPipelineStateObject) ShaderValidation ¶
func (o MTLRenderPipelineStateObject) ShaderValidation() MTLShaderValidation
The current state of shader validation for the pipeline.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/shaderValidation
func (MTLRenderPipelineStateObject) SupportIndirectCommandBuffers ¶
func (o MTLRenderPipelineStateObject) SupportIndirectCommandBuffers() bool
A Boolean value that indicates whether the render pipeline supports encoding commands into an indirect command buffer.
See: https://developer.apple.com/documentation/Metal/MTLRenderPipelineState/supportIndirectCommandBuffers
func (MTLRenderPipelineStateObject) ThreadgroupSizeMatchesTileSize ¶
func (o MTLRenderPipelineStateObject) ThreadgroupSizeMatchesTileSize() bool
A Boolean value that indicates whether the pipeline state needs a threadgroup’s size to equal a tile’s size.
type MTLRenderStages ¶
type MTLRenderStages int
See: https://developer.apple.com/documentation/Metal/MTLRenderStages
const ( // MTLRenderStageFragment: The fragment rendering stage. MTLRenderStageFragment MTLRenderStages = 2 // MTLRenderStageMesh: The mesh rendering stage. MTLRenderStageMesh MTLRenderStages = 16 // MTLRenderStageObject: The object rendering stage. MTLRenderStageObject MTLRenderStages = 8 // MTLRenderStageTile: The tile rendering stage. MTLRenderStageTile MTLRenderStages = 4 // MTLRenderStageVertex: The vertex rendering stage. MTLRenderStageVertex MTLRenderStages = 1 )
func (MTLRenderStages) String ¶
func (e MTLRenderStages) String() string
type MTLResidencySet ¶
type MTLResidencySet interface {
objectivec.IObject
// Stages a single resource to join the residency set’s list of allocations.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/addAllocation(_:)
AddAllocation(allocation MTLAllocation)
// Stages all the resources in the residency set to leave its list of allocations.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/removeAllAllocations()
RemoveAllAllocations()
// Stages a single resource to leave the residency set’s list of allocations.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/removeAllocation(_:)
RemoveAllocation(allocation MTLAllocation)
// Applies any pending additions to and removals from the residency set.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/commit()
Commit()
// Tells Metal to do as much preparatory work as it can, with the system’s current conditions, to make the set’s resource allocations resident.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/requestResidency()
RequestResidency()
// Informs Metal that the residency set’s allocations no longer need to be resident, and that it can reuse the memory for other allocations.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/endResidency()
EndResidency()
// An optional name that can help you identify the residency set.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/label
Label() string
// The Metal device that owns the residency set.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/device
Device() MTLDevice
// Returns a Boolean value that indicates whether the residency set contains a specific resource allocation.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/containsAllocation(_:)
ContainsAllocation(anAllocation MTLAllocation) bool
// The residency set’s current list of resource allocations.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/allAllocations
AllAllocations() []objectivec.IObject
// The number of resource allocations in the residency set.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/allocationCount
AllocationCount() uint
// The amount of resident memory, in bytes, the residency set’s resource allocations consume.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/allocatedSize
AllocatedSize() uint64
// Stages multiple resources to join the residency set’s list of allocations.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/addAllocations:count:
AddAllocationsCount(allocations []MTLAllocation, count uint)
// Stages multiple resources to leave the residency set’s list of allocations.
//
// See: https://developer.apple.com/documentation/Metal/MTLResidencySet/removeAllocations:count:
RemoveAllocationsCount(allocations []MTLAllocation, count uint)
}
A collection of resource allocations that can move in and out of resident memory.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet
type MTLResidencySetDescriptor ¶
type MTLResidencySetDescriptor struct {
objectivec.Object
}
A configuration that customizes the behavior for a residency set.
Overview ¶
Make an MTLResidencySet by creating and configuring an MTLResidencySetDescriptor instance and pass it to the [NewResidencySetWithDescriptorError] method of an MTLDevice instance.
See Simplifying GPU resource management with residency sets for more information.
Configuring the residency set ¶
- MTLResidencySetDescriptor.Label: An optional name that can help you identify a residency set you create with the descriptor.
- MTLResidencySetDescriptor.SetLabel
- MTLResidencySetDescriptor.InitialCapacity: The number of allocations a new residency set can store without reallocating memory.
- MTLResidencySetDescriptor.SetInitialCapacity
See: https://developer.apple.com/documentation/Metal/MTLResidencySetDescriptor
func MTLResidencySetDescriptorFromID ¶
func MTLResidencySetDescriptorFromID(id objc.ID) MTLResidencySetDescriptor
MTLResidencySetDescriptorFromID constructs a MTLResidencySetDescriptor from an objc.ID.
A configuration that customizes the behavior for a residency set.
func NewMTLResidencySetDescriptor ¶
func NewMTLResidencySetDescriptor() MTLResidencySetDescriptor
NewMTLResidencySetDescriptor creates a new MTLResidencySetDescriptor instance.
func (MTLResidencySetDescriptor) Autorelease ¶
func (r MTLResidencySetDescriptor) Autorelease() MTLResidencySetDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLResidencySetDescriptor) Init ¶
func (r MTLResidencySetDescriptor) Init() MTLResidencySetDescriptor
Init initializes the instance.
func (MTLResidencySetDescriptor) InitialCapacity ¶
func (r MTLResidencySetDescriptor) InitialCapacity() uint
The number of allocations a new residency set can store without reallocating memory.
Discussion ¶
Reduce the memory reallocations the set needs to make by setting the property to a value large enough to hold the allocations you expect. You can leave the property at its default value of `0`, which tells Metal to give the residency set the standard starting capacity.
See: https://developer.apple.com/documentation/Metal/MTLResidencySetDescriptor/initialCapacity
func (MTLResidencySetDescriptor) Label ¶
func (r MTLResidencySetDescriptor) Label() string
An optional name that can help you identify a residency set you create with the descriptor.
Discussion ¶
Metal applies the value of this property to the [Label] property of an MTLResidencySet that you create by passing the descriptor to [NewResidencySetWithDescriptorError].
See: https://developer.apple.com/documentation/Metal/MTLResidencySetDescriptor/label
func (MTLResidencySetDescriptor) SetInitialCapacity ¶
func (r MTLResidencySetDescriptor) SetInitialCapacity(value uint)
func (MTLResidencySetDescriptor) SetLabel ¶
func (r MTLResidencySetDescriptor) SetLabel(value string)
type MTLResidencySetDescriptorClass ¶
type MTLResidencySetDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLResidencySetDescriptorClass ¶
func GetMTLResidencySetDescriptorClass() MTLResidencySetDescriptorClass
GetMTLResidencySetDescriptorClass returns the class object for MTLResidencySetDescriptor.
func (MTLResidencySetDescriptorClass) Alloc ¶
func (mc MTLResidencySetDescriptorClass) Alloc() MTLResidencySetDescriptor
Alloc allocates memory for a new instance of the class.
type MTLResidencySetObject ¶
type MTLResidencySetObject struct {
objectivec.Object
}
MTLResidencySetObject wraps an existing Objective-C object that conforms to the MTLResidencySet protocol.
func MTLResidencySetObjectFromID ¶
func MTLResidencySetObjectFromID(id objc.ID) MTLResidencySetObject
MTLResidencySetObjectFromID constructs a MTLResidencySetObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLResidencySetObject) AddAllocation ¶
func (o MTLResidencySetObject) AddAllocation(allocation MTLAllocation)
Stages a single resource to join the residency set’s list of allocations.
allocation: A resource allocation, such as an MTLBuffer, MTLTexture, or MTLHeap.
Discussion ¶
Finalize the inclusion of these resource allocations, and all other changes you stage, by calling a residency set’s [Commit] method.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/addAllocation(_:)
func (MTLResidencySetObject) AddAllocationsCount ¶
func (o MTLResidencySetObject) AddAllocationsCount(allocations []MTLAllocation, count uint)
Stages multiple resources to join the residency set’s list of allocations.
allocations: A C array of resource allocations, whose elements can be an arbitrarily mix of MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `allocations`.
Discussion ¶
Finalize the inclusion of these resource allocations, and all other changes you stage, by calling a residency set’s [Commit] method.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/addAllocations:count:
func (MTLResidencySetObject) AllAllocations ¶
func (o MTLResidencySetObject) AllAllocations() []objectivec.IObject
The residency set’s current list of resource allocations.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/allAllocations
func (MTLResidencySetObject) AllocatedSize ¶
func (o MTLResidencySetObject) AllocatedSize() uint64
The amount of resident memory, in bytes, the residency set’s resource allocations consume.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/allocatedSize
func (MTLResidencySetObject) AllocationCount ¶
func (o MTLResidencySetObject) AllocationCount() uint
The number of resource allocations in the residency set.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/allocationCount
func (MTLResidencySetObject) BaseObject ¶
func (o MTLResidencySetObject) BaseObject() objectivec.Object
func (MTLResidencySetObject) Commit ¶
func (o MTLResidencySetObject) Commit()
Applies any pending additions to and removals from the residency set.
Discussion ¶
Call the method when have no other changes to stage, such as with [AddAllocation], [RemoveAllocation], and their sibling methods.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/commit()
func (MTLResidencySetObject) ContainsAllocation ¶
func (o MTLResidencySetObject) ContainsAllocation(anAllocation MTLAllocation) bool
Returns a Boolean value that indicates whether the residency set contains a specific resource allocation.
anAllocation: A resource allocation, such as an MTLBuffer, MTLTexture, or MTLHeap.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/containsAllocation(_:)
func (MTLResidencySetObject) Device ¶
func (o MTLResidencySetObject) Device() MTLDevice
The Metal device that owns the residency set.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/device
func (MTLResidencySetObject) EndResidency ¶
func (o MTLResidencySetObject) EndResidency()
Informs Metal that the residency set’s allocations no longer need to be resident, and that it can reuse the memory for other allocations.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/endResidency()
func (MTLResidencySetObject) Label ¶
func (o MTLResidencySetObject) Label() string
An optional name that can help you identify the residency set.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/label
func (MTLResidencySetObject) RemoveAllAllocations ¶
func (o MTLResidencySetObject) RemoveAllAllocations()
Stages all the resources in the residency set to leave its list of allocations.
Discussion ¶
Finalize the removal of these resource allocations, and all others changes you stage, by calling a residency set’s [Commit] method.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/removeAllAllocations()
func (MTLResidencySetObject) RemoveAllocation ¶
func (o MTLResidencySetObject) RemoveAllocation(allocation MTLAllocation)
Stages a single resource to leave the residency set’s list of allocations.
allocation: A resource allocation, such as an MTLBuffer, MTLTexture, or MTLHeap.
Discussion ¶
Finalize the removal of these resource allocations, and all others changes you stage, by calling a residency set’s [Commit] method.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/removeAllocation(_:)
func (MTLResidencySetObject) RemoveAllocationsCount ¶
func (o MTLResidencySetObject) RemoveAllocationsCount(allocations []MTLAllocation, count uint)
Stages multiple resources to leave the residency set’s list of allocations.
allocations: A C array of resource allocations, whose elements can be an arbitrarily mix of MTLBuffer, MTLTexture, and MTLHeap instances.
count: The number of elements in `allocations`.
Discussion ¶
Finalize the removal of these resource allocations, and all other changes you stage, by calling a residency set’s [Commit] method.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/removeAllocations:count:
func (MTLResidencySetObject) RequestResidency ¶
func (o MTLResidencySetObject) RequestResidency()
Tells Metal to do as much preparatory work as it can, with the system’s current conditions, to make the set’s resource allocations resident.
Discussion ¶
Call the method anytime after calling a residency set’s [Commit] method, ideally well before calling the [Commit] method of any MTLCommandBuffer that uses it.
The method may postpone some of the necessary steps to make resources resident in scenarios where other apps concurrently need resources in residency.
See: https://developer.apple.com/documentation/Metal/MTLResidencySet/requestResidency()
type MTLResource ¶
type MTLResource interface {
objectivec.IObject
MTLAllocation
// The device object that created the resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/device
Device() MTLDevice
// A string that identifies the resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/label
Label() string
// The CPU cache mode that defines the CPU mapping of the resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
CpuCacheMode() MTLCPUCacheMode
// The location and access permissions of the resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
StorageMode() MTLStorageMode
// A mode that determines whether Metal tracks and synchronizes resource access.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
HazardTrackingMode() MTLHazardTrackingMode
// The storage mode, CPU cache mode, and hazard tracking mode of the resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
ResourceOptions() MTLResourceOptions
// Specifies or queries the resource’s purgeable state.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
// The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
HeapOffset() uint
// The heap on which the resource is allocated, if any.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/heap
Heap() MTLHeap
// Allows future heap resource allocations to alias against the resource’s memory, reusing it.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
MakeAliasable()
// A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
IsAliasable() bool
// The size of the resource, in bytes.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/allocatedSize
AllocatedSize() uint
// SetOwnerWithIdentity protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
// A string that identifies the resource.
//
// See: https://developer.apple.com/documentation/Metal/MTLResource/label
SetLabel(value string)
}
An allocation of memory accessible to a GPU.
See: https://developer.apple.com/documentation/Metal/MTLResource
type MTLResourceID ¶
type MTLResourceID struct {
}
MTLResourceID
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLResourceID
type MTLResourceObject ¶
type MTLResourceObject struct {
objectivec.Object
}
MTLResourceObject wraps an existing Objective-C object that conforms to the MTLResource protocol.
func MTLResourceObjectFromID ¶
func MTLResourceObjectFromID(id objc.ID) MTLResourceObject
MTLResourceObjectFromID constructs a MTLResourceObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLResourceObject) AllocatedSize ¶
func (o MTLResourceObject) AllocatedSize() uint
The size of the resource, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLResource/allocatedSize
func (MTLResourceObject) BaseObject ¶
func (o MTLResourceObject) BaseObject() objectivec.Object
func (MTLResourceObject) CpuCacheMode ¶
func (o MTLResourceObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLResourceObject) Device ¶
func (o MTLResourceObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLResourceObject) HazardTrackingMode ¶
func (o MTLResourceObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLResourceObject) Heap ¶
func (o MTLResourceObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLResourceObject) HeapOffset ¶
func (o MTLResourceObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLResourceObject) IsAliasable ¶
func (o MTLResourceObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLResourceObject) Label ¶
func (o MTLResourceObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLResourceObject) MakeAliasable ¶
func (o MTLResourceObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLResourceObject) ResourceOptions ¶
func (o MTLResourceObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLResourceObject) SetLabel ¶
func (o MTLResourceObject) SetLabel(value string)
func (MTLResourceObject) SetOwnerWithIdentity ¶
func (o MTLResourceObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLResourceObject) SetPurgeableState ¶
func (o MTLResourceObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLResourceObject) StorageMode ¶
func (o MTLResourceObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
type MTLResourceOptions ¶
type MTLResourceOptions int
See: https://developer.apple.com/documentation/Metal/MTLResourceOptions
const ( // MTLResourceCPUCacheModeDefaultCache: The default CPU cache mode for the resource, which guarantees that read and write operations are executed in the expected order. MTLResourceCPUCacheModeDefaultCache MTLResourceOptions = 0 // MTLResourceCPUCacheModeWriteCombined: A write-combined CPU cache mode that is optimized for resources that the CPU writes into, but never reads. MTLResourceCPUCacheModeWriteCombined MTLResourceOptions = 1 // MTLResourceHazardTrackingModeDefault: An option specifying that the default tracking mode should be used. MTLResourceHazardTrackingModeDefault MTLResourceOptions = 0 // MTLResourceHazardTrackingModeTracked: An option that instructs Metal to apply safeguards for a resource at runtime to avoid memory hazards for the applicable commands. MTLResourceHazardTrackingModeTracked MTLResourceOptions = 2 // MTLResourceHazardTrackingModeUntracked: A resource option that instructs Metal to ignore memory hazards for a resource at runtime. MTLResourceHazardTrackingModeUntracked MTLResourceOptions = 1 // MTLResourceStorageModeManaged: The CPU and GPU may maintain separate copies of the resource, and any changes need to be explicitly synchronized. MTLResourceStorageModeManaged MTLResourceOptions = 1 // MTLResourceStorageModeMemoryless: The resource’s contents are only available to the GPU, and only exist temporarily during a render pass. MTLResourceStorageModeMemoryless MTLResourceOptions = 3 // MTLResourceStorageModePrivate: The resource is only available to the GPU. MTLResourceStorageModePrivate MTLResourceOptions = 2 MTLResourceStorageModeShared MTLResourceOptions = 0 // Deprecated. MTLResourceOptionCPUCacheModeDefault MTLResourceOptions = 0 // Deprecated. MTLResourceOptionCPUCacheModeWriteCombined MTLResourceOptions = 1 )
func (MTLResourceOptions) String ¶
func (e MTLResourceOptions) String() string
type MTLResourceStateCommandEncoder ¶
type MTLResourceStateCommandEncoder interface {
objectivec.IObject
MTLCommandEncoder
// Encodes a command to update the texture mappings for a region in a single texture mipmap.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/updateTextureMapping(_:mode:region:mipLevel:slice:)
UpdateTextureMappingModeRegionMipLevelSlice(texture MTLTexture, mode MTLSparseTextureMappingMode, region MTLRegion, mipLevel uint, slice uint)
// Encodes a command to update memory mappings for multiple regions inside a texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/updateTextureMappings(_:mode:regions:mipLevels:slices:numRegions:)
UpdateTextureMappingsModeRegionsMipLevelsSlicesNumRegions(texture MTLTexture, mode MTLSparseTextureMappingMode, regions []MTLRegion, mipLevels uint, slices uint, numRegions uint)
// Encodes a command to update a texture’s memory mappings, specifying the parameters indirectly.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/updateTextureMapping(_:mode:indirectBuffer:indirectBufferOffset:)
UpdateTextureMappingModeIndirectBufferIndirectBufferOffset(texture MTLTexture, mode MTLSparseTextureMappingMode, indirectBuffer MTLBuffer, indirectBufferOffset uint)
// Encodes a command that instructs the GPU to update a fence, which signals passes waiting on the fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/update(_:)
UpdateFence(fence MTLFence)
// Encodes a command that instructs the GPU to pause before starting the resource state commands until another pass updates a fence.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/wait(for:)
WaitForFence(fence MTLFence)
// MoveTextureMappingsFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/moveTextureMappings(sourceTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:destinationTexture:destinationSlice:destinationLevel:destinationOrigin:)
MoveTextureMappingsFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
}
An encoder that encodes commands that modify resource configurations.
See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder
type MTLResourceStateCommandEncoderObject ¶
type MTLResourceStateCommandEncoderObject struct {
objectivec.Object
}
MTLResourceStateCommandEncoderObject wraps an existing Objective-C object that conforms to the MTLResourceStateCommandEncoder protocol.
func MTLResourceStateCommandEncoderObjectFromID ¶
func MTLResourceStateCommandEncoderObjectFromID(id objc.ID) MTLResourceStateCommandEncoderObject
MTLResourceStateCommandEncoderObjectFromID constructs a MTLResourceStateCommandEncoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLResourceStateCommandEncoderObject) BarrierAfterQueueStagesBeforeStages ¶
func (o MTLResourceStateCommandEncoderObject) BarrierAfterQueueStagesBeforeStages(afterQueueStages MTLStages, beforeStages MTLStages)
Encodes a consumer barrier on work you commit to the same command queue.
afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder. // MTLStages: https://developer.apple.com/documentation/Metal/MTLStages
Discussion ¶
Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the `beforeStages` stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the `afterQueueStages` stages, completes.
Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.
If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.
You can specify `afterQueueStages` and `beforeStages` that contain MTLStages unrelated to the current command encoder.
func (MTLResourceStateCommandEncoderObject) BaseObject ¶
func (o MTLResourceStateCommandEncoderObject) BaseObject() objectivec.Object
func (MTLResourceStateCommandEncoderObject) Device ¶
func (o MTLResourceStateCommandEncoderObject) Device() MTLDevice
The Metal device from which the command encoder was created.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/device
func (MTLResourceStateCommandEncoderObject) EndEncoding ¶
func (o MTLResourceStateCommandEncoderObject) EndEncoding()
Declares that all command generation from the encoder is completed.
Discussion ¶
After `endEncoding` is called, the command encoder has no further use. You cannot encode any other commands with this encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/endEncoding()
func (MTLResourceStateCommandEncoderObject) InsertDebugSignpost ¶
func (o MTLResourceStateCommandEncoderObject) InsertDebugSignpost(string_ string)
Inserts a debug string into the captured frame data.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/insertDebugSignpost(_:)
func (MTLResourceStateCommandEncoderObject) Label ¶
func (o MTLResourceStateCommandEncoderObject) Label() string
A string that labels the command encoder.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/label
func (MTLResourceStateCommandEncoderObject) MoveTextureMappingsFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin ¶
func (o MTLResourceStateCommandEncoderObject) MoveTextureMappingsFromTextureSourceSliceSourceLevelSourceOriginSourceSizeToTextureDestinationSliceDestinationLevelDestinationOrigin(sourceTexture MTLTexture, sourceSlice uint, sourceLevel uint, sourceOrigin MTLOrigin, sourceSize MTLSize, destinationTexture MTLTexture, destinationSlice uint, destinationLevel uint, destinationOrigin MTLOrigin)
func (MTLResourceStateCommandEncoderObject) PopDebugGroup ¶
func (o MTLResourceStateCommandEncoderObject) PopDebugGroup()
Pops the latest string off of a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/popDebugGroup()
func (MTLResourceStateCommandEncoderObject) PushDebugGroup ¶
func (o MTLResourceStateCommandEncoderObject) PushDebugGroup(string_ string)
Pushes a specific string onto a stack of debug group strings for the command encoder.
Discussion ¶
For more information, see Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLCommandEncoder/pushDebugGroup(_:)
func (MTLResourceStateCommandEncoderObject) SetLabel ¶
func (o MTLResourceStateCommandEncoderObject) SetLabel(value string)
func (MTLResourceStateCommandEncoderObject) UpdateFence ¶
func (o MTLResourceStateCommandEncoderObject) UpdateFence(fence MTLFence)
Encodes a command that instructs the GPU to update a fence, which signals passes waiting on the fence.
fence: An MTLFence instance to update.
Discussion ¶
Fences maintain order to prevent GPU data hazards as the GPU runs various passes within the same command queue. This encoded command notifies any passes waiting for `fence`.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/update(_:)
func (MTLResourceStateCommandEncoderObject) UpdateTextureMappingModeIndirectBufferIndirectBufferOffset ¶
func (o MTLResourceStateCommandEncoderObject) UpdateTextureMappingModeIndirectBufferIndirectBufferOffset(texture MTLTexture, mode MTLSparseTextureMappingMode, indirectBuffer MTLBuffer, indirectBufferOffset uint)
Encodes a command to update a texture’s memory mappings, specifying the parameters indirectly.
texture: The sparse texture to update.
mode: A mode that indicates whether the method allocates or frees a memory tile in the texture.
indirectBuffer: A buffer that contains an array of mapping arguments that are instances of the MTLMapIndirectArguments structure. // MTLMapIndirectArguments: https://developer.apple.com/documentation/Metal/MTLMapIndirectArguments
indirectBufferOffset: The offset, in bytes, where the first argument begins in the `indirectBuffer` parameter.
Discussion ¶
When the GPU executes the command that updates the texture’s memory mapping, the GPU gets details about the region to update from the `indirectBuffer` parameter.
To allocate tiles from the heap, pass [SparseTextureMappingModeMap] as the `mode` parameter, and to free files back to the heap, pass [SparseTextureMappingModeUnmap].
If you encode other commands that use the texture’s contents, such as rendering to the texture or sampling from a texture, synchronize the texture’s mapping updates with those commands to avoid race conditions. See Resource synchronization.
If you encode commands with multiple resource state passes, synchronize the resources to run the commands in the passes sequentially. See the MTLResourceStateCommandEncoder protocol.
func (MTLResourceStateCommandEncoderObject) UpdateTextureMappingModeRegionMipLevelSlice ¶
func (o MTLResourceStateCommandEncoderObject) UpdateTextureMappingModeRegionMipLevelSlice(texture MTLTexture, mode MTLSparseTextureMappingMode, region MTLRegion, mipLevel uint, slice uint)
Encodes a command to update the texture mappings for a region in a single texture mipmap.
texture: The sparse texture to update.
mode: A mode that indicates whether the method allocates or frees a memory tile in the texture.
region: A region, in tile coordinates, that describes the part of the mipmap to update.
mipLevel: The mipmap to update.
slice: The slice in the texture to update.
Discussion ¶
When the GPU executes the command that updates the texture’s memory mapping, the GPU gets details about the region from the `region` parameter.
To allocate tiles from the heap, pass [SparseTextureMappingModeMap] as the `mode` parameter, and to free files back to the heap, pass [SparseTextureMappingModeUnmap].
If you encode other commands that use the texture’s contents, such as rendering to the texture or sampling from a texture, synchronize the texture’s mapping updates with those commands to avoid race conditions. See Resource synchronization.
If you encode commands with multiple resource state passes, synchronize the resources to run the commands in the passes sequentially. See the MTLResourceStateCommandEncoder protocol.
func (MTLResourceStateCommandEncoderObject) UpdateTextureMappingsModeRegionsMipLevelsSlicesNumRegions ¶
func (o MTLResourceStateCommandEncoderObject) UpdateTextureMappingsModeRegionsMipLevelsSlicesNumRegions(texture MTLTexture, mode MTLSparseTextureMappingMode, regions []MTLRegion, mipLevels uint, slices uint, numRegions uint)
Encodes a command to update memory mappings for multiple regions inside a texture.
texture: The sparse texture to update.
mode: The change to make to the texture mapping.
regions: A pointer to an array of regions to change. You need to provide as many regions as you specify in the `numRegions` parameter.
mipLevels: A pointer to an array of mipmap levels to change. You need to provide as many entries as you specify in the `numRegions` parameter.
slices: A pointer to an array of slices to change. You need to provide as many entries as you specify in the `numRegions` parameter.
numRegions: The number of regions to update.
func (MTLResourceStateCommandEncoderObject) WaitForFence ¶
func (o MTLResourceStateCommandEncoderObject) WaitForFence(fence MTLFence)
Encodes a command that instructs the GPU to pause before starting the resource state commands until another pass updates a fence.
fence: An MTLFence instance to pause execution on until updated.
Discussion ¶
Fences maintain order to prevent GPU data hazards as the GPU runs various passes within the same command queue. The encoded resource state commands wait for a pass to update `fence` before running.
The GPU driver evaluates the fences that apply to the pass and the commands that depend on those fences when your app commits the enclosing MTLCommandBuffer.
See: https://developer.apple.com/documentation/Metal/MTLResourceStateCommandEncoder/wait(for:)
type MTLResourceStatePassDescriptor ¶
type MTLResourceStatePassDescriptor struct {
objectivec.Object
}
A configuration for a resource state pass, used to create a resource state command encoder.
Specifying sample buffers for GPU counters ¶
- MTLResourceStatePassDescriptor.SampleBufferAttachments: The array of sample buffers that the resource state pass can access.
See: https://developer.apple.com/documentation/Metal/MTLResourceStatePassDescriptor
func MTLResourceStatePassDescriptorFromID ¶
func MTLResourceStatePassDescriptorFromID(id objc.ID) MTLResourceStatePassDescriptor
MTLResourceStatePassDescriptorFromID constructs a MTLResourceStatePassDescriptor from an objc.ID.
A configuration for a resource state pass, used to create a resource state command encoder.
func NewMTLResourceStatePassDescriptor ¶
func NewMTLResourceStatePassDescriptor() MTLResourceStatePassDescriptor
NewMTLResourceStatePassDescriptor creates a new MTLResourceStatePassDescriptor instance.
func (MTLResourceStatePassDescriptor) Autorelease ¶
func (r MTLResourceStatePassDescriptor) Autorelease() MTLResourceStatePassDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLResourceStatePassDescriptor) Init ¶
func (r MTLResourceStatePassDescriptor) Init() MTLResourceStatePassDescriptor
Init initializes the instance.
func (MTLResourceStatePassDescriptor) SampleBufferAttachments ¶
func (r MTLResourceStatePassDescriptor) SampleBufferAttachments() IMTLResourceStatePassSampleBufferAttachmentDescriptorArray
The array of sample buffers that the resource state pass can access.
type MTLResourceStatePassDescriptorClass ¶
type MTLResourceStatePassDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLResourceStatePassDescriptorClass ¶
func GetMTLResourceStatePassDescriptorClass() MTLResourceStatePassDescriptorClass
GetMTLResourceStatePassDescriptorClass returns the class object for MTLResourceStatePassDescriptor.
func (MTLResourceStatePassDescriptorClass) Alloc ¶
func (mc MTLResourceStatePassDescriptorClass) Alloc() MTLResourceStatePassDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLResourceStatePassDescriptorClass) ResourceStatePassDescriptor ¶
func (_MTLResourceStatePassDescriptorClass MTLResourceStatePassDescriptorClass) ResourceStatePassDescriptor() MTLResourceStatePassDescriptor
Creates a new resource state pass descriptor.
Return Value ¶
A new resource state pass descriptor.
type MTLResourceStatePassSampleBufferAttachmentDescriptor ¶
type MTLResourceStatePassSampleBufferAttachmentDescriptor struct {
objectivec.Object
}
A description of where to store GPU counter information at the start and end of a resource state pass.
Configuring the sample buffer attachment ¶
- MTLResourceStatePassSampleBufferAttachmentDescriptor.SampleBuffer: A specialized memory buffer that the GPU uses to store its counter data during the resource state pass.
- MTLResourceStatePassSampleBufferAttachmentDescriptor.SetSampleBuffer
- MTLResourceStatePassSampleBufferAttachmentDescriptor.StartOfEncoderSampleIndex: The index the Metal device object should use to store GPU counters when starting the resource state pass.
- MTLResourceStatePassSampleBufferAttachmentDescriptor.SetStartOfEncoderSampleIndex
- MTLResourceStatePassSampleBufferAttachmentDescriptor.EndOfEncoderSampleIndex: The index the Metal device object should use to store GPU counters when ending the resource state pass.
- MTLResourceStatePassSampleBufferAttachmentDescriptor.SetEndOfEncoderSampleIndex
See: https://developer.apple.com/documentation/Metal/MTLResourceStatePassSampleBufferAttachmentDescriptor
func MTLResourceStatePassSampleBufferAttachmentDescriptorFromID ¶
func MTLResourceStatePassSampleBufferAttachmentDescriptorFromID(id objc.ID) MTLResourceStatePassSampleBufferAttachmentDescriptor
MTLResourceStatePassSampleBufferAttachmentDescriptorFromID constructs a MTLResourceStatePassSampleBufferAttachmentDescriptor from an objc.ID.
A description of where to store GPU counter information at the start and end of a resource state pass.
func NewMTLResourceStatePassSampleBufferAttachmentDescriptor ¶
func NewMTLResourceStatePassSampleBufferAttachmentDescriptor() MTLResourceStatePassSampleBufferAttachmentDescriptor
NewMTLResourceStatePassSampleBufferAttachmentDescriptor creates a new MTLResourceStatePassSampleBufferAttachmentDescriptor instance.
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) Autorelease ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) Autorelease() MTLResourceStatePassSampleBufferAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) EndOfEncoderSampleIndex() uint
The index the Metal device object should use to store GPU counters when ending the resource state pass.
Discussion ¶
Specify MTLCounterDontSample if you don’t want to sample GPU counters at the end of the resource state pass. Otherwise, specify an index within the sample buffer where you want the GPU to write the sample data.
On devices that don’t support [CounterSamplingPointAtStageBoundary] you need to set the value to MTLCounterDontSample.
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) Init ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) Init() MTLResourceStatePassSampleBufferAttachmentDescriptor
Init initializes the instance.
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) SampleBuffer ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SampleBuffer() MTLCounterSampleBuffer
A specialized memory buffer that the GPU uses to store its counter data during the resource state pass.
Discussion ¶
The property defaults to `nil`, which means the GPU doesn’t save any GPU counter information during the resource state pass. For more information, see Creating a counter sample buffer to store a GPU’s counter data during a pass and Sampling GPU data into counter sample buffers.
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SetEndOfEncoderSampleIndex(value uint)
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) SetSampleBuffer ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SetSampleBuffer(value MTLCounterSampleBuffer)
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) SetStartOfEncoderSampleIndex(value uint)
func (MTLResourceStatePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptor) StartOfEncoderSampleIndex() uint
The index the Metal device object should use to store GPU counters when starting the resource state pass.
Discussion ¶
Specify MTLCounterDontSample if you don’t want to sample GPU counters at the start of the resource state pass. Otherwise, specify an index within the sample buffer where you want the GPU to write the sample data.
On devices that don’t support [CounterSamplingPointAtStageBoundary] you need to set the value to MTLCounterDontSample.
type MTLResourceStatePassSampleBufferAttachmentDescriptorArray ¶
type MTLResourceStatePassSampleBufferAttachmentDescriptorArray struct {
objectivec.Object
}
An array of sample buffer attachments for a resource state pass.
Accessing a sample buffer attachment ¶
- MTLResourceStatePassSampleBufferAttachmentDescriptorArray.ObjectAtIndexedSubscript: Returns the descriptor object for the specified sample buffer attachment.
func MTLResourceStatePassSampleBufferAttachmentDescriptorArrayFromID ¶
func MTLResourceStatePassSampleBufferAttachmentDescriptorArrayFromID(id objc.ID) MTLResourceStatePassSampleBufferAttachmentDescriptorArray
MTLResourceStatePassSampleBufferAttachmentDescriptorArrayFromID constructs a MTLResourceStatePassSampleBufferAttachmentDescriptorArray from an objc.ID.
An array of sample buffer attachments for a resource state pass.
func NewMTLResourceStatePassSampleBufferAttachmentDescriptorArray ¶
func NewMTLResourceStatePassSampleBufferAttachmentDescriptorArray() MTLResourceStatePassSampleBufferAttachmentDescriptorArray
NewMTLResourceStatePassSampleBufferAttachmentDescriptorArray creates a new MTLResourceStatePassSampleBufferAttachmentDescriptorArray instance.
func (MTLResourceStatePassSampleBufferAttachmentDescriptorArray) Autorelease ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) Autorelease() MTLResourceStatePassSampleBufferAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLResourceStatePassSampleBufferAttachmentDescriptorArray) Init ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) Init() MTLResourceStatePassSampleBufferAttachmentDescriptorArray
Init initializes the instance.
func (MTLResourceStatePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLResourceStatePassSampleBufferAttachmentDescriptor
Returns the descriptor object for the specified sample buffer attachment.
attachmentIndex: An index for the object to fetch.
Return Value ¶
The requested MTLResourceStatePassSampleBufferAttachmentDescriptor object.
func (MTLResourceStatePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (r MTLResourceStatePassSampleBufferAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLResourceStatePassSampleBufferAttachmentDescriptor, attachmentIndex uint)
Sets the descriptor object for the specified sample buffer attachment.
attachment: A sample buffer attachment descriptor. If you specify `nil`, the attachment descriptor resets its configuration to default values.
attachmentIndex: The item in the array to replace.
Discussion ¶
The method copies the `attachment` parameter’s contents into the attachment at the specified index..
type MTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass ¶
type MTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass ¶
func GetMTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass() MTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass
GetMTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass returns the class object for MTLResourceStatePassSampleBufferAttachmentDescriptorArray.
func (MTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLResourceStatePassSampleBufferAttachmentDescriptorArrayClass) Alloc() MTLResourceStatePassSampleBufferAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLResourceStatePassSampleBufferAttachmentDescriptorClass ¶
type MTLResourceStatePassSampleBufferAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLResourceStatePassSampleBufferAttachmentDescriptorClass ¶
func GetMTLResourceStatePassSampleBufferAttachmentDescriptorClass() MTLResourceStatePassSampleBufferAttachmentDescriptorClass
GetMTLResourceStatePassSampleBufferAttachmentDescriptorClass returns the class object for MTLResourceStatePassSampleBufferAttachmentDescriptor.
func (MTLResourceStatePassSampleBufferAttachmentDescriptorClass) Alloc ¶
func (mc MTLResourceStatePassSampleBufferAttachmentDescriptorClass) Alloc() MTLResourceStatePassSampleBufferAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLResourceUsage ¶
type MTLResourceUsage int
See: https://developer.apple.com/documentation/Metal/MTLResourceUsage
const ( // MTLResourceUsageRead: An option that enables reading from the resource. MTLResourceUsageRead MTLResourceUsage = 1 // MTLResourceUsageWrite: An option that enables writing to the resource. MTLResourceUsageWrite MTLResourceUsage = 2 // Deprecated. MTLResourceUsageSample MTLResourceUsage = 4 )
func (MTLResourceUsage) String ¶
func (e MTLResourceUsage) String() string
type MTLResourceViewPool ¶
type MTLResourceViewPool interface {
objectivec.IObject
// Obtains the resource ID corresponding to the resource view at index 0 in this resource view pool.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/baseResourceID
BaseResourceID() MTLResourceID
// Obtains a reference to the GPU device this pool belongs to.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/device
Device() MTLDevice
// Queries the optional debug label of this resource view pool.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/label
Label() string
// Queries the number of resource views that this pool contains.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/resourceViewCount
ResourceViewCount() uint
// Copies a range of resource views from a source view pool to a destination location in this view pool.
//
// See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/copyResourceViewsFromPool:sourceRange:destinationIndex:
CopyResourceViewsFromPoolSourceRangeDestinationIndex(sourcePool MTLResourceViewPool, sourceRange foundation.NSRange, destinationIndex uint) MTLResourceID
}
Contains views over resources of a specific type, and allows you to manage those views.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool
type MTLResourceViewPoolDescriptor ¶
type MTLResourceViewPoolDescriptor struct {
objectivec.Object
}
Provides parameters for creating a resource view pool.
Instance Properties ¶
- MTLResourceViewPoolDescriptor.Label: Assigns an optional label you to the resource view pool for debugging purposes.
- MTLResourceViewPoolDescriptor.SetLabel
- MTLResourceViewPoolDescriptor.ResourceViewCount: Configures the number of resource views with which Metal creates the resource view pool.
- MTLResourceViewPoolDescriptor.SetResourceViewCount
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPoolDescriptor
func MTLResourceViewPoolDescriptorFromID ¶
func MTLResourceViewPoolDescriptorFromID(id objc.ID) MTLResourceViewPoolDescriptor
MTLResourceViewPoolDescriptorFromID constructs a MTLResourceViewPoolDescriptor from an objc.ID.
Provides parameters for creating a resource view pool.
func NewMTLResourceViewPoolDescriptor ¶
func NewMTLResourceViewPoolDescriptor() MTLResourceViewPoolDescriptor
NewMTLResourceViewPoolDescriptor creates a new MTLResourceViewPoolDescriptor instance.
func (MTLResourceViewPoolDescriptor) Autorelease ¶
func (r MTLResourceViewPoolDescriptor) Autorelease() MTLResourceViewPoolDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLResourceViewPoolDescriptor) Init ¶
func (r MTLResourceViewPoolDescriptor) Init() MTLResourceViewPoolDescriptor
Init initializes the instance.
func (MTLResourceViewPoolDescriptor) Label ¶
func (r MTLResourceViewPoolDescriptor) Label() string
Assigns an optional label you to the resource view pool for debugging purposes.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPoolDescriptor/label
func (MTLResourceViewPoolDescriptor) ResourceViewCount ¶
func (r MTLResourceViewPoolDescriptor) ResourceViewCount() uint
Configures the number of resource views with which Metal creates the resource view pool.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPoolDescriptor/resourceViewCount
func (MTLResourceViewPoolDescriptor) SetLabel ¶
func (r MTLResourceViewPoolDescriptor) SetLabel(value string)
func (MTLResourceViewPoolDescriptor) SetResourceViewCount ¶
func (r MTLResourceViewPoolDescriptor) SetResourceViewCount(value uint)
type MTLResourceViewPoolDescriptorClass ¶
type MTLResourceViewPoolDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLResourceViewPoolDescriptorClass ¶
func GetMTLResourceViewPoolDescriptorClass() MTLResourceViewPoolDescriptorClass
GetMTLResourceViewPoolDescriptorClass returns the class object for MTLResourceViewPoolDescriptor.
func (MTLResourceViewPoolDescriptorClass) Alloc ¶
func (mc MTLResourceViewPoolDescriptorClass) Alloc() MTLResourceViewPoolDescriptor
Alloc allocates memory for a new instance of the class.
type MTLResourceViewPoolObject ¶
type MTLResourceViewPoolObject struct {
objectivec.Object
}
MTLResourceViewPoolObject wraps an existing Objective-C object that conforms to the MTLResourceViewPool protocol.
func MTLResourceViewPoolObjectFromID ¶
func MTLResourceViewPoolObjectFromID(id objc.ID) MTLResourceViewPoolObject
MTLResourceViewPoolObjectFromID constructs a MTLResourceViewPoolObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLResourceViewPoolObject) BaseObject ¶
func (o MTLResourceViewPoolObject) BaseObject() objectivec.Object
func (MTLResourceViewPoolObject) BaseResourceID ¶
func (o MTLResourceViewPoolObject) BaseResourceID() MTLResourceID
Obtains the resource ID corresponding to the resource view at index 0 in this resource view pool.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/baseResourceID
func (MTLResourceViewPoolObject) CopyResourceViewsFromPoolSourceRangeDestinationIndex ¶
func (o MTLResourceViewPoolObject) CopyResourceViewsFromPoolSourceRangeDestinationIndex(sourcePool MTLResourceViewPool, sourceRange foundation.NSRange, destinationIndex uint) MTLResourceID
Copies a range of resource views from a source view pool to a destination location in this view pool.
sourcePool: Resource view pool from which to copy resource views.
sourceRange: The range in the source resource view pool to copy.
destinationIndex: The starting index in this destination view pool into which to copy the source range of resource views.
Return Value ¶
The MTLResourceID of the resource view corresponding to `destinationIndex` of the copy in this resource view pool.
func (MTLResourceViewPoolObject) Device ¶
func (o MTLResourceViewPoolObject) Device() MTLDevice
Obtains a reference to the GPU device this pool belongs to.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/device
func (MTLResourceViewPoolObject) Label ¶
func (o MTLResourceViewPoolObject) Label() string
Queries the optional debug label of this resource view pool.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/label
func (MTLResourceViewPoolObject) ResourceViewCount ¶
func (o MTLResourceViewPoolObject) ResourceViewCount() uint
Queries the number of resource views that this pool contains.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/resourceViewCount
type MTLSamplePosition ¶
type MTLSamplePosition struct {
X float32 // The x position of the sample on the subpixel grid.
Y float32 // The y position of the sample on the subpixel grid.
}
MTLSamplePosition - A subpixel sample position for use in multisample antialiasing (MSAA).
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLSamplePosition
type MTLSamplerAddressMode ¶
type MTLSamplerAddressMode int
See: https://developer.apple.com/documentation/Metal/MTLSamplerAddressMode
const ( // MTLSamplerAddressModeClampToBorderColor: Out-of-range texture coordinates return the value specified by the borderColor property. MTLSamplerAddressModeClampToBorderColor MTLSamplerAddressMode = 5 // MTLSamplerAddressModeClampToEdge: Texture coordinates are clamped between `0.0` and `1.0`, inclusive. MTLSamplerAddressModeClampToEdge MTLSamplerAddressMode = 0 // MTLSamplerAddressModeClampToZero: Out-of-range texture coordinates return transparent zero `(0,0,0,0)` for images with an alpha channel and return opaque zero `(0,0,0,1)` for images without an alpha channel. MTLSamplerAddressModeClampToZero MTLSamplerAddressMode = 4 // MTLSamplerAddressModeMirrorClampToEdge: Between `-1.0` and `1.0`, the texture coordinates are mirrored across the axis; outside `-1.0` and `1.0`, texture coordinates are clamped. MTLSamplerAddressModeMirrorClampToEdge MTLSamplerAddressMode = 1 // MTLSamplerAddressModeMirrorRepeat: Between `-1.0` and `1.0`, the texture coordinates are mirrored across the axis; outside `-1.0` and `1.0`, the image is repeated. MTLSamplerAddressModeMirrorRepeat MTLSamplerAddressMode = 3 // MTLSamplerAddressModeRepeat: Texture coordinates wrap to the other side of the texture, effectively keeping only the fractional part of the texture coordinate. MTLSamplerAddressModeRepeat MTLSamplerAddressMode = 2 )
func (MTLSamplerAddressMode) String ¶
func (e MTLSamplerAddressMode) String() string
type MTLSamplerBorderColor ¶
type MTLSamplerBorderColor int
See: https://developer.apple.com/documentation/Metal/MTLSamplerBorderColor
const ( // MTLSamplerBorderColorOpaqueBlack: An opaque black color `(0,0,0,1)` for texture values outside the border MTLSamplerBorderColorOpaqueBlack MTLSamplerBorderColor = 1 // MTLSamplerBorderColorOpaqueWhite: An opaque white color `(1,1,1,1)` for texture values outside the border. MTLSamplerBorderColorOpaqueWhite MTLSamplerBorderColor = 2 // MTLSamplerBorderColorTransparentBlack: A transparent black color `(0,0,0,0)` for texture values outside the border. MTLSamplerBorderColorTransparentBlack MTLSamplerBorderColor = 0 )
func (MTLSamplerBorderColor) String ¶
func (e MTLSamplerBorderColor) String() string
type MTLSamplerDescriptor ¶
type MTLSamplerDescriptor struct {
objectivec.Object
}
An object that you use to configure a texture sampler.
Overview ¶
To make a sampler, create and configure an MTLSamplerDescriptor instance and then call an MTLDevice instance’s [NewSamplerStateWithDescriptor] method. After you create the sampler, you can release the descriptor or reconfigure its properties to create other samplers.
Declaring the coordinate space ¶
- MTLSamplerDescriptor.NormalizedCoordinates: A Boolean value that indicates whether texture coordinates are normalized to the range `[0.0, 1.0]`.
- MTLSamplerDescriptor.SetNormalizedCoordinates
Declaring addressing modes ¶
- MTLSamplerDescriptor.RAddressMode: The address mode for the texture depth (r) coordinate.
- MTLSamplerDescriptor.SetRAddressMode
- MTLSamplerDescriptor.SAddressMode: The address mode for the texture width (s) coordinate.
- MTLSamplerDescriptor.SetSAddressMode
- MTLSamplerDescriptor.TAddressMode: The address mode for the texture height (t) coordinate.
- MTLSamplerDescriptor.SetTAddressMode
- MTLSamplerDescriptor.BorderColor: The border color for clamped texture values.
- MTLSamplerDescriptor.SetBorderColor
Declaring filter modes ¶
- MTLSamplerDescriptor.MinFilter: The filtering option for combining pixels within one mipmap level when the sample footprint is larger than a pixel (minification).
- MTLSamplerDescriptor.SetMinFilter
- MTLSamplerDescriptor.MagFilter: The filtering operation for combining pixels within one mipmap level when the sample footprint is smaller than a pixel (magnification).
- MTLSamplerDescriptor.SetMagFilter
- MTLSamplerDescriptor.MipFilter: The filtering option for combining pixels between two mipmap levels.
- MTLSamplerDescriptor.SetMipFilter
- MTLSamplerDescriptor.LodMinClamp: The minimum level of detail (LOD) to use when sampling from a texture.
- MTLSamplerDescriptor.SetLodMinClamp
- MTLSamplerDescriptor.LodMaxClamp: The maximum level of detail (LOD) to use when sampling from a texture.
- MTLSamplerDescriptor.SetLodMaxClamp
- MTLSamplerDescriptor.LodAverage: A Boolean value that specifies whether the GPU can use an average level of detail (LOD) when sampling from a texture.
- MTLSamplerDescriptor.SetLodAverage
- MTLSamplerDescriptor.MaxAnisotropy: The number of samples that can be taken to improve the quality of sample footprints that are anisotropic.
- MTLSamplerDescriptor.SetMaxAnisotropy
Declaring the depth comparison mode ¶
- MTLSamplerDescriptor.CompareFunction: The sampler comparison function used when performing a sample compare operation on a depth texture.
- MTLSamplerDescriptor.SetCompareFunction
Declaring whether the sampler can be used in argument buffers ¶
- MTLSamplerDescriptor.SupportArgumentBuffers: A Boolean value that indicates whether you can reference a sampler, that you make with this descriptor, by its resource ID from an argument buffer.
- MTLSamplerDescriptor.SetSupportArgumentBuffers
Identifying the sampler ¶
- MTLSamplerDescriptor.Label: A string that identifies the sampler.
- MTLSamplerDescriptor.SetLabel
Instance Properties ¶
- MTLSamplerDescriptor.LodBias: Sets the level-of-detail (lod) bias when sampling from a texture.
- MTLSamplerDescriptor.SetLodBias
- MTLSamplerDescriptor.ReductionMode: Sets the reduction mode for filtering contributing samples.
- MTLSamplerDescriptor.SetReductionMode
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor
func MTLSamplerDescriptorFromID ¶
func MTLSamplerDescriptorFromID(id objc.ID) MTLSamplerDescriptor
MTLSamplerDescriptorFromID constructs a MTLSamplerDescriptor from an objc.ID.
An object that you use to configure a texture sampler.
func NewMTLSamplerDescriptor ¶
func NewMTLSamplerDescriptor() MTLSamplerDescriptor
NewMTLSamplerDescriptor creates a new MTLSamplerDescriptor instance.
func (MTLSamplerDescriptor) Autorelease ¶
func (s MTLSamplerDescriptor) Autorelease() MTLSamplerDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLSamplerDescriptor) BorderColor ¶
func (s MTLSamplerDescriptor) BorderColor() MTLSamplerBorderColor
The border color for clamped texture values.
Discussion ¶
This value is only used when the sampler address mode is [SamplerAddressModeClampToBorderColor].
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/borderColor
func (MTLSamplerDescriptor) CompareFunction ¶
func (s MTLSamplerDescriptor) CompareFunction() MTLCompareFunction
The sampler comparison function used when performing a sample compare operation on a depth texture.
Discussion ¶
The default value is [CompareFunctionNever].
The [FeatureSet_iOS_GPUFamily3_v1] and [FeatureSet_iOS_GPUFamily1_v1] feature sets allow you to define a framework-side sampler comparison function for an MTLSamplerState instance. All feature sets support shader-side sampler comparison functions, as described in the Metal Shading Language Specification.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/compareFunction
func (MTLSamplerDescriptor) Init ¶
func (s MTLSamplerDescriptor) Init() MTLSamplerDescriptor
Init initializes the instance.
func (MTLSamplerDescriptor) Label ¶
func (s MTLSamplerDescriptor) Label() string
A string that identifies the sampler.
Discussion ¶
Object and command labels are useful identifiers at runtime or when profiling and debugging your app using any Metal tool. See Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/label
func (MTLSamplerDescriptor) LodAverage ¶
func (s MTLSamplerDescriptor) LodAverage() bool
A Boolean value that specifies whether the GPU can use an average level of detail (LOD) when sampling from a texture.
Discussion ¶
If this value is true, an average LOD may be used across four fragment shader threads. If this value is false, no averaging is performed and each thread accesses its own LOD.
The default value is false.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/lodAverage
func (MTLSamplerDescriptor) LodBias ¶
func (s MTLSamplerDescriptor) LodBias() float32
Sets the level-of-detail (lod) bias when sampling from a texture.
Discussion ¶
The property’s default value is `0.0f`. The precision format is `S4.6`, and the range is `[-16.0, 15.999]`.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/lodBias
func (MTLSamplerDescriptor) LodMaxClamp ¶
func (s MTLSamplerDescriptor) LodMaxClamp() float32
The maximum level of detail (LOD) to use when sampling from a texture.
Discussion ¶
The default value is `FLT_MAX`. Clamp values are always applied, even when using an explicit LOD.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/lodMaxClamp
func (MTLSamplerDescriptor) LodMinClamp ¶
func (s MTLSamplerDescriptor) LodMinClamp() float32
The minimum level of detail (LOD) to use when sampling from a texture.
Discussion ¶
The default value is `0.0`. Clamp values are always applied, even when using an explicit LOD.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/lodMinClamp
func (MTLSamplerDescriptor) MagFilter ¶
func (s MTLSamplerDescriptor) MagFilter() MTLSamplerMinMagFilter
The filtering operation for combining pixels within one mipmap level when the sample footprint is smaller than a pixel (magnification).
Discussion ¶
The default value is [SamplerMinMagFilterNearest].
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/magFilter
func (MTLSamplerDescriptor) MaxAnisotropy ¶
func (s MTLSamplerDescriptor) MaxAnisotropy() uint
The number of samples that can be taken to improve the quality of sample footprints that are anisotropic.
Discussion ¶
Values need to be between `1` and `16`, inclusive. The default value is `1`.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/maxAnisotropy
func (MTLSamplerDescriptor) MinFilter ¶
func (s MTLSamplerDescriptor) MinFilter() MTLSamplerMinMagFilter
The filtering option for combining pixels within one mipmap level when the sample footprint is larger than a pixel (minification).
Discussion ¶
The default value is [SamplerMinMagFilterNearest].
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/minFilter
func (MTLSamplerDescriptor) MipFilter ¶
func (s MTLSamplerDescriptor) MipFilter() MTLSamplerMipFilter
The filtering option for combining pixels between two mipmap levels.
Discussion ¶
The default value is [SamplerMipFilterNotMipmapped].
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/mipFilter
func (MTLSamplerDescriptor) NormalizedCoordinates ¶
func (s MTLSamplerDescriptor) NormalizedCoordinates() bool
A Boolean value that indicates whether texture coordinates are normalized to the range `[0.0, 1.0]`.
Discussion ¶
If true, texture coordinates are from `0.0` to `1.0`. If false, texture coordinates are from `0` to `width` for horizontal coordinates and `0` to `height` for vertical coordinates. The default value is true.
Non-normalized texture coordinates should only be used with 1D and 2D textures with the following conditions; otherwise, the results of sampling are undefined.
- The [SamplerAddressModeClampToEdge] or [SamplerAddressModeClampToZero] address mode. - The [SamplerMipFilterNotMipmapped] mipmap filtering option. - [MinFilter] and [MagFilter] need to be equal to each other. - [MaxAnisotropy] needs to be `1`.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/normalizedCoordinates
func (MTLSamplerDescriptor) RAddressMode ¶
func (s MTLSamplerDescriptor) RAddressMode() MTLSamplerAddressMode
The address mode for the texture depth (r) coordinate.
Discussion ¶
The default value is [SamplerAddressModeClampToEdge].
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/rAddressMode
func (MTLSamplerDescriptor) ReductionMode ¶
func (s MTLSamplerDescriptor) ReductionMode() MTLSamplerReductionMode
Sets the reduction mode for filtering contributing samples.
Discussion ¶
The property’s default value is MTLSamplerReductionModeWeightedAverage. The sampler ignores this property if any of the following property values are equal to a specific value:
- The sampler’s [MipFilter] property is equal to MTLSamplerMipFilterNotMipmapped. - The sampler’s [MipFilter] property is equal to MTLSamplerMipFilterNearest. - The sampler’s [MinFilter] property is equal to MTLSamplerMinMagFilterNearest. - The sampler’s [MagFilter] property is equal to MTLSamplerMinMagFilterNearest.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/reductionMode
func (MTLSamplerDescriptor) SAddressMode ¶
func (s MTLSamplerDescriptor) SAddressMode() MTLSamplerAddressMode
The address mode for the texture width (s) coordinate.
Discussion ¶
The default value is [SamplerAddressModeClampToEdge].
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/sAddressMode
func (MTLSamplerDescriptor) SetBorderColor ¶
func (s MTLSamplerDescriptor) SetBorderColor(value MTLSamplerBorderColor)
func (MTLSamplerDescriptor) SetCompareFunction ¶
func (s MTLSamplerDescriptor) SetCompareFunction(value MTLCompareFunction)
func (MTLSamplerDescriptor) SetLabel ¶
func (s MTLSamplerDescriptor) SetLabel(value string)
func (MTLSamplerDescriptor) SetLodAverage ¶
func (s MTLSamplerDescriptor) SetLodAverage(value bool)
func (MTLSamplerDescriptor) SetLodBias ¶
func (s MTLSamplerDescriptor) SetLodBias(value float32)
func (MTLSamplerDescriptor) SetLodMaxClamp ¶
func (s MTLSamplerDescriptor) SetLodMaxClamp(value float32)
func (MTLSamplerDescriptor) SetLodMinClamp ¶
func (s MTLSamplerDescriptor) SetLodMinClamp(value float32)
func (MTLSamplerDescriptor) SetMagFilter ¶
func (s MTLSamplerDescriptor) SetMagFilter(value MTLSamplerMinMagFilter)
func (MTLSamplerDescriptor) SetMaxAnisotropy ¶
func (s MTLSamplerDescriptor) SetMaxAnisotropy(value uint)
func (MTLSamplerDescriptor) SetMinFilter ¶
func (s MTLSamplerDescriptor) SetMinFilter(value MTLSamplerMinMagFilter)
func (MTLSamplerDescriptor) SetMipFilter ¶
func (s MTLSamplerDescriptor) SetMipFilter(value MTLSamplerMipFilter)
func (MTLSamplerDescriptor) SetNormalizedCoordinates ¶
func (s MTLSamplerDescriptor) SetNormalizedCoordinates(value bool)
func (MTLSamplerDescriptor) SetRAddressMode ¶
func (s MTLSamplerDescriptor) SetRAddressMode(value MTLSamplerAddressMode)
func (MTLSamplerDescriptor) SetReductionMode ¶
func (s MTLSamplerDescriptor) SetReductionMode(value MTLSamplerReductionMode)
func (MTLSamplerDescriptor) SetSAddressMode ¶
func (s MTLSamplerDescriptor) SetSAddressMode(value MTLSamplerAddressMode)
func (MTLSamplerDescriptor) SetSupportArgumentBuffers ¶
func (s MTLSamplerDescriptor) SetSupportArgumentBuffers(value bool)
func (MTLSamplerDescriptor) SetTAddressMode ¶
func (s MTLSamplerDescriptor) SetTAddressMode(value MTLSamplerAddressMode)
func (MTLSamplerDescriptor) SupportArgumentBuffers ¶
func (s MTLSamplerDescriptor) SupportArgumentBuffers() bool
A Boolean value that indicates whether you can reference a sampler, that you make with this descriptor, by its resource ID from an argument buffer.
Discussion ¶
The default value is false, which means that you can only encode the samplers you make with this descriptor as individual resources in the sampler state argument table.
Your app can encode samplers into an argument buffer if you create them with an MTLSamplerDescriptor instance that has this property equal to true.
Each unique configuration of an MTLSamplerDescriptor instance’s properties creates a unique MTLSamplerState instance. For example, you can create unique samplers with the same MTLSamplerDescriptor instance by changing one or more values of its properties, such as [MinFilter] or [MagFilter] before creating another instance.
Conversely, creating secondary sampler instances with the same descriptor property values doesn’t create any additional, unique samplers. Instead, they refer to the same underlying sampler, even if you create it with a difference descriptor instance because the configuration is the same.
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/supportArgumentBuffers
func (MTLSamplerDescriptor) TAddressMode ¶
func (s MTLSamplerDescriptor) TAddressMode() MTLSamplerAddressMode
The address mode for the texture height (t) coordinate.
Discussion ¶
The default value is [SamplerAddressModeClampToEdge].
See: https://developer.apple.com/documentation/Metal/MTLSamplerDescriptor/tAddressMode
type MTLSamplerDescriptorClass ¶
type MTLSamplerDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLSamplerDescriptorClass ¶
func GetMTLSamplerDescriptorClass() MTLSamplerDescriptorClass
GetMTLSamplerDescriptorClass returns the class object for MTLSamplerDescriptor.
func (MTLSamplerDescriptorClass) Alloc ¶
func (mc MTLSamplerDescriptorClass) Alloc() MTLSamplerDescriptor
Alloc allocates memory for a new instance of the class.
type MTLSamplerMinMagFilter ¶
type MTLSamplerMinMagFilter int
See: https://developer.apple.com/documentation/Metal/MTLSamplerMinMagFilter
const ( // MTLSamplerMinMagFilterLinear: Select two pixels in each dimension and interpolate linearly between them. MTLSamplerMinMagFilterLinear MTLSamplerMinMagFilter = 1 // MTLSamplerMinMagFilterNearest: Select the single pixel nearest to the sample point. MTLSamplerMinMagFilterNearest MTLSamplerMinMagFilter = 0 )
func (MTLSamplerMinMagFilter) String ¶
func (e MTLSamplerMinMagFilter) String() string
type MTLSamplerMipFilter ¶
type MTLSamplerMipFilter int
See: https://developer.apple.com/documentation/Metal/MTLSamplerMipFilter
const ( // MTLSamplerMipFilterLinear: If the filter falls between mipmap levels, both levels are sampled and the results are determined by linear interpolation between levels. MTLSamplerMipFilterLinear MTLSamplerMipFilter = 2 // MTLSamplerMipFilterNearest: The nearest mipmap level is selected. MTLSamplerMipFilterNearest MTLSamplerMipFilter = 1 // MTLSamplerMipFilterNotMipmapped: The texture is sampled from mipmap level `0`, and other mipmap levels are ignored. MTLSamplerMipFilterNotMipmapped MTLSamplerMipFilter = 0 )
func (MTLSamplerMipFilter) String ¶
func (e MTLSamplerMipFilter) String() string
type MTLSamplerReductionMode ¶
type MTLSamplerReductionMode int
See: https://developer.apple.com/documentation/Metal/MTLSamplerReductionMode
const ( // MTLSamplerReductionModeMaximum: A reduction mode that finds the maximum contributing sample value by separately evaluating each channel. MTLSamplerReductionModeMaximum MTLSamplerReductionMode = 2 // MTLSamplerReductionModeMinimum: A reduction mode that finds the minimum contributing sample value by separately evaluating each channel. MTLSamplerReductionModeMinimum MTLSamplerReductionMode = 1 // MTLSamplerReductionModeWeightedAverage: A reduction mode that adds together the product of each contributing sample value by its weight. MTLSamplerReductionModeWeightedAverage MTLSamplerReductionMode = 0 )
func (MTLSamplerReductionMode) String ¶
func (e MTLSamplerReductionMode) String() string
type MTLSamplerState ¶
type MTLSamplerState interface {
objectivec.IObject
// The device object that created the sampler.
//
// See: https://developer.apple.com/documentation/Metal/MTLSamplerState/device
Device() MTLDevice
// A string that identifies the sampler.
//
// See: https://developer.apple.com/documentation/Metal/MTLSamplerState/label
Label() string
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLSamplerState/gpuResourceID
GpuResourceID() MTLResourceID
}
An instance that defines how a texture should be sampled.
See: https://developer.apple.com/documentation/Metal/MTLSamplerState
type MTLSamplerStateObject ¶
type MTLSamplerStateObject struct {
objectivec.Object
}
MTLSamplerStateObject wraps an existing Objective-C object that conforms to the MTLSamplerState protocol.
func MTLSamplerStateObjectFromID ¶
func MTLSamplerStateObjectFromID(id objc.ID) MTLSamplerStateObject
MTLSamplerStateObjectFromID constructs a MTLSamplerStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLSamplerStateObject) BaseObject ¶
func (o MTLSamplerStateObject) BaseObject() objectivec.Object
func (MTLSamplerStateObject) Device ¶
func (o MTLSamplerStateObject) Device() MTLDevice
The device object that created the sampler.
See: https://developer.apple.com/documentation/Metal/MTLSamplerState/device
func (MTLSamplerStateObject) GpuResourceID ¶
func (o MTLSamplerStateObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLSamplerState/gpuResourceID
func (MTLSamplerStateObject) Label ¶
func (o MTLSamplerStateObject) Label() string
A string that identifies the sampler.
See: https://developer.apple.com/documentation/Metal/MTLSamplerState/label
type MTLScissorRect ¶
type MTLScissorRect struct {
Height uint // The height of the scissor rectangle, in pixels.
Width uint // The width of the scissor rectangle, in pixels.
X uint // The x window coordinate of the upper-left corner of the scissor rectangle.
Y uint // The y window coordinate of the upper-left corner of the scissor rectangle.
}
MTLScissorRect - A rectangle for the scissor fragment test.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLScissorRect
type MTLShaderValidation ¶
type MTLShaderValidation int
See: https://developer.apple.com/documentation/Metal/MTLShaderValidation
const ( // MTLShaderValidationDefault: The default value when the property isn’t set. MTLShaderValidationDefault MTLShaderValidation = 0 // MTLShaderValidationDisabled: Disables shader validation. MTLShaderValidationDisabled MTLShaderValidation = 2 // MTLShaderValidationEnabled: Enables shader validation. MTLShaderValidationEnabled MTLShaderValidation = 1 )
func (MTLShaderValidation) String ¶
func (e MTLShaderValidation) String() string
type MTLSharedEvent ¶
type MTLSharedEvent interface {
objectivec.IObject
MTLEvent
//
// See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/signaledValue
SignaledValue() uint64
//
// See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/notify(_:atValue:block:)
NotifyListenerAtValueBlock(listener IMTLSharedEventListener, value uint64, block MTLSharedEventNotificationBlock)
//
// See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/makeSharedEventHandle()
NewSharedEventHandle() IMTLSharedEventHandle
//
// See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/wait(untilSignaledValue:timeoutMS:)
WaitUntilSignaledValueTimeoutMS(value uint64, milliseconds uint64) bool
//
// See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/signaledValue
SetSignaledValue(value uint64)
}
A type that synchronizes memory operations to one or more resources across multiple CPUs, GPUs, and processes.
See: https://developer.apple.com/documentation/Metal/MTLSharedEvent
type MTLSharedEventHandle ¶
type MTLSharedEventHandle struct {
}
An instance you use to recreate a shareable event.
Overview ¶
To create a MTLSharedEventHandle instance, call the [NewSharedEventHandle] method on an MTLSharedEvent instance. Use an XPC conection to pass a MTLSharedEventHandle instance to another process. To recreate the event, call the [NewSharedEventWithHandle] on an MTLDevice instance.
Identifying the shareable event handle ¶
- MTLSharedEventHandle.Label: A string that identifies the shareable event.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventHandle
func MTLSharedEventHandleFromID ¶
func MTLSharedEventHandleFromID(id objc.ID) MTLSharedEventHandle
MTLSharedEventHandleFromID constructs a MTLSharedEventHandle from an objc.ID.
An instance you use to recreate a shareable event.
func NewMTLSharedEventHandle ¶
func NewMTLSharedEventHandle() MTLSharedEventHandle
NewMTLSharedEventHandle creates a new MTLSharedEventHandle instance.
func (MTLSharedEventHandle) Autorelease ¶
func (s MTLSharedEventHandle) Autorelease() MTLSharedEventHandle
Autorelease adds the receiver to the current autorelease pool.
func (MTLSharedEventHandle) EncodeWithCoder ¶
func (s MTLSharedEventHandle) EncodeWithCoder(coder foundation.INSCoder)
func (MTLSharedEventHandle) Init ¶
func (s MTLSharedEventHandle) Init() MTLSharedEventHandle
Init initializes the instance.
func (MTLSharedEventHandle) Label ¶
func (s MTLSharedEventHandle) Label() string
A string that identifies the shareable event.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventHandle/label
type MTLSharedEventHandleClass ¶
type MTLSharedEventHandleClass struct {
// contains filtered or unexported fields
}
func GetMTLSharedEventHandleClass ¶
func GetMTLSharedEventHandleClass() MTLSharedEventHandleClass
GetMTLSharedEventHandleClass returns the class object for MTLSharedEventHandle.
func (MTLSharedEventHandleClass) Alloc ¶
func (mc MTLSharedEventHandleClass) Alloc() MTLSharedEventHandle
Alloc allocates memory for a new instance of the class.
type MTLSharedEventListener ¶
type MTLSharedEventListener struct {
}
A listener for shareable event notifications.
Initializing a shareable event listener ¶
- MTLSharedEventListener.InitWithDispatchQueue: Creates a new shareable event listener with a specific dispatch queue.
Getting the dispatch queue ¶
- MTLSharedEventListener.DispatchQueue: The dispatch queue used to dispatch any notifications.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventListener
func MTLSharedEventListenerFromID ¶
func MTLSharedEventListenerFromID(id objc.ID) MTLSharedEventListener
MTLSharedEventListenerFromID constructs a MTLSharedEventListener from an objc.ID.
A listener for shareable event notifications.
func NewMTLSharedEventListener ¶
func NewMTLSharedEventListener() MTLSharedEventListener
NewMTLSharedEventListener creates a new MTLSharedEventListener instance.
func NewSharedEventListenerWithDispatchQueue ¶
func NewSharedEventListenerWithDispatchQueue(dispatchQueue dispatch.Queue) MTLSharedEventListener
Creates a new shareable event listener with a specific dispatch queue.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventListener/init(dispatchQueue:)
func (MTLSharedEventListener) Autorelease ¶
func (s MTLSharedEventListener) Autorelease() MTLSharedEventListener
Autorelease adds the receiver to the current autorelease pool.
func (MTLSharedEventListener) DispatchQueue ¶
func (s MTLSharedEventListener) DispatchQueue() dispatch.Queue
The dispatch queue used to dispatch any notifications.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventListener/dispatchQueue
func (MTLSharedEventListener) Init ¶
func (s MTLSharedEventListener) Init() MTLSharedEventListener
Init initializes the instance.
func (MTLSharedEventListener) InitWithDispatchQueue ¶
func (s MTLSharedEventListener) InitWithDispatchQueue(dispatchQueue dispatch.Queue) MTLSharedEventListener
Creates a new shareable event listener with a specific dispatch queue.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventListener/init(dispatchQueue:)
type MTLSharedEventListenerClass ¶
type MTLSharedEventListenerClass struct {
// contains filtered or unexported fields
}
func GetMTLSharedEventListenerClass ¶
func GetMTLSharedEventListenerClass() MTLSharedEventListenerClass
GetMTLSharedEventListenerClass returns the class object for MTLSharedEventListener.
func (MTLSharedEventListenerClass) Alloc ¶
func (mc MTLSharedEventListenerClass) Alloc() MTLSharedEventListener
Alloc allocates memory for a new instance of the class.
func (MTLSharedEventListenerClass) SharedListener ¶
func (_MTLSharedEventListenerClass MTLSharedEventListenerClass) SharedListener() MTLSharedEventListener
See: https://developer.apple.com/documentation/Metal/MTLSharedEventListener/shared()
type MTLSharedEventNotificationBlock ¶
type MTLSharedEventNotificationBlock = func(MTLSharedEvent, uint64)
MTLSharedEventNotificationBlock is a block of code invoked after a shareable event’s signal value equals or exceeds a given value.
See: https://developer.apple.com/documentation/Metal/MTLSharedEventNotificationBlock
type MTLSharedEventObject ¶
type MTLSharedEventObject struct {
}
MTLSharedEventObject wraps an existing Objective-C object that conforms to the MTLSharedEvent protocol.
func MTLSharedEventObjectFromID ¶
func MTLSharedEventObjectFromID(id objc.ID) MTLSharedEventObject
MTLSharedEventObjectFromID constructs a MTLSharedEventObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLSharedEventObject) BaseObject ¶
func (o MTLSharedEventObject) BaseObject() objectivec.Object
func (MTLSharedEventObject) Device ¶
func (o MTLSharedEventObject) Device() MTLDevice
The device object that created the event.
See: https://developer.apple.com/documentation/Metal/MTLEvent/device
func (MTLSharedEventObject) Label ¶
func (o MTLSharedEventObject) Label() string
A string that identifies the event.
See: https://developer.apple.com/documentation/Metal/MTLEvent/label
func (MTLSharedEventObject) NewSharedEventHandle ¶
func (o MTLSharedEventObject) NewSharedEventHandle() IMTLSharedEventHandle
Creates a new shareable event handle.
See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/makeSharedEventHandle()
func (MTLSharedEventObject) NotifyListenerAtValueBlock ¶
func (o MTLSharedEventObject) NotifyListenerAtValueBlock(listener IMTLSharedEventListener, value uint64, block MTLSharedEventNotificationBlock)
Schedules a notification handler to be called after the shareable event’s signal value equals or exceeds a given value.
listener: The listener object used to dispatch the notification.
value: The minimum value that needs to be signaled before the notification handler is called.
block: The notification handler to call.
See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/notify(_:atValue:block:)
func (MTLSharedEventObject) NotifyListenerAtValueRetained ¶
func (o MTLSharedEventObject) NotifyListenerAtValueRetained(listener IMTLSharedEventListener, value uint64, block MTLSharedEventNotificationBlock) *SharedEventNotificationBinding
NotifyListenerAtValueRetained registers a notification block and returns a binding that must be released when notifications are no longer needed.
func (MTLSharedEventObject) SetLabel ¶
func (o MTLSharedEventObject) SetLabel(value string)
func (MTLSharedEventObject) SetSignaledValue ¶
func (o MTLSharedEventObject) SetSignaledValue(value uint64)
func (MTLSharedEventObject) SignaledValue ¶
func (o MTLSharedEventObject) SignaledValue() uint64
The current signal value for the shareable event.
See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/signaledValue
func (MTLSharedEventObject) WaitUntilSignaledValueTimeoutMS ¶
func (o MTLSharedEventObject) WaitUntilSignaledValueTimeoutMS(value uint64, milliseconds uint64) bool
See: https://developer.apple.com/documentation/Metal/MTLSharedEvent/wait(untilSignaledValue:timeoutMS:)
type MTLSharedTextureHandle ¶
type MTLSharedTextureHandle struct {
}
A texture handle that can be shared across process address space boundaries.
Overview ¶
MTLSharedTextureHandle objects may be passed between processes using XPC connections and then used to create a reference to the texture in another process. The texture in the other process needs to be created using the same MTLDevice on which the shared texture was originally created. To identify which device it was created on, you can use the MTLSharedTextureHandle.Device property of the MTLSharedTextureHandle object.
Identifying the shared texture handle ¶
- MTLSharedTextureHandle.Device: The device object that created the texture.
- MTLSharedTextureHandle.Label: A string that identifies the texture.
See: https://developer.apple.com/documentation/Metal/MTLSharedTextureHandle
func MTLSharedTextureHandleFromID ¶
func MTLSharedTextureHandleFromID(id objc.ID) MTLSharedTextureHandle
MTLSharedTextureHandleFromID constructs a MTLSharedTextureHandle from an objc.ID.
A texture handle that can be shared across process address space boundaries.
func NewMTLSharedTextureHandle ¶
func NewMTLSharedTextureHandle() MTLSharedTextureHandle
NewMTLSharedTextureHandle creates a new MTLSharedTextureHandle instance.
func (MTLSharedTextureHandle) Autorelease ¶
func (s MTLSharedTextureHandle) Autorelease() MTLSharedTextureHandle
Autorelease adds the receiver to the current autorelease pool.
func (MTLSharedTextureHandle) Device ¶
func (s MTLSharedTextureHandle) Device() MTLDevice
The device object that created the texture.
Discussion ¶
A texture is always associated with the MTLDevice that created it and can be used only with that device.
See: https://developer.apple.com/documentation/Metal/MTLSharedTextureHandle/device
func (MTLSharedTextureHandle) EncodeWithCoder ¶
func (s MTLSharedTextureHandle) EncodeWithCoder(coder foundation.INSCoder)
func (MTLSharedTextureHandle) Init ¶
func (s MTLSharedTextureHandle) Init() MTLSharedTextureHandle
Init initializes the instance.
func (MTLSharedTextureHandle) Label ¶
func (s MTLSharedTextureHandle) Label() string
A string that identifies the texture.
Discussion ¶
Object and command labels are useful identifiers at runtime or when profiling and debugging your app using any Metal tool. See Naming resources and commands.
See: https://developer.apple.com/documentation/Metal/MTLSharedTextureHandle/label
type MTLSharedTextureHandleClass ¶
type MTLSharedTextureHandleClass struct {
// contains filtered or unexported fields
}
func GetMTLSharedTextureHandleClass ¶
func GetMTLSharedTextureHandleClass() MTLSharedTextureHandleClass
GetMTLSharedTextureHandleClass returns the class object for MTLSharedTextureHandle.
func (MTLSharedTextureHandleClass) Alloc ¶
func (mc MTLSharedTextureHandleClass) Alloc() MTLSharedTextureHandle
Alloc allocates memory for a new instance of the class.
type MTLSize ¶
type MTLSize struct {
Width uint // A value for the x-axis dimension.
Height uint // A value for the y-axis dimension.
Depth uint // A value for the z-axis dimension.
}
MTLSize - A type that represents one, two, or three dimensions of a type instance, such as an array or texture.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLSize
type MTLSizeAndAlign ¶
type MTLSizeAndAlign struct {
Size uint // The size of a resource, in bytes.
Align uint // The alignment of a resource, in bytes.
}
MTLSizeAndAlign - The size and alignment of a resource, in bytes.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLSizeAndAlign
type MTLSparsePageSize ¶
type MTLSparsePageSize int
See: https://developer.apple.com/documentation/Metal/MTLSparsePageSize
const ( // MTLSparsePageSize16: Represents a sparse texture’s page size of 16 kilobytes. MTLSparsePageSize16 MTLSparsePageSize = 101 // MTLSparsePageSize256: Represents a sparse texture’s page size of 256 kilobytes. MTLSparsePageSize256 MTLSparsePageSize = 103 // MTLSparsePageSize64: Represents a sparse texture’s page size of 64 kilobytes. MTLSparsePageSize64 MTLSparsePageSize = 102 )
func (MTLSparsePageSize) String ¶
func (e MTLSparsePageSize) String() string
type MTLSparseTextureMappingMode ¶
type MTLSparseTextureMappingMode int
See: https://developer.apple.com/documentation/Metal/MTLSparseTextureMappingMode
const ( // MTLSparseTextureMappingModeMap: A request to map sparse tiles from the heap to a region in the texture. MTLSparseTextureMappingModeMap MTLSparseTextureMappingMode = 0 // MTLSparseTextureMappingModeUnmap: A request to remove any mappings for a region in the texture. MTLSparseTextureMappingModeUnmap MTLSparseTextureMappingMode = 1 )
func (MTLSparseTextureMappingMode) String ¶
func (e MTLSparseTextureMappingMode) String() string
type MTLSparseTextureRegionAlignmentMode ¶
type MTLSparseTextureRegionAlignmentMode int
See: https://developer.apple.com/documentation/Metal/MTLSparseTextureRegionAlignmentMode
const ( // MTLSparseTextureRegionAlignmentModeInward: The tile region ignores partially covered tiles. MTLSparseTextureRegionAlignmentModeInward MTLSparseTextureRegionAlignmentMode = 1 // MTLSparseTextureRegionAlignmentModeOutward: The tile region includes any partially covered tiles. MTLSparseTextureRegionAlignmentModeOutward MTLSparseTextureRegionAlignmentMode = 0 )
func (MTLSparseTextureRegionAlignmentMode) String ¶
func (e MTLSparseTextureRegionAlignmentMode) String() string
type MTLStageInRegionIndirectArguments ¶
type MTLStageInRegionIndirectArguments struct {
StageInOrigin uint32 // The location of the upper-left corner of the block.
StageInSize uint32 // The size of the block.
}
MTLStageInRegionIndirectArguments - The data layout required for the arguments needed to specify the stage-in region.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLStageInRegionIndirectArguments
type MTLStageInputOutputDescriptor ¶
type MTLStageInputOutputDescriptor struct {
objectivec.Object
}
A description of the input and output data of a function.
Describing argument layouts ¶
- MTLStageInputOutputDescriptor.Attributes: An array that describes where and how to fetch data for the function.
- MTLStageInputOutputDescriptor.Layouts: An array that describes how the function fetches data.
Declaring index buffers for indirect compute commands ¶
- MTLStageInputOutputDescriptor.IndexBufferIndex: The location of the index buffer for a compute function using indexed thread addressing.
- MTLStageInputOutputDescriptor.SetIndexBufferIndex
- MTLStageInputOutputDescriptor.IndexType: The data type of the indices stored in the index buffer.
- MTLStageInputOutputDescriptor.SetIndexType
Resetting the descriptor ¶
- MTLStageInputOutputDescriptor.Reset: Resets the default state for the descriptor.
See: https://developer.apple.com/documentation/Metal/MTLStageInputOutputDescriptor
func MTLStageInputOutputDescriptorFromID ¶
func MTLStageInputOutputDescriptorFromID(id objc.ID) MTLStageInputOutputDescriptor
MTLStageInputOutputDescriptorFromID constructs a MTLStageInputOutputDescriptor from an objc.ID.
A description of the input and output data of a function.
func NewMTLStageInputOutputDescriptor ¶
func NewMTLStageInputOutputDescriptor() MTLStageInputOutputDescriptor
NewMTLStageInputOutputDescriptor creates a new MTLStageInputOutputDescriptor instance.
func (MTLStageInputOutputDescriptor) Attributes ¶
func (s MTLStageInputOutputDescriptor) Attributes() IMTLAttributeDescriptorArray
An array that describes where and how to fetch data for the function.
See: https://developer.apple.com/documentation/Metal/MTLStageInputOutputDescriptor/attributes
func (MTLStageInputOutputDescriptor) Autorelease ¶
func (s MTLStageInputOutputDescriptor) Autorelease() MTLStageInputOutputDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLStageInputOutputDescriptor) IndexBufferIndex ¶
func (s MTLStageInputOutputDescriptor) IndexBufferIndex() uint
The location of the index buffer for a compute function using indexed thread addressing.
See: https://developer.apple.com/documentation/Metal/MTLStageInputOutputDescriptor/indexBufferIndex
func (MTLStageInputOutputDescriptor) IndexType ¶
func (s MTLStageInputOutputDescriptor) IndexType() MTLIndexType
The data type of the indices stored in the index buffer.
See: https://developer.apple.com/documentation/Metal/MTLStageInputOutputDescriptor/indexType
func (MTLStageInputOutputDescriptor) Init ¶
func (s MTLStageInputOutputDescriptor) Init() MTLStageInputOutputDescriptor
Init initializes the instance.
func (MTLStageInputOutputDescriptor) Layouts ¶
func (s MTLStageInputOutputDescriptor) Layouts() IMTLBufferLayoutDescriptorArray
An array that describes how the function fetches data.
See: https://developer.apple.com/documentation/Metal/MTLStageInputOutputDescriptor/layouts
func (MTLStageInputOutputDescriptor) Reset ¶
func (s MTLStageInputOutputDescriptor) Reset()
Resets the default state for the descriptor.
See: https://developer.apple.com/documentation/Metal/MTLStageInputOutputDescriptor/reset()
func (MTLStageInputOutputDescriptor) SetIndexBufferIndex ¶
func (s MTLStageInputOutputDescriptor) SetIndexBufferIndex(value uint)
func (MTLStageInputOutputDescriptor) SetIndexType ¶
func (s MTLStageInputOutputDescriptor) SetIndexType(value MTLIndexType)
type MTLStageInputOutputDescriptorClass ¶
type MTLStageInputOutputDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLStageInputOutputDescriptorClass ¶
func GetMTLStageInputOutputDescriptorClass() MTLStageInputOutputDescriptorClass
GetMTLStageInputOutputDescriptorClass returns the class object for MTLStageInputOutputDescriptor.
func (MTLStageInputOutputDescriptorClass) Alloc ¶
func (mc MTLStageInputOutputDescriptorClass) Alloc() MTLStageInputOutputDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLStageInputOutputDescriptorClass) StageInputOutputDescriptor ¶
func (_MTLStageInputOutputDescriptorClass MTLStageInputOutputDescriptorClass) StageInputOutputDescriptor() MTLStageInputOutputDescriptor
type MTLStages ¶
type MTLStages int
See: https://developer.apple.com/documentation/Metal/MTLStages
const ( // MTLStageAccelerationStructure: Represents all acceleration structure operations. MTLStageAccelerationStructure MTLStages = 536870912 // MTLStageAll: Convenience mask representing all stages of GPU work. MTLStageAll MTLStages = 9223372036854775807 // MTLStageBlit: Represents all blit operations in a pass. MTLStageBlit MTLStages = 268435456 // MTLStageDispatch: Represents all compute dispatches in a compute pass. MTLStageDispatch MTLStages = 134217728 // MTLStageFragment: Represents all fragment shader stage work in a render pass. MTLStageFragment MTLStages = 2 // MTLStageMachineLearning: Represents all machine learning network dispatch operations. MTLStageMachineLearning MTLStages = 1073741824 // MTLStageMesh: Represents all mesh shader stage work work in a render pass. MTLStageMesh MTLStages = 16 // MTLStageObject: Represents all object shader stage work in a render pass. MTLStageObject MTLStages = 8 // MTLStageResourceState: Represents all sparse and placement sparse resource mapping updates. MTLStageResourceState MTLStages = 67108864 // MTLStageTile: Represents all tile shading stage work in a render pass. MTLStageTile MTLStages = 4 // MTLStageVertex: Represents all vertex shader stage work in a render pass. MTLStageVertex MTLStages = 1 )
type MTLStencilDescriptor ¶
type MTLStencilDescriptor struct {
objectivec.Object
}
An object that defines the front-facing or back-facing stencil operations of a depth and stencil state object.
Overview ¶
A stencil test is a comparison between a masked reference value and a masked value stored in a stencil attachment. (A value is by performing a logical AND operation on it with the MTLStencilDescriptor.ReadMask value.) The MTLStencilDescriptor object defines how to update the contents of the stencil attachment, based on the results of the stencil test and the depth test.
The MTLStencilDescriptor.StencilCompareFunction property defines the stencil test. The MTLStencilDescriptor.StencilFailureOperation, MTLStencilDescriptor.DepthFailureOperation, and MTLStencilDescriptor.DepthStencilPassOperation properties specify what to do to a stencil value stored in the stencil attachment for three different test outcomes: if the stencil test fails, if the stencil test passes and the depth test fails, or if both stencil and depth tests succeed, respectively. MTLStencilDescriptor.WriteMask determines which stencil bits can be modified as the result of a stencil operation.
Configuring stencil functions and operations ¶
- MTLStencilDescriptor.StencilFailureOperation: The operation that is performed to update the values in the stencil attachment when the stencil test fails.
- MTLStencilDescriptor.SetStencilFailureOperation
- MTLStencilDescriptor.DepthFailureOperation: The operation that is performed to update the values in the stencil attachment when the stencil test passes, but the depth test fails.
- MTLStencilDescriptor.SetDepthFailureOperation
- MTLStencilDescriptor.DepthStencilPassOperation: The operation that is performed to update the values in the stencil attachment when both the stencil test and the depth test pass.
- MTLStencilDescriptor.SetDepthStencilPassOperation
- MTLStencilDescriptor.StencilCompareFunction: The comparison that is performed between the masked reference value and a masked value in the stencil attachment.
- MTLStencilDescriptor.SetStencilCompareFunction
Configuring stencil bit mask properties ¶
- MTLStencilDescriptor.ReadMask: A bitmask that determines from which bits that stencil comparison tests can read.
- MTLStencilDescriptor.SetReadMask
- MTLStencilDescriptor.WriteMask: A bitmask that determines to which bits that stencil operations can write.
- MTLStencilDescriptor.SetWriteMask
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor
func MTLStencilDescriptorFromID ¶
func MTLStencilDescriptorFromID(id objc.ID) MTLStencilDescriptor
MTLStencilDescriptorFromID constructs a MTLStencilDescriptor from an objc.ID.
An object that defines the front-facing or back-facing stencil operations of a depth and stencil state object.
func NewMTLStencilDescriptor ¶
func NewMTLStencilDescriptor() MTLStencilDescriptor
NewMTLStencilDescriptor creates a new MTLStencilDescriptor instance.
func (MTLStencilDescriptor) Autorelease ¶
func (s MTLStencilDescriptor) Autorelease() MTLStencilDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLStencilDescriptor) DepthFailureOperation ¶
func (s MTLStencilDescriptor) DepthFailureOperation() MTLStencilOperation
The operation that is performed to update the values in the stencil attachment when the stencil test passes, but the depth test fails.
Discussion ¶
The default value is [StencilOperationKeep], which does not change the current stencil value. For more information on possible values, see MTLStencilOperation.
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor/depthFailureOperation
func (MTLStencilDescriptor) DepthStencilPassOperation ¶
func (s MTLStencilDescriptor) DepthStencilPassOperation() MTLStencilOperation
The operation that is performed to update the values in the stencil attachment when both the stencil test and the depth test pass.
Discussion ¶
The default value is [StencilOperationKeep], which does not change the current stencil value. For more information on possible values, see MTLStencilOperation.
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor/depthStencilPassOperation
func (MTLStencilDescriptor) Init ¶
func (s MTLStencilDescriptor) Init() MTLStencilDescriptor
Init initializes the instance.
func (MTLStencilDescriptor) ReadMask ¶
func (s MTLStencilDescriptor) ReadMask() uint32
A bitmask that determines from which bits that stencil comparison tests can read.
Discussion ¶
The [ReadMask] bits are used for logical AND operations to both the stored stencil value and the reference value.
The least significant bits of the read mask are used. The default value is all ones. A logical AND operation with the default [ReadMask] does not change the value.
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor/readMask
func (MTLStencilDescriptor) SetDepthFailureOperation ¶
func (s MTLStencilDescriptor) SetDepthFailureOperation(value MTLStencilOperation)
func (MTLStencilDescriptor) SetDepthStencilPassOperation ¶
func (s MTLStencilDescriptor) SetDepthStencilPassOperation(value MTLStencilOperation)
func (MTLStencilDescriptor) SetReadMask ¶
func (s MTLStencilDescriptor) SetReadMask(value uint32)
func (MTLStencilDescriptor) SetStencilCompareFunction ¶
func (s MTLStencilDescriptor) SetStencilCompareFunction(value MTLCompareFunction)
func (MTLStencilDescriptor) SetStencilFailureOperation ¶
func (s MTLStencilDescriptor) SetStencilFailureOperation(value MTLStencilOperation)
func (MTLStencilDescriptor) SetWriteMask ¶
func (s MTLStencilDescriptor) SetWriteMask(value uint32)
func (MTLStencilDescriptor) StencilCompareFunction ¶
func (s MTLStencilDescriptor) StencilCompareFunction() MTLCompareFunction
The comparison that is performed between the masked reference value and a masked value in the stencil attachment.
Discussion ¶
For example, if `stencilCompareFunction` is [CompareFunctionLess], then the stencil test passes if the masked reference value is less than the masked stored stencil value. The default value is [CompareFunctionAlways], which indicates that the stencil test always passes.
The stored stencil value and the reference value are both by performing a logical AND operation with the [ReadMask] value before the comparison takes place. For more information on possible values, see MTLCompareFunction.
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor/stencilCompareFunction
func (MTLStencilDescriptor) StencilFailureOperation ¶
func (s MTLStencilDescriptor) StencilFailureOperation() MTLStencilOperation
The operation that is performed to update the values in the stencil attachment when the stencil test fails.
Discussion ¶
The default value is [StencilOperationKeep], which does not change the current stencil value. For more information on possible values, see MTLStencilOperation.
When the stencil test fails for a pixel, its incoming color, depth, or stencil values are discarded.
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor/stencilFailureOperation
func (MTLStencilDescriptor) WriteMask ¶
func (s MTLStencilDescriptor) WriteMask() uint32
A bitmask that determines to which bits that stencil operations can write.
Discussion ¶
[WriteMask] are used for logical AND operations to values that are going to be written into a stencil attachment as the result of a stencil operation.
The least significant bits of the write mask are used. The default value is all ones. A logical AND operation with the default [WriteMask] does not change the value.
See: https://developer.apple.com/documentation/Metal/MTLStencilDescriptor/writeMask
type MTLStencilDescriptorClass ¶
type MTLStencilDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLStencilDescriptorClass ¶
func GetMTLStencilDescriptorClass() MTLStencilDescriptorClass
GetMTLStencilDescriptorClass returns the class object for MTLStencilDescriptor.
func (MTLStencilDescriptorClass) Alloc ¶
func (mc MTLStencilDescriptorClass) Alloc() MTLStencilDescriptor
Alloc allocates memory for a new instance of the class.
type MTLStencilOperation ¶
type MTLStencilOperation int
See: https://developer.apple.com/documentation/Metal/MTLStencilOperation
const ( // MTLStencilOperationDecrementClamp: A stencil operation that decreases a nonzero stencil value by one. MTLStencilOperationDecrementClamp MTLStencilOperation = 4 // MTLStencilOperationDecrementWrap: A stencil operation that decreases a nonzero stencil value by one, or when it’s zero, resets it to the maximum representable value. MTLStencilOperationDecrementWrap MTLStencilOperation = 7 // MTLStencilOperationIncrementClamp: A stencil operation that increases a stencil value by one, but only when the current value isn’t the maximum representable value. MTLStencilOperationIncrementClamp MTLStencilOperation = 3 // MTLStencilOperationIncrementWrap: A stencil operation that decreases a nonzero stencil value by one, or when it’s the maximum representable value, resets it to zero. MTLStencilOperationIncrementWrap MTLStencilOperation = 6 // MTLStencilOperationInvert: A stencil operation that applies a logical bitwise NOT to a stencil value. MTLStencilOperationInvert MTLStencilOperation = 5 // MTLStencilOperationKeep: A stencil operation that doesn’t modify a stencil value. MTLStencilOperationKeep MTLStencilOperation = 0 // MTLStencilOperationReplace: A stencil operation that replaces a stencil value with a reference value. MTLStencilOperationReplace MTLStencilOperation = 2 // MTLStencilOperationZero: A stencil operation that sets a stencil value to zero. MTLStencilOperationZero MTLStencilOperation = 1 )
func (MTLStencilOperation) String ¶
func (e MTLStencilOperation) String() string
type MTLStepFunction ¶
type MTLStepFunction int
See: https://developer.apple.com/documentation/Metal/MTLStepFunction
const ( // MTLStepFunctionConstant: The function fetches attribute data once. MTLStepFunctionConstant MTLStepFunction = 0 // MTLStepFunctionPerInstance: The function fetches data based on the instance index. MTLStepFunctionPerInstance MTLStepFunction = 2 // MTLStepFunctionPerPatch: The post-tessellation function fetches data based on the patch index of the patch. MTLStepFunctionPerPatch MTLStepFunction = 3 // MTLStepFunctionPerPatchControlPoint: The post-tessellation function fetches data based on the control-point indices associated with the patch. MTLStepFunctionPerPatchControlPoint MTLStepFunction = 4 // MTLStepFunctionPerVertex: The vertex function fetches data for every vertex. MTLStepFunctionPerVertex MTLStepFunction = 1 // MTLStepFunctionThreadPositionInGridX: The compute function fetches data based on the thread’s `x` coordinate. MTLStepFunctionThreadPositionInGridX MTLStepFunction = 5 // MTLStepFunctionThreadPositionInGridXIndexed: The compute function fetches data by using the thread’s `x` coordinate to look up a value in the index buffer. MTLStepFunctionThreadPositionInGridXIndexed MTLStepFunction = 7 // MTLStepFunctionThreadPositionInGridY: The compute function fetches data based on the thread’s `y` coordinate. MTLStepFunctionThreadPositionInGridY MTLStepFunction = 6 // MTLStepFunctionThreadPositionInGridYIndexed: The compute function fetches data by using the thread’s `y` coordinate to look up a value in the index buffer. MTLStepFunctionThreadPositionInGridYIndexed MTLStepFunction = 8 )
func (MTLStepFunction) String ¶
func (e MTLStepFunction) String() string
type MTLStitchedLibraryDescriptor ¶
type MTLStitchedLibraryDescriptor struct {
objectivec.Object
}
A description of a new library of procedurally generated functions.
Overview ¶
An MTLStitchedLibraryDescriptor describes a library of new stitched functions. A is a visible function you create by composing other Metal shader functions together in a function graph.
Configure a stitched library descriptor by assigning an array of one or more MTLFunctionStitchingGraph instances, each describing a stitched function, to the MTLStitchedLibraryDescriptor.FunctionGraphs property. Then assign an MTLFunction array that includes all the functions the graphs depend on to the MTLStitchedLibraryDescriptor.Functions property.
Create a stitched library from the descriptor by passing it to the [NewLibraryWithStitchedDescriptorError] method of an MTLDevice. You can change the descriptor to create other libraries without affecting any existing ones.
Configuring a stitched library ¶
- MTLStitchedLibraryDescriptor.Functions: The list of functions for creating the stitched library.
- MTLStitchedLibraryDescriptor.SetFunctions
- MTLStitchedLibraryDescriptor.FunctionGraphs: The function graphs that define the new stitched library’s functions.
- MTLStitchedLibraryDescriptor.SetFunctionGraphs
Instance Properties ¶
- MTLStitchedLibraryDescriptor.BinaryArchives
- MTLStitchedLibraryDescriptor.SetBinaryArchives
- MTLStitchedLibraryDescriptor.Options
- MTLStitchedLibraryDescriptor.SetOptions
See: https://developer.apple.com/documentation/Metal/MTLStitchedLibraryDescriptor
func MTLStitchedLibraryDescriptorFromID ¶
func MTLStitchedLibraryDescriptorFromID(id objc.ID) MTLStitchedLibraryDescriptor
MTLStitchedLibraryDescriptorFromID constructs a MTLStitchedLibraryDescriptor from an objc.ID.
A description of a new library of procedurally generated functions.
func NewMTLStitchedLibraryDescriptor ¶
func NewMTLStitchedLibraryDescriptor() MTLStitchedLibraryDescriptor
NewMTLStitchedLibraryDescriptor creates a new MTLStitchedLibraryDescriptor instance.
func (MTLStitchedLibraryDescriptor) Autorelease ¶
func (s MTLStitchedLibraryDescriptor) Autorelease() MTLStitchedLibraryDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLStitchedLibraryDescriptor) BinaryArchives ¶
func (s MTLStitchedLibraryDescriptor) BinaryArchives() []objectivec.IObject
See: https://developer.apple.com/documentation/Metal/MTLStitchedLibraryDescriptor/binaryArchives
func (MTLStitchedLibraryDescriptor) FunctionGraphs ¶
func (s MTLStitchedLibraryDescriptor) FunctionGraphs() []MTLFunctionStitchingGraph
The function graphs that define the new stitched library’s functions.
See: https://developer.apple.com/documentation/Metal/MTLStitchedLibraryDescriptor/functionGraphs
func (MTLStitchedLibraryDescriptor) Functions ¶
func (s MTLStitchedLibraryDescriptor) Functions() []objectivec.IObject
The list of functions for creating the stitched library.
Discussion ¶
The function objects need to all be created by the same Metal device object that you’ll use to create the library. The MSL functions referenced by these function objects need to be declared with the `stitchable` attribute, as in the example below:
See: https://developer.apple.com/documentation/Metal/MTLStitchedLibraryDescriptor/functions
func (MTLStitchedLibraryDescriptor) Init ¶
func (s MTLStitchedLibraryDescriptor) Init() MTLStitchedLibraryDescriptor
Init initializes the instance.
func (MTLStitchedLibraryDescriptor) Options ¶
func (s MTLStitchedLibraryDescriptor) Options() MTLStitchedLibraryOptions
See: https://developer.apple.com/documentation/Metal/MTLStitchedLibraryDescriptor/options
func (MTLStitchedLibraryDescriptor) SetBinaryArchives ¶
func (s MTLStitchedLibraryDescriptor) SetBinaryArchives(value []objectivec.IObject)
func (MTLStitchedLibraryDescriptor) SetFunctionGraphs ¶
func (s MTLStitchedLibraryDescriptor) SetFunctionGraphs(value []MTLFunctionStitchingGraph)
func (MTLStitchedLibraryDescriptor) SetFunctions ¶
func (s MTLStitchedLibraryDescriptor) SetFunctions(value []objectivec.IObject)
func (MTLStitchedLibraryDescriptor) SetOptions ¶
func (s MTLStitchedLibraryDescriptor) SetOptions(value MTLStitchedLibraryOptions)
type MTLStitchedLibraryDescriptorClass ¶
type MTLStitchedLibraryDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLStitchedLibraryDescriptorClass ¶
func GetMTLStitchedLibraryDescriptorClass() MTLStitchedLibraryDescriptorClass
GetMTLStitchedLibraryDescriptorClass returns the class object for MTLStitchedLibraryDescriptor.
func (MTLStitchedLibraryDescriptorClass) Alloc ¶
func (mc MTLStitchedLibraryDescriptorClass) Alloc() MTLStitchedLibraryDescriptor
Alloc allocates memory for a new instance of the class.
type MTLStitchedLibraryOptions ¶
type MTLStitchedLibraryOptions int
See: https://developer.apple.com/documentation/Metal/MTLStitchedLibraryOptions
const ( // MTLStitchedLibraryOptionFailOnBinaryArchiveMiss: An option that instructs the compiler to return an error when a GPU function for a stitched library isn’t in a binary archive. MTLStitchedLibraryOptionFailOnBinaryArchiveMiss MTLStitchedLibraryOptions = 1 MTLStitchedLibraryOptionNone MTLStitchedLibraryOptions = 0 MTLStitchedLibraryOptionStoreLibraryInMetalPipelinesScript MTLStitchedLibraryOptions = 2 )
func (MTLStitchedLibraryOptions) String ¶
func (e MTLStitchedLibraryOptions) String() string
type MTLStorageMode ¶
type MTLStorageMode int
See: https://developer.apple.com/documentation/Metal/MTLStorageMode
const ( // MTLStorageModeManaged: The CPU and GPU may maintain separate copies of the resource, and any changes need to be explicitly synchronized. MTLStorageModeManaged MTLStorageMode = 1 // MTLStorageModeMemoryless: The resource’s contents are only available to the GPU, and only exist temporarily during a render pass. MTLStorageModeMemoryless MTLStorageMode = 3 // MTLStorageModePrivate: The resource is only available to the GPU. MTLStorageModePrivate MTLStorageMode = 2 MTLStorageModeShared MTLStorageMode = 0 )
func (MTLStorageMode) String ¶
func (e MTLStorageMode) String() string
type MTLStoreAction ¶
type MTLStoreAction int
See: https://developer.apple.com/documentation/Metal/MTLStoreAction
const ( // MTLStoreActionCustomSampleDepthStore: The GPU stores depth data in a sample-position–agnostic representation. MTLStoreActionCustomSampleDepthStore MTLStoreAction = 5 // MTLStoreActionDontCare: The GPU has permission to discard the rendered contents of the attachment at the end of the render pass, replacing them with arbitrary data. MTLStoreActionDontCare MTLStoreAction = 0 // MTLStoreActionMultisampleResolve: The GPU resolves the multisampled data to one sample per pixel and stores the data to the resolve texture, discarding the multisample data afterwards. MTLStoreActionMultisampleResolve MTLStoreAction = 2 // MTLStoreActionStore: The GPU stores the rendered contents to the texture. MTLStoreActionStore MTLStoreAction = 1 // MTLStoreActionStoreAndMultisampleResolve: The GPU stores the multisample data to the multisample texture, resolves the data to a sample per pixel, and stores the data to the resolve texture. MTLStoreActionStoreAndMultisampleResolve MTLStoreAction = 3 // MTLStoreActionUnknown: The system selects a store action when it encodes the render pass. MTLStoreActionUnknown MTLStoreAction = 4 )
func (MTLStoreAction) String ¶
func (e MTLStoreAction) String() string
type MTLStoreActionOptions ¶
type MTLStoreActionOptions int
See: https://developer.apple.com/documentation/Metal/MTLStoreActionOptions
const ( // MTLStoreActionOptionCustomSamplePositions: An option that stores data in a sample-position–agnostic representation. MTLStoreActionOptionCustomSamplePositions MTLStoreActionOptions = 1 // MTLStoreActionOptionNone: An option that doesn’t modify the intended behavior of a store action. MTLStoreActionOptionNone MTLStoreActionOptions = 0 )
func (MTLStoreActionOptions) String ¶
func (e MTLStoreActionOptions) String() string
type MTLStructMember ¶
type MTLStructMember struct {
objectivec.Object
}
An instance that provides information about a field in a structure.
Overview ¶
MTLStructMember is part of the reflection API that allows Metal framework code to query details about an argument of a Metal shading language function. An MTLStructMember instance describes the data type of one field in a struct that is passed as an MTLFunction argument, which is represented by MTLArgument.
Don’t create MTLStructMember instances directly. You obtain an MTLStructMember instance from either the MTLStructMember.Members property or the [MemberByName] method of an MTLStructType instance. The MTLStructMember.DataType property of the MTLStructMember instance tells you what kind of data is stored in the member. Recursively drill down every struct member until you reach a data type that is neither a struct nor an array.
Describing the struct member ¶
- MTLStructMember.Name: The name of the struct member.
- MTLStructMember.DataType: The data type of the struct member.
- MTLStructMember.Offset: The location of this member relative to the start of its struct, in bytes.
- MTLStructMember.ArgumentIndex: The index in the argument table that corresponds to the struct member.
Obtaining struct member details ¶
- MTLStructMember.ArrayType: Provides a description of the underlying array when the struct member holds an array.
- MTLStructMember.StructType: Provides a description of the underlying struct when the struct member holds a struct.
- MTLStructMember.PointerType: Provides a description of the underlying pointer when the struct member holds a pointer.
- MTLStructMember.TextureReferenceType: Provides a description of the underlying texture when the struct member holds a texture.
Instance Methods ¶
- MTLStructMember.TensorReferenceType: Provides a description of the underlying tensor type when this struct member holds a tensor.
See: https://developer.apple.com/documentation/Metal/MTLStructMember
func MTLStructMemberFromID ¶
func MTLStructMemberFromID(id objc.ID) MTLStructMember
MTLStructMemberFromID constructs a MTLStructMember from an objc.ID.
An instance that provides information about a field in a structure.
func NewMTLStructMember ¶
func NewMTLStructMember() MTLStructMember
NewMTLStructMember creates a new MTLStructMember instance.
func (MTLStructMember) ArgumentIndex ¶
func (s MTLStructMember) ArgumentIndex() uint
The index in the argument table that corresponds to the struct member.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/argumentIndex
func (MTLStructMember) ArrayType ¶
func (s MTLStructMember) ArrayType() IMTLArrayType
Provides a description of the underlying array when the struct member holds an array.
Return Value ¶
An object that describes the array. If [DataType] indicates that this member is not an array, this method returns `nil.`
See: https://developer.apple.com/documentation/Metal/MTLStructMember/arrayType()
func (MTLStructMember) Autorelease ¶
func (s MTLStructMember) Autorelease() MTLStructMember
Autorelease adds the receiver to the current autorelease pool.
func (MTLStructMember) DataType ¶
func (s MTLStructMember) DataType() MTLDataType
The data type of the struct member.
Discussion ¶
For information on possible values, see MTLDataType. If the value is [DataTypeArray], then the [ArrayType] method returns an object that describes the underlying array. If the value is [DataTypeStruct], then the [StructType] method returns an object that describes the underlying struct.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/dataType
func (MTLStructMember) Init ¶
func (s MTLStructMember) Init() MTLStructMember
Init initializes the instance.
func (MTLStructMember) Members ¶
func (s MTLStructMember) Members() IMTLStructMember
An array of instances that describe the fields in the struct.
See: https://developer.apple.com/documentation/metal/mtlstructtype/members
func (MTLStructMember) Name ¶
func (s MTLStructMember) Name() string
The name of the struct member.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/name
func (MTLStructMember) Offset ¶
func (s MTLStructMember) Offset() uint
The location of this member relative to the start of its struct, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/offset
func (MTLStructMember) PointerType ¶
func (s MTLStructMember) PointerType() IMTLPointerType
Provides a description of the underlying pointer when the struct member holds a pointer.
Return Value ¶
An object that describes the pointer. If [DataType] indicates that this member isn’t a pointer, this method returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/pointerType()
func (MTLStructMember) SetMembers ¶
func (s MTLStructMember) SetMembers(value IMTLStructMember)
func (MTLStructMember) StructType ¶
func (s MTLStructMember) StructType() IMTLStructType
Provides a description of the underlying struct when the struct member holds a struct.
Return Value ¶
An object that describes the struct. If [DataType] indicates that this member is not a struct, this method returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/structType()
func (MTLStructMember) TensorReferenceType ¶
func (s MTLStructMember) TensorReferenceType() IMTLTensorReferenceType
Provides a description of the underlying tensor type when this struct member holds a tensor.
Return Value ¶
A description of the tensor type that this struct member holds, or `nil` if this struct member doesn’t hold a tensor.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/tensorReferenceType()
func (MTLStructMember) TextureReferenceType ¶
func (s MTLStructMember) TextureReferenceType() IMTLTextureReferenceType
Provides a description of the underlying texture when the struct member holds a texture.
Return Value ¶
An object that describes the texture. If [DataType] indicates that this member isn’t a texture, this method returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLStructMember/textureReferenceType()
type MTLStructMemberClass ¶
type MTLStructMemberClass struct {
// contains filtered or unexported fields
}
func GetMTLStructMemberClass ¶
func GetMTLStructMemberClass() MTLStructMemberClass
GetMTLStructMemberClass returns the class object for MTLStructMember.
func (MTLStructMemberClass) Alloc ¶
func (mc MTLStructMemberClass) Alloc() MTLStructMember
Alloc allocates memory for a new instance of the class.
type MTLStructType ¶
type MTLStructType struct {
MTLType
}
A description of a structure.
Overview ¶
MTLStructType is part of the reflection API that allows Metal framework code to query details of a struct that is passed as an argument of a Metal shading language function. Don’t create MTLStructType instances directly; instead query the bufferStructType property of an MTLArgument instance, or call the [StructType] method for an MTLStructMember instance. To examine the details of the struct, you can recursively drill down the MTLStructType.Members property of the MTLStructType instance, which contains details about struct members, each of which is represented by an MTLStructMember instance.
Obtaining information about struct members ¶
- MTLStructType.Members: An array of instances that describe the fields in the struct.
- MTLStructType.MemberByName: Provides a representation of a struct member.
See: https://developer.apple.com/documentation/Metal/MTLStructType
func MTLStructTypeFromID ¶
func MTLStructTypeFromID(id objc.ID) MTLStructType
MTLStructTypeFromID constructs a MTLStructType from an objc.ID.
A description of a structure.
func NewMTLStructType ¶
func NewMTLStructType() MTLStructType
NewMTLStructType creates a new MTLStructType instance.
func (MTLStructType) Autorelease ¶
func (s MTLStructType) Autorelease() MTLStructType
Autorelease adds the receiver to the current autorelease pool.
func (MTLStructType) BufferStructType ¶
func (s MTLStructType) BufferStructType() IMTLStructType
A description of the structure data of a buffer argument.
See: https://developer.apple.com/documentation/metal/mtlargument/bufferstructtype
func (MTLStructType) Init ¶
func (s MTLStructType) Init() MTLStructType
Init initializes the instance.
func (MTLStructType) MemberByName ¶
func (s MTLStructType) MemberByName(name string) IMTLStructMember
Provides a representation of a struct member.
name: The name of a member in the struct.
Return Value ¶
An object that represents the named struct member. If `name` does not match a member name, `nil` is returned.
See: https://developer.apple.com/documentation/Metal/MTLStructType/memberByName(_:)
func (MTLStructType) Members ¶
func (s MTLStructType) Members() []MTLStructMember
An array of instances that describe the fields in the struct.
Discussion ¶
Each array element in [Members] is an MTLStructMember instance that corresponds to one of the fields in the struct.
See: https://developer.apple.com/documentation/Metal/MTLStructType/members
func (MTLStructType) SetBufferStructType ¶
func (s MTLStructType) SetBufferStructType(value IMTLStructType)
type MTLStructTypeClass ¶
type MTLStructTypeClass struct {
// contains filtered or unexported fields
}
func GetMTLStructTypeClass ¶
func GetMTLStructTypeClass() MTLStructTypeClass
GetMTLStructTypeClass returns the class object for MTLStructType.
func (MTLStructTypeClass) Alloc ¶
func (mc MTLStructTypeClass) Alloc() MTLStructType
Alloc allocates memory for a new instance of the class.
type MTLTensor ¶
type MTLTensor interface {
objectivec.IObject
MTLAllocation
MTLResource
// A buffer instance this tensor shares its storage with or nil if this tensor does not wrap an underlying buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/buffer
Buffer() MTLBuffer
// An offset, in bytes, into the buffer instance this tensor shares its storage with, or zero if this tensor does not wrap an underlying buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/bufferOffset
BufferOffset() uint
// An underlying data format of this tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/dataType
DataType() MTLTensorDataType
// An array of sizes, in elements, one for each dimension of this tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/dimensions
Dimensions() IMTLTensorExtents
// A handle that represents the GPU resource, which you can store in an argument buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/gpuResourceID
GpuResourceID() MTLResourceID
// An array of strides, in elements, one for each dimension of this tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/strides
Strides() IMTLTensorExtents
// A set of contexts in which you can use this tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/usage
Usage() MTLTensorUsage
// Copies the data corresponding to a slice of this tensor into a pointer you provide.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/getBytes(_:strides:sliceOrigin:sliceDimensions:)
GetBytesStridesFromSliceOriginSliceDimensions(bytes unsafe.Pointer, strides IMTLTensorExtents, sliceOrigin IMTLTensorExtents, sliceDimensions IMTLTensorExtents)
// Replaces the contents of a slice of this tensor with data you provide.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensor/replace(sliceOrigin:sliceDimensions:withBytes:strides:)
ReplaceSliceOriginSliceDimensionsWithBytesStrides(sliceOrigin IMTLTensorExtents, sliceDimensions IMTLTensorExtents, bytes unsafe.Pointer, strides IMTLTensorExtents)
}
A resource representing a multi-dimensional array that you can use with machine learning workloads.
See: https://developer.apple.com/documentation/Metal/MTLTensor
type MTLTensorBinding ¶
type MTLTensorBinding interface {
objectivec.IObject
MTLBinding
// The array of sizes, in elements, one for each dimension of this tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensorBinding/dimensions
Dimensions() IMTLTensorExtents
// The data format you use for indexing into the tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensorBinding/indexType
IndexType() MTLDataType
// The underlying data format of this tensor.
//
// See: https://developer.apple.com/documentation/Metal/MTLTensorBinding/tensorDataType
TensorDataType() MTLTensorDataType
}
An object that represents a tensor bound to a graphics or compute function or a machine learning function.
See: https://developer.apple.com/documentation/Metal/MTLTensorBinding
type MTLTensorBindingObject ¶
type MTLTensorBindingObject struct {
objectivec.Object
}
MTLTensorBindingObject wraps an existing Objective-C object that conforms to the MTLTensorBinding protocol.
func MTLTensorBindingObjectFromID ¶
func MTLTensorBindingObjectFromID(id objc.ID) MTLTensorBindingObject
MTLTensorBindingObjectFromID constructs a MTLTensorBindingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLTensorBindingObject) Access ¶
func (o MTLTensorBindingObject) Access() MTLBindingAccess
See: https://developer.apple.com/documentation/Metal/MTLBinding/access
func (MTLTensorBindingObject) BaseObject ¶
func (o MTLTensorBindingObject) BaseObject() objectivec.Object
func (MTLTensorBindingObject) Dimensions ¶
func (o MTLTensorBindingObject) Dimensions() IMTLTensorExtents
The array of sizes, in elements, one for each dimension of this tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorBinding/dimensions
func (MTLTensorBindingObject) Index ¶
func (o MTLTensorBindingObject) Index() uint
See: https://developer.apple.com/documentation/Metal/MTLBinding/index
func (MTLTensorBindingObject) IndexType ¶
func (o MTLTensorBindingObject) IndexType() MTLDataType
The data format you use for indexing into the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorBinding/indexType
func (MTLTensorBindingObject) IsArgument ¶
func (o MTLTensorBindingObject) IsArgument() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isArgument
func (MTLTensorBindingObject) IsUsed ¶
func (o MTLTensorBindingObject) IsUsed() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isUsed
func (MTLTensorBindingObject) Name ¶
func (o MTLTensorBindingObject) Name() string
See: https://developer.apple.com/documentation/Metal/MTLBinding/name
func (MTLTensorBindingObject) TensorDataType ¶
func (o MTLTensorBindingObject) TensorDataType() MTLTensorDataType
The underlying data format of this tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorBinding/tensorDataType
func (MTLTensorBindingObject) Type ¶
func (o MTLTensorBindingObject) Type() MTLBindingType
See: https://developer.apple.com/documentation/Metal/MTLBinding/type
type MTLTensorDataType ¶
type MTLTensorDataType int
See: https://developer.apple.com/documentation/Metal/MTLTensorDataType
const ( MTLTensorDataTypeBFloat16 MTLTensorDataType = 121 MTLTensorDataTypeFloat16 MTLTensorDataType = 16 MTLTensorDataTypeFloat32 MTLTensorDataType = 3 MTLTensorDataTypeInt16 MTLTensorDataType = 37 MTLTensorDataTypeInt32 MTLTensorDataType = 29 MTLTensorDataTypeInt4 MTLTensorDataType = 0 MTLTensorDataTypeInt8 MTLTensorDataType = 45 MTLTensorDataTypeNone MTLTensorDataType = 0 MTLTensorDataTypeUInt16 MTLTensorDataType = 41 MTLTensorDataTypeUInt32 MTLTensorDataType = 33 MTLTensorDataTypeUInt4 MTLTensorDataType = 0 MTLTensorDataTypeUInt8 MTLTensorDataType = 49 )
func (MTLTensorDataType) String ¶
func (e MTLTensorDataType) String() string
type MTLTensorDescriptor ¶
type MTLTensorDescriptor struct {
objectivec.Object
}
A configuration type for creating new tensor instances.
Instance Properties ¶
- MTLTensorDescriptor.CpuCacheMode: A value that configures the cache mode of CPU mapping of tensors you create with this descriptor.
- MTLTensorDescriptor.SetCpuCacheMode
- MTLTensorDescriptor.DataType: A data format for the tensors you create with this descriptor.
- MTLTensorDescriptor.SetDataType
- MTLTensorDescriptor.Dimensions: An array of sizes, in elements, one for each dimension of the tensors you create with this descriptor.
- MTLTensorDescriptor.SetDimensions
- MTLTensorDescriptor.HazardTrackingMode: A value that configures the hazard tracking of tensors you create with this descriptor.
- MTLTensorDescriptor.SetHazardTrackingMode
- MTLTensorDescriptor.ResourceOptions: A packed set of the `storageMode`, `cpuCacheMode` and `hazardTrackingMode` properties.
- MTLTensorDescriptor.SetResourceOptions
- MTLTensorDescriptor.StorageMode: A value that configures the memory location and access permissions of tensors you create with this descriptor.
- MTLTensorDescriptor.SetStorageMode
- MTLTensorDescriptor.Strides: An array of strides, in elements, one for each dimension in the tensors you create with this descriptor, if applicable.
- MTLTensorDescriptor.SetStrides
- MTLTensorDescriptor.Usage: A set of contexts in which you can use tensors you create with this descriptor.
- MTLTensorDescriptor.SetUsage
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor
func MTLTensorDescriptorFromID ¶
func MTLTensorDescriptorFromID(id objc.ID) MTLTensorDescriptor
MTLTensorDescriptorFromID constructs a MTLTensorDescriptor from an objc.ID.
A configuration type for creating new tensor instances.
func NewMTLTensorDescriptor ¶
func NewMTLTensorDescriptor() MTLTensorDescriptor
NewMTLTensorDescriptor creates a new MTLTensorDescriptor instance.
func (MTLTensorDescriptor) Autorelease ¶
func (t MTLTensorDescriptor) Autorelease() MTLTensorDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLTensorDescriptor) CpuCacheMode ¶
func (t MTLTensorDescriptor) CpuCacheMode() MTLCPUCacheMode
A value that configures the cache mode of CPU mapping of tensors you create with this descriptor.
Discussion ¶
The default value of this property is [CPUCacheModeDefaultCache].
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/cpuCacheMode
func (MTLTensorDescriptor) DataType ¶
func (t MTLTensorDescriptor) DataType() MTLTensorDataType
A data format for the tensors you create with this descriptor.
Discussion ¶
The default value of this property is [TensorDataTypeFloat32].
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/dataType
func (MTLTensorDescriptor) Dimensions ¶
func (t MTLTensorDescriptor) Dimensions() IMTLTensorExtents
An array of sizes, in elements, one for each dimension of the tensors you create with this descriptor.
Discussion ¶
The default value of this property is a rank one extents with size one.
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/dimensions
func (MTLTensorDescriptor) HazardTrackingMode ¶
func (t MTLTensorDescriptor) HazardTrackingMode() MTLHazardTrackingMode
A value that configures the hazard tracking of tensors you create with this descriptor.
Discussion ¶
The default value of this property is [HazardTrackingModeDefault].
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/hazardTrackingMode
func (MTLTensorDescriptor) Init ¶
func (t MTLTensorDescriptor) Init() MTLTensorDescriptor
Init initializes the instance.
func (MTLTensorDescriptor) MTLTensorDomain ¶
func (t MTLTensorDescriptor) MTLTensorDomain() string
An error domain for errors that pertain to creating a tensor.
See: https://developer.apple.com/documentation/metal/mtltensordomain
func (MTLTensorDescriptor) MTL_TENSOR_MAX_RANK ¶
func (t MTLTensorDescriptor) MTL_TENSOR_MAX_RANK() objectivec.IObject
See: https://developer.apple.com/documentation/metal/mtl_tensor_max_rank
func (MTLTensorDescriptor) ResourceOptions ¶
func (t MTLTensorDescriptor) ResourceOptions() MTLResourceOptions
A packed set of the `storageMode`, `cpuCacheMode` and `hazardTrackingMode` properties.
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/resourceOptions
func (MTLTensorDescriptor) SetCpuCacheMode ¶
func (t MTLTensorDescriptor) SetCpuCacheMode(value MTLCPUCacheMode)
func (MTLTensorDescriptor) SetDataType ¶
func (t MTLTensorDescriptor) SetDataType(value MTLTensorDataType)
func (MTLTensorDescriptor) SetDimensions ¶
func (t MTLTensorDescriptor) SetDimensions(value IMTLTensorExtents)
func (MTLTensorDescriptor) SetHazardTrackingMode ¶
func (t MTLTensorDescriptor) SetHazardTrackingMode(value MTLHazardTrackingMode)
func (MTLTensorDescriptor) SetMTL_TENSOR_MAX_RANK ¶
func (t MTLTensorDescriptor) SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
func (MTLTensorDescriptor) SetResourceOptions ¶
func (t MTLTensorDescriptor) SetResourceOptions(value MTLResourceOptions)
func (MTLTensorDescriptor) SetStorageMode ¶
func (t MTLTensorDescriptor) SetStorageMode(value MTLStorageMode)
func (MTLTensorDescriptor) SetStrides ¶
func (t MTLTensorDescriptor) SetStrides(value IMTLTensorExtents)
func (MTLTensorDescriptor) SetUsage ¶
func (t MTLTensorDescriptor) SetUsage(value MTLTensorUsage)
func (MTLTensorDescriptor) StorageMode ¶
func (t MTLTensorDescriptor) StorageMode() MTLStorageMode
A value that configures the memory location and access permissions of tensors you create with this descriptor.
Discussion ¶
The default value of this property defaults to [StorageModeShared].
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/storageMode
func (MTLTensorDescriptor) Strides ¶
func (t MTLTensorDescriptor) Strides() IMTLTensorExtents
An array of strides, in elements, one for each dimension in the tensors you create with this descriptor, if applicable.
Discussion ¶
This property only applies to tensors you create from a buffer, otherwise it is nil. You are responsible for ensuring `strides` meets the following requirements:
- Elements of `strides`are in monotonically non-decreasing order. - The first element of `strides` is one. - For any `i` larger than zero, `strides[i]` is greater than or equal to `strides[i-1] * dimensions[i-1]`. - If `usage` contains [TensorUsageMachineLearning], the second element of `strides` is aligned to 64 bytes, and for any `i` larger than one, `strides[i]` is equal to `strides[i-1] * dimensions[i-1]`.
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/strides
func (MTLTensorDescriptor) Usage ¶
func (t MTLTensorDescriptor) Usage() MTLTensorUsage
A set of contexts in which you can use tensors you create with this descriptor.
Discussion ¶
The default value for this property is a bitwise [OR] of:
- [TensorUsageRender] - [TensorUsageCompute]
See: https://developer.apple.com/documentation/Metal/MTLTensorDescriptor/usage
type MTLTensorDescriptorClass ¶
type MTLTensorDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLTensorDescriptorClass ¶
func GetMTLTensorDescriptorClass() MTLTensorDescriptorClass
GetMTLTensorDescriptorClass returns the class object for MTLTensorDescriptor.
func (MTLTensorDescriptorClass) Alloc ¶
func (mc MTLTensorDescriptorClass) Alloc() MTLTensorDescriptor
Alloc allocates memory for a new instance of the class.
type MTLTensorError ¶
type MTLTensorError int
See: https://developer.apple.com/documentation/Metal/MTLTensorError-swift.struct/Code
const ( MTLTensorErrorInternalError MTLTensorError = 1 MTLTensorErrorInvalidDescriptor MTLTensorError = 2 MTLTensorErrorNone MTLTensorError = 0 )
func (MTLTensorError) String ¶
func (e MTLTensorError) String() string
type MTLTensorExtents ¶
type MTLTensorExtents struct {
objectivec.Object
}
An array of length matching the rank, holding the dimensions of a tensor.
Overview ¶
Supports rank up to MTL_TENSOR_MAX_RANK.
Instance Properties ¶
- MTLTensorExtents.Extents: Retrieves the extents for this object.
- MTLTensorExtents.SetExtents
- MTLTensorExtents.Rank: Obtains the rank of the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorExtents
func MTLTensorExtentsFromID ¶
func MTLTensorExtentsFromID(id objc.ID) MTLTensorExtents
MTLTensorExtentsFromID constructs a MTLTensorExtents from an objc.ID.
An array of length matching the rank, holding the dimensions of a tensor.
func NewMTLTensorExtents ¶
func NewMTLTensorExtents() MTLTensorExtents
NewMTLTensorExtents creates a new MTLTensorExtents instance.
func NewTensorExtentsWithRankValues ¶
func NewTensorExtentsWithRankValues(rank uint, values unsafe.Pointer) MTLTensorExtents
Creates a new tensor extents with the rank and extent values you provide.
rank: The number of dimensions.
values: An array of length `rank` that specifies the size of each dimension. The first dimension is the innermost dimension.
Return Value ¶
Tensor extents with the rank and extent values you provide. Returns `nil` if `rank` exceeds 0 and `values` is nil or if `rank` exceeds MTL_TENSOR_MAX_RANK.
Discussion ¶
Zero rank extents represent scalars. `values` can only be `nil`if `rank` is 0.
See: https://developer.apple.com/documentation/Metal/MTLTensorExtents/initWithRank:values:
func (MTLTensorExtents) Autorelease ¶
func (t MTLTensorExtents) Autorelease() MTLTensorExtents
Autorelease adds the receiver to the current autorelease pool.
func (MTLTensorExtents) ExtentAtDimensionIndex ¶
func (t MTLTensorExtents) ExtentAtDimensionIndex(dimensionIndex uint) int
Returns the extent at an index.
dimensionIndex: The index of the dimension. The first dimension is the innermost dimension.
Return Value ¶
The extent at `dimensionIndex`. This method returns -1 if `dimensionIndex` is greater than or equal to `rank`.
See: https://developer.apple.com/documentation/Metal/MTLTensorExtents/extentAtDimensionIndex:
func (MTLTensorExtents) Extents ¶
func (t MTLTensorExtents) Extents() int
Retrieves the extents for this object.
See: https://developer.apple.com/documentation/metal/mtltensorextents/extents
func (MTLTensorExtents) Init ¶
func (t MTLTensorExtents) Init() MTLTensorExtents
Init initializes the instance.
func (MTLTensorExtents) InitWithRankValues ¶
func (t MTLTensorExtents) InitWithRankValues(rank uint, values unsafe.Pointer) MTLTensorExtents
Creates a new tensor extents with the rank and extent values you provide.
rank: The number of dimensions.
values: An array of length `rank` that specifies the size of each dimension. The first dimension is the innermost dimension.
Return Value ¶
Tensor extents with the rank and extent values you provide. Returns `nil` if `rank` exceeds 0 and `values` is nil or if `rank` exceeds MTL_TENSOR_MAX_RANK.
Discussion ¶
Zero rank extents represent scalars. `values` can only be `nil`if `rank` is 0.
See: https://developer.apple.com/documentation/Metal/MTLTensorExtents/initWithRank:values:
func (MTLTensorExtents) MTLTensorDomain ¶
func (t MTLTensorExtents) MTLTensorDomain() string
An error domain for errors that pertain to creating a tensor.
See: https://developer.apple.com/documentation/metal/mtltensordomain
func (MTLTensorExtents) MTL_TENSOR_MAX_RANK ¶
func (t MTLTensorExtents) MTL_TENSOR_MAX_RANK() objectivec.IObject
See: https://developer.apple.com/documentation/metal/mtl_tensor_max_rank
func (MTLTensorExtents) Rank ¶
func (t MTLTensorExtents) Rank() uint
Obtains the rank of the tensor.
Discussion ¶
The rank represents the number of dimensions.
See: https://developer.apple.com/documentation/Metal/MTLTensorExtents/rank
func (MTLTensorExtents) SetExtents ¶
func (t MTLTensorExtents) SetExtents(value int)
func (MTLTensorExtents) SetMTL_TENSOR_MAX_RANK ¶
func (t MTLTensorExtents) SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
type MTLTensorExtentsClass ¶
type MTLTensorExtentsClass struct {
// contains filtered or unexported fields
}
func GetMTLTensorExtentsClass ¶
func GetMTLTensorExtentsClass() MTLTensorExtentsClass
GetMTLTensorExtentsClass returns the class object for MTLTensorExtents.
func (MTLTensorExtentsClass) Alloc ¶
func (mc MTLTensorExtentsClass) Alloc() MTLTensorExtents
Alloc allocates memory for a new instance of the class.
type MTLTensorObject ¶
type MTLTensorObject struct {
objectivec.Object
}
MTLTensorObject wraps an existing Objective-C object that conforms to the MTLTensor protocol.
func MTLTensorObjectFromID ¶
func MTLTensorObjectFromID(id objc.ID) MTLTensorObject
MTLTensorObjectFromID constructs a MTLTensorObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLTensorObject) AllocatedSize ¶
func (o MTLTensorObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLTensorObject) BaseObject ¶
func (o MTLTensorObject) BaseObject() objectivec.Object
func (MTLTensorObject) Buffer ¶
func (o MTLTensorObject) Buffer() MTLBuffer
A buffer instance this tensor shares its storage with or nil if this tensor does not wrap an underlying buffer.
See: https://developer.apple.com/documentation/Metal/MTLTensor/buffer
func (MTLTensorObject) BufferOffset ¶
func (o MTLTensorObject) BufferOffset() uint
An offset, in bytes, into the buffer instance this tensor shares its storage with, or zero if this tensor does not wrap an underlying buffer.
See: https://developer.apple.com/documentation/Metal/MTLTensor/bufferOffset
func (MTLTensorObject) CpuCacheMode ¶
func (o MTLTensorObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLTensorObject) DataType ¶
func (o MTLTensorObject) DataType() MTLTensorDataType
An underlying data format of this tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensor/dataType
func (MTLTensorObject) Device ¶
func (o MTLTensorObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLTensorObject) Dimensions ¶
func (o MTLTensorObject) Dimensions() IMTLTensorExtents
An array of sizes, in elements, one for each dimension of this tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensor/dimensions
func (MTLTensorObject) GetBytesStridesFromSliceOriginSliceDimensions ¶
func (o MTLTensorObject) GetBytesStridesFromSliceOriginSliceDimensions(bytes unsafe.Pointer, strides IMTLTensorExtents, sliceOrigin IMTLTensorExtents, sliceDimensions IMTLTensorExtents)
Copies the data corresponding to a slice of this tensor into a pointer you provide.
bytes: A pointer to bytes of data that this method copies into the slice you specify with `sliceOrigin` and `sliceDimensions`.
strides: An array of strides, in elements, that describes the layout of the data in `bytes`. You are responsible for ensuring `strides` meets the following requirements:
- Elements of `strides`are in monotonically non-decreasing order. - For any `i` larger than zero, `strides[i]` is greater than or equal to `strides[i-1] * dimensions[i-1]`.
sliceOrigin: An array of offsets, in elements, to the first element of the slice that this method reads data from.
sliceDimensions: An array of sizes, in elements, of the slice this method reads data from.
func (MTLTensorObject) GpuResourceID ¶
func (o MTLTensorObject) GpuResourceID() MTLResourceID
A handle that represents the GPU resource, which you can store in an argument buffer.
See: https://developer.apple.com/documentation/Metal/MTLTensor/gpuResourceID
func (MTLTensorObject) HazardTrackingMode ¶
func (o MTLTensorObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLTensorObject) Heap ¶
func (o MTLTensorObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLTensorObject) HeapOffset ¶
func (o MTLTensorObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLTensorObject) IsAliasable ¶
func (o MTLTensorObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLTensorObject) Label ¶
func (o MTLTensorObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLTensorObject) MakeAliasable ¶
func (o MTLTensorObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLTensorObject) ReplaceSliceOriginSliceDimensionsWithBytesStrides ¶
func (o MTLTensorObject) ReplaceSliceOriginSliceDimensionsWithBytesStrides(sliceOrigin IMTLTensorExtents, sliceDimensions IMTLTensorExtents, bytes unsafe.Pointer, strides IMTLTensorExtents)
Replaces the contents of a slice of this tensor with data you provide.
sliceOrigin: An array of offsets, in elements, to the first element of the slice that this method writes data to.
sliceDimensions: An array of sizes, in elements, of the slice this method writes data to.
bytes: A pointer to bytes of data that this method copies into the slice you specify with `sliceOrigin` and `sliceDimensions`.
strides: An array of strides, in elements, that describes the layout of the data in `bytes`. You are responsible for ensuring `strides` meets the following requirements:
- Elements of `strides`are in monotonically non-decreasing order. - For any `i` larger than zero, `strides[i]` is greater than or equal to `strides[i-1] * dimensions[i-1]`.
func (MTLTensorObject) ResourceOptions ¶
func (o MTLTensorObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLTensorObject) SetLabel ¶
func (o MTLTensorObject) SetLabel(value string)
func (MTLTensorObject) SetOwnerWithIdentity ¶
func (o MTLTensorObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLTensorObject) SetPurgeableState ¶
func (o MTLTensorObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLTensorObject) StorageMode ¶
func (o MTLTensorObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
func (MTLTensorObject) Strides ¶
func (o MTLTensorObject) Strides() IMTLTensorExtents
An array of strides, in elements, one for each dimension of this tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensor/strides
func (MTLTensorObject) Usage ¶
func (o MTLTensorObject) Usage() MTLTensorUsage
A set of contexts in which you can use this tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensor/usage
type MTLTensorReferenceType ¶
type MTLTensorReferenceType struct {
MTLType
}
An object that represents a tensor in the shading language in a struct or array.
Instance Properties ¶
- MTLTensorReferenceType.Access: A value that represents the read/write permissions of the tensor.
- MTLTensorReferenceType.Dimensions: The array of sizes, in elements, one for each dimension of this tensor.
- MTLTensorReferenceType.IndexType: The data format you use for indexing into the tensor.
- MTLTensorReferenceType.TensorDataType: The underlying data format of the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorReferenceType
func MTLTensorReferenceTypeFromID ¶
func MTLTensorReferenceTypeFromID(id objc.ID) MTLTensorReferenceType
MTLTensorReferenceTypeFromID constructs a MTLTensorReferenceType from an objc.ID.
An object that represents a tensor in the shading language in a struct or array.
func NewMTLTensorReferenceType ¶
func NewMTLTensorReferenceType() MTLTensorReferenceType
NewMTLTensorReferenceType creates a new MTLTensorReferenceType instance.
func (MTLTensorReferenceType) Access ¶
func (t MTLTensorReferenceType) Access() MTLBindingAccess
A value that represents the read/write permissions of the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorReferenceType/access
func (MTLTensorReferenceType) Autorelease ¶
func (t MTLTensorReferenceType) Autorelease() MTLTensorReferenceType
Autorelease adds the receiver to the current autorelease pool.
func (MTLTensorReferenceType) Dimensions ¶
func (t MTLTensorReferenceType) Dimensions() IMTLTensorExtents
The array of sizes, in elements, one for each dimension of this tensor.
Discussion ¶
Because shader-bound tensors have dynamic extents, the [Rank] of `dimensions` corresponds to the rank the shader function specifies, and `MTLTensorExtents/` always returns a value of -1.
See: https://developer.apple.com/documentation/Metal/MTLTensorReferenceType/dimensions
func (MTLTensorReferenceType) IndexType ¶
func (t MTLTensorReferenceType) IndexType() MTLDataType
The data format you use for indexing into the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorReferenceType/indexType
func (MTLTensorReferenceType) Init ¶
func (t MTLTensorReferenceType) Init() MTLTensorReferenceType
Init initializes the instance.
func (MTLTensorReferenceType) MTLTensorDomain ¶
func (t MTLTensorReferenceType) MTLTensorDomain() string
An error domain for errors that pertain to creating a tensor.
See: https://developer.apple.com/documentation/metal/mtltensordomain
func (MTLTensorReferenceType) MTL_TENSOR_MAX_RANK ¶
func (t MTLTensorReferenceType) MTL_TENSOR_MAX_RANK() objectivec.IObject
See: https://developer.apple.com/documentation/metal/mtl_tensor_max_rank
func (MTLTensorReferenceType) SetMTL_TENSOR_MAX_RANK ¶
func (t MTLTensorReferenceType) SetMTL_TENSOR_MAX_RANK(value objectivec.IObject)
func (MTLTensorReferenceType) TensorDataType ¶
func (t MTLTensorReferenceType) TensorDataType() MTLTensorDataType
The underlying data format of the tensor.
See: https://developer.apple.com/documentation/Metal/MTLTensorReferenceType/tensorDataType
type MTLTensorReferenceTypeClass ¶
type MTLTensorReferenceTypeClass struct {
// contains filtered or unexported fields
}
func GetMTLTensorReferenceTypeClass ¶
func GetMTLTensorReferenceTypeClass() MTLTensorReferenceTypeClass
GetMTLTensorReferenceTypeClass returns the class object for MTLTensorReferenceType.
func (MTLTensorReferenceTypeClass) Alloc ¶
func (mc MTLTensorReferenceTypeClass) Alloc() MTLTensorReferenceType
Alloc allocates memory for a new instance of the class.
type MTLTensorUsage ¶
type MTLTensorUsage int
See: https://developer.apple.com/documentation/Metal/MTLTensorUsage
const ( // MTLTensorUsageCompute: A tensor context that applies to compute encoders. MTLTensorUsageCompute MTLTensorUsage = 1 // MTLTensorUsageMachineLearning: A tensor context that applies to machine learning encoders. MTLTensorUsageMachineLearning MTLTensorUsage = 4 // MTLTensorUsageRender: A tensor context that applies to render encoders. MTLTensorUsageRender MTLTensorUsage = 2 )
func (MTLTensorUsage) String ¶
func (e MTLTensorUsage) String() string
type MTLTessellationControlPointIndexType ¶
type MTLTessellationControlPointIndexType int
See: https://developer.apple.com/documentation/Metal/MTLTessellationControlPointIndexType
const ( // MTLTessellationControlPointIndexTypeNone: No size. MTLTessellationControlPointIndexTypeNone MTLTessellationControlPointIndexType = 0 // MTLTessellationControlPointIndexTypeUInt16: The size of a 16-bit unsigned integer. MTLTessellationControlPointIndexTypeUInt16 MTLTessellationControlPointIndexType = 1 // MTLTessellationControlPointIndexTypeUInt32: The size of a 32-bit unsigned integer. MTLTessellationControlPointIndexTypeUInt32 MTLTessellationControlPointIndexType = 2 )
func (MTLTessellationControlPointIndexType) String ¶
func (e MTLTessellationControlPointIndexType) String() string
type MTLTessellationFactorFormat ¶
type MTLTessellationFactorFormat int
See: https://developer.apple.com/documentation/Metal/MTLTessellationFactorFormat
const ( // MTLTessellationFactorFormatHalf: A 16-bit floating-point format. MTLTessellationFactorFormatHalf MTLTessellationFactorFormat = 0 )
func (MTLTessellationFactorFormat) String ¶
func (e MTLTessellationFactorFormat) String() string
type MTLTessellationFactorStepFunction ¶
type MTLTessellationFactorStepFunction int
See: https://developer.apple.com/documentation/Metal/MTLTessellationFactorStepFunction
const ( // MTLTessellationFactorStepFunctionConstant: A constant step function. MTLTessellationFactorStepFunctionConstant MTLTessellationFactorStepFunction = 0 // MTLTessellationFactorStepFunctionPerInstance: A per-instance step function. MTLTessellationFactorStepFunctionPerInstance MTLTessellationFactorStepFunction = 2 // MTLTessellationFactorStepFunctionPerPatch: A per-patch step function. MTLTessellationFactorStepFunctionPerPatch MTLTessellationFactorStepFunction = 1 // MTLTessellationFactorStepFunctionPerPatchAndPerInstance: A per-patch and per-instance step function. MTLTessellationFactorStepFunctionPerPatchAndPerInstance MTLTessellationFactorStepFunction = 3 )
func (MTLTessellationFactorStepFunction) String ¶
func (e MTLTessellationFactorStepFunction) String() string
type MTLTessellationPartitionMode ¶
type MTLTessellationPartitionMode int
See: https://developer.apple.com/documentation/Metal/MTLTessellationPartitionMode
const ( // MTLTessellationPartitionModeFractionalEven: A fractional even partitioning mode. MTLTessellationPartitionModeFractionalEven MTLTessellationPartitionMode = 3 // MTLTessellationPartitionModeFractionalOdd: A fractional odd partitioning mode. MTLTessellationPartitionModeFractionalOdd MTLTessellationPartitionMode = 2 // MTLTessellationPartitionModeInteger: An integer partitioning mode. MTLTessellationPartitionModeInteger MTLTessellationPartitionMode = 1 // MTLTessellationPartitionModePow2: A power of two partitioning mode. MTLTessellationPartitionModePow2 MTLTessellationPartitionMode = 0 )
func (MTLTessellationPartitionMode) String ¶
func (e MTLTessellationPartitionMode) String() string
type MTLTexture ¶
type MTLTexture interface {
objectivec.IObject
MTLAllocation
MTLResource
// Copies pixel data into a section of a texture slice.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/replace(region:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage:)
ReplaceRegionMipmapLevelSliceWithBytesBytesPerRowBytesPerImage(region MTLRegion, level uint, slice uint, pixelBytes unsafe.Pointer, bytesPerRow uint, bytesPerImage uint)
// Copies a block of pixels into a section of texture slice 0.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/replace(region:mipmapLevel:withBytes:bytesPerRow:)
ReplaceRegionMipmapLevelWithBytesBytesPerRow(region MTLRegion, level uint, pixelBytes unsafe.Pointer, bytesPerRow uint)
// Copies pixel data from the texture to a buffer in system memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/getBytes(_:bytesPerRow:bytesPerImage:from:mipmapLevel:slice:)
GetBytesBytesPerRowBytesPerImageFromRegionMipmapLevelSlice(pixelBytes unsafe.Pointer, bytesPerRow uint, bytesPerImage uint, region MTLRegion, level uint, slice uint)
// Copies pixel data from the first slice of the texture to a buffer in system memory.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/getBytes(_:bytesPerRow:from:mipmapLevel:)
GetBytesBytesPerRowFromRegionMipmapLevel(pixelBytes unsafe.Pointer, bytesPerRow uint, region MTLRegion, level uint)
// Creates a new view of the texture, reinterpreting its data using a different pixel format.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/makeTextureView(pixelFormat:)
NewTextureViewWithPixelFormat(pixelFormat MTLPixelFormat) MTLTexture
// The dimension and arrangement of the texture image data.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/textureType
TextureType() MTLTextureType
// The format of pixels in the texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/pixelFormat
PixelFormat() MTLPixelFormat
// The width of the texture image for the base level mipmap, in pixels.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/width
Width() uint
// The height of the texture image for the base level mipmap, in pixels.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/height
Height() uint
// The depth of the texture image for the base level mipmap, in pixels.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/depth
Depth() uint
// The number of mipmap levels in the texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/mipmapLevelCount
MipmapLevelCount() uint
// The number of slices in the texture array.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/arrayLength
ArrayLength() uint
// The number of samples in each pixel.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/sampleCount
SampleCount() uint
// A Boolean value that indicates whether the texture can only be used as a render target.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/isFramebufferOnly
IsFramebufferOnly() bool
// Options that determine how you can use the texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/usage
Usage() MTLTextureUsage
// A Boolean value indicating whether the GPU is allowed to adjust the contents of the texture to improve GPU performance.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/allowGPUOptimizedContents
AllowGPUOptimizedContents() bool
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/isShareable
IsShareable() bool
// The pattern that the GPU applies to pixels when you read or sample pixels from the texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/swizzle
Swizzle() MTLTextureSwizzleChannels
// A reference to the underlying surface instance for the texture, if applicable.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/iosurface
Iosurface() iosurface.IOSurfaceRef
// The number of a plane within the underlying surface instance for the texture, if applicable.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/iosurfacePlane
IosurfacePlane() uint
// The parent texture used to create this texture, if any.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/parent
ParentTexture() MTLTexture
// The base level of the parent texture used to create this texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/parentRelativeLevel
ParentRelativeLevel() uint
// The base slice of the parent texture used to create this texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/parentRelativeSlice
ParentRelativeSlice() uint
// The source buffer used to create this texture, if any.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/buffer
Buffer() MTLBuffer
// The offset in the source buffer where the texture’s data comes from.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/bufferOffset
BufferOffset() uint
// The number of bytes in each row of the texture’s source buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/bufferBytesPerRow
BufferBytesPerRow() uint
// The resource that owns the storage for this texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/rootResource
RootResource() MTLResource
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/makeSharedTextureHandle()
NewSharedTextureHandle() IMTLSharedTextureHandle
// Creates a remote texture view for another GPU in the same peer group.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/makeRemoteTextureView(_:)
NewRemoteTextureViewForDevice(device MTLDevice) MTLTexture
// The texture on another GPU that the texture was created from, if any.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/remoteStorageTexture
RemoteStorageTexture() MTLTexture
// A Boolean value that indicates whether this is a sparse texture.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/isSparse
IsSparse() bool
// The index of the first mipmap in the tail.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/firstMipmapInTail
FirstMipmapInTail() uint
// The size of the sparse texture tail, in bytes.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/tailSizeInBytes
TailSizeInBytes() uint
// CompressionType protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/compressionType
CompressionType() MTLTextureCompressionType
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/gpuResourceID
GpuResourceID() MTLResourceID
// SparseTextureTier protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/sparseTextureTier
SparseTextureTier() MTLTextureSparseTier
// NewTextureViewWithDescriptor protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/newTextureView(with:)
NewTextureViewWithDescriptor(descriptor IMTLTextureViewDescriptor) MTLTexture
// Creates a new view of the texture, reinterpreting a subset of its data using a different type and pixel format.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/newTextureViewWithPixelFormat:textureType:levels:slices:
NewTextureViewWithPixelFormatTextureTypeLevelsSlices(pixelFormat MTLPixelFormat, textureType MTLTextureType, levelRange foundation.NSRange, sliceRange foundation.NSRange) MTLTexture
// Creates a new view of the texture, reinterpreting a subset of its data using a different type, pixel format, and swizzle pattern.
//
// See: https://developer.apple.com/documentation/Metal/MTLTexture/newTextureViewWithPixelFormat:textureType:levels:slices:swizzle:
NewTextureViewWithPixelFormatTextureTypeLevelsSlicesSwizzle(pixelFormat MTLPixelFormat, textureType MTLTextureType, levelRange foundation.NSRange, sliceRange foundation.NSRange, swizzle MTLTextureSwizzleChannels) MTLTexture
}
A resource that holds formatted image data.
See: https://developer.apple.com/documentation/Metal/MTLTexture
type MTLTextureBinding ¶
type MTLTextureBinding interface {
objectivec.IObject
MTLBinding
// ArrayLength protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/arrayLength
ArrayLength() uint
// DepthTexture protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/isDepthTexture
IsDepthTexture() bool
// TextureDataType protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/textureDataType
TextureDataType() MTLDataType
// TextureType protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/textureType
TextureType() MTLTextureType
}
MTLTextureBinding protocol.
See: https://developer.apple.com/documentation/Metal/MTLTextureBinding
type MTLTextureBindingObject ¶
type MTLTextureBindingObject struct {
objectivec.Object
}
MTLTextureBindingObject wraps an existing Objective-C object that conforms to the MTLTextureBinding protocol.
func MTLTextureBindingObjectFromID ¶
func MTLTextureBindingObjectFromID(id objc.ID) MTLTextureBindingObject
MTLTextureBindingObjectFromID constructs a MTLTextureBindingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLTextureBindingObject) Access ¶
func (o MTLTextureBindingObject) Access() MTLBindingAccess
See: https://developer.apple.com/documentation/Metal/MTLBinding/access
func (MTLTextureBindingObject) ArrayLength ¶
func (o MTLTextureBindingObject) ArrayLength() uint
See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/arrayLength
func (MTLTextureBindingObject) BaseObject ¶
func (o MTLTextureBindingObject) BaseObject() objectivec.Object
func (MTLTextureBindingObject) Index ¶
func (o MTLTextureBindingObject) Index() uint
See: https://developer.apple.com/documentation/Metal/MTLBinding/index
func (MTLTextureBindingObject) IsArgument ¶
func (o MTLTextureBindingObject) IsArgument() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isArgument
func (MTLTextureBindingObject) IsDepthTexture ¶
func (o MTLTextureBindingObject) IsDepthTexture() bool
See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/isDepthTexture
func (MTLTextureBindingObject) IsUsed ¶
func (o MTLTextureBindingObject) IsUsed() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isUsed
func (MTLTextureBindingObject) Name ¶
func (o MTLTextureBindingObject) Name() string
See: https://developer.apple.com/documentation/Metal/MTLBinding/name
func (MTLTextureBindingObject) TextureDataType ¶
func (o MTLTextureBindingObject) TextureDataType() MTLDataType
See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/textureDataType
func (MTLTextureBindingObject) TextureType ¶
func (o MTLTextureBindingObject) TextureType() MTLTextureType
See: https://developer.apple.com/documentation/Metal/MTLTextureBinding/textureType
func (MTLTextureBindingObject) Type ¶
func (o MTLTextureBindingObject) Type() MTLBindingType
See: https://developer.apple.com/documentation/Metal/MTLBinding/type
type MTLTextureCompressionType ¶
type MTLTextureCompressionType int
See: https://developer.apple.com/documentation/Metal/MTLTextureCompressionType
const ( MTLTextureCompressionTypeLossless MTLTextureCompressionType = 0 MTLTextureCompressionTypeLossy MTLTextureCompressionType = 1 )
func (MTLTextureCompressionType) String ¶
func (e MTLTextureCompressionType) String() string
type MTLTextureDescriptor ¶
type MTLTextureDescriptor struct {
objectivec.Object
}
An instance that you use to configure new Metal texture instances.
Overview ¶
To create a new texture, first create an MTLTextureDescriptor instance and set its property values. Then, call either the [NewTextureWithDescriptor] or [NewTextureWithDescriptorIosurfacePlane] method of an MTLDevice instance, or the [NewTextureWithDescriptorOffsetBytesPerRow] method of an MTLBuffer instance.
When you create a texture, Metal copies property values from the descriptor into the new texture. You can reuse an MTLTextureDescriptor instance, modifying its property values as needed, to create more MTLTexture instances, without affecting any textures you already created.
Specifying texture attributes ¶
- MTLTextureDescriptor.TextureType: The dimension and arrangement of texture image data.
- MTLTextureDescriptor.SetTextureType
- MTLTextureDescriptor.PixelFormat: The size and bit layout of all pixels in the texture.
- MTLTextureDescriptor.SetPixelFormat
- MTLTextureDescriptor.Width: The width of the texture image for the base level mipmap, in pixels.
- MTLTextureDescriptor.SetWidth
- MTLTextureDescriptor.Height: The height of the texture image for the base level mipmap, in pixels.
- MTLTextureDescriptor.SetHeight
- MTLTextureDescriptor.Depth: The depth of the texture image for the base level mipmap, in pixels.
- MTLTextureDescriptor.SetDepth
- MTLTextureDescriptor.MipmapLevelCount: The number of mipmap levels for this texture.
- MTLTextureDescriptor.SetMipmapLevelCount
- MTLTextureDescriptor.SampleCount: The number of samples in each fragment.
- MTLTextureDescriptor.SetSampleCount
- MTLTextureDescriptor.ArrayLength: The number of array elements for this texture.
- MTLTextureDescriptor.SetArrayLength
- MTLTextureDescriptor.ResourceOptions: The behavior of a new memory allocation.
- MTLTextureDescriptor.SetResourceOptions
- MTLTextureDescriptor.CpuCacheMode: The CPU cache mode used for the CPU mapping of the texture.
- MTLTextureDescriptor.SetCpuCacheMode
- MTLTextureDescriptor.StorageMode: The location and access permissions of the texture.
- MTLTextureDescriptor.SetStorageMode
- MTLTextureDescriptor.HazardTrackingMode: The texture’s hazard tracking mode.
- MTLTextureDescriptor.SetHazardTrackingMode
- MTLTextureDescriptor.AllowGPUOptimizedContents: A Boolean value indicating whether the GPU is allowed to adjust the texture’s contents to improve GPU performance.
- MTLTextureDescriptor.SetAllowGPUOptimizedContents
- MTLTextureDescriptor.Usage: Options that determine how you can use the texture.
- MTLTextureDescriptor.SetUsage
- MTLTextureDescriptor.Swizzle: The pattern you want the GPU to apply to pixels when you read or sample pixels from the texture.
- MTLTextureDescriptor.SetSwizzle
Instance Properties ¶
- MTLTextureDescriptor.CompressionType
- MTLTextureDescriptor.SetCompressionType
- MTLTextureDescriptor.PlacementSparsePageSize: Determines the page size for a placement sparse texture.
- MTLTextureDescriptor.SetPlacementSparsePageSize
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor
func MTLTextureDescriptorFromID ¶
func MTLTextureDescriptorFromID(id objc.ID) MTLTextureDescriptor
MTLTextureDescriptorFromID constructs a MTLTextureDescriptor from an objc.ID.
An instance that you use to configure new Metal texture instances.
func NewMTLTextureDescriptor ¶
func NewMTLTextureDescriptor() MTLTextureDescriptor
NewMTLTextureDescriptor creates a new MTLTextureDescriptor instance.
func (MTLTextureDescriptor) AllowGPUOptimizedContents ¶
func (t MTLTextureDescriptor) AllowGPUOptimizedContents() bool
A Boolean value indicating whether the GPU is allowed to adjust the texture’s contents to improve GPU performance.
Discussion ¶
The default value is `true`, which means that the Metal device is allowed to adjust the private layout of the texture in memory to improve GPU performance. For a shared or managed texture, this optimization can cause slower performance when accessing the texture from the CPU. Setting this property to `false` improves CPU performance at the cost of some GPU performance.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/allowGPUOptimizedContents
func (MTLTextureDescriptor) ArrayLength ¶
func (t MTLTextureDescriptor) ArrayLength() uint
The number of array elements for this texture.
Discussion ¶
The value of this property needs to be between `1` and `2048`, inclusive. The default value is `1`.
This value is `1` if the texture type is not an array.
This value can be between `1` and `2048` if the texture type is one of the following array types:
- [TextureType1DArray] - [TextureType2DArray] - [TextureType2DMultisampleArray] - [TextureTypeCubeArray]
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/arrayLength
func (MTLTextureDescriptor) Autorelease ¶
func (t MTLTextureDescriptor) Autorelease() MTLTextureDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLTextureDescriptor) CompressionType ¶
func (t MTLTextureDescriptor) CompressionType() MTLTextureCompressionType
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/compressionType
func (MTLTextureDescriptor) CpuCacheMode ¶
func (t MTLTextureDescriptor) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode used for the CPU mapping of the texture.
Discussion ¶
The default value is [CPUCacheModeDefaultCache].
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/cpuCacheMode
func (MTLTextureDescriptor) Depth ¶
func (t MTLTextureDescriptor) Depth() uint
The depth of the texture image for the base level mipmap, in pixels.
Discussion ¶
The default value is `1`. The value needs to be greater than or equal to `1`. For 1D, 2D, and cube textures, the value needs to be `1`.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/depth
func (MTLTextureDescriptor) HazardTrackingMode ¶
func (t MTLTextureDescriptor) HazardTrackingMode() MTLHazardTrackingMode
The texture’s hazard tracking mode.
Discussion ¶
The default value is [HazardTrackingModeDefault].
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/hazardTrackingMode
func (MTLTextureDescriptor) Height ¶
func (t MTLTextureDescriptor) Height() uint
The height of the texture image for the base level mipmap, in pixels.
Discussion ¶
The default value is `1`. The value needs to be greater than or equal to `1`. For a 1D texture, the value needs to be `1`.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/height
func (MTLTextureDescriptor) Init ¶
func (t MTLTextureDescriptor) Init() MTLTextureDescriptor
Init initializes the instance.
func (MTLTextureDescriptor) MipmapLevelCount ¶
func (t MTLTextureDescriptor) MipmapLevelCount() uint
The number of mipmap levels for this texture.
Discussion ¶
The default value is `1`. For a buffer-backed or multisample textures, the value needs to be `1`.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/mipmapLevelCount
func (MTLTextureDescriptor) PixelFormat ¶
func (t MTLTextureDescriptor) PixelFormat() MTLPixelFormat
The size and bit layout of all pixels in the texture.
Discussion ¶
The default value is MTLPixelFormatRGBA8Unorm.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/pixelFormat
func (MTLTextureDescriptor) PlacementSparsePageSize ¶
func (t MTLTextureDescriptor) PlacementSparsePageSize() MTLSparsePageSize
Determines the page size for a placement sparse texture.
Discussion ¶
Set this property to a non-zero value to create a .
Placement sparse textures are instances of MTLTexture that you assign memory to using a MTLHeap instance of type [HeapTypePlacement] and a [MaxCompatiblePlacementSparsePageSize] at least as large as the MTLSparsePageSize value you assign to this property.
This value is 0 by default.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/placementSparsePageSize
func (MTLTextureDescriptor) ResourceOptions ¶
func (t MTLTextureDescriptor) ResourceOptions() MTLResourceOptions
The behavior of a new memory allocation.
Discussion ¶
This property only has an effect when you are allocating a new texture. If you are creating a texture whose data comes from another MTLResource object, this property value is ignored, and the value of the original resource is used instead.
The value of this property aggregates the values of [StorageMode], [CpuCacheMode], and [HazardTrackingMode]. If you modify this property, the other properties also change, and vice versa.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/resourceOptions
func (MTLTextureDescriptor) SampleCount ¶
func (t MTLTextureDescriptor) SampleCount() uint
The number of samples in each fragment.
Discussion ¶
The default value is `1`. If [TextureType] is not [TextureType2DMultisample] or [TextureType2DMultisampleArray], this value needs to be `1`.
Support for different sample count values varies by device. Call the [SupportsTextureSampleCount] method to determine if your desired sample count value is supported.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/sampleCount
func (MTLTextureDescriptor) SetAllowGPUOptimizedContents ¶
func (t MTLTextureDescriptor) SetAllowGPUOptimizedContents(value bool)
func (MTLTextureDescriptor) SetArrayLength ¶
func (t MTLTextureDescriptor) SetArrayLength(value uint)
func (MTLTextureDescriptor) SetCompressionType ¶
func (t MTLTextureDescriptor) SetCompressionType(value MTLTextureCompressionType)
func (MTLTextureDescriptor) SetCpuCacheMode ¶
func (t MTLTextureDescriptor) SetCpuCacheMode(value MTLCPUCacheMode)
func (MTLTextureDescriptor) SetDepth ¶
func (t MTLTextureDescriptor) SetDepth(value uint)
func (MTLTextureDescriptor) SetHazardTrackingMode ¶
func (t MTLTextureDescriptor) SetHazardTrackingMode(value MTLHazardTrackingMode)
func (MTLTextureDescriptor) SetHeight ¶
func (t MTLTextureDescriptor) SetHeight(value uint)
func (MTLTextureDescriptor) SetMipmapLevelCount ¶
func (t MTLTextureDescriptor) SetMipmapLevelCount(value uint)
func (MTLTextureDescriptor) SetPixelFormat ¶
func (t MTLTextureDescriptor) SetPixelFormat(value MTLPixelFormat)
func (MTLTextureDescriptor) SetPlacementSparsePageSize ¶
func (t MTLTextureDescriptor) SetPlacementSparsePageSize(value MTLSparsePageSize)
func (MTLTextureDescriptor) SetResourceOptions ¶
func (t MTLTextureDescriptor) SetResourceOptions(value MTLResourceOptions)
func (MTLTextureDescriptor) SetSampleCount ¶
func (t MTLTextureDescriptor) SetSampleCount(value uint)
func (MTLTextureDescriptor) SetStorageMode ¶
func (t MTLTextureDescriptor) SetStorageMode(value MTLStorageMode)
func (MTLTextureDescriptor) SetSwizzle ¶
func (t MTLTextureDescriptor) SetSwizzle(value MTLTextureSwizzleChannels)
func (MTLTextureDescriptor) SetTextureType ¶
func (t MTLTextureDescriptor) SetTextureType(value MTLTextureType)
func (MTLTextureDescriptor) SetUsage ¶
func (t MTLTextureDescriptor) SetUsage(value MTLTextureUsage)
func (MTLTextureDescriptor) SetWidth ¶
func (t MTLTextureDescriptor) SetWidth(value uint)
func (MTLTextureDescriptor) StorageMode ¶
func (t MTLTextureDescriptor) StorageMode() MTLStorageMode
The location and access permissions of the texture.
Discussion ¶
In iOS and tvOS, the default value is [StorageModeShared]. In macOS, the default value is [StorageModeManaged].
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/storageMode
func (MTLTextureDescriptor) Swizzle ¶
func (t MTLTextureDescriptor) Swizzle() MTLTextureSwizzleChannels
The pattern you want the GPU to apply to pixels when you read or sample pixels from the texture.
Discussion ¶
The default value does not apply a transformation to pixels sampled or read from the texture.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/swizzle
func (MTLTextureDescriptor) TextureType ¶
func (t MTLTextureDescriptor) TextureType() MTLTextureType
The dimension and arrangement of texture image data.
Discussion ¶
The default value is [MTLTexture2D].
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/textureType
func (MTLTextureDescriptor) Usage ¶
func (t MTLTextureDescriptor) Usage() MTLTextureUsage
Options that determine how you can use the texture.
Discussion ¶
The default value for this property is [TextureUsageShaderRead]. If the given texture has multiple uses in your app, you can combine multiple usage options for that texture. After you set a texture’s usage options, you can use it only in the ways that you specified.
Metal can optimize operations for a given texture, based on its intended use. Set explicit usage options for a texture, if you know them in advance, before you use the texture. Only set usage options that correspond to a texture’s intended use.
In iOS devices with GPU family 5, Metal doesn’t apply lossless compression to a given texture if you set any of these options:
- [TextureUsageUnknown] - [TextureUsageShaderWrite] - [TextureUsagePixelFormatView]
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/usage
func (MTLTextureDescriptor) Width ¶
func (t MTLTextureDescriptor) Width() uint
The width of the texture image for the base level mipmap, in pixels.
Discussion ¶
The default value is `1`. The value needs to be greater than or equal to `1`.
See: https://developer.apple.com/documentation/Metal/MTLTextureDescriptor/width
type MTLTextureDescriptorClass ¶
type MTLTextureDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLTextureDescriptorClass ¶
func GetMTLTextureDescriptorClass() MTLTextureDescriptorClass
GetMTLTextureDescriptorClass returns the class object for MTLTextureDescriptor.
func (MTLTextureDescriptorClass) Alloc ¶
func (mc MTLTextureDescriptorClass) Alloc() MTLTextureDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLTextureDescriptorClass) Texture2DDescriptorWithPixelFormatWidthHeightMipmapped ¶
func (_MTLTextureDescriptorClass MTLTextureDescriptorClass) Texture2DDescriptorWithPixelFormatWidthHeightMipmapped(pixelFormat MTLPixelFormat, width uint, height uint, mipmapped bool) MTLTextureDescriptor
Creates a texture descriptor object for a 2D texture.
pixelFormat: The format describing how every pixel on the texture image is stored. The default value is [PixelFormatRGBA8Unorm].
width: The width of the 2D texture image. The value needs to be greater than or equal to `1`.
height: The height of the 2D texture image. The value needs to be greater than or equal to `1`.
mipmapped: A Boolean indicating whether the resulting image should be mipmapped. If [true], then the [MipmapLevelCount] property in the returned descriptor is computed from `width` and `height`. If [false], then [MipmapLevelCount] is `1`. // [false]: https://developer.apple.com/documentation/Swift/false [true]: https://developer.apple.com/documentation/Swift/true
Return Value ¶
A pointer to a texture descriptor object for a 2D texture.
func (MTLTextureDescriptorClass) TextureBufferDescriptorWithPixelFormatWidthResourceOptionsUsage ¶
func (_MTLTextureDescriptorClass MTLTextureDescriptorClass) TextureBufferDescriptorWithPixelFormatWidthResourceOptionsUsage(pixelFormat MTLPixelFormat, width uint, resourceOptions MTLResourceOptions, usage MTLTextureUsage) MTLTextureDescriptor
Creates a texture descriptor object for a texture buffer.
pixelFormat: The format describing how every pixel on the texture buffer is stored. The default value is [PixelFormatRGBA8Unorm].
width: The width of the texture buffer. The value needs to be greater than or equal to `1`.
resourceOptions: The access options to use for the new texture buffer.
usage: The allowed usage of the new texture buffer.
Return Value ¶
A pointer to a texture descriptor object for a texture buffer.
func (MTLTextureDescriptorClass) TextureCubeDescriptorWithPixelFormatSizeMipmapped ¶
func (_MTLTextureDescriptorClass MTLTextureDescriptorClass) TextureCubeDescriptorWithPixelFormatSizeMipmapped(pixelFormat MTLPixelFormat, size uint, mipmapped bool) MTLTextureDescriptor
Creates a texture descriptor object for a cube texture.
pixelFormat: The format describing how every pixel on the texture image is stored. The default value is [PixelFormatRGBA8Unorm].
size: The width and height of each slice of the cube texture. The value needs to be greater than or equal to `1`.
mipmapped: A Boolean indicating whether the resulting image should be mipmapped. If [true], then the [MipmapLevelCount] property in the returned descriptor is computed from `width` and `height`. If [false], then [MipmapLevelCount] is `1`. // [false]: https://developer.apple.com/documentation/Swift/false [true]: https://developer.apple.com/documentation/Swift/true
Return Value ¶
A pointer to a texture descriptor object for a cube texture.
Discussion ¶
For a cube texture, the property values describe one slice, which is any one of its six sides. Each slice is a square.
type MTLTextureObject ¶
type MTLTextureObject struct {
objectivec.Object
}
MTLTextureObject wraps an existing Objective-C object that conforms to the MTLTexture protocol.
func MTLTextureObjectFromID ¶
func MTLTextureObjectFromID(id objc.ID) MTLTextureObject
MTLTextureObjectFromID constructs a MTLTextureObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLTextureObject) AllocatedSize ¶
func (o MTLTextureObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLTextureObject) AllowGPUOptimizedContents ¶
func (o MTLTextureObject) AllowGPUOptimizedContents() bool
A Boolean value indicating whether the GPU is allowed to adjust the contents of the texture to improve GPU performance.
See: https://developer.apple.com/documentation/Metal/MTLTexture/allowGPUOptimizedContents
func (MTLTextureObject) ArrayLength ¶
func (o MTLTextureObject) ArrayLength() uint
The number of slices in the texture array.
See: https://developer.apple.com/documentation/Metal/MTLTexture/arrayLength
func (MTLTextureObject) BaseObject ¶
func (o MTLTextureObject) BaseObject() objectivec.Object
func (MTLTextureObject) Buffer ¶
func (o MTLTextureObject) Buffer() MTLBuffer
The source buffer used to create this texture, if any.
See: https://developer.apple.com/documentation/Metal/MTLTexture/buffer
func (MTLTextureObject) BufferBytesPerRow ¶
func (o MTLTextureObject) BufferBytesPerRow() uint
The number of bytes in each row of the texture’s source buffer.
See: https://developer.apple.com/documentation/Metal/MTLTexture/bufferBytesPerRow
func (MTLTextureObject) BufferOffset ¶
func (o MTLTextureObject) BufferOffset() uint
The offset in the source buffer where the texture’s data comes from.
See: https://developer.apple.com/documentation/Metal/MTLTexture/bufferOffset
func (MTLTextureObject) CompressionType ¶
func (o MTLTextureObject) CompressionType() MTLTextureCompressionType
See: https://developer.apple.com/documentation/Metal/MTLTexture/compressionType
func (MTLTextureObject) CpuCacheMode ¶
func (o MTLTextureObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLTextureObject) Depth ¶
func (o MTLTextureObject) Depth() uint
The depth of the texture image for the base level mipmap, in pixels.
See: https://developer.apple.com/documentation/Metal/MTLTexture/depth
func (MTLTextureObject) Device ¶
func (o MTLTextureObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLTextureObject) FirstMipmapInTail ¶
func (o MTLTextureObject) FirstMipmapInTail() uint
The index of the first mipmap in the tail.
See: https://developer.apple.com/documentation/Metal/MTLTexture/firstMipmapInTail
func (MTLTextureObject) GetBytesBytesPerRowBytesPerImageFromRegionMipmapLevelSlice ¶
func (o MTLTextureObject) GetBytesBytesPerRowBytesPerImageFromRegionMipmapLevelSlice(pixelBytes unsafe.Pointer, bytesPerRow uint, bytesPerImage uint, region MTLRegion, level uint, slice uint)
Copies pixel data from the texture to a buffer in system memory.
pixelBytes: A pointer to a destination buffer in system memory.
bytesPerRow: The number of bytes () between two adjacent rows of pixel data in the destination buffer. For [TextureType1D] and [TextureType1DArray], use `0`. For raw and packed pixel types, the stride is the number of pixels in one row. For compressed pixel formats, the stride is the number of bytes from the beginning of one row of blocks to the beginning of the next.
Your data type determines how you should compute `bytesPerRow`:
- For raw or packed pixel data, use a multiple of the pixel size less than [max] `* pixel size`. - For compressed pixel data, use a multiple of the compression block size. When working with PowerVR Texture Compression (PVRTC), use `0.`
Nonzero values smaller than the texture width or any values not a multiple of the pixel or block size cause an error. // [max]: https://developer.apple.com/documentation/Swift/Int32/max
bytesPerImage: The stride between adjacent images in the destination buffer.
region: The location of a block of pixels in the texture slice. For textures compressed as PVRTC, use the entire texture for the region.
level: A zero-indexed value that selects the texture’s mipmap level as the method’s data source. Use `0` for textures that don’t have mipmaps.
slice: A zero-indexed value specifying the destination texture slice:
- For a cube texture, `slice` is a value between `0` and `5`, inclusive, that defines which cube face is the source. - For a texture array, `slice` is the element index. - For a cube texture array, slice defines both the cube face and an array index. To determine the correct slice for a cube texture array, treat it as having a stride of `6`: `slice = cubeFace + arrayIndex * 6.` - For all other texture types, use `0`.
Discussion ¶
This method runs on the CPU and immediately copies the pixel data from the texture to system memory, but it doesn’t synchronize with any GPU texture memory operations. Ensure all operations that write or render to the texture complete before reading the texture’s contents using one of the following methods:
- Synchronize on the GPU with a [SynchronizeResource] or [SynchronizeTextureSliceLevel] command in an MTLBlitCommandEncoder. - Synchronize on the CPU with a callback passed to the [AddCompletedHandler] method to handle completion asynchronously, or the [WaitUntilCompleted] method to block thread execution until the GPU work completes.
For multisample textures, the method consecutively positions each sample within a pixel in memory and treats the pixels as part of one row.
func (MTLTextureObject) GetBytesBytesPerRowFromRegionMipmapLevel ¶
func (o MTLTextureObject) GetBytesBytesPerRowFromRegionMipmapLevel(pixelBytes unsafe.Pointer, bytesPerRow uint, region MTLRegion, level uint)
Copies pixel data from the first slice of the texture to a buffer in system memory.
pixelBytes: A pointer to a destination buffer in system memory.
bytesPerRow: The number of bytes () between two adjacent rows of pixel data in the destination buffer. For [TextureType1D] and [TextureType1DArray], use `0`. For raw and packed pixel types, the stride is the number of pixels in one row. For compressed pixel formats, the stride is the number of bytes from the beginning of one row of blocks to the beginning of the next.
Your data type determines how you should compute `bytesPerRow`:
- For raw or packed pixel data, use a multiple of the pixel size less than [max] `* pixel size`. - For compressed pixel data, use a multiple of the compression block size. When working with PowerVR Texture Compression (PVRTC), use `0.`
Nonzero values smaller than the texture width or any values not a multiple of the pixel or block size cause an error. // [max]: https://developer.apple.com/documentation/Swift/Int32/max
region: The location of a block of pixels in the texture slice. For textures compressed as PVRTC, use the entire texture for the region.
level: A zero-indexed value that selects the texture’s mipmap level as the method’s data source. Use `0` for textures that don’t have mipmaps.
Discussion ¶
This method runs on the CPU and immediately copies the pixel data from the texture to system memory, but it doesn’t synchronize with any GPU texture memory operations. Ensure all operations that write or render to the texture complete before reading the texture’s contents using one of the following methods:
- Synchronize on the GPU with a [SynchronizeResource] or [SynchronizeTextureSliceLevel] command in an MTLBlitCommandEncoder. - Synchronize on the CPU with a callback passed to the [AddCompletedHandler] method to handle completion asynchronously, or the [WaitUntilCompleted] method to block thread execution until the GPU work completes.
For multisample textures, the method consecutively positions each sample within a pixel in memory and treats the pixels as part of one row.
See: https://developer.apple.com/documentation/Metal/MTLTexture/getBytes(_:bytesPerRow:from:mipmapLevel:)
func (MTLTextureObject) GpuResourceID ¶
func (o MTLTextureObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLTexture/gpuResourceID
func (MTLTextureObject) HazardTrackingMode ¶
func (o MTLTextureObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLTextureObject) Heap ¶
func (o MTLTextureObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLTextureObject) HeapOffset ¶
func (o MTLTextureObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLTextureObject) Height ¶
func (o MTLTextureObject) Height() uint
The height of the texture image for the base level mipmap, in pixels.
See: https://developer.apple.com/documentation/Metal/MTLTexture/height
func (MTLTextureObject) Iosurface ¶
func (o MTLTextureObject) Iosurface() iosurface.IOSurfaceRef
A reference to the underlying surface instance for the texture, if applicable.
See: https://developer.apple.com/documentation/Metal/MTLTexture/iosurface
func (MTLTextureObject) IosurfacePlane ¶
func (o MTLTextureObject) IosurfacePlane() uint
The number of a plane within the underlying surface instance for the texture, if applicable.
See: https://developer.apple.com/documentation/Metal/MTLTexture/iosurfacePlane
func (MTLTextureObject) IsAliasable ¶
func (o MTLTextureObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLTextureObject) IsFramebufferOnly ¶
func (o MTLTextureObject) IsFramebufferOnly() bool
A Boolean value that indicates whether the texture can only be used as a render target.
See: https://developer.apple.com/documentation/Metal/MTLTexture/isFramebufferOnly
func (MTLTextureObject) IsShareable ¶
func (o MTLTextureObject) IsShareable() bool
A Boolean indicating whether this texture can be shared with other processes.
See: https://developer.apple.com/documentation/Metal/MTLTexture/isShareable
func (MTLTextureObject) IsSparse ¶
func (o MTLTextureObject) IsSparse() bool
A Boolean value that indicates whether this is a sparse texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/isSparse
func (MTLTextureObject) Label ¶
func (o MTLTextureObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLTextureObject) MakeAliasable ¶
func (o MTLTextureObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLTextureObject) MipmapLevelCount ¶
func (o MTLTextureObject) MipmapLevelCount() uint
The number of mipmap levels in the texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/mipmapLevelCount
func (MTLTextureObject) NewRemoteTextureViewForDevice ¶
func (o MTLTextureObject) NewRemoteTextureViewForDevice(device MTLDevice) MTLTexture
Creates a remote texture view for another GPU in the same peer group.
Discussion ¶
The device instance that created this texture and the device instance passed into this method need to have the same nonzero peer group identifier (peerGroupID). This texture needs to either use the private storage mode ([StorageModePrivate]) or be backed by an IOSurface.
A remote view doesn’t allocate any storage for the new texture; it references the memory allocated for the original texture. You can use remote views only as a source for copy commands encoded by an MTLBlitCommandEncoder. For more information, see Transferring data between connected GPUs.
See: https://developer.apple.com/documentation/Metal/MTLTexture/makeRemoteTextureView(_:)
func (MTLTextureObject) NewSharedTextureHandle ¶
func (o MTLTextureObject) NewSharedTextureHandle() IMTLSharedTextureHandle
Creates a new texture handle from a shareable texture.
Discussion ¶
If the texture is not shareable, this method returns `nil`.
See: https://developer.apple.com/documentation/Metal/MTLTexture/makeSharedTextureHandle()
func (MTLTextureObject) NewTextureViewWithDescriptor ¶
func (o MTLTextureObject) NewTextureViewWithDescriptor(descriptor IMTLTextureViewDescriptor) MTLTexture
Discussion ¶
Create a new texture which shares the same storage as the source texture, but with different (but compatible) properties specified by the descriptor
See: https://developer.apple.com/documentation/Metal/MTLTexture/newTextureView(with:)
func (MTLTextureObject) NewTextureViewWithPixelFormat ¶
func (o MTLTextureObject) NewTextureViewWithPixelFormat(pixelFormat MTLPixelFormat) MTLTexture
Creates a new view of the texture, reinterpreting its data using a different pixel format.
pixelFormat: A new pixel format, which needs to be compatible with the original pixel format.
Return Value ¶
A new texture object that shares the same storage allocation of the texture.
Discussion ¶
When you create a texture normally, Metal allocates memory for the textureʼs pixel data. These storage allocations can be quite large. You can reduce memory use and avoid copying texture data by using a —a texture object that shares another textureʼs storage allocation, reinterpreting the pixel data in some other format.
Not all pixel formats are compatible with one another. Reinterpretation of image data between pixel formats is supported within the following groups:
- All 8-, 16-, 32-, 64-, and 128-bit color formats are compatible with other formats with the same bit length. - sRGB and non-sRGB forms of the same compressed format (for example, [PixelFormatBC1_RGBA] and [PixelFormatBC1_RGBA_sRGB]) - Combined depth-stencil texture formats and the related format used to access the stencil from a shader (for example, [PixelFormatDepth24Unorm_Stencil8] and [PixelFormatX24_Stencil8])
This method doesn’t change the original texture image data in any way, but it may drastically change how the data is interpreted. For example, given a texture with the [PixelFormatRG16Uint] pixel format that contains image data for Red `0xFFFE` and Green `0x0001`, this method would reinterpret that data in an [PixelFormatR32Uint] format as Red `0x0001FFFE`.
Some format reinterpretations are supported but may not be useful. For example, this method considers the 32-bit packed color formats [PixelFormatBGR10A2Unorm] and [DataTypeRG11B10Float] to be compatible, but it’s unlikely that the same data can be interpreted by both formats in a meaningful way.
Some format reinterpretations require you to create the source texture with a special usage flag. Set that flag only when necessary, as it can affect performance. For more details, see [TextureUsagePixelFormatView].
See: https://developer.apple.com/documentation/Metal/MTLTexture/makeTextureView(pixelFormat:)
func (MTLTextureObject) NewTextureViewWithPixelFormatTextureTypeLevelsSlices ¶
func (o MTLTextureObject) NewTextureViewWithPixelFormatTextureTypeLevelsSlices(pixelFormat MTLPixelFormat, textureType MTLTextureType, levelRange foundation.NSRange, sliceRange foundation.NSRange) MTLTexture
Creates a new view of the texture, reinterpreting a subset of its data using a different type and pixel format.
pixelFormat: A new pixel format, which needs to be compatible with the original pixel format.
textureType: A new texture type, which can be cast according to the original texture type as listed in the table below.
levelRange: A new base level range that restricts which mipmap levels are visible in the new texture.
sliceRange: A new base slice range that restricts which array slices are visible in the new texture.
Return Value ¶
A new texture object that shares the same storage allocation of the calling texture object.
Discussion ¶
The texture type can be cast between the targets listed in the following table.
[Table data omitted]
The `length` value of the `sliceRange` parameter needs to be `6` if the new texture type value is [TextureTypeCube], or a multiple of `6` if the new texture type value is [TextureTypeCubeArray].
For more information on pixel format restrictions, see [NewTextureViewWithPixelFormat]
func (MTLTextureObject) NewTextureViewWithPixelFormatTextureTypeLevelsSlicesSwizzle ¶
func (o MTLTextureObject) NewTextureViewWithPixelFormatTextureTypeLevelsSlicesSwizzle(pixelFormat MTLPixelFormat, textureType MTLTextureType, levelRange foundation.NSRange, sliceRange foundation.NSRange, swizzle MTLTextureSwizzleChannels) MTLTexture
Creates a new view of the texture, reinterpreting a subset of its data using a different type, pixel format, and swizzle pattern.
pixelFormat: A new pixel format, which needs to be compatible with the original pixel format.
textureType: A new texture type.
levelRange: A new base level range that restricts which mipmap levels are visible in the new texture.
sliceRange: A new base slice range that restricts which array slices are visible in the new texture.
swizzle: The swizzle pattern the GPU uses to reorder the data when sampling or reading the texture.
Return Value ¶
A new texture view.
Discussion ¶
For more information on texture views, see [NewTextureViewWithPixelFormatTextureTypeLevelsSlices].
The swizzle pattern of the view is combined with that of the parent texture to generate the final swizzle pattern. For example: An `[R,G,A,B]` swizzle of a texture with a `[R,1,1,G]` swizzle pattern is `[R,1,G,1]`.
func (MTLTextureObject) ParentRelativeLevel ¶
func (o MTLTextureObject) ParentRelativeLevel() uint
The base level of the parent texture used to create this texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/parentRelativeLevel
func (MTLTextureObject) ParentRelativeSlice ¶
func (o MTLTextureObject) ParentRelativeSlice() uint
The base slice of the parent texture used to create this texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/parentRelativeSlice
func (MTLTextureObject) ParentTexture ¶
func (o MTLTextureObject) ParentTexture() MTLTexture
The parent texture used to create this texture, if any.
See: https://developer.apple.com/documentation/Metal/MTLTexture/parent
func (MTLTextureObject) PixelFormat ¶
func (o MTLTextureObject) PixelFormat() MTLPixelFormat
The format of pixels in the texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/pixelFormat
func (MTLTextureObject) RemoteStorageTexture ¶
func (o MTLTextureObject) RemoteStorageTexture() MTLTexture
The texture on another GPU that the texture was created from, if any.
See: https://developer.apple.com/documentation/Metal/MTLTexture/remoteStorageTexture
func (MTLTextureObject) ReplaceRegionMipmapLevelSliceWithBytesBytesPerRowBytesPerImage ¶
func (o MTLTextureObject) ReplaceRegionMipmapLevelSliceWithBytesBytesPerRowBytesPerImage(region MTLRegion, level uint, slice uint, pixelBytes unsafe.Pointer, bytesPerRow uint, bytesPerImage uint)
Copies pixel data into a section of a texture slice.
region: The location of a block of pixels in the texture slice. The region needs to be within the dimensions of the slice.
level: A zero-indexed value that specifies which mipmap level is the destination. If the texture doesn’t have mipmaps, use `0`.
slice: A zero-indexed value that specifies which texture slice is the destination:
- For a cube texture, `slice` is a value between `0` and `5`, inclusive, that defines which cube face is the destination. - For a texture array, `slice` is the element index. - For a cube texture array, slice defines both the cube face and an array index. To determine the correct slice for a cube texture array, treat it as having a stride of `6`: `slice = cubeFace + arrayIndex * 6.` - For all other texture types, use `0`.
pixelBytes: A pointer to the bytes in memory to copy.
bytesPerRow: The stride, in bytes, of one row in the source data. For [TextureType1D] and [TextureType1DArray], use `0`. For raw and packed pixel types, the stride is the number of pixels in one row. For compressed pixel formats, the stride is the number of bytes from the beginning of one row of blocks to the beginning of the next. When source data consists of only a single row, use `0`.
Your data type determines how you should compute `bytesPerRow`:
- For raw or packed pixel data, use a value greater than or equal to the size of data in one row, and less than `32767 * pixel size`. - For compressed pixel data, use a multiple of the compression block size. When working with PowerVR Texture Compression (PVRTC), use `0.`
Nonzero values smaller than the texture width or not a multiple of the pixel size cause an error.
bytesPerImage: The stride, in bytes, between images in the source data. Supply a nonzero value only when you copy data to an [TextureType3D] type texture. Your data type determines how you should compute `bytesPerImage`:
- For data that consists only of a single image, use `0`. - For ordinary or packed pixel formats, use a multiple of pixel size. - For compressed pixel data, use a multiple of the compression block size. When working with PVRTC, use `0`.
When copying data to a type of texture other than [TextureType3D], use `0`.
Discussion ¶
This method runs on the CPU and immediately copies the pixel data into the texture. It doesn’t synchronize against any GPU memory operations to the texture. Ensure all operations that write or render to the texture complete before reading the texture’s contents using one of the following methods:
- Synchronize on the GPU with a [SynchronizeResource] or [SynchronizeTextureSliceLevel] command in an MTLBlitCommandEncoder. - Synchronize on the CPU with a callback passed to the [AddCompletedHandler] method to handle completion asynchronously, or the [WaitUntilCompleted] method to block thread execution until the GPU work completes.
If the texture image has a compressed pixel format, only write to block-aligned regions. If the size of a dimension of region isn’t a multiple of the block size, include both the edge block and additional space up to the texture dimensions in `bytesPerRow`.
To copy your data to a private texture, copy your data to a temporary texture with non-private storage, and then use an MTLBlitCommandEncoder to copy the data to the private texture for GPU use.
func (MTLTextureObject) ReplaceRegionMipmapLevelWithBytesBytesPerRow ¶
func (o MTLTextureObject) ReplaceRegionMipmapLevelWithBytesBytesPerRow(region MTLRegion, level uint, pixelBytes unsafe.Pointer, bytesPerRow uint)
Copies a block of pixels into a section of texture slice 0.
region: The location of a block of pixels in the texture slice. The region needs to be within the dimensions of the slice.
level: A zero-indexed value that specifies which mipmap level is the destination. If the texture doesn’t have mipmaps, use `0`.
pixelBytes: A pointer to the bytes in memory to copy.
bytesPerRow: The stride, in bytes, of one row in the source data. For [TextureType1D] and [TextureType1DArray], use `0`. For raw and packed pixel types, the stride is the number of pixels in one row. For compressed pixel formats, the stride is the number of bytes from the beginning of one row of blocks to the beginning of the next. When source data consists of only a single row, use `0`.
Your data type determines how you should compute `bytesPerRow`:
- For raw or packed pixel data, use a value greater than or equal to the size of data in one row, and less than [max] `* pixel size`. - For compressed pixel data, use a multiple of the compression block size. When working with PowerVR Texture Compression (PVRTC), use `0.`
Nonzero values smaller than the texture width or not a multiple of the pixel size cause an error. // [max]: https://developer.apple.com/documentation/Swift/Int32/max
Discussion ¶
This method runs on the CPU and immediately copies the pixel data into the texture. It doesn’t synchronize against any GPU memory operations to the texture. Ensure all operations that write or render to the texture complete before reading the texture’s contents using one of the following methods:
- Synchronize on the GPU with a [SynchronizeResource] or [SynchronizeTextureSliceLevel] command in an MTLBlitCommandEncoder. - Synchronize on the CPU with a callback passed to the [AddCompletedHandler] method to handle completion asynchronously, or the [WaitUntilCompleted] method to block thread execution until the GPU work completes.
If the texture image has a compressed pixel format, only write to block-aligned regions. If the size of a dimension of region isn’t a multiple of the block size, then include both the edge block and space up to the texture dimensions in `bytesPerRow`.
To copy your data to a private texture, copy your data to a temporary texture with non-private storage, and then use an MTLBlitCommandEncoder to copy the data to the private texture for GPU use.
func (MTLTextureObject) ResourceOptions ¶
func (o MTLTextureObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLTextureObject) RootResource ¶
func (o MTLTextureObject) RootResource() MTLResource
The resource that owns the storage for this texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/rootResource
func (MTLTextureObject) SampleCount ¶
func (o MTLTextureObject) SampleCount() uint
The number of samples in each pixel.
See: https://developer.apple.com/documentation/Metal/MTLTexture/sampleCount
func (MTLTextureObject) SetLabel ¶
func (o MTLTextureObject) SetLabel(value string)
func (MTLTextureObject) SetOwnerWithIdentity ¶
func (o MTLTextureObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLTextureObject) SetPurgeableState ¶
func (o MTLTextureObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLTextureObject) SparseTextureTier ¶
func (o MTLTextureObject) SparseTextureTier() MTLTextureSparseTier
See: https://developer.apple.com/documentation/Metal/MTLTexture/sparseTextureTier
func (MTLTextureObject) StorageMode ¶
func (o MTLTextureObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
func (MTLTextureObject) Swizzle ¶
func (o MTLTextureObject) Swizzle() MTLTextureSwizzleChannels
The pattern that the GPU applies to pixels when you read or sample pixels from the texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/swizzle
func (MTLTextureObject) TailSizeInBytes ¶
func (o MTLTextureObject) TailSizeInBytes() uint
The size of the sparse texture tail, in bytes.
See: https://developer.apple.com/documentation/Metal/MTLTexture/tailSizeInBytes
func (MTLTextureObject) TextureType ¶
func (o MTLTextureObject) TextureType() MTLTextureType
The dimension and arrangement of the texture image data.
See: https://developer.apple.com/documentation/Metal/MTLTexture/textureType
func (MTLTextureObject) Usage ¶
func (o MTLTextureObject) Usage() MTLTextureUsage
Options that determine how you can use the texture.
See: https://developer.apple.com/documentation/Metal/MTLTexture/usage
func (MTLTextureObject) Width ¶
func (o MTLTextureObject) Width() uint
The width of the texture image for the base level mipmap, in pixels.
See: https://developer.apple.com/documentation/Metal/MTLTexture/width
type MTLTextureReferenceType ¶
type MTLTextureReferenceType struct {
MTLType
}
A description of a texture.
Describing the texture ¶
- MTLTextureReferenceType.TextureType: The texture type of the texture.
- MTLTextureReferenceType.TextureDataType: The data type of the texture.
- MTLTextureReferenceType.Access: The texture’s read/write access to the argument.
- MTLTextureReferenceType.IsDepthTexture: A Boolean value that indicates whether the texture is a depth texture.
See: https://developer.apple.com/documentation/Metal/MTLTextureReferenceType
func MTLTextureReferenceTypeFromID ¶
func MTLTextureReferenceTypeFromID(id objc.ID) MTLTextureReferenceType
MTLTextureReferenceTypeFromID constructs a MTLTextureReferenceType from an objc.ID.
A description of a texture.
func NewMTLTextureReferenceType ¶
func NewMTLTextureReferenceType() MTLTextureReferenceType
NewMTLTextureReferenceType creates a new MTLTextureReferenceType instance.
func (MTLTextureReferenceType) Access ¶
func (t MTLTextureReferenceType) Access() MTLBindingAccess
The texture’s read/write access to the argument.
Discussion ¶
This property indicates the type of access qualifiers (read-only, write-only, or read-write) used in the Metal shading language code. For information on possible values, see MTLArgumentAccess.
See: https://developer.apple.com/documentation/Metal/MTLTextureReferenceType/access
func (MTLTextureReferenceType) Autorelease ¶
func (t MTLTextureReferenceType) Autorelease() MTLTextureReferenceType
Autorelease adds the receiver to the current autorelease pool.
func (MTLTextureReferenceType) Init ¶
func (t MTLTextureReferenceType) Init() MTLTextureReferenceType
Init initializes the instance.
func (MTLTextureReferenceType) IsDepthTexture ¶
func (t MTLTextureReferenceType) IsDepthTexture() bool
A Boolean value that indicates whether the texture is a depth texture.
See: https://developer.apple.com/documentation/Metal/MTLTextureReferenceType/isDepthTexture
func (MTLTextureReferenceType) TextureDataType ¶
func (t MTLTextureReferenceType) TextureDataType() MTLDataType
The data type of the texture.
See: https://developer.apple.com/documentation/Metal/MTLTextureReferenceType/textureDataType
func (MTLTextureReferenceType) TextureType ¶
func (t MTLTextureReferenceType) TextureType() MTLTextureType
The texture type of the texture.
See: https://developer.apple.com/documentation/Metal/MTLTextureReferenceType/textureType
type MTLTextureReferenceTypeClass ¶
type MTLTextureReferenceTypeClass struct {
// contains filtered or unexported fields
}
func GetMTLTextureReferenceTypeClass ¶
func GetMTLTextureReferenceTypeClass() MTLTextureReferenceTypeClass
GetMTLTextureReferenceTypeClass returns the class object for MTLTextureReferenceType.
func (MTLTextureReferenceTypeClass) Alloc ¶
func (mc MTLTextureReferenceTypeClass) Alloc() MTLTextureReferenceType
Alloc allocates memory for a new instance of the class.
type MTLTextureSparseTier ¶
type MTLTextureSparseTier int
See: https://developer.apple.com/documentation/Metal/MTLTextureSparseTier
const ( // MTLTextureSparseTier1: Indicates support for sparse textures tier 1. MTLTextureSparseTier1 MTLTextureSparseTier = 1 // MTLTextureSparseTier2: Indicates support for sparse textures tier 2. MTLTextureSparseTier2 MTLTextureSparseTier = 2 // MTLTextureSparseTierNone: Indicates that the texture is not sparse. MTLTextureSparseTierNone MTLTextureSparseTier = 0 )
func (MTLTextureSparseTier) String ¶
func (e MTLTextureSparseTier) String() string
type MTLTextureSwizzle ¶
type MTLTextureSwizzle int
See: https://developer.apple.com/documentation/Metal/MTLTextureSwizzle
const ( // MTLTextureSwizzleAlpha: The alpha channel of the source pixel is copied to the destination channel. MTLTextureSwizzleAlpha MTLTextureSwizzle = 5 // MTLTextureSwizzleBlue: The blue channel of the source pixel is copied to the destination channel. MTLTextureSwizzleBlue MTLTextureSwizzle = 4 // MTLTextureSwizzleGreen: The green channel of the source pixel is copied to the destination channel. MTLTextureSwizzleGreen MTLTextureSwizzle = 3 // MTLTextureSwizzleOne: A value of `1.0` is copied to the destination channel. MTLTextureSwizzleOne MTLTextureSwizzle = 1 // MTLTextureSwizzleRed: The red channel of the source pixel is copied to the destination channel. MTLTextureSwizzleRed MTLTextureSwizzle = 2 // MTLTextureSwizzleZero: A value of `0.0` is copied to the destination channel. MTLTextureSwizzleZero MTLTextureSwizzle = 0 )
func (MTLTextureSwizzle) String ¶
func (e MTLTextureSwizzle) String() string
type MTLTextureSwizzleChannels ¶
type MTLTextureSwizzleChannels struct {
Red MTLTextureSwizzle // The data copied to the first output channel.
Green MTLTextureSwizzle // The data copied to the second output channel.
Blue MTLTextureSwizzle // The data copied to the third output channel.
Alpha MTLTextureSwizzle // The data copied to the fourth output channel.
}
MTLTextureSwizzleChannels - A pattern that modifies the data read or sampled from a texture by rearranging or duplicating the elements of a vector.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLTextureSwizzleChannels
type MTLTextureType ¶
type MTLTextureType int
See: https://developer.apple.com/documentation/Metal/MTLTextureType
const ( // MTLTextureType1D: A one-dimensional texture image. MTLTextureType1D MTLTextureType = 0 // MTLTextureType1DArray: An array of one-dimensional texture images. MTLTextureType1DArray MTLTextureType = 1 // MTLTextureType2D: A two-dimensional texture image. MTLTextureType2D MTLTextureType = 2 // MTLTextureType2DArray: An array of two-dimensional texture images. MTLTextureType2DArray MTLTextureType = 3 // MTLTextureType2DMultisample: A two-dimensional texture image that uses more than one sample for each pixel. MTLTextureType2DMultisample MTLTextureType = 4 // MTLTextureType2DMultisampleArray: An array of two-dimensional texture images that use more than one sample for each pixel. MTLTextureType2DMultisampleArray MTLTextureType = 8 // MTLTextureType3D: A three-dimensional texture image. MTLTextureType3D MTLTextureType = 7 // MTLTextureTypeCube: A cube texture with six two-dimensional images. MTLTextureTypeCube MTLTextureType = 5 // MTLTextureTypeCubeArray: An array of cube textures, each with six two-dimensional images. MTLTextureTypeCubeArray MTLTextureType = 6 // MTLTextureTypeTextureBuffer: A texture buffer. MTLTextureTypeTextureBuffer MTLTextureType = 9 )
func (MTLTextureType) String ¶
func (e MTLTextureType) String() string
type MTLTextureUsage ¶
type MTLTextureUsage int
See: https://developer.apple.com/documentation/Metal/MTLTextureUsage
const ( // MTLTextureUsagePixelFormatView: An option to create texture views with a different component layout. MTLTextureUsagePixelFormatView MTLTextureUsage = 16 // MTLTextureUsageRenderTarget: An option for rendering to the texture in a render pass. MTLTextureUsageRenderTarget MTLTextureUsage = 4 // MTLTextureUsageShaderAtomic: An option that enables atomic memory operations on texture elements in shader code. MTLTextureUsageShaderAtomic MTLTextureUsage = 32 // MTLTextureUsageShaderRead: An option for reading or sampling from the texture in a shader. MTLTextureUsageShaderRead MTLTextureUsage = 1 // MTLTextureUsageShaderWrite: An option for writing to the texture in a shader. MTLTextureUsageShaderWrite MTLTextureUsage = 2 // MTLTextureUsageUnknown: An option for a texture whose usage is unknown. MTLTextureUsageUnknown MTLTextureUsage = 0 )
func (MTLTextureUsage) String ¶
func (e MTLTextureUsage) String() string
type MTLTextureViewDescriptor ¶
type MTLTextureViewDescriptor struct {
objectivec.Object
}
Instance Properties ¶
- MTLTextureViewDescriptor.PixelFormat
- MTLTextureViewDescriptor.SetPixelFormat
- MTLTextureViewDescriptor.Swizzle
- MTLTextureViewDescriptor.SetSwizzle
- MTLTextureViewDescriptor.TextureType
- MTLTextureViewDescriptor.SetTextureType
See: https://developer.apple.com/documentation/Metal/MTLTextureViewDescriptor
func MTLTextureViewDescriptorFromID ¶
func MTLTextureViewDescriptorFromID(id objc.ID) MTLTextureViewDescriptor
MTLTextureViewDescriptorFromID constructs a MTLTextureViewDescriptor from an objc.ID.
func NewMTLTextureViewDescriptor ¶
func NewMTLTextureViewDescriptor() MTLTextureViewDescriptor
NewMTLTextureViewDescriptor creates a new MTLTextureViewDescriptor instance.
func (MTLTextureViewDescriptor) Autorelease ¶
func (t MTLTextureViewDescriptor) Autorelease() MTLTextureViewDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLTextureViewDescriptor) Init ¶
func (t MTLTextureViewDescriptor) Init() MTLTextureViewDescriptor
Init initializes the instance.
func (MTLTextureViewDescriptor) LevelRange ¶
func (t MTLTextureViewDescriptor) LevelRange() foundation.NSRange
Discussion ¶
A desired range of mip levels of a texture view.
See: https://developer.apple.com/documentation/Metal/MTLTextureViewDescriptor/levelRange-7e7f3
func (MTLTextureViewDescriptor) PixelFormat ¶
func (t MTLTextureViewDescriptor) PixelFormat() MTLPixelFormat
Discussion ¶
A desired pixel format of a texture view.
See: https://developer.apple.com/documentation/Metal/MTLTextureViewDescriptor/pixelFormat
func (MTLTextureViewDescriptor) SetLevelRange ¶
func (t MTLTextureViewDescriptor) SetLevelRange(value foundation.NSRange)
func (MTLTextureViewDescriptor) SetPixelFormat ¶
func (t MTLTextureViewDescriptor) SetPixelFormat(value MTLPixelFormat)
func (MTLTextureViewDescriptor) SetSliceRange ¶
func (t MTLTextureViewDescriptor) SetSliceRange(value foundation.NSRange)
func (MTLTextureViewDescriptor) SetSwizzle ¶
func (t MTLTextureViewDescriptor) SetSwizzle(value MTLTextureSwizzleChannels)
func (MTLTextureViewDescriptor) SetTextureType ¶
func (t MTLTextureViewDescriptor) SetTextureType(value MTLTextureType)
func (MTLTextureViewDescriptor) SliceRange ¶
func (t MTLTextureViewDescriptor) SliceRange() foundation.NSRange
Discussion ¶
A desired range of slices of a texture view.
See: https://developer.apple.com/documentation/Metal/MTLTextureViewDescriptor/sliceRange-3cs9b
func (MTLTextureViewDescriptor) Swizzle ¶
func (t MTLTextureViewDescriptor) Swizzle() MTLTextureSwizzleChannels
Discussion ¶
A desired swizzle format of a texture view.
See: https://developer.apple.com/documentation/Metal/MTLTextureViewDescriptor/swizzle
func (MTLTextureViewDescriptor) TextureType ¶
func (t MTLTextureViewDescriptor) TextureType() MTLTextureType
Discussion ¶
A desired texture view of a texture view.
See: https://developer.apple.com/documentation/Metal/MTLTextureViewDescriptor/textureType
type MTLTextureViewDescriptorClass ¶
type MTLTextureViewDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLTextureViewDescriptorClass ¶
func GetMTLTextureViewDescriptorClass() MTLTextureViewDescriptorClass
GetMTLTextureViewDescriptorClass returns the class object for MTLTextureViewDescriptor.
func (MTLTextureViewDescriptorClass) Alloc ¶
func (mc MTLTextureViewDescriptorClass) Alloc() MTLTextureViewDescriptor
Alloc allocates memory for a new instance of the class.
type MTLTextureViewPool ¶
type MTLTextureViewPool interface {
objectivec.IObject
MTLResourceViewPool
// Creates a new lightweight texture view of a buffer.
//
// See: https://developer.apple.com/documentation/Metal/MTLTextureViewPool/setTextureView(buffer:descriptor:offset:bytesPerRow:index:)
SetTextureViewFromBufferDescriptorOffsetBytesPerRowAtIndex(buffer MTLBuffer, descriptor IMTLTextureDescriptor, offset uint, bytesPerRow uint, index uint) MTLResourceID
// Creates a new lightweight texture view.
//
// See: https://developer.apple.com/documentation/Metal/MTLTextureViewPool/setTextureView(texture:descriptor:index:)
SetTextureViewDescriptorAtIndex(texture MTLTexture, descriptor IMTLTextureViewDescriptor, index uint) MTLResourceID
// Copies a default texture view to a slot in this texture view pool at an index provided.
//
// See: https://developer.apple.com/documentation/Metal/MTLTextureViewPool/setTextureView(texture:index:)
SetTextureViewAtIndex(texture MTLTexture, index uint) MTLResourceID
}
A pool of lightweight texture views.
See: https://developer.apple.com/documentation/Metal/MTLTextureViewPool
type MTLTextureViewPoolObject ¶
type MTLTextureViewPoolObject struct {
objectivec.Object
}
MTLTextureViewPoolObject wraps an existing Objective-C object that conforms to the MTLTextureViewPool protocol.
func MTLTextureViewPoolObjectFromID ¶
func MTLTextureViewPoolObjectFromID(id objc.ID) MTLTextureViewPoolObject
MTLTextureViewPoolObjectFromID constructs a MTLTextureViewPoolObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLTextureViewPoolObject) BaseObject ¶
func (o MTLTextureViewPoolObject) BaseObject() objectivec.Object
func (MTLTextureViewPoolObject) BaseResourceID ¶
func (o MTLTextureViewPoolObject) BaseResourceID() MTLResourceID
Obtains the resource ID corresponding to the resource view at index 0 in this resource view pool.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/baseResourceID
func (MTLTextureViewPoolObject) CopyResourceViewsFromPoolSourceRangeDestinationIndex ¶
func (o MTLTextureViewPoolObject) CopyResourceViewsFromPoolSourceRangeDestinationIndex(sourcePool MTLResourceViewPool, sourceRange foundation.NSRange, destinationIndex uint) MTLResourceID
Copies a range of resource views from a source view pool to a destination location in this view pool.
sourcePool: Resource view pool from which to copy resource views.
sourceRange: The range in the source resource view pool to copy.
destinationIndex: The starting index in this destination view pool into which to copy the source range of resource views.
Return Value ¶
The MTLResourceID of the resource view corresponding to `destinationIndex` of the copy in this resource view pool.
func (MTLTextureViewPoolObject) Device ¶
func (o MTLTextureViewPoolObject) Device() MTLDevice
Obtains a reference to the GPU device this pool belongs to.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/device
func (MTLTextureViewPoolObject) Label ¶
func (o MTLTextureViewPoolObject) Label() string
Queries the optional debug label of this resource view pool.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/label
func (MTLTextureViewPoolObject) ResourceViewCount ¶
func (o MTLTextureViewPoolObject) ResourceViewCount() uint
Queries the number of resource views that this pool contains.
See: https://developer.apple.com/documentation/Metal/MTLResourceViewPool/resourceViewCount
func (MTLTextureViewPoolObject) SetTextureViewAtIndex ¶
func (o MTLTextureViewPoolObject) SetTextureViewAtIndex(texture MTLTexture, index uint) MTLResourceID
Copies a default texture view to a slot in this texture view pool at an index provided.
texture: An MTLTexture instance for which to copy its texture view.
index: An index of a slot in this texture pool into which this method copies the texture view.
Return Value ¶
The MTLResourceID of a newly created texture view in this pool.
See: https://developer.apple.com/documentation/Metal/MTLTextureViewPool/setTextureView(texture:index:)
func (MTLTextureViewPoolObject) SetTextureViewDescriptorAtIndex ¶
func (o MTLTextureViewPoolObject) SetTextureViewDescriptorAtIndex(texture MTLTexture, descriptor IMTLTextureViewDescriptor, index uint) MTLResourceID
Creates a new lightweight texture view.
texture: An MTLTexture instance for which to create a new lightweight texture view.
descriptor: A descriptor specifying properties of the texture view to create.
index: An index of a slot in the texture pool into which this method writes the new texture view.
Return Value ¶
The MTLResourceID of a newly created texture view in this pool.
Discussion ¶
This method creates a lightweight texture view over a texture according to a descriptor you provide. It then associates the texture view with a slot in this texture view pool at the index you specify.
func (MTLTextureViewPoolObject) SetTextureViewFromBufferDescriptorOffsetBytesPerRowAtIndex ¶
func (o MTLTextureViewPoolObject) SetTextureViewFromBufferDescriptorOffsetBytesPerRowAtIndex(buffer MTLBuffer, descriptor IMTLTextureDescriptor, offset uint, bytesPerRow uint, index uint) MTLResourceID
Creates a new lightweight texture view of a buffer.
buffer: An MTLBuffer instance for which to create a new texture view.
descriptor: A descriptor specifying properties of the texture view to create.
offset: A byte offset, within the `buffer` parameter, at which the data for the texture view starts.
bytesPerRow: The number of bytes between adjacent rows of pixels in the source buffer’s memory.
index: An index of a slot in the table into which this method writes the new texture view.
Return Value ¶
The MTLResourceID of a new buffer view in this pool.
Discussion ¶
This method creates a lightweight texture view over a buffer, according to a descriptor you provide. It then associates the texture view with a slot in this texture view pool at the index you specify.
type MTLThreadgroupBinding ¶
type MTLThreadgroupBinding interface {
objectivec.IObject
MTLBinding
// ThreadgroupMemoryAlignment protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLThreadgroupBinding/threadgroupMemoryAlignment
ThreadgroupMemoryAlignment() uint
// ThreadgroupMemoryDataSize protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLThreadgroupBinding/threadgroupMemoryDataSize
ThreadgroupMemoryDataSize() uint
}
MTLThreadgroupBinding protocol.
See: https://developer.apple.com/documentation/Metal/MTLThreadgroupBinding
type MTLThreadgroupBindingObject ¶
type MTLThreadgroupBindingObject struct {
objectivec.Object
}
MTLThreadgroupBindingObject wraps an existing Objective-C object that conforms to the MTLThreadgroupBinding protocol.
func MTLThreadgroupBindingObjectFromID ¶
func MTLThreadgroupBindingObjectFromID(id objc.ID) MTLThreadgroupBindingObject
MTLThreadgroupBindingObjectFromID constructs a MTLThreadgroupBindingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLThreadgroupBindingObject) Access ¶
func (o MTLThreadgroupBindingObject) Access() MTLBindingAccess
See: https://developer.apple.com/documentation/Metal/MTLBinding/access
func (MTLThreadgroupBindingObject) BaseObject ¶
func (o MTLThreadgroupBindingObject) BaseObject() objectivec.Object
func (MTLThreadgroupBindingObject) Index ¶
func (o MTLThreadgroupBindingObject) Index() uint
See: https://developer.apple.com/documentation/Metal/MTLBinding/index
func (MTLThreadgroupBindingObject) IsArgument ¶
func (o MTLThreadgroupBindingObject) IsArgument() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isArgument
func (MTLThreadgroupBindingObject) IsUsed ¶
func (o MTLThreadgroupBindingObject) IsUsed() bool
See: https://developer.apple.com/documentation/Metal/MTLBinding/isUsed
func (MTLThreadgroupBindingObject) Name ¶
func (o MTLThreadgroupBindingObject) Name() string
See: https://developer.apple.com/documentation/Metal/MTLBinding/name
func (MTLThreadgroupBindingObject) ThreadgroupMemoryAlignment ¶
func (o MTLThreadgroupBindingObject) ThreadgroupMemoryAlignment() uint
See: https://developer.apple.com/documentation/Metal/MTLThreadgroupBinding/threadgroupMemoryAlignment
func (MTLThreadgroupBindingObject) ThreadgroupMemoryDataSize ¶
func (o MTLThreadgroupBindingObject) ThreadgroupMemoryDataSize() uint
See: https://developer.apple.com/documentation/Metal/MTLThreadgroupBinding/threadgroupMemoryDataSize
func (MTLThreadgroupBindingObject) Type ¶
func (o MTLThreadgroupBindingObject) Type() MTLBindingType
See: https://developer.apple.com/documentation/Metal/MTLBinding/type
type MTLTileRenderPipelineColorAttachmentDescriptor ¶
type MTLTileRenderPipelineColorAttachmentDescriptor struct {
objectivec.Object
}
A description of a tile-shading render pipeline’s color render target.
Specifying pixel format ¶
- MTLTileRenderPipelineColorAttachmentDescriptor.PixelFormat: The pixel format associated with the tile shading render pipeline.
- MTLTileRenderPipelineColorAttachmentDescriptor.SetPixelFormat
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineColorAttachmentDescriptor
func MTLTileRenderPipelineColorAttachmentDescriptorFromID ¶
func MTLTileRenderPipelineColorAttachmentDescriptorFromID(id objc.ID) MTLTileRenderPipelineColorAttachmentDescriptor
MTLTileRenderPipelineColorAttachmentDescriptorFromID constructs a MTLTileRenderPipelineColorAttachmentDescriptor from an objc.ID.
A description of a tile-shading render pipeline’s color render target.
func NewMTLTileRenderPipelineColorAttachmentDescriptor ¶
func NewMTLTileRenderPipelineColorAttachmentDescriptor() MTLTileRenderPipelineColorAttachmentDescriptor
NewMTLTileRenderPipelineColorAttachmentDescriptor creates a new MTLTileRenderPipelineColorAttachmentDescriptor instance.
func (MTLTileRenderPipelineColorAttachmentDescriptor) Autorelease ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptor) Autorelease() MTLTileRenderPipelineColorAttachmentDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLTileRenderPipelineColorAttachmentDescriptor) Init ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptor) Init() MTLTileRenderPipelineColorAttachmentDescriptor
Init initializes the instance.
func (MTLTileRenderPipelineColorAttachmentDescriptor) PixelFormat ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptor) PixelFormat() MTLPixelFormat
The pixel format associated with the tile shading render pipeline.
Discussion ¶
The default value is [PixelFormatInvalid].
func (MTLTileRenderPipelineColorAttachmentDescriptor) SetPixelFormat ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptor) SetPixelFormat(value MTLPixelFormat)
type MTLTileRenderPipelineColorAttachmentDescriptorArray ¶
type MTLTileRenderPipelineColorAttachmentDescriptorArray struct {
objectivec.Object
}
An array of color attachment descriptors for the tile render pipeline.
Instance methods ¶
- MTLTileRenderPipelineColorAttachmentDescriptorArray.ObjectAtIndexedSubscript: Returns the render pipeline state for the specified color attachment.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineColorAttachmentDescriptorArray
func MTLTileRenderPipelineColorAttachmentDescriptorArrayFromID ¶
func MTLTileRenderPipelineColorAttachmentDescriptorArrayFromID(id objc.ID) MTLTileRenderPipelineColorAttachmentDescriptorArray
MTLTileRenderPipelineColorAttachmentDescriptorArrayFromID constructs a MTLTileRenderPipelineColorAttachmentDescriptorArray from an objc.ID.
An array of color attachment descriptors for the tile render pipeline.
func NewMTLTileRenderPipelineColorAttachmentDescriptorArray ¶
func NewMTLTileRenderPipelineColorAttachmentDescriptorArray() MTLTileRenderPipelineColorAttachmentDescriptorArray
NewMTLTileRenderPipelineColorAttachmentDescriptorArray creates a new MTLTileRenderPipelineColorAttachmentDescriptorArray instance.
func (MTLTileRenderPipelineColorAttachmentDescriptorArray) Autorelease ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) Autorelease() MTLTileRenderPipelineColorAttachmentDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLTileRenderPipelineColorAttachmentDescriptorArray) Init ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) Init() MTLTileRenderPipelineColorAttachmentDescriptorArray
Init initializes the instance.
func (MTLTileRenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) ObjectAtIndexedSubscript(attachmentIndex uint) IMTLTileRenderPipelineColorAttachmentDescriptor
Returns the render pipeline state for the specified color attachment.
attachmentIndex: An index in the color attachment array.
Return Value ¶
An MTLTileRenderPipelineColorAttachmentDescriptor that describes the render pipeline information for a color attachment.
func (MTLTileRenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript ¶
func (t MTLTileRenderPipelineColorAttachmentDescriptorArray) SetObjectAtIndexedSubscript(attachment IMTLTileRenderPipelineColorAttachmentDescriptor, attachmentIndex uint)
Sets the render pipeline state for a specified color attachment.
attachment: A descriptor that contains the render pipeline description for a color attachment. Specify `nil` to reset the entry to default values.
attachmentIndex: An index in the color attachment array.
Discussion ¶
This method copies the pipeline state from the descriptor into the specified attachment in the array. Afterwards, you can modify and reuse the descriptior without affecting a previously set attachment.
type MTLTileRenderPipelineColorAttachmentDescriptorArrayClass ¶
type MTLTileRenderPipelineColorAttachmentDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLTileRenderPipelineColorAttachmentDescriptorArrayClass ¶
func GetMTLTileRenderPipelineColorAttachmentDescriptorArrayClass() MTLTileRenderPipelineColorAttachmentDescriptorArrayClass
GetMTLTileRenderPipelineColorAttachmentDescriptorArrayClass returns the class object for MTLTileRenderPipelineColorAttachmentDescriptorArray.
func (MTLTileRenderPipelineColorAttachmentDescriptorArrayClass) Alloc ¶
func (mc MTLTileRenderPipelineColorAttachmentDescriptorArrayClass) Alloc() MTLTileRenderPipelineColorAttachmentDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLTileRenderPipelineColorAttachmentDescriptorClass ¶
type MTLTileRenderPipelineColorAttachmentDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLTileRenderPipelineColorAttachmentDescriptorClass ¶
func GetMTLTileRenderPipelineColorAttachmentDescriptorClass() MTLTileRenderPipelineColorAttachmentDescriptorClass
GetMTLTileRenderPipelineColorAttachmentDescriptorClass returns the class object for MTLTileRenderPipelineColorAttachmentDescriptor.
func (MTLTileRenderPipelineColorAttachmentDescriptorClass) Alloc ¶
func (mc MTLTileRenderPipelineColorAttachmentDescriptorClass) Alloc() MTLTileRenderPipelineColorAttachmentDescriptor
Alloc allocates memory for a new instance of the class.
type MTLTileRenderPipelineDescriptor ¶
type MTLTileRenderPipelineDescriptor struct {
objectivec.Object
}
An object that configures new render pipeline state objects for tile shading.
Identifying the render pipeline ¶
- MTLTileRenderPipelineDescriptor.Label: A string that identifies the tile pipeline descriptor.
- MTLTileRenderPipelineDescriptor.SetLabel
Specifying graphics functions and associated data ¶
- MTLTileRenderPipelineDescriptor.TileFunction: The compute kernel or fragment function the pipeline calls.
- MTLTileRenderPipelineDescriptor.SetTileFunction
- MTLTileRenderPipelineDescriptor.TileBuffers: An array that contains the buffer mutability options for a render pipeline’s tile function.
- MTLTileRenderPipelineDescriptor.MaxCallStackDepth: The maximum call stack depth for indirect function calls in tile shaders.
- MTLTileRenderPipelineDescriptor.SetMaxCallStackDepth
Specifying rasterization and visibility state ¶
- MTLTileRenderPipelineDescriptor.ThreadgroupSizeMatchesTileSize: A Boolean value that indicates whether all threadgroups for this pipeline completely cover tiles.
- MTLTileRenderPipelineDescriptor.SetThreadgroupSizeMatchesTileSize
- MTLTileRenderPipelineDescriptor.RasterSampleCount: The number of samples in each fragment.
- MTLTileRenderPipelineDescriptor.SetRasterSampleCount
Specifying rendering pipeline state ¶
- MTLTileRenderPipelineDescriptor.Reset: Specifies the default rendering pipeline state values for the descriptor.
- MTLTileRenderPipelineDescriptor.ColorAttachments: An array of attachments that store color data.
Specifying threads per threadgroup ¶
- MTLTileRenderPipelineDescriptor.MaxTotalThreadsPerThreadgroup: The maximum number of threads in a threadgroup when dispatching a command using the pipeline.
- MTLTileRenderPipelineDescriptor.SetMaxTotalThreadsPerThreadgroup
Specifying precompiled shader binaries ¶
- MTLTileRenderPipelineDescriptor.SupportAddingBinaryFunctions: A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
- MTLTileRenderPipelineDescriptor.SetSupportAddingBinaryFunctions
- MTLTileRenderPipelineDescriptor.BinaryArchives: An array of binary archives to search for precompiled versions of the shader.
- MTLTileRenderPipelineDescriptor.SetBinaryArchives
Specifying callable functions for the pipeline ¶
- MTLTileRenderPipelineDescriptor.LinkedFunctions: Functions that you can specify as function arguments for the tile shader when encoding commands that use the pipeline.
- MTLTileRenderPipelineDescriptor.SetLinkedFunctions
Specifying shader validation ¶
- MTLTileRenderPipelineDescriptor.ShaderValidation: A value that enables or disables shader validation for the pipeline.
- MTLTileRenderPipelineDescriptor.SetShaderValidation
Instance Properties ¶
- MTLTileRenderPipelineDescriptor.PreloadedLibraries
- MTLTileRenderPipelineDescriptor.SetPreloadedLibraries
- MTLTileRenderPipelineDescriptor.RequiredThreadsPerThreadgroup
- MTLTileRenderPipelineDescriptor.SetRequiredThreadsPerThreadgroup
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor
func MTLTileRenderPipelineDescriptorFromID ¶
func MTLTileRenderPipelineDescriptorFromID(id objc.ID) MTLTileRenderPipelineDescriptor
MTLTileRenderPipelineDescriptorFromID constructs a MTLTileRenderPipelineDescriptor from an objc.ID.
An object that configures new render pipeline state objects for tile shading.
func NewMTLTileRenderPipelineDescriptor ¶
func NewMTLTileRenderPipelineDescriptor() MTLTileRenderPipelineDescriptor
NewMTLTileRenderPipelineDescriptor creates a new MTLTileRenderPipelineDescriptor instance.
func (MTLTileRenderPipelineDescriptor) Autorelease ¶
func (t MTLTileRenderPipelineDescriptor) Autorelease() MTLTileRenderPipelineDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLTileRenderPipelineDescriptor) BinaryArchives ¶
func (t MTLTileRenderPipelineDescriptor) BinaryArchives() []objectivec.IObject
An array of binary archives to search for precompiled versions of the shader.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/binaryArchives
func (MTLTileRenderPipelineDescriptor) ColorAttachments ¶
func (t MTLTileRenderPipelineDescriptor) ColorAttachments() IMTLTileRenderPipelineColorAttachmentDescriptorArray
An array of attachments that store color data.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/colorAttachments
func (MTLTileRenderPipelineDescriptor) Init ¶
func (t MTLTileRenderPipelineDescriptor) Init() MTLTileRenderPipelineDescriptor
Init initializes the instance.
func (MTLTileRenderPipelineDescriptor) Label ¶
func (t MTLTileRenderPipelineDescriptor) Label() string
A string that identifies the tile pipeline descriptor.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/label
func (MTLTileRenderPipelineDescriptor) LinkedFunctions ¶
func (t MTLTileRenderPipelineDescriptor) LinkedFunctions() IMTLLinkedFunctions
Functions that you can specify as function arguments for the tile shader when encoding commands that use the pipeline.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/linkedFunctions
func (MTLTileRenderPipelineDescriptor) MaxCallStackDepth ¶
func (t MTLTileRenderPipelineDescriptor) MaxCallStackDepth() uint
The maximum call stack depth for indirect function calls in tile shaders.
Discussion ¶
The property’s default value is `1`. Change its value if you use recursive functions in your tile dispatch.
The maximum call stack depth applies only to indirect function calls in your shader, and affects the upper bound of stack memory for each thread. Indirect function calls include those to visible functions, intersection functions, and to dynamic libraries.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/maxCallStackDepth
func (MTLTileRenderPipelineDescriptor) MaxTotalThreadsPerThreadgroup ¶
func (t MTLTileRenderPipelineDescriptor) MaxTotalThreadsPerThreadgroup() uint
The maximum number of threads in a threadgroup when dispatching a command using the pipeline.
func (MTLTileRenderPipelineDescriptor) PreloadedLibraries ¶
func (t MTLTileRenderPipelineDescriptor) PreloadedLibraries() []objectivec.IObject
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/preloadedLibraries
func (MTLTileRenderPipelineDescriptor) RasterSampleCount ¶
func (t MTLTileRenderPipelineDescriptor) RasterSampleCount() uint
The number of samples in each fragment.
Discussion ¶
The default value is `1`. This value is used only if the pipeline render targets support multisampling. If the render targets don’t support multisampling, then this value needs to be `1`.
When you create a MTLRenderCommandEncoder, the [SampleCount] value of all attachments need to match this `sampleCount` value. Furthermore, the texture type of all attachments need to be [TextureType2DMultisample].
Support for different sample count values varies by device instance. Call the [SupportsTextureSampleCount] method on an MTLDevice instance to determine whether it supports a specific sample count.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/rasterSampleCount
func (MTLTileRenderPipelineDescriptor) RequiredThreadsPerThreadgroup ¶
func (t MTLTileRenderPipelineDescriptor) RequiredThreadsPerThreadgroup() MTLSize
Discussion ¶
Sets the required threads-per-threadgroup during tile dispatches. The `threadsPerTile` argument of any tile dispatch must match to this value if it is set. Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set. Setting this to a size of 0 in every dimension disables this property
func (MTLTileRenderPipelineDescriptor) Reset ¶
func (t MTLTileRenderPipelineDescriptor) Reset()
Specifies the default rendering pipeline state values for the descriptor.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/reset()
func (MTLTileRenderPipelineDescriptor) SetBinaryArchives ¶
func (t MTLTileRenderPipelineDescriptor) SetBinaryArchives(value []objectivec.IObject)
func (MTLTileRenderPipelineDescriptor) SetLabel ¶
func (t MTLTileRenderPipelineDescriptor) SetLabel(value string)
func (MTLTileRenderPipelineDescriptor) SetLinkedFunctions ¶
func (t MTLTileRenderPipelineDescriptor) SetLinkedFunctions(value IMTLLinkedFunctions)
func (MTLTileRenderPipelineDescriptor) SetMaxCallStackDepth ¶
func (t MTLTileRenderPipelineDescriptor) SetMaxCallStackDepth(value uint)
func (MTLTileRenderPipelineDescriptor) SetMaxTotalThreadsPerThreadgroup ¶
func (t MTLTileRenderPipelineDescriptor) SetMaxTotalThreadsPerThreadgroup(value uint)
func (MTLTileRenderPipelineDescriptor) SetPreloadedLibraries ¶
func (t MTLTileRenderPipelineDescriptor) SetPreloadedLibraries(value []objectivec.IObject)
func (MTLTileRenderPipelineDescriptor) SetRasterSampleCount ¶
func (t MTLTileRenderPipelineDescriptor) SetRasterSampleCount(value uint)
func (MTLTileRenderPipelineDescriptor) SetRequiredThreadsPerThreadgroup ¶
func (t MTLTileRenderPipelineDescriptor) SetRequiredThreadsPerThreadgroup(value MTLSize)
func (MTLTileRenderPipelineDescriptor) SetShaderValidation ¶
func (t MTLTileRenderPipelineDescriptor) SetShaderValidation(value MTLShaderValidation)
func (MTLTileRenderPipelineDescriptor) SetSupportAddingBinaryFunctions ¶
func (t MTLTileRenderPipelineDescriptor) SetSupportAddingBinaryFunctions(value bool)
func (MTLTileRenderPipelineDescriptor) SetThreadgroupSizeMatchesTileSize ¶
func (t MTLTileRenderPipelineDescriptor) SetThreadgroupSizeMatchesTileSize(value bool)
func (MTLTileRenderPipelineDescriptor) SetTileFunction ¶
func (t MTLTileRenderPipelineDescriptor) SetTileFunction(value MTLFunction)
func (MTLTileRenderPipelineDescriptor) ShaderValidation ¶
func (t MTLTileRenderPipelineDescriptor) ShaderValidation() MTLShaderValidation
A value that enables or disables shader validation for the pipeline.
Discussion ¶
You can override the value using either of these environment variables: `MTL_SHADER_VALIDATION_ENABLE_PIPELINES` or `MTL_SHADER_VALIDATION_DISABLE_PIPELINES.`
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/shaderValidation
func (MTLTileRenderPipelineDescriptor) SupportAddingBinaryFunctions ¶
func (t MTLTileRenderPipelineDescriptor) SupportAddingBinaryFunctions() bool
A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to its callable functions list.
func (MTLTileRenderPipelineDescriptor) ThreadgroupSizeMatchesTileSize ¶
func (t MTLTileRenderPipelineDescriptor) ThreadgroupSizeMatchesTileSize() bool
A Boolean value that indicates whether all threadgroups for this pipeline completely cover tiles.
Discussion ¶
Metal can optimize code generation when the threadgroup and tile sizes match.
func (MTLTileRenderPipelineDescriptor) TileBuffers ¶
func (t MTLTileRenderPipelineDescriptor) TileBuffers() IMTLPipelineBufferDescriptorArray
An array that contains the buffer mutability options for a render pipeline’s tile function.
Discussion ¶
This property returns an array of MTLPipelineBufferDescriptor objects, with each array index corresponding to the same index in the buffer argument table for the render pipeline’s tile shader.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/tileBuffers
func (MTLTileRenderPipelineDescriptor) TileFunction ¶
func (t MTLTileRenderPipelineDescriptor) TileFunction() MTLFunction
The compute kernel or fragment function the pipeline calls.
Discussion ¶
Kernel-based and fragment-based tile pipeline dispatches act as a barrier against previous draw commands and other dispatches. Kernel-based pipelines wait until all prior access to the tile completes. Fragment-based pipelines wait only until all prior access to the fragment’s location completes.
See: https://developer.apple.com/documentation/Metal/MTLTileRenderPipelineDescriptor/tileFunction
type MTLTileRenderPipelineDescriptorClass ¶
type MTLTileRenderPipelineDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLTileRenderPipelineDescriptorClass ¶
func GetMTLTileRenderPipelineDescriptorClass() MTLTileRenderPipelineDescriptorClass
GetMTLTileRenderPipelineDescriptorClass returns the class object for MTLTileRenderPipelineDescriptor.
func (MTLTileRenderPipelineDescriptorClass) Alloc ¶
func (mc MTLTileRenderPipelineDescriptorClass) Alloc() MTLTileRenderPipelineDescriptor
Alloc allocates memory for a new instance of the class.
type MTLTimestamp ¶
type MTLTimestamp = uint64
MTLTimestamp is the number of nanoseconds for a point in absolute time or Mach absolute time.
See: https://developer.apple.com/documentation/Metal/MTLTimestamp
type MTLTransformType ¶
type MTLTransformType int
See: https://developer.apple.com/documentation/Metal/MTLTransformType
const ( MTLTransformTypeComponent MTLTransformType = 1 MTLTransformTypePackedFloat4x3 MTLTransformType = 0 )
func (MTLTransformType) String ¶
func (e MTLTransformType) String() string
type MTLTriangleFillMode ¶
type MTLTriangleFillMode int
See: https://developer.apple.com/documentation/Metal/MTLTriangleFillMode
const ( // MTLTriangleFillModeFill: Rasterize triangle and triangle strip primitives as filled triangles. MTLTriangleFillModeFill MTLTriangleFillMode = 0 // MTLTriangleFillModeLines: Rasterize triangle and triangle strip primitives as lines. MTLTriangleFillModeLines MTLTriangleFillMode = 1 )
func (MTLTriangleFillMode) String ¶
func (e MTLTriangleFillMode) String() string
type MTLTriangleTessellationFactorsHalf ¶
type MTLTriangleTessellationFactorsHalf struct {
InsideTessellationFactor uint16 // The inside tessellation factor.
EdgeTessellationFactor uint16 // The edge tessellation factors, with each index value providing the tessellation factor for a particular edge.
}
MTLTriangleTessellationFactorsHalf - The per-patch tessellation factors for a triangle patch.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLTriangleTessellationFactorsHalf
type MTLType ¶
type MTLType struct {
objectivec.Object
}
A description of a data type.
Identifying the data type ¶
- MTLType.DataType: The data type of the function argument.
See: https://developer.apple.com/documentation/Metal/MTLType
func MTLTypeFromID ¶
MTLTypeFromID constructs a MTLType from an objc.ID.
A description of a data type.
func (MTLType) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (MTLType) DataType ¶
func (t MTLType) DataType() MTLDataType
The data type of the function argument.
See: https://developer.apple.com/documentation/Metal/MTLType/dataType
type MTLTypeClass ¶
type MTLTypeClass struct {
// contains filtered or unexported fields
}
func GetMTLTypeClass ¶
func GetMTLTypeClass() MTLTypeClass
GetMTLTypeClass returns the class object for MTLType.
func (MTLTypeClass) Alloc ¶
func (mc MTLTypeClass) Alloc() MTLType
Alloc allocates memory for a new instance of the class.
type MTLVertexAmplificationViewMapping ¶
type MTLVertexAmplificationViewMapping struct {
RenderTargetArrayIndexOffset uint32 // An offset into the list of render targets.
ViewportArrayIndexOffset uint32 // An offset into the list of viewports.
}
MTLVertexAmplificationViewMapping - An offset applied to a render target index and viewport index.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLVertexAmplificationViewMapping
type MTLVertexAttribute ¶
type MTLVertexAttribute struct {
objectivec.Object
}
An instance that represents an attribute of a vertex function.
Overview ¶
An MTLVertexAttribute instance represents an attribute for per-vertex input in a vertex function. You use vertex attribute instances to inspect the inputs of a vertex function by examining the MTLVertexAttribute.VertexAttributes property of the corresponding MTLFunction instance.
Describing the attribute ¶
- MTLVertexAttribute.Name: The name of the attribute.
- MTLVertexAttribute.AttributeIndex: The index of the attribute, as declared in Metal shader source code.
- MTLVertexAttribute.AttributeType: The data type for the attribute, as declared in Metal shader source code.
- MTLVertexAttribute.Active: A Boolean value that indicates whether this vertex attribute is active.
- MTLVertexAttribute.PatchControlPointData: A Boolean value that indicates whether this vertex attribute represents control point data.
- MTLVertexAttribute.PatchData: A Boolean value that indicates whether this vertex attribute represents patch data.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute
func MTLVertexAttributeFromID ¶
func MTLVertexAttributeFromID(id objc.ID) MTLVertexAttribute
MTLVertexAttributeFromID constructs a MTLVertexAttribute from an objc.ID.
An instance that represents an attribute of a vertex function.
func NewMTLVertexAttribute ¶
func NewMTLVertexAttribute() MTLVertexAttribute
NewMTLVertexAttribute creates a new MTLVertexAttribute instance.
func (MTLVertexAttribute) Active ¶
func (v MTLVertexAttribute) Active() bool
A Boolean value that indicates whether this vertex attribute is active.
Discussion ¶
If false, this attribute is inactive and can be ignored.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute/isActive
func (MTLVertexAttribute) AttributeIndex ¶
func (v MTLVertexAttribute) AttributeIndex() uint
The index of the attribute, as declared in Metal shader source code.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute/attributeIndex
func (MTLVertexAttribute) AttributeType ¶
func (v MTLVertexAttribute) AttributeType() MTLDataType
The data type for the attribute, as declared in Metal shader source code.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute/attributeType
func (MTLVertexAttribute) Autorelease ¶
func (v MTLVertexAttribute) Autorelease() MTLVertexAttribute
Autorelease adds the receiver to the current autorelease pool.
func (MTLVertexAttribute) Init ¶
func (v MTLVertexAttribute) Init() MTLVertexAttribute
Init initializes the instance.
func (MTLVertexAttribute) Name ¶
func (v MTLVertexAttribute) Name() string
The name of the attribute.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute/name
func (MTLVertexAttribute) PatchControlPointData ¶
func (v MTLVertexAttribute) PatchControlPointData() bool
A Boolean value that indicates whether this vertex attribute represents control point data.
Discussion ¶
This value is always false if the vertex function is not a post-tessellation vertex function.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute/isPatchControlPointData
func (MTLVertexAttribute) PatchData ¶
func (v MTLVertexAttribute) PatchData() bool
A Boolean value that indicates whether this vertex attribute represents patch data.
Discussion ¶
This value is always false if the vertex function is not a post-tessellation vertex function.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttribute/isPatchData
func (MTLVertexAttribute) SetVertexAttributes ¶
func (v MTLVertexAttribute) SetVertexAttributes(value IMTLVertexAttribute)
func (MTLVertexAttribute) VertexAttributes ¶
func (v MTLVertexAttribute) VertexAttributes() IMTLVertexAttribute
An array that describes the vertex input attributes to a vertex function.
See: https://developer.apple.com/documentation/metal/mtlfunction/vertexattributes
type MTLVertexAttributeClass ¶
type MTLVertexAttributeClass struct {
// contains filtered or unexported fields
}
func GetMTLVertexAttributeClass ¶
func GetMTLVertexAttributeClass() MTLVertexAttributeClass
GetMTLVertexAttributeClass returns the class object for MTLVertexAttribute.
func (MTLVertexAttributeClass) Alloc ¶
func (mc MTLVertexAttributeClass) Alloc() MTLVertexAttribute
Alloc allocates memory for a new instance of the class.
type MTLVertexAttributeDescriptor ¶
type MTLVertexAttributeDescriptor struct {
objectivec.Object
}
An object that determines how to store attribute data in memory and map it to the arguments of a vertex function.
Overview ¶
A vertex attribute descriptor provides organization information so a vertex shader function can locate and load data into its arguments. The descriptor maps memory locations to attribute locations. It supports access to multiple attributes (such as vertex coordinates, surface normals, and texture coordinates) that are interleaved within the same buffer.
Organizing the vertex attribute ¶
- MTLVertexAttributeDescriptor.Format: The format of the vertex attribute.
- MTLVertexAttributeDescriptor.SetFormat
- MTLVertexAttributeDescriptor.Offset: The location of an attribute in vertex data, determined by the byte offset from the start of the vertex data.
- MTLVertexAttributeDescriptor.SetOffset
- MTLVertexAttributeDescriptor.BufferIndex: The index in the argument table for the associated vertex buffer.
- MTLVertexAttributeDescriptor.SetBufferIndex
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptor
func MTLVertexAttributeDescriptorFromID ¶
func MTLVertexAttributeDescriptorFromID(id objc.ID) MTLVertexAttributeDescriptor
MTLVertexAttributeDescriptorFromID constructs a MTLVertexAttributeDescriptor from an objc.ID.
An object that determines how to store attribute data in memory and map it to the arguments of a vertex function.
func NewMTLVertexAttributeDescriptor ¶
func NewMTLVertexAttributeDescriptor() MTLVertexAttributeDescriptor
NewMTLVertexAttributeDescriptor creates a new MTLVertexAttributeDescriptor instance.
func (MTLVertexAttributeDescriptor) Autorelease ¶
func (v MTLVertexAttributeDescriptor) Autorelease() MTLVertexAttributeDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLVertexAttributeDescriptor) BufferIndex ¶
func (v MTLVertexAttributeDescriptor) BufferIndex() uint
The index in the argument table for the associated vertex buffer.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptor/bufferIndex
func (MTLVertexAttributeDescriptor) Format ¶
func (v MTLVertexAttributeDescriptor) Format() MTLVertexFormat
The format of the vertex attribute.
Discussion ¶
This property specifies the data type of the vertex attribute that corresponds to an input argument of a shading language function. The MTLVertexFormat may be converted to the data type in the shading function argument with the following specified limitations. Invalid type conversion causes a compilation error.
Conversion of vectors of different lengths is valid. The length of vectors can be reduced. For example, [VertexFormatInt4] data can be reduced to a single `int` shader argument is valid, and the last three values of the vector are discarded. Vectors can also be expanded; for example, expanding [VertexFormatInt] to an `int4` vector shader argument is valid. When expanding, the extra components are filled with the corresponding components of (0,0,0,1).
The sign of an integer MTLVertexFormat can not be cast to a shader argument with an integer type of a different sign. For example, casting the signed format [VertexFormatInt] to an `uint` shader argument is invalid. Casting [VertexFormatUInt] to an `int` argument is also invalid.
Integer truncation is not supported. For example, casting the [VertexFormatInt] to a `short` is invalid. However, casting [VertexFormatShort2] to a vector of `int` values is valid.
Casting any MTLVertexFormat to a `float` or `half` is valid. Casting normalized MTLVertexFormat types (such as [VertexFormatShort2Normalized]) are only valid to `float` or `half`.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptor/format
func (MTLVertexAttributeDescriptor) Init ¶
func (v MTLVertexAttributeDescriptor) Init() MTLVertexAttributeDescriptor
Init initializes the instance.
func (MTLVertexAttributeDescriptor) MTLBufferLayoutStrideDynamic ¶
func (v MTLVertexAttributeDescriptor) MTLBufferLayoutStrideDynamic() int
See: https://developer.apple.com/documentation/metal/mtlbufferlayoutstridedynamic
func (MTLVertexAttributeDescriptor) Offset ¶
func (v MTLVertexAttributeDescriptor) Offset() uint
The location of an attribute in vertex data, determined by the byte offset from the start of the vertex data.
Discussion ¶
The `offset` value needs to be a multiple of `4` bytes.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptor/offset
func (MTLVertexAttributeDescriptor) SetBufferIndex ¶
func (v MTLVertexAttributeDescriptor) SetBufferIndex(value uint)
func (MTLVertexAttributeDescriptor) SetFormat ¶
func (v MTLVertexAttributeDescriptor) SetFormat(value MTLVertexFormat)
func (MTLVertexAttributeDescriptor) SetOffset ¶
func (v MTLVertexAttributeDescriptor) SetOffset(value uint)
type MTLVertexAttributeDescriptorArray ¶
type MTLVertexAttributeDescriptorArray struct {
objectivec.Object
}
An array of vertex attribute descriptor instances.
Overview ¶
An MTLVertexAttributeDescriptorArray instance is an array of instances that defines how vertex attribute data is formatted and assigned to an index in the attribute argument table. The methods of MTLVertexAttributeDescriptorArray set or retrieve the attribute formatting information from the array.
Accessing a specified vertex attribute ¶
- MTLVertexAttributeDescriptorArray.ObjectAtIndexedSubscript: Returns the state of the specified vertex attribute.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptorArray
func MTLVertexAttributeDescriptorArrayFromID ¶
func MTLVertexAttributeDescriptorArrayFromID(id objc.ID) MTLVertexAttributeDescriptorArray
MTLVertexAttributeDescriptorArrayFromID constructs a MTLVertexAttributeDescriptorArray from an objc.ID.
An array of vertex attribute descriptor instances.
func NewMTLVertexAttributeDescriptorArray ¶
func NewMTLVertexAttributeDescriptorArray() MTLVertexAttributeDescriptorArray
NewMTLVertexAttributeDescriptorArray creates a new MTLVertexAttributeDescriptorArray instance.
func (MTLVertexAttributeDescriptorArray) Autorelease ¶
func (v MTLVertexAttributeDescriptorArray) Autorelease() MTLVertexAttributeDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLVertexAttributeDescriptorArray) Init ¶
func (v MTLVertexAttributeDescriptorArray) Init() MTLVertexAttributeDescriptorArray
Init initializes the instance.
func (MTLVertexAttributeDescriptorArray) MTLBufferLayoutStrideDynamic ¶
func (v MTLVertexAttributeDescriptorArray) MTLBufferLayoutStrideDynamic() int
See: https://developer.apple.com/documentation/metal/mtlbufferlayoutstridedynamic
func (MTLVertexAttributeDescriptorArray) ObjectAtIndexedSubscript ¶
func (v MTLVertexAttributeDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLVertexAttributeDescriptor
Returns the state of the specified vertex attribute.
index: A specified index in the array of vertex attribute states.
Return Value ¶
A descriptor that contains the vertex attribute state.
See: https://developer.apple.com/documentation/Metal/MTLVertexAttributeDescriptorArray/subscript(_:)
func (MTLVertexAttributeDescriptorArray) SetObjectAtIndexedSubscript ¶
func (v MTLVertexAttributeDescriptorArray) SetObjectAtIndexedSubscript(attributeDesc IMTLVertexAttributeDescriptor, index uint)
Sets state for the specified vertex attribute.
attributeDesc: A descriptor that contains vertex attribute state.
index: A specified index in the array of vertex attribute states.
Discussion ¶
If this method is called with `nil` for `attributeDesc` for any legal `index`, its vertex attribute state is set to the default values.
type MTLVertexAttributeDescriptorArrayClass ¶
type MTLVertexAttributeDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLVertexAttributeDescriptorArrayClass ¶
func GetMTLVertexAttributeDescriptorArrayClass() MTLVertexAttributeDescriptorArrayClass
GetMTLVertexAttributeDescriptorArrayClass returns the class object for MTLVertexAttributeDescriptorArray.
func (MTLVertexAttributeDescriptorArrayClass) Alloc ¶
func (mc MTLVertexAttributeDescriptorArrayClass) Alloc() MTLVertexAttributeDescriptorArray
Alloc allocates memory for a new instance of the class.
type MTLVertexAttributeDescriptorClass ¶
type MTLVertexAttributeDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLVertexAttributeDescriptorClass ¶
func GetMTLVertexAttributeDescriptorClass() MTLVertexAttributeDescriptorClass
GetMTLVertexAttributeDescriptorClass returns the class object for MTLVertexAttributeDescriptor.
func (MTLVertexAttributeDescriptorClass) Alloc ¶
func (mc MTLVertexAttributeDescriptorClass) Alloc() MTLVertexAttributeDescriptor
Alloc allocates memory for a new instance of the class.
type MTLVertexBufferLayoutDescriptor ¶
type MTLVertexBufferLayoutDescriptor struct {
objectivec.Object
}
An object that configures how a render pipeline fetches data to send to the vertex function.
Organizing the vertex buffer layout ¶
- MTLVertexBufferLayoutDescriptor.StepFunction: The circumstances under which the vertex and its attributes are presented to the vertex function.
- MTLVertexBufferLayoutDescriptor.SetStepFunction
- MTLVertexBufferLayoutDescriptor.StepRate: The interval at which the vertex and its attributes are presented to the vertex function.
- MTLVertexBufferLayoutDescriptor.SetStepRate
- MTLVertexBufferLayoutDescriptor.Stride: The number of bytes between the first byte of two consecutive vertices in a buffer.
- MTLVertexBufferLayoutDescriptor.SetStride
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptor
func MTLVertexBufferLayoutDescriptorFromID ¶
func MTLVertexBufferLayoutDescriptorFromID(id objc.ID) MTLVertexBufferLayoutDescriptor
MTLVertexBufferLayoutDescriptorFromID constructs a MTLVertexBufferLayoutDescriptor from an objc.ID.
An object that configures how a render pipeline fetches data to send to the vertex function.
func NewMTLVertexBufferLayoutDescriptor ¶
func NewMTLVertexBufferLayoutDescriptor() MTLVertexBufferLayoutDescriptor
NewMTLVertexBufferLayoutDescriptor creates a new MTLVertexBufferLayoutDescriptor instance.
func (MTLVertexBufferLayoutDescriptor) Autorelease ¶
func (v MTLVertexBufferLayoutDescriptor) Autorelease() MTLVertexBufferLayoutDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLVertexBufferLayoutDescriptor) Init ¶
func (v MTLVertexBufferLayoutDescriptor) Init() MTLVertexBufferLayoutDescriptor
Init initializes the instance.
func (MTLVertexBufferLayoutDescriptor) MTLBufferLayoutStrideDynamic ¶
func (v MTLVertexBufferLayoutDescriptor) MTLBufferLayoutStrideDynamic() int
See: https://developer.apple.com/documentation/metal/mtlbufferlayoutstridedynamic
func (MTLVertexBufferLayoutDescriptor) SetStepFunction ¶
func (v MTLVertexBufferLayoutDescriptor) SetStepFunction(value MTLVertexStepFunction)
func (MTLVertexBufferLayoutDescriptor) SetStepRate ¶
func (v MTLVertexBufferLayoutDescriptor) SetStepRate(value uint)
func (MTLVertexBufferLayoutDescriptor) SetStride ¶
func (v MTLVertexBufferLayoutDescriptor) SetStride(value uint)
func (MTLVertexBufferLayoutDescriptor) StepFunction ¶
func (v MTLVertexBufferLayoutDescriptor) StepFunction() MTLVertexStepFunction
The circumstances under which the vertex and its attributes are presented to the vertex function.
Discussion ¶
The default value is [VertexStepFunctionPerVertex].
If `stepFunction` is [VertexStepFunctionPerVertex], the function fetches new attribute data based on the `[[ vertex_id ]]` attribute qualifier. The function fetches new attribute data each time a new vertex is processed. In this case, `stepRate` needs to be set to `1`, which is its default value.
If `stepFunction` is [VertexStepFunctionPerInstance], the function fetches new attribute data based on the `[[ instance_id ]]` attribute qualifier. In this case, `stepRate` needs to be greater than `0` and its value determines how often the function fetches new attribute data.
If `stepFunction` is [VertexStepFunctionConstant], the function fetches attribute data just once, and that attribute data is used for every vertex. In this case,`stepRate` needs to be set to `0`.
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptor/stepFunction
func (MTLVertexBufferLayoutDescriptor) StepRate ¶
func (v MTLVertexBufferLayoutDescriptor) StepRate() uint
The interval at which the vertex and its attributes are presented to the vertex function.
Discussion ¶
The default value is `1`. The `stepRate` value, in conjunction with the [StepFunction] property, determines how often the function fetches new attribute data. The `stepRate` property is generally used when `stepFunction` is [VertexStepFunctionPerInstance]. If `stepRate` is equal to `1`, new attribute data is fetched for every instance; if `stepRate` is equal to `2`, new attribute data is fetched for every two instances, and so forth.
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptor/stepRate
func (MTLVertexBufferLayoutDescriptor) Stride ¶
func (v MTLVertexBufferLayoutDescriptor) Stride() uint
The number of bytes between the first byte of two consecutive vertices in a buffer.
Discussion ¶
Check the Metal feature set tables (PDF) for potential alignment restrictions for `stride`.
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptor/stride
type MTLVertexBufferLayoutDescriptorArray ¶
type MTLVertexBufferLayoutDescriptorArray struct {
objectivec.Object
}
An array of vertex buffer layout descriptor instances.
Overview ¶
An MTLVertexBufferLayoutDescriptorArray holds an array of vertex buffer layout states. The methods of MTLVertexBufferLayoutDescriptorArray set the vertex buffer layout state in the array or retrieve the state from the array.
Accessing a specified vertex buffer layout ¶
- MTLVertexBufferLayoutDescriptorArray.ObjectAtIndexedSubscript: Returns the state of the specified vertex buffer layout.
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptorArray
func MTLVertexBufferLayoutDescriptorArrayFromID ¶
func MTLVertexBufferLayoutDescriptorArrayFromID(id objc.ID) MTLVertexBufferLayoutDescriptorArray
MTLVertexBufferLayoutDescriptorArrayFromID constructs a MTLVertexBufferLayoutDescriptorArray from an objc.ID.
An array of vertex buffer layout descriptor instances.
func NewMTLVertexBufferLayoutDescriptorArray ¶
func NewMTLVertexBufferLayoutDescriptorArray() MTLVertexBufferLayoutDescriptorArray
NewMTLVertexBufferLayoutDescriptorArray creates a new MTLVertexBufferLayoutDescriptorArray instance.
func (MTLVertexBufferLayoutDescriptorArray) Autorelease ¶
func (v MTLVertexBufferLayoutDescriptorArray) Autorelease() MTLVertexBufferLayoutDescriptorArray
Autorelease adds the receiver to the current autorelease pool.
func (MTLVertexBufferLayoutDescriptorArray) MTLBufferLayoutStrideDynamic ¶
func (v MTLVertexBufferLayoutDescriptorArray) MTLBufferLayoutStrideDynamic() int
See: https://developer.apple.com/documentation/metal/mtlbufferlayoutstridedynamic
func (MTLVertexBufferLayoutDescriptorArray) ObjectAtIndexedSubscript ¶
func (v MTLVertexBufferLayoutDescriptorArray) ObjectAtIndexedSubscript(index uint) IMTLVertexBufferLayoutDescriptor
Returns the state of the specified vertex buffer layout.
index: A specified index in the array of vertex buffer layouts.
Return Value ¶
A descriptor that contains vertex buffer layout state.
See: https://developer.apple.com/documentation/Metal/MTLVertexBufferLayoutDescriptorArray/subscript(_:)
func (MTLVertexBufferLayoutDescriptorArray) SetObjectAtIndexedSubscript ¶
func (v MTLVertexBufferLayoutDescriptorArray) SetObjectAtIndexedSubscript(bufferDesc IMTLVertexBufferLayoutDescriptor, index uint)
Sets the state of the specified vertex buffer layout.
bufferDesc: A descriptor that contains vertex buffer layout state.
index: An index in the array of vertex buffer layouts.
Discussion ¶
If this method is called with `nil` for `bufferDesc` for any legal index, the MTLVertexBufferLayoutDescriptor object in the array is set to the default values.
type MTLVertexBufferLayoutDescriptorArrayClass ¶
type MTLVertexBufferLayoutDescriptorArrayClass struct {
// contains filtered or unexported fields
}
func GetMTLVertexBufferLayoutDescriptorArrayClass ¶
func GetMTLVertexBufferLayoutDescriptorArrayClass() MTLVertexBufferLayoutDescriptorArrayClass
GetMTLVertexBufferLayoutDescriptorArrayClass returns the class object for MTLVertexBufferLayoutDescriptorArray.
type MTLVertexBufferLayoutDescriptorClass ¶
type MTLVertexBufferLayoutDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLVertexBufferLayoutDescriptorClass ¶
func GetMTLVertexBufferLayoutDescriptorClass() MTLVertexBufferLayoutDescriptorClass
GetMTLVertexBufferLayoutDescriptorClass returns the class object for MTLVertexBufferLayoutDescriptor.
func (MTLVertexBufferLayoutDescriptorClass) Alloc ¶
func (mc MTLVertexBufferLayoutDescriptorClass) Alloc() MTLVertexBufferLayoutDescriptor
Alloc allocates memory for a new instance of the class.
type MTLVertexDescriptor ¶
type MTLVertexDescriptor struct {
objectivec.Object
}
An instance that describes how to organize and map data to a vertex function.
Overview ¶
An MTLVertexDescriptor instance is used to configure how vertex data stored in memory is mapped to attributes in a vertex shader.
A pipeline state is the state of the graphics rendering pipeline, including shaders, blending, multisampling, and visibility testing. For every pipeline state, there can be only one MTLVertexDescriptor instance. When you configure an MTLRenderPipelineDescriptor instance to create this pipeline state, you use an MTLVertexDescriptor instance to establish the vertex layout for the function associated with the pipeline. Create and configure an MTLVertexDescriptor instance, then use this instance to set the [VertexDescriptor] property of the MTLRenderPipelineDescriptor instance.
Setting default values ¶
- MTLVertexDescriptor.Reset: Resets the default state for the vertex descriptor.
Accessing the vertex buffer layouts and vertex attributes ¶
- MTLVertexDescriptor.Attributes: An array of state data that describes how vertex attribute data is stored in memory and is mapped to arguments for a vertex shader function.
- MTLVertexDescriptor.Layouts: An array of state data that describes how data are fetched by a vertex shader function when rendering primitives.
See: https://developer.apple.com/documentation/Metal/MTLVertexDescriptor
func MTLVertexDescriptorFromID ¶
func MTLVertexDescriptorFromID(id objc.ID) MTLVertexDescriptor
MTLVertexDescriptorFromID constructs a MTLVertexDescriptor from an objc.ID.
An instance that describes how to organize and map data to a vertex function.
func NewMTLVertexDescriptor ¶
func NewMTLVertexDescriptor() MTLVertexDescriptor
NewMTLVertexDescriptor creates a new MTLVertexDescriptor instance.
func (MTLVertexDescriptor) Attributes ¶
func (v MTLVertexDescriptor) Attributes() IMTLVertexAttributeDescriptorArray
An array of state data that describes how vertex attribute data is stored in memory and is mapped to arguments for a vertex shader function.
See: https://developer.apple.com/documentation/Metal/MTLVertexDescriptor/attributes
func (MTLVertexDescriptor) Autorelease ¶
func (v MTLVertexDescriptor) Autorelease() MTLVertexDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLVertexDescriptor) Init ¶
func (v MTLVertexDescriptor) Init() MTLVertexDescriptor
Init initializes the instance.
func (MTLVertexDescriptor) Layouts ¶
func (v MTLVertexDescriptor) Layouts() IMTLVertexBufferLayoutDescriptorArray
An array of state data that describes how data are fetched by a vertex shader function when rendering primitives.
See: https://developer.apple.com/documentation/Metal/MTLVertexDescriptor/layouts
func (MTLVertexDescriptor) MTLBufferLayoutStrideDynamic ¶
func (v MTLVertexDescriptor) MTLBufferLayoutStrideDynamic() int
See: https://developer.apple.com/documentation/metal/mtlbufferlayoutstridedynamic
func (MTLVertexDescriptor) Reset ¶
func (v MTLVertexDescriptor) Reset()
Resets the default state for the vertex descriptor.
Discussion ¶
After reset, each element of the [Attributes] array has a default vertex attribute descriptor, and each element of the [Layouts] array has a default vertex buffer layout descriptor.
See: https://developer.apple.com/documentation/Metal/MTLVertexDescriptor/reset()
func (MTLVertexDescriptor) SetVertexDescriptor ¶
func (v MTLVertexDescriptor) SetVertexDescriptor(value IMTLVertexDescriptor)
func (MTLVertexDescriptor) VertexDescriptor ¶
func (v MTLVertexDescriptor) VertexDescriptor() IMTLVertexDescriptor
The organization of vertex data in an attribute’s argument table.
See: https://developer.apple.com/documentation/metal/mtlrenderpipelinedescriptor/vertexdescriptor
type MTLVertexDescriptorClass ¶
type MTLVertexDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLVertexDescriptorClass ¶
func GetMTLVertexDescriptorClass() MTLVertexDescriptorClass
GetMTLVertexDescriptorClass returns the class object for MTLVertexDescriptor.
func (MTLVertexDescriptorClass) Alloc ¶
func (mc MTLVertexDescriptorClass) Alloc() MTLVertexDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLVertexDescriptorClass) VertexDescriptor ¶
func (_MTLVertexDescriptorClass MTLVertexDescriptorClass) VertexDescriptor() MTLVertexDescriptor
Creates and returns a new vertex descriptor.
Return Value ¶
A default object with allocated arrays in the [Attributes] and [Layouts] properties.
See: https://developer.apple.com/documentation/Metal/MTLVertexDescriptor/vertexDescriptor
type MTLVertexFormat ¶
type MTLVertexFormat int
See: https://developer.apple.com/documentation/Metal/MTLVertexFormat
const ( // MTLVertexFormatChar: An 8-bit, signed integer value. MTLVertexFormatChar MTLVertexFormat = 46 // MTLVertexFormatChar2: A two-component vector with 8-bit, signed integer values. MTLVertexFormatChar2 MTLVertexFormat = 4 // MTLVertexFormatChar2Normalized: A two-component vector with 8-bit, normalized, signed integer values. MTLVertexFormatChar2Normalized MTLVertexFormat = 10 // MTLVertexFormatChar3: A three-component vector with 8-bit, signed integer values. MTLVertexFormatChar3 MTLVertexFormat = 5 // MTLVertexFormatChar3Normalized: A three-component vector with 8-bit, normalized, signed integer values. MTLVertexFormatChar3Normalized MTLVertexFormat = 11 // MTLVertexFormatChar4: A four-component vector with 8-bit, signed integer values. MTLVertexFormatChar4 MTLVertexFormat = 6 // MTLVertexFormatChar4Normalized: A four-component vector with 8-bit, normalized, signed integer values. MTLVertexFormatChar4Normalized MTLVertexFormat = 12 // MTLVertexFormatCharNormalized: An 8-bit, normalized, signed integer value. MTLVertexFormatCharNormalized MTLVertexFormat = 48 // MTLVertexFormatFloat: A 32-bit floating-point value. MTLVertexFormatFloat MTLVertexFormat = 28 // MTLVertexFormatFloat2: A two-component vector with 32-bit floating-point values. MTLVertexFormatFloat2 MTLVertexFormat = 29 // MTLVertexFormatFloat3: A three-component vector with 32-bit floating-point values. MTLVertexFormatFloat3 MTLVertexFormat = 30 // MTLVertexFormatFloat4: A four-component vector with 32-bit floating-point values. MTLVertexFormatFloat4 MTLVertexFormat = 31 // MTLVertexFormatFloatRG11B10: A three-component vector with 11-bit floating-point values for red and green, and a 10-bit value for blue. MTLVertexFormatFloatRG11B10 MTLVertexFormat = 54 // MTLVertexFormatFloatRGB9E5: A three-component vector with 9-bit floating-point values for red, green, and blue, and a 5-bit shared exponent. MTLVertexFormatFloatRGB9E5 MTLVertexFormat = 55 // MTLVertexFormatHalf: A 16-bit floating-point value. MTLVertexFormatHalf MTLVertexFormat = 53 // MTLVertexFormatHalf2: A two-component vector with 16-bit floating-point values. MTLVertexFormatHalf2 MTLVertexFormat = 25 // MTLVertexFormatHalf3: A three-component vector with 16-bit floating-point values. MTLVertexFormatHalf3 MTLVertexFormat = 26 // MTLVertexFormatHalf4: A four-component vector with 16-bit floating-point values. MTLVertexFormatHalf4 MTLVertexFormat = 27 // MTLVertexFormatInt: A 32-bit, signed integer value. MTLVertexFormatInt MTLVertexFormat = 32 // MTLVertexFormatInt1010102Normalized: A four-component vector with 10-bit, normalized, signed integer values for red, green, and blue, and a 2-bit value for alpha. MTLVertexFormatInt1010102Normalized MTLVertexFormat = 40 // MTLVertexFormatInt2: A two-component vector with 32-bit, signed integer values. MTLVertexFormatInt2 MTLVertexFormat = 33 // MTLVertexFormatInt3: A three-component vector with 32-bit, signed integer values. MTLVertexFormatInt3 MTLVertexFormat = 34 // MTLVertexFormatInt4: A four-component vector with 32-bit, signed integer values. MTLVertexFormatInt4 MTLVertexFormat = 35 // MTLVertexFormatInvalid: A sentinel value that represents an empty set of vertex format options. MTLVertexFormatInvalid MTLVertexFormat = 0 // MTLVertexFormatShort: A 16-bit, signed integer value. MTLVertexFormatShort MTLVertexFormat = 50 // MTLVertexFormatShort2: A two-component vector with 16-bit, signed integer values. MTLVertexFormatShort2 MTLVertexFormat = 16 // MTLVertexFormatShort2Normalized: A two-component vector with 16-bit, normalized, signed integer values. MTLVertexFormatShort2Normalized MTLVertexFormat = 22 // MTLVertexFormatShort3: A three-component vector with 16-bit, signed integer values. MTLVertexFormatShort3 MTLVertexFormat = 17 // MTLVertexFormatShort3Normalized: A three-component vector with 16-bit, normalized, signed integer values. MTLVertexFormatShort3Normalized MTLVertexFormat = 23 // MTLVertexFormatShort4: A four-component vector with 16-bit, signed integer values. MTLVertexFormatShort4 MTLVertexFormat = 18 // MTLVertexFormatShort4Normalized: A four-component vector with 16-bit, normalized, signed integer values. MTLVertexFormatShort4Normalized MTLVertexFormat = 24 // MTLVertexFormatShortNormalized: A 16-bit, normalized, signed integer value. MTLVertexFormatShortNormalized MTLVertexFormat = 52 // MTLVertexFormatUChar: An 8-bit, unsigned integer value. MTLVertexFormatUChar MTLVertexFormat = 45 // MTLVertexFormatUChar2: A two-component vector with 8-bit, unsigned integer values. MTLVertexFormatUChar2 MTLVertexFormat = 1 // MTLVertexFormatUChar2Normalized: A two-component vector with 8-bit, normalized, unsigned integer values. MTLVertexFormatUChar2Normalized MTLVertexFormat = 7 // MTLVertexFormatUChar3: A three-component vector with 8-bit, unsigned integer values. MTLVertexFormatUChar3 MTLVertexFormat = 2 // MTLVertexFormatUChar3Normalized: A three-component vector with 8-bit, normalized, unsigned integer values. MTLVertexFormatUChar3Normalized MTLVertexFormat = 8 // MTLVertexFormatUChar4: A four-component vector with 8-bit, unsigned integer values. MTLVertexFormatUChar4 MTLVertexFormat = 3 // MTLVertexFormatUChar4Normalized: A four-component vector with 8-bit, normalized, unsigned integer values. MTLVertexFormatUChar4Normalized MTLVertexFormat = 9 // MTLVertexFormatUChar4Normalized_BGRA: A four-component vector with 8-bit, normalized, unsigned integer values for blue, green, red, and alpha. MTLVertexFormatUChar4Normalized_BGRA MTLVertexFormat = 42 // MTLVertexFormatUCharNormalized: An 8-bit, normalized, unsigned integer value. MTLVertexFormatUCharNormalized MTLVertexFormat = 47 // MTLVertexFormatUInt: A 32-bit, unsigned integer value. MTLVertexFormatUInt MTLVertexFormat = 36 // MTLVertexFormatUInt1010102Normalized: A four-component vector with 10-bit, normalized, unsigned integer values for red, green, and blue, and a 2-bit value for alpha. MTLVertexFormatUInt1010102Normalized MTLVertexFormat = 41 // MTLVertexFormatUInt2: A two-component vector with 32-bit, unsigned integer values. MTLVertexFormatUInt2 MTLVertexFormat = 37 // MTLVertexFormatUInt3: A three-component vector with 32-bit, unsigned integer values. MTLVertexFormatUInt3 MTLVertexFormat = 38 // MTLVertexFormatUInt4: A four-component vector with 32-bit, unsigned integer values. MTLVertexFormatUInt4 MTLVertexFormat = 39 // MTLVertexFormatUShort: A 16-bit, unsigned integer value. MTLVertexFormatUShort MTLVertexFormat = 49 // MTLVertexFormatUShort2: A two-component vector with 16-bit, unsigned integer values. MTLVertexFormatUShort2 MTLVertexFormat = 13 // MTLVertexFormatUShort2Normalized: A two-component vector with 16-bit, normalized, unsigned integer values. MTLVertexFormatUShort2Normalized MTLVertexFormat = 19 // MTLVertexFormatUShort3: A three-component vector with 16-bit, unsigned integer values. MTLVertexFormatUShort3 MTLVertexFormat = 14 // MTLVertexFormatUShort3Normalized: A three-component vector with 16-bit, normalized, unsigned integer values. MTLVertexFormatUShort3Normalized MTLVertexFormat = 20 // MTLVertexFormatUShort4: A four-component vector with 16-bit, unsigned integer values. MTLVertexFormatUShort4 MTLVertexFormat = 15 // MTLVertexFormatUShort4Normalized: A four-component vector with 16-bit, normalized, unsigned integer values. MTLVertexFormatUShort4Normalized MTLVertexFormat = 21 // MTLVertexFormatUShortNormalized: A 16-bit, normalized, unsigned integer value. MTLVertexFormatUShortNormalized MTLVertexFormat = 51 )
func (MTLVertexFormat) String ¶
func (e MTLVertexFormat) String() string
type MTLVertexStepFunction ¶
type MTLVertexStepFunction int
See: https://developer.apple.com/documentation/Metal/MTLVertexStepFunction
const ( // MTLVertexStepFunctionConstant: The vertex function fetches attribute data once and uses that data for every vertex. MTLVertexStepFunctionConstant MTLVertexStepFunction = 0 // MTLVertexStepFunctionPerInstance: The vertex function regularly fetches new attribute data for a number of instances that is determined by `stepRate`. MTLVertexStepFunctionPerInstance MTLVertexStepFunction = 2 // MTLVertexStepFunctionPerPatch: The post-tessellation vertex function fetches data based on the patch index of the patch. MTLVertexStepFunctionPerPatch MTLVertexStepFunction = 3 // MTLVertexStepFunctionPerPatchControlPoint: The post-tessellation vertex function fetches data based on the control-point indices associated with the patch. MTLVertexStepFunctionPerPatchControlPoint MTLVertexStepFunction = 4 // MTLVertexStepFunctionPerVertex: The vertex function fetches and uses new attribute data for every vertex. MTLVertexStepFunctionPerVertex MTLVertexStepFunction = 1 )
func (MTLVertexStepFunction) String ¶
func (e MTLVertexStepFunction) String() string
type MTLViewport ¶
type MTLViewport struct {
OriginX float64 // The x coordinate of the upper-left corner of the viewport.
OriginY float64 // The y coordinate of the upper-left corner of the viewport.
Width float64 // The width of the viewport, in pixels.
Height float64 // The height of the viewport, in pixels.
Znear float64 // The z coordinate of the near clipping plane of the viewport.
Zfar float64 // The z coordinate of the far clipping plane of the viewport.
}
MTLViewport - A 3D rectangular region for the viewport clipping.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/Metal/MTLViewport
type MTLVisibilityResultMode ¶
type MTLVisibilityResultMode int
See: https://developer.apple.com/documentation/Metal/MTLVisibilityResultMode
const ( // MTLVisibilityResultModeBoolean: The result records whether any samples passed depth and stencil tests. MTLVisibilityResultModeBoolean MTLVisibilityResultMode = 1 // MTLVisibilityResultModeCounting: The result records how many samples passed depth and stencil tests. MTLVisibilityResultModeCounting MTLVisibilityResultMode = 2 // MTLVisibilityResultModeDisabled: The result doesn’t contain any data because visibility testing was disabled. MTLVisibilityResultModeDisabled MTLVisibilityResultMode = 0 )
func (MTLVisibilityResultMode) String ¶
func (e MTLVisibilityResultMode) String() string
type MTLVisibilityResultType ¶
type MTLVisibilityResultType int
See: https://developer.apple.com/documentation/Metal/MTLVisibilityResultType
const ( // MTLVisibilityResultTypeAccumulate: Accumulate visibility results data across multiple render passes. MTLVisibilityResultTypeAccumulate MTLVisibilityResultType = 1 // MTLVisibilityResultTypeReset: Reset visibility result data when you create a render command encoder. MTLVisibilityResultTypeReset MTLVisibilityResultType = 0 )
func (MTLVisibilityResultType) String ¶
func (e MTLVisibilityResultType) String() string
type MTLVisibleFunctionTable ¶
type MTLVisibleFunctionTable interface {
objectivec.IObject
MTLAllocation
MTLResource
// Sets a table entry to point to a callable function.
//
// See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTable/setFunction(_:index:)
SetFunctionAtIndex(function MTLFunctionHandle, index uint)
// GpuResourceID protocol.
//
// See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTable/gpuResourceID
GpuResourceID() MTLResourceID
// Sets a range of table entries to point to an array of callable functions.
//
// See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTable/setFunctions:withRange:
SetFunctionsWithRange(functions []MTLFunctionHandle, range_ foundation.NSRange)
}
A table of shader functions visible to your app that you can pass into compute commands to customize the behavior of a shader.
See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTable
type MTLVisibleFunctionTableDescriptor ¶
type MTLVisibleFunctionTableDescriptor struct {
objectivec.Object
}
A specification of how to create a visible function table.
Configuring the function table ¶
- MTLVisibleFunctionTableDescriptor.FunctionCount: The number of entries in the function table.
- MTLVisibleFunctionTableDescriptor.SetFunctionCount
See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTableDescriptor
func MTLVisibleFunctionTableDescriptorFromID ¶
func MTLVisibleFunctionTableDescriptorFromID(id objc.ID) MTLVisibleFunctionTableDescriptor
MTLVisibleFunctionTableDescriptorFromID constructs a MTLVisibleFunctionTableDescriptor from an objc.ID.
A specification of how to create a visible function table.
func NewMTLVisibleFunctionTableDescriptor ¶
func NewMTLVisibleFunctionTableDescriptor() MTLVisibleFunctionTableDescriptor
NewMTLVisibleFunctionTableDescriptor creates a new MTLVisibleFunctionTableDescriptor instance.
func (MTLVisibleFunctionTableDescriptor) Autorelease ¶
func (v MTLVisibleFunctionTableDescriptor) Autorelease() MTLVisibleFunctionTableDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MTLVisibleFunctionTableDescriptor) FunctionCount ¶
func (v MTLVisibleFunctionTableDescriptor) FunctionCount() uint
The number of entries in the function table.
See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTableDescriptor/functionCount
func (MTLVisibleFunctionTableDescriptor) Init ¶
func (v MTLVisibleFunctionTableDescriptor) Init() MTLVisibleFunctionTableDescriptor
Init initializes the instance.
func (MTLVisibleFunctionTableDescriptor) SetFunctionCount ¶
func (v MTLVisibleFunctionTableDescriptor) SetFunctionCount(value uint)
type MTLVisibleFunctionTableDescriptorClass ¶
type MTLVisibleFunctionTableDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMTLVisibleFunctionTableDescriptorClass ¶
func GetMTLVisibleFunctionTableDescriptorClass() MTLVisibleFunctionTableDescriptorClass
GetMTLVisibleFunctionTableDescriptorClass returns the class object for MTLVisibleFunctionTableDescriptor.
func (MTLVisibleFunctionTableDescriptorClass) Alloc ¶
func (mc MTLVisibleFunctionTableDescriptorClass) Alloc() MTLVisibleFunctionTableDescriptor
Alloc allocates memory for a new instance of the class.
func (MTLVisibleFunctionTableDescriptorClass) VisibleFunctionTableDescriptor ¶
func (_MTLVisibleFunctionTableDescriptorClass MTLVisibleFunctionTableDescriptorClass) VisibleFunctionTableDescriptor() MTLVisibleFunctionTableDescriptor
Creates a default visible function table descriptor.
type MTLVisibleFunctionTableObject ¶
type MTLVisibleFunctionTableObject struct {
objectivec.Object
}
MTLVisibleFunctionTableObject wraps an existing Objective-C object that conforms to the MTLVisibleFunctionTable protocol.
func MTLVisibleFunctionTableObjectFromID ¶
func MTLVisibleFunctionTableObjectFromID(id objc.ID) MTLVisibleFunctionTableObject
MTLVisibleFunctionTableObjectFromID constructs a MTLVisibleFunctionTableObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (MTLVisibleFunctionTableObject) AllocatedSize ¶
func (o MTLVisibleFunctionTableObject) AllocatedSize() uint
The amount of memory, in byes, a resource consumes, such as for a buffer, texture, or heap.
See: https://developer.apple.com/documentation/Metal/MTLAllocation/allocatedSize
func (MTLVisibleFunctionTableObject) BaseObject ¶
func (o MTLVisibleFunctionTableObject) BaseObject() objectivec.Object
func (MTLVisibleFunctionTableObject) CpuCacheMode ¶
func (o MTLVisibleFunctionTableObject) CpuCacheMode() MTLCPUCacheMode
The CPU cache mode that defines the CPU mapping of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/cpuCacheMode
func (MTLVisibleFunctionTableObject) Device ¶
func (o MTLVisibleFunctionTableObject) Device() MTLDevice
The device object that created the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/device
func (MTLVisibleFunctionTableObject) GpuResourceID ¶
func (o MTLVisibleFunctionTableObject) GpuResourceID() MTLResourceID
See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTable/gpuResourceID
func (MTLVisibleFunctionTableObject) HazardTrackingMode ¶
func (o MTLVisibleFunctionTableObject) HazardTrackingMode() MTLHazardTrackingMode
A mode that determines whether Metal tracks and synchronizes resource access.
See: https://developer.apple.com/documentation/Metal/MTLResource/hazardTrackingMode
func (MTLVisibleFunctionTableObject) Heap ¶
func (o MTLVisibleFunctionTableObject) Heap() MTLHeap
The heap on which the resource is allocated, if any.
See: https://developer.apple.com/documentation/Metal/MTLResource/heap
func (MTLVisibleFunctionTableObject) HeapOffset ¶
func (o MTLVisibleFunctionTableObject) HeapOffset() uint
The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.
See: https://developer.apple.com/documentation/Metal/MTLResource/heapOffset
func (MTLVisibleFunctionTableObject) IsAliasable ¶
func (o MTLVisibleFunctionTableObject) IsAliasable() bool
A Boolean value that indicates whether future heap resource allocations may alias against the resource’s memory.
Return Value ¶
The default value is false. The value is true only if the [MakeAliasable] method was previously called on this resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/isAliasable()
func (MTLVisibleFunctionTableObject) Label ¶
func (o MTLVisibleFunctionTableObject) Label() string
A string that identifies the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/label
func (MTLVisibleFunctionTableObject) MakeAliasable ¶
func (o MTLVisibleFunctionTableObject) MakeAliasable()
Allows future heap resource allocations to alias against the resource’s memory, reusing it.
Discussion ¶
Resource instances marked as aliased have backing memory available for use in new allocations to the heap. One common use case is to make a single large resource aliasable for reuse of memory by smaller and more frequent resource allocations. For situations where you need fine-grained control over your memory management, you might want to use a heap with the allocation type [HeapTypePlacement] and manage memory yourself instead.
Aliased resources can’t be un-aliased or moved. If you use an aliased resource instance to read or write data, it results in undefined behavior.
When working with resources possibly backed by aliased memory, you should take great care that the system doesn’t access resources from multiple aliases concurrently. Use an MTLEvent or MTLFence instance to protect access to resources that you’ve either already aliased or intend to alias.
The general process to reuse memory from aliased resources is:
- Allocate an MTLHeap instance to hold your task’s resources, using the [NewHeapWithDescriptor] method. Your heap should be big enough to store the maximum amount of concurrently loaded data you expect. - Allocate your resource(s) using a heap method that returns an MTLResource instance. - Perform your stage on the GPU, and when it completes, mark the resource allocation(s) as aliasable by calling this method. - For each successive stage of your overall pass, repeat steps 2 and 3. Ensure that the prior stage fully completes before making any new resources on an aliasable heap through an event or fence.
See: https://developer.apple.com/documentation/Metal/MTLResource/makeAliasable()
func (MTLVisibleFunctionTableObject) ResourceOptions ¶
func (o MTLVisibleFunctionTableObject) ResourceOptions() MTLResourceOptions
The storage mode, CPU cache mode, and hazard tracking mode of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/resourceOptions
func (MTLVisibleFunctionTableObject) SetFunctionAtIndex ¶
func (o MTLVisibleFunctionTableObject) SetFunctionAtIndex(function MTLFunctionHandle, index uint)
Sets a table entry to point to a callable function.
function: A function handle for the function to be called.
index: The index of the table entry to change.
See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTable/setFunction(_:index:)
func (MTLVisibleFunctionTableObject) SetFunctionsWithRange ¶
func (o MTLVisibleFunctionTableObject) SetFunctionsWithRange(functions []MTLFunctionHandle, range_ foundation.NSRange)
Sets a range of table entries to point to an array of callable functions.
functions: An array of function handles for the functions to be called.
range: A range of indices to change in the table.
See: https://developer.apple.com/documentation/Metal/MTLVisibleFunctionTable/setFunctions:withRange:
func (MTLVisibleFunctionTableObject) SetLabel ¶
func (o MTLVisibleFunctionTableObject) SetLabel(value string)
func (MTLVisibleFunctionTableObject) SetOwnerWithIdentity ¶
func (o MTLVisibleFunctionTableObject) SetOwnerWithIdentity(task_id_token objectivec.IObject) int32
See: https://developer.apple.com/documentation/Metal/MTLResource/setOwnerWithIdentity:
func (MTLVisibleFunctionTableObject) SetPurgeableState ¶
func (o MTLVisibleFunctionTableObject) SetPurgeableState(state MTLPurgeableState) MTLPurgeableState
Specifies or queries the resource’s purgeable state.
state: The desired purgeable state of a resource.
Return Value ¶
The prior purgeable state of the resource.
Discussion ¶
If `state` is [PurgeableStateKeepCurrent], the method returns the current purgeable state without changing it.
If `state` is [PurgeableStateNonVolatile], the resource is marked to inform the caller that the data should not be discarded.
If `state` is [PurgeableStateEmpty], the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
If `state` is [PurgeableStateVolatile], the resource is marked as data that can be discarded, even if the caller may need the resource. MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism ensures that auto-removal policies don’t discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.
See: https://developer.apple.com/documentation/Metal/MTLResource/setPurgeableState(_:)
func (MTLVisibleFunctionTableObject) StorageMode ¶
func (o MTLVisibleFunctionTableObject) StorageMode() MTLStorageMode
The location and access permissions of the resource.
See: https://developer.apple.com/documentation/Metal/MTLResource/storageMode
type MTLWinding ¶
type MTLWinding int
See: https://developer.apple.com/documentation/Metal/MTLWinding
const ( // MTLWindingClockwise: Primitives whose vertices are specified in clockwise order are front-facing. MTLWindingClockwise MTLWinding = 0 // MTLWindingCounterClockwise: Primitives whose vertices are specified in counter-clockwise order are front-facing. MTLWindingCounterClockwise MTLWinding = 1 )
func (MTLWinding) String ¶
func (e MTLWinding) String() string
type NSDeviceCertification ¶
type NSDeviceCertification = int
See: https://developer.apple.com/documentation/Metal/NSDeviceCertification
var ( // DeviceCertificationiPhonePerformanceGaming is the performance gaming tier for iPhone. // // See: https://developer.apple.com/documentation/Metal/NSDeviceCertification/iPhonePerformanceGaming DeviceCertificationiPhonePerformanceGaming NSDeviceCertification )
type NSProcessPerformanceProfile ¶
type NSProcessPerformanceProfile = int
NSProcessPerformanceProfile is a value describing the device’s performance profile.
See: https://developer.apple.com/documentation/Metal/NSProcessPerformanceProfile
type SharedEventNotificationBinding ¶
type SharedEventNotificationBinding struct {
// contains filtered or unexported fields
}
SharedEventNotificationBinding keeps a notify block alive.
func (*SharedEventNotificationBinding) Release ¶
func (b *SharedEventNotificationBinding) Release()
Release releases the underlying Objective-C block.
type VoidHandler ¶
type VoidHandler = func()
VoidHandler is the signature for a completion handler block.
Used by:
- [MTLLogState.AddLogHandler]
Source Files
¶
- acceleration_structure_command_encoder_protocol.gen.go
- acceleration_structure_protocol.gen.go
- allocation_protocol.gen.go
- argument_encoder_protocol.gen.go
- binary_archive_protocol.gen.go
- binding_protocol.gen.go
- blit_command_encoder_protocol.gen.go
- blocks.gen.go
- buffer_binding_protocol.gen.go
- buffer_protocol.gen.go
- capture_scope_protocol.gen.go
- command_buffer_encoder_info_protocol.gen.go
- command_buffer_protocol.gen.go
- command_encoder_protocol.gen.go
- command_queue_protocol.gen.go
- compute_command_encoder_protocol.gen.go
- compute_pipeline_state_protocol.gen.go
- counter_protocol.gen.go
- counter_sample_buffer_protocol.gen.go
- counter_set_protocol.gen.go
- depth_stencil_state_protocol.gen.go
- device_protocol.gen.go
- doc.gen.go
- drawable_protocol.gen.go
- dynamic_library_protocol.gen.go
- enums.gen.go
- event_protocol.gen.go
- extensions.gen.go
- fence_protocol.gen.go
- function_handle_protocol.gen.go
- function_log_debug_location_protocol.gen.go
- function_log_protocol.gen.go
- function_protocol.gen.go
- function_stitching_attribute_protocol.gen.go
- function_stitching_node_protocol.gen.go
- functions.gen.go
- generate.go
- global_vars.gen.go
- heap_protocol.gen.go
- indirect_command_buffer_protocol.gen.go
- indirect_compute_command_protocol.gen.go
- indirect_render_command_protocol.gen.go
- intersection_function_table_protocol.gen.go
- io_command_buffer_protocol.gen.go
- io_command_queue_protocol.gen.go
- io_file_handle_protocol.gen.go
- io_scratch_buffer_allocator_protocol.gen.go
- io_scratch_buffer_protocol.gen.go
- library_protocol.gen.go
- log_container_protocol.gen.go
- log_state_protocol.gen.go
- metal_inline_helpers.gen.go
- mtl4_acceleration_structure_bounding_box_geometry_descriptor.gen.go
- mtl4_acceleration_structure_curve_geometry_descriptor.gen.go
- mtl4_acceleration_structure_descriptor.gen.go
- mtl4_acceleration_structure_geometry_descriptor.gen.go
- mtl4_acceleration_structure_motion_bounding_box_geometry_descriptor.gen.go
- mtl4_acceleration_structure_motion_curve_geometry_descriptor.gen.go
- mtl4_acceleration_structure_motion_triangle_geometry_descriptor.gen.go
- mtl4_acceleration_structure_triangle_geometry_descriptor.gen.go
- mtl4_archive_protocol.gen.go
- mtl4_argument_table_descriptor.gen.go
- mtl4_argument_table_protocol.gen.go
- mtl4_binary_function_descriptor.gen.go
- mtl4_binary_function_protocol.gen.go
- mtl4_command_allocator_descriptor.gen.go
- mtl4_command_allocator_protocol.gen.go
- mtl4_command_buffer_options.gen.go
- mtl4_command_buffer_protocol.gen.go
- mtl4_command_encoder_protocol.gen.go
- mtl4_command_queue_descriptor.gen.go
- mtl4_command_queue_protocol.gen.go
- mtl4_commit_feedback_protocol.gen.go
- mtl4_commit_options.gen.go
- mtl4_compiler_descriptor.gen.go
- mtl4_compiler_protocol.gen.go
- mtl4_compiler_task_options.gen.go
- mtl4_compiler_task_protocol.gen.go
- mtl4_compute_command_encoder_protocol.gen.go
- mtl4_compute_pipeline_descriptor.gen.go
- mtl4_counter_heap_descriptor.gen.go
- mtl4_counter_heap_protocol.gen.go
- mtl4_function_descriptor.gen.go
- mtl4_indirect_instance_acceleration_structure_descriptor.gen.go
- mtl4_instance_acceleration_structure_descriptor.gen.go
- mtl4_library_descriptor.gen.go
- mtl4_library_function_descriptor.gen.go
- mtl4_machine_learning_command_encoder_protocol.gen.go
- mtl4_machine_learning_pipeline_descriptor.gen.go
- mtl4_machine_learning_pipeline_reflection.gen.go
- mtl4_machine_learning_pipeline_state_protocol.gen.go
- mtl4_mesh_render_pipeline_descriptor.gen.go
- mtl4_pipeline_data_set_serializer_descriptor.gen.go
- mtl4_pipeline_data_set_serializer_protocol.gen.go
- mtl4_pipeline_descriptor.gen.go
- mtl4_pipeline_options.gen.go
- mtl4_pipeline_stage_dynamic_linking_descriptor.gen.go
- mtl4_primitive_acceleration_structure_descriptor.gen.go
- mtl4_render_command_encoder_protocol.gen.go
- mtl4_render_pass_descriptor.gen.go
- mtl4_render_pipeline_binary_functions_descriptor.gen.go
- mtl4_render_pipeline_color_attachment_descriptor.gen.go
- mtl4_render_pipeline_color_attachment_descriptor_array.gen.go
- mtl4_render_pipeline_descriptor.gen.go
- mtl4_render_pipeline_dynamic_linking_descriptor.gen.go
- mtl4_specialized_function_descriptor.gen.go
- mtl4_static_linking_descriptor.gen.go
- mtl4_stitched_function_descriptor.gen.go
- mtl4_tile_render_pipeline_descriptor.gen.go
- mtl_acceleration_structure_bounding_box_geometry_descriptor.gen.go
- mtl_acceleration_structure_curve_geometry_descriptor.gen.go
- mtl_acceleration_structure_descriptor.gen.go
- mtl_acceleration_structure_geometry_descriptor.gen.go
- mtl_acceleration_structure_motion_bounding_box_geometry_descriptor.gen.go
- mtl_acceleration_structure_motion_curve_geometry_descriptor.gen.go
- mtl_acceleration_structure_motion_triangle_geometry_descriptor.gen.go
- mtl_acceleration_structure_pass_descriptor.gen.go
- mtl_acceleration_structure_pass_sample_buffer_attachment_descriptor.gen.go
- mtl_acceleration_structure_pass_sample_buffer_attachment_descriptor_array.gen.go
- mtl_acceleration_structure_triangle_geometry_descriptor.gen.go
- mtl_architecture.gen.go
- mtl_argument_descriptor.gen.go
- mtl_array_type.gen.go
- mtl_attribute.gen.go
- mtl_attribute_descriptor.gen.go
- mtl_attribute_descriptor_array.gen.go
- mtl_binary_archive_descriptor.gen.go
- mtl_blit_pass_descriptor.gen.go
- mtl_blit_pass_sample_buffer_attachment_descriptor.gen.go
- mtl_blit_pass_sample_buffer_attachment_descriptor_array.gen.go
- mtl_buffer_layout_descriptor.gen.go
- mtl_buffer_layout_descriptor_array.gen.go
- mtl_capture_descriptor.gen.go
- mtl_capture_manager.gen.go
- mtl_command_buffer_descriptor.gen.go
- mtl_command_queue_descriptor.gen.go
- mtl_compile_options.gen.go
- mtl_compute_pass_descriptor.gen.go
- mtl_compute_pass_sample_buffer_attachment_descriptor.gen.go
- mtl_compute_pass_sample_buffer_attachment_descriptor_array.gen.go
- mtl_compute_pipeline_descriptor.gen.go
- mtl_compute_pipeline_reflection.gen.go
- mtl_counter_sample_buffer_descriptor.gen.go
- mtl_depth_stencil_descriptor.gen.go
- mtl_function_constant.gen.go
- mtl_function_constant_values.gen.go
- mtl_function_descriptor.gen.go
- mtl_function_reflection.gen.go
- mtl_function_stitching_attribute_always_inline.gen.go
- mtl_function_stitching_function_node.gen.go
- mtl_function_stitching_graph.gen.go
- mtl_function_stitching_input_node.gen.go
- mtl_heap_descriptor.gen.go
- mtl_indirect_command_buffer_descriptor.gen.go
- mtl_indirect_instance_acceleration_structure_descriptor.gen.go
- mtl_instance_acceleration_structure_descriptor.gen.go
- mtl_intersection_function_descriptor.gen.go
- mtl_intersection_function_table_descriptor.gen.go
- mtl_linked_functions.gen.go
- mtl_log_state_descriptor.gen.go
- mtl_logical_to_physical_color_attachment_map.gen.go
- mtl_mesh_render_pipeline_descriptor.gen.go
- mtl_motion_keyframe_data.gen.go
- mtl_pipeline_buffer_descriptor.gen.go
- mtl_pipeline_buffer_descriptor_array.gen.go
- mtl_pointer_type.gen.go
- mtl_primitive_acceleration_structure_descriptor.gen.go
- mtl_rasterization_rate_layer_array.gen.go
- mtl_rasterization_rate_layer_descriptor.gen.go
- mtl_rasterization_rate_map_descriptor.gen.go
- mtl_rasterization_rate_sample_array.gen.go
- mtl_render_pass_attachment_descriptor.gen.go
- mtl_render_pass_color_attachment_descriptor.gen.go
- mtl_render_pass_color_attachment_descriptor_array.gen.go
- mtl_render_pass_depth_attachment_descriptor.gen.go
- mtl_render_pass_descriptor.gen.go
- mtl_render_pass_sample_buffer_attachment_descriptor.gen.go
- mtl_render_pass_sample_buffer_attachment_descriptor_array.gen.go
- mtl_render_pass_stencil_attachment_descriptor.gen.go
- mtl_render_pipeline_color_attachment_descriptor.gen.go
- mtl_render_pipeline_color_attachment_descriptor_array.gen.go
- mtl_render_pipeline_descriptor.gen.go
- mtl_render_pipeline_functions_descriptor.gen.go
- mtl_render_pipeline_reflection.gen.go
- mtl_residency_set_descriptor.gen.go
- mtl_resource_state_pass_descriptor.gen.go
- mtl_resource_state_pass_sample_buffer_attachment_descriptor.gen.go
- mtl_resource_state_pass_sample_buffer_attachment_descriptor_array.gen.go
- mtl_resource_view_pool_descriptor.gen.go
- mtl_sampler_descriptor.gen.go
- mtl_shared_event_handle.gen.go
- mtl_shared_event_listener.gen.go
- mtl_shared_texture_handle.gen.go
- mtl_stage_input_output_descriptor.gen.go
- mtl_stencil_descriptor.gen.go
- mtl_stitched_library_descriptor.gen.go
- mtl_struct_member.gen.go
- mtl_struct_type.gen.go
- mtl_tensor_descriptor.gen.go
- mtl_tensor_extents.gen.go
- mtl_tensor_reference_type.gen.go
- mtl_texture_descriptor.gen.go
- mtl_texture_reference_type.gen.go
- mtl_texture_view_descriptor.gen.go
- mtl_tile_render_pipeline_color_attachment_descriptor.gen.go
- mtl_tile_render_pipeline_color_attachment_descriptor_array.gen.go
- mtl_tile_render_pipeline_descriptor.gen.go
- mtl_type.gen.go
- mtl_vertex_attribute.gen.go
- mtl_vertex_attribute_descriptor.gen.go
- mtl_vertex_attribute_descriptor_array.gen.go
- mtl_vertex_buffer_layout_descriptor.gen.go
- mtl_vertex_buffer_layout_descriptor_array.gen.go
- mtl_vertex_descriptor.gen.go
- mtl_visible_function_table_descriptor.gen.go
- mtlio_command_queue_descriptor.gen.go
- object_payload_binding_protocol.gen.go
- parallel_render_command_encoder_protocol.gen.go
- rasterization_rate_map_protocol.gen.go
- render_command_encoder_protocol.gen.go
- render_pipeline_state_protocol.gen.go
- residency_set_protocol.gen.go
- resource_protocol.gen.go
- resource_state_command_encoder_protocol.gen.go
- resource_view_pool_protocol.gen.go
- sampler_state_protocol.gen.go
- shared_event_protocol.gen.go
- tensor_binding_protocol.gen.go
- tensor_protocol.gen.go
- texture_binding_protocol.gen.go
- texture_protocol.gen.go
- texture_view_pool_protocol.gen.go
- threadgroup_binding_protocol.gen.go
- typedefs.gen.go
- types.gen.go
- undefined_types.gen.go
- visible_function_table_protocol.gen.go