-
Notifications
You must be signed in to change notification settings - Fork 546
Metal iOS xcode26.0 b3
Rolf Bjarne Kvinge edited this page Jul 18, 2025
·
2 revisions
#Metal.framework https://github.com/dotnet/macios/pull/23355
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h 2025-06-16 08:25:13
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h 2025-06-28 11:01:32
@@ -66,7 +66,7 @@
/// It is an error for this value to match or exceed the value of property
/// ``MTL4ArgumentTableDescriptor/maxBufferBindCount`` on the descriptor
/// from which you created this argument table.
-- (void)setAddress:(uint64_t)gpuAddress
+- (void)setAddress:(MTLGPUAddress)gpuAddress
atIndex:(NSUInteger)bindingIndex;
/// Binds a GPU address to a buffer binding slot, providing a dynamic vertex stride.
@@ -81,7 +81,7 @@
/// It is an error for this value to match or exceed the value of property
/// ``MTL4ArgumentTableDescriptor/maxBufferBindCount`` on the descriptor
/// from which you created this argument table.
-- (void)setAddress:(uint64_t)gpuAddress
+- (void)setAddress:(MTLGPUAddress)gpuAddress
attributeStride:(NSUInteger)stride
atIndex:(NSUInteger)bindingIndex;
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h 2025-06-16 08:25:10
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h 2025-06-28 11:01:28
@@ -8,6 +8,7 @@
#ifdef __METAL_VERSION__
#import <metal_stdlib>
+#import <Metal/MTLGPUAddress.h>
#else
@@ -15,8 +16,10 @@
#ifndef _WIN32
#import <Metal/MTLDefines.h>
+#import <Metal/MTLGPUAddress.h>
#else
#include <Metal/MTLDefines.h>
+#include <Metal/MTLGPUAddress.h>
#endif // _WIN32
#endif
@@ -31,7 +34,7 @@
/**
* @brief Buffer address returned by the gpuAddress property of an MTLBuffer plus any offset into the buffer
*/
- uint64_t bufferAddress;
+ MTLGPUAddress bufferAddress;
/**
* @brief Length of the region which begins at the given address. If the length is not known, a value of
@@ -46,13 +49,13 @@
{
}
- MTL4BufferRange(uint64_t bufferAddress)
+ MTL4BufferRange(MTLGPUAddress bufferAddress)
: bufferAddress(bufferAddress),
length((uint64_t)-1)
{
}
- MTL4BufferRange(uint64_t bufferAddress, uint64_t length)
+ MTL4BufferRange(MTLGPUAddress bufferAddress, uint64_t length)
: bufferAddress(bufferAddress),
length(length)
{
@@ -65,7 +68,7 @@
* @brief Create a buffer range from a buffer's GPU address (given by the gpuAddress property) and length. A length of
* (uint64_t)-1 represents the the range from the given address to the end of the buffer.
*/
-MTL_INLINE MTL4BufferRange MTL4BufferRangeMake(uint64_t bufferAddress, uint64_t length) {
+MTL_INLINE MTL4BufferRange MTL4BufferRangeMake(MTLGPUAddress bufferAddress, uint64_t length) {
MTL4BufferRange range;
range.bufferAddress = bufferAddress;
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h 2025-06-16 08:25:13
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h 2025-06-28 09:59:26
@@ -24,6 +24,13 @@
/// Flushes caches to the GPU (device) memory coherence point.
MTL4VisibilityOptionDevice = 1 << 0,
+
+ /// Flushes caches to ensure that aliased virtual addresses are memory consistent.
+ ///
+ /// On some systems this may be the GPU+CPU (system) memory coherence point
+ /// and on other systems it may be the GPU (device) memory coherence point.
+ MTL4VisibilityOptionResourceAlias = 1 << 1,
+
} API_AVAILABLE(macos(26.0), ios(26.0));
/// An encoder that writes GPU commands into a command buffer.
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h 2025-06-14 09:07:50
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h 2025-06-28 09:59:25
@@ -106,7 +106,7 @@
/// requires 4-byte alignment.
/// - threadsPerThreadgroup: A ``MTLSize`` instance that represents the number of threads in one
/// threadgroup, in each dimension.
-- (void)dispatchThreadgroupsWithIndirectBuffer:(uint64_t)indirectBuffer
+- (void)dispatchThreadgroupsWithIndirectBuffer:(MTLGPUAddress)indirectBuffer
threadsPerThreadgroup:(MTLSize)threadsPerThreadgroup;
/// Encodes a compute dispatch command with an arbitrarily sized grid, using an indirect buffer for arguments.
@@ -115,13 +115,13 @@
/// - 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.
-- (void)dispatchThreadsWithIndirectBuffer:(uint64_t)indirectBuffer;
+- (void)dispatchThreadsWithIndirectBuffer:(MTLGPUAddress)indirectBuffer;
/// Encodes a command to execute a series of commands from an indirect command buffer.
///
/// - Parameters:
/// - indirectCommandBuffer: ``MTLIndirectCommandBuffer`` instance containing the commands to execute.
-/// - executionRange: The range of commands to execute. The maximum length of the range is 16,384 commands.
+/// - executionRange: The range of commands to execute.
- (void)executeCommandsInBuffer:(id<MTLIndirectCommandBuffer>)indirectCommandBuffer
withRange:(NSRange)executionRange;
@@ -135,10 +135,9 @@
/// - 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. The maximum length of the range is 16384 commands. This address
-/// requires 4-byte alignment.
+/// structure. This address requires 4-byte alignment.
- (void)executeCommandsInBuffer:(id<MTLIndirectCommandBuffer>)indirectCommandbuffer
- indirectBuffer:(uint64_t)indirectRangeBuffer;
+ indirectBuffer:(MTLGPUAddress)indirectRangeBuffer;
/// Encodes a command that copies data from a texture to another.
///
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h 2025-06-16 06:56:32
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h 2025-06-27 21:39:00
@@ -328,7 +328,7 @@
- (void)drawIndexedPrimitives:(MTLPrimitiveType)primitiveType
indexCount:(NSUInteger)indexCount
indexType:(MTLIndexType)indexType
- indexBuffer:(uint64_t)indexBuffer
+ indexBuffer:(MTLGPUAddress)indexBuffer
indexBufferLength:(NSUInteger)indexBufferLength;
/// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices.
@@ -363,7 +363,7 @@
- (void)drawIndexedPrimitives:(MTLPrimitiveType)primitiveType
indexCount:(NSUInteger)indexCount
indexType:(MTLIndexType)indexType
- indexBuffer:(uint64_t)indexBuffer
+ indexBuffer:(MTLGPUAddress)indexBuffer
indexBufferLength:(NSUInteger)indexBufferLength
instanceCount:(NSUInteger)instanceCount;
@@ -405,7 +405,7 @@
- (void)drawIndexedPrimitives:(MTLPrimitiveType)primitiveType
indexCount:(NSUInteger)indexCount
indexType:(MTLIndexType)indexType
- indexBuffer:(uint64_t)indexBuffer
+ indexBuffer:(MTLGPUAddress)indexBuffer
indexBufferLength:(NSUInteger)indexBufferLength
instanceCount:(NSUInteger)instanceCount
baseVertex:(NSInteger)baseVertex
@@ -431,7 +431,7 @@
/// ``MTLDrawPrimitivesIndirectArguments`` structure. You are responsible for ensuring that the
/// alignment of this address is 4 bytes.
- (void)drawPrimitives:(MTLPrimitiveType)primitiveType
- indirectBuffer:(uint64_t)indirectBuffer;
+ indirectBuffer:(MTLGPUAddress)indirectBuffer;
/// Encodes a draw command that renders multiple instances of a geometric primitive with indexed vertices
/// and indirect arguments.
@@ -470,16 +470,15 @@
/// ``MTLDrawIndexedPrimitivesIndirectArguments`` structure. This address requires 4-byte alignment.
- (void)drawIndexedPrimitives:(MTLPrimitiveType)primitiveType
indexType:(MTLIndexType)indexType
- indexBuffer:(uint64_t)indexBuffer
+ indexBuffer:(MTLGPUAddress)indexBuffer
indexBufferLength:(NSUInteger)indexBufferLength
- indirectBuffer:(uint64_t)indirectBuffer;
+ indirectBuffer:(MTLGPUAddress)indirectBuffer;
/// Encodes a command that runs a range of commands from an indirect command buffer.
///
/// - Parameters:
/// - 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.
-/// The number of commands needs to be less than or equal to 16,384.
- (void)executeCommandsInBuffer:(id<MTLIndirectCommandBuffer>)indirectCommandBuffer
withRange:(NSRange)executionRange;
@@ -491,8 +490,7 @@
///
/// 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, and that the length member in the buffer contents doesn't exceed
-/// `16,384`.
+/// 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.
@@ -501,11 +499,9 @@
/// - 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. You are responsible for ensuring the
-/// length property of the structure in the contents of this buffer is less than or equal to
-/// 16,384. Additionally, this address requires 4-byte alignment.
+/// ``MTLIndirectCommandBufferExecutionRange`` structure. This address requires 4-byte alignment.
- (void)executeCommandsInBuffer:(id<MTLIndirectCommandBuffer>)indirectCommandBuffer
- indirectBuffer:(uint64_t)indirectRangeBuffer;
+ indirectBuffer:(MTLGPUAddress)indirectRangeBuffer;
/// Configures the size of a threadgroup memory buffer for a threadgroup argument in the object shader function.
///
@@ -559,7 +555,7 @@
/// shader threadgroup, if applicable.
/// - threadsPerMeshThreadgroup: A ``MTLSize`` instance that represents the number of threads in a mesh shader
/// threadgroup.
-- (void)drawMeshThreadgroupsWithIndirectBuffer:(uint64_t)indirectBuffer
+- (void)drawMeshThreadgroupsWithIndirectBuffer:(MTLGPUAddress)indirectBuffer
threadsPerObjectThreadgroup:(MTLSize)threadsPerObjectThreadgroup
threadsPerMeshThreadgroup:(MTLSize)threadsPerMeshThreadgroup;
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h 2025-06-16 08:25:13
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h 2025-06-27 21:39:00
@@ -10,6 +10,7 @@
#import <Metal/MTLPixelFormat.h>
#import <Metal/MTLResource.h>
#import <Metal/MTLTensor.h>
+#import <Metal/MTLGPUAddress.h>
NS_ASSUME_NONNULL_BEGIN
@@ -102,7 +103,7 @@
@property gpuAddress
@abstract Represents the GPU virtual address of a buffer resource
*/
-@property (readonly) uint64_t gpuAddress API_AVAILABLE(macos(13.0), ios(16.0));
+@property (readonly) MTLGPUAddress gpuAddress API_AVAILABLE(macos(13.0), ios(16.0));
/*!
@property sparseBufferTier
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h 2025-07-04 17:37:49
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h 2025-06-28 11:01:30
@@ -8,6 +8,7 @@
#import <Availability.h>
#import <Foundation/Foundation.h>
#import <Metal/MTLDefines.h>
+#import <Metal/MTLGPUAddress.h>
#import <Metal/MTLTypes.h>
#import <Metal/MTLPixelFormat.h>
#import <Metal/MTLResource.h>
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h 1970-01-01 01:00:00
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h 2025-06-28 11:01:28
@@ -0,0 +1,19 @@
+//
+// MTLGPUAddress.h
+// Metal
+//
+// Copyright (c) 2025 Apple Inc. All rights reserved.
+//
+
+#ifdef __METAL_VERSION__
+
+#import <metal_stdlib>
+
+#else
+
+#include <stdint.h>
+
+#endif
+
+/// A 64-bit unsigned integer type appropriate for storing GPU addresses.
+typedef uint64_t MTLGPUAddress;
diff -ruN /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h
--- /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h 2025-06-16 08:25:10
+++ /Applications/Xcode_26.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h 2025-06-28 11:01:29
@@ -91,3 +91,4 @@
#import <Metal/MTL4BinaryFunctionDescriptor.h>
#import <Metal/MTL4LinkingDescriptor.h>
#import <Metal/MTL4BufferRange.h>
+#import <Metal/MTLGPUAddress.h>