Skip to content

Metal tvOS xcode16.0 rc

Rolf Bjarne Kvinge edited this page Sep 12, 2024 · 2 revisions

#Metal.framework https://github.com/xamarin/xamarin-macios/pull/21229

diff -ruN /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h
--- /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h	2024-08-09 07:08:19
+++ /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h	2024-08-09 06:32:30
@@ -74,6 +74,17 @@
     MTLAccelerationStructureInstanceOptionNonOpaque = (1 << 3),
 } API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0));
 
+typedef NS_ENUM(NSInteger, MTLMatrixLayout) {
+    /**
+     * @brief Column-major order
+     */
+    MTLMatrixLayoutColumnMajor = 0,
+    
+    /**
+     * @brief Row-major order
+     */
+    MTLMatrixLayoutRowMajor = 1,
+} API_AVAILABLE(macos(15.0), ios(18.0));
 
 /**
  * @brief Base class for acceleration structure descriptors. Do not use this class directly. Use
@@ -256,6 +267,11 @@
  */
 @property (nonatomic) NSUInteger transformationMatrixBufferOffset API_AVAILABLE(macos(13.0), ios(16.0));
 
+/**
+ * @brief Matrix layout for the transformation matrix in the transformation
+ * matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
+ */
+@property (nonatomic) MTLMatrixLayout transformationMatrixLayout API_AVAILABLE(macos(15.0), ios(18.0));
 + (instancetype)descriptor;
 
 @end
@@ -369,6 +385,11 @@
  */
 @property (nonatomic) NSUInteger transformationMatrixBufferOffset API_AVAILABLE(macos(13.0), ios(16.0));
 
+/**
+ * @brief Matrix layout for the transformation matrix in the transformation
+ * matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
+ */
+@property (nonatomic) MTLMatrixLayout transformationMatrixLayout API_AVAILABLE(macos(15.0), ios(18.0));
 + (instancetype)descriptor;
 
 @end
@@ -951,7 +972,21 @@
     float motionEndTime;
 } MTLIndirectAccelerationStructureMotionInstanceDescriptor API_AVAILABLE(macos(14.0), ios(17.0));
 
+typedef NS_ENUM(NSInteger, MTLTransformType) {
+    /**
+     * @brief A tightly packed matrix with 4 columns and 3 rows. The full transform is assumed
+     * to be a 4x4 matrix with the last row being (0, 0, 0, 1).
+     */
+    MTLTransformTypePackedFloat4x3 = 0,
 
+    /**
+     * @brief A transformation represented by individual components such as translation and
+     * rotation. The rotation is represented by a quaternion, allowing for correct motion
+     * interpolation.
+     */
+    MTLTransformTypeComponent = 1,
+} API_AVAILABLE(macos(15.0), ios(18.0));
+
 /**
  * @brief Descriptor for an instance acceleration structure
  */
@@ -1008,8 +1043,24 @@
  */
 @property (nonatomic) NSUInteger motionTransformCount API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
 
+/**
+ * Matrix layout of the transformation matrices in the instance descriptors
+ * in the instance descriptor buffer and the transformation matrices in the
+ * transformation matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
+ */
+@property (nonatomic) MTLMatrixLayout instanceTransformationMatrixLayout API_AVAILABLE(macos(15.0), ios(18.0));
 
+/**
+ * @brief Type of motion transforms. Defaults to MTLTransformTypePackedFloat4x3.
+ */
+@property (nonatomic) MTLTransformType motionTransformType API_AVAILABLE(macos(15.0), ios(18.0));
 
+/**
+ * @brief Motion transform stride. Defaults to 0, indicating that transforms are tightly packed according to the
+ * motion transform type.
+ */
+@property (nonatomic) NSUInteger motionTransformStride API_AVAILABLE(macos(15.0), ios(18.0));
+
 + (instancetype)descriptor;
 
 @end
@@ -1091,7 +1142,23 @@
  */
 @property (nonatomic) NSUInteger motionTransformCountBufferOffset;
 
+/**
+ * Matrix layout of the transformation matrices in the instance descriptors
+ * in the instance descriptor buffer and the transformation matrices in the
+ * transformation matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
+ */
+@property (nonatomic) MTLMatrixLayout instanceTransformationMatrixLayout API_AVAILABLE(macos(15.0), ios(18.0));
 
+/**
+ * @brief Type of motion transforms. Defaults to MTLTransformTypePackedFloat4x3.
+ */
+@property (nonatomic) MTLTransformType motionTransformType API_AVAILABLE(macos(15.0), ios(18.0));
+
+/**
+ * @brief Motion transform stride. Defaults to 0, indicating that transforms are tightly packed according to the
+ * motion transform type.
+ */
+@property (nonatomic) NSUInteger motionTransformStride API_AVAILABLE(macos(15.0), ios(18.0));
 
 + (instancetype)descriptor;
 
diff -ruN /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h
--- /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h	2024-08-09 07:12:28
+++ /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h	2024-08-09 06:32:16
@@ -165,6 +165,7 @@
     MTLGPUFamilyApple6  = 1006,
     MTLGPUFamilyApple7  = 1007,
     MTLGPUFamilyApple8  = 1008,
+    MTLGPUFamilyApple9  = 1009,
     
     MTLGPUFamilyMac1 API_DEPRECATED_WITH_REPLACEMENT("MTLGPUFamilyMac2", macos(10.15, 13.0), ios(13.0, 16.0)) = 2001,
     MTLGPUFamilyMac2 = 2002,
diff -ruN /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h
--- /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h	2024-08-09 07:08:20
+++ /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h	2024-08-09 05:59:29
@@ -25,6 +25,8 @@
     MTLIndirectCommandTypeConcurrentDispatch  API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0)) = (1 << 5), /* Dispatch threadgroups with concurrent execution */
 
     MTLIndirectCommandTypeConcurrentDispatchThreads  API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0)) = (1 << 6), /* Dispatch threads with concurrent execution */
+    MTLIndirectCommandTypeDrawMeshThreadgroups API_AVAILABLE(macos(14.0), ios(17.0)) = (1 << 7),
+    MTLIndirectCommandTypeDrawMeshThreads API_AVAILABLE(macos(14.0), ios(17.0)) = (1 << 8),
 } API_AVAILABLE(macos(10.14), ios(12.0));
 
 
@@ -95,6 +97,24 @@
  */
 @property (readwrite, nonatomic) NSUInteger maxKernelThreadgroupMemoryBindCount API_AVAILABLE(macos(14.0), ios(17.0));
 
+/*!
+ @abstract
+ The maximum bind index of object stage buffers that can be set per render command.
+ */
+@property (readwrite, nonatomic) NSUInteger maxObjectBufferBindCount API_AVAILABLE(macos(14.0), ios(17.0));
+
+/*!
+ @abstract
+ The maximum bind index of mesh stage buffers that can be set per render command.
+ */
+@property (readwrite, nonatomic) NSUInteger maxMeshBufferBindCount API_AVAILABLE(macos(14.0), ios(17.0));
+
+/*!
+ @abstract
+ The maximum bind index of object threadgroup memory that can be set per render command.
+ The default value is 0.
+ */
+@property (readwrite, nonatomic) NSUInteger maxObjectThreadgroupMemoryBindCount API_AVAILABLE(macos(14.0), ios(17.0));
 
 /*!
  @abstract
diff -ruN /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h
--- /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h	2024-08-09 06:45:10
+++ /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h	2024-08-09 05:58:15
@@ -50,6 +50,17 @@
 - (void)drawPrimitives:(MTLPrimitiveType)primitiveType vertexStart:(NSUInteger)vertexStart vertexCount:(NSUInteger)vertexCount instanceCount:(NSUInteger)instanceCount baseInstance:(NSUInteger)baseInstance;
 - (void)drawIndexedPrimitives:(MTLPrimitiveType)primitiveType indexCount:(NSUInteger)indexCount indexType:(MTLIndexType)indexType indexBuffer:(id <MTLBuffer>)indexBuffer indexBufferOffset:(NSUInteger)indexBufferOffset instanceCount:(NSUInteger)instanceCount baseVertex:(NSInteger)baseVertex baseInstance:(NSUInteger)baseInstance;
 
+- (void)setObjectThreadgroupMemoryLength:(NSUInteger)length atIndex:(NSUInteger)index API_AVAILABLE(macos(14.0), ios(17.0));
+- (void)setObjectBuffer:(id <MTLBuffer>)buffer offset:(NSUInteger)offset atIndex:(NSUInteger)index API_AVAILABLE(macos(14.0), ios(17.0));
+- (void)setMeshBuffer:(id <MTLBuffer>)buffer offset:(NSUInteger)offset atIndex:(NSUInteger)index API_AVAILABLE(macos(14.0), ios(17.0));
+- (void)drawMeshThreadgroups:(MTLSize)threadgroupsPerGrid // MTLIndirectCommandTypeDrawMeshThreadgroups
+ threadsPerObjectThreadgroup:(MTLSize)threadsPerObjectThreadgroup
+   threadsPerMeshThreadgroup:(MTLSize)threadsPerMeshThreadgroup API_AVAILABLE(macos(14.0), ios(17.0));
+- (void)     drawMeshThreads:(MTLSize)threadsPerGrid // MTLIndirectCommandTypeDrawMeshThreads
+ threadsPerObjectThreadgroup:(MTLSize)threadsPerObjectThreadgroup
+   threadsPerMeshThreadgroup:(MTLSize)threadsPerMeshThreadgroup API_AVAILABLE(macos(14.0), ios(17.0));
+- (void)setBarrier API_AVAILABLE(macos(14.0), ios(17.0));
+- (void)clearBarrier API_AVAILABLE(macos(14.0), ios(17.0));
 
 - (void)reset;
 
diff -ruN /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h
--- /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h	2024-08-09 07:12:29
+++ /Applications/Xcode_16.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h	2024-08-09 06:32:17
@@ -696,6 +696,13 @@
 @property (nonatomic) MTLPixelFormat stencilAttachmentPixelFormat;
 
 /*!
+ @property supportIndirectCommandBuffers
+ @abstract Whether this pipeline will support being used by commands in an indirect command buffer.
+ @discussion The default value is NO.
+ */
+@property (readwrite, nonatomic) BOOL supportIndirectCommandBuffers API_AVAILABLE(macos(14.0), ios(17.0));
+
+/*!
  @property binaryArchives
  @abstract The set of MTLBinaryArchive to search for compiled code when creating the pipeline state.
  @discussion Accelerate pipeline state creation by providing archives of compiled code such that no compilation needs to happen on the fast path.
Clone this wiki locally