Changes to Metal protocols to support MacOS SDK 27.0

This commit is contained in:
Jake Turner committed 2026-10-07 05:59:50 +01:00
1 parent 2cb0a87d6a
commit 15c73df694
8 files changed
+417 -14

No files matched your search

@@ -63,7 +63,7 @@
}
// MTLCommandEncoder : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h
- (id<MTLDevice>)device
{
@@ -85,6 +85,15 @@
GetWrapped(self)->endEncoding();
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (void)barrierAfterQueueStages:(MTLStages)afterQueueStages
beforeStages:(MTLStages)beforeStages API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real barrierAfterQueueStages:afterQueueStages beforeStages:beforeStages];
}
#endif
- (void)insertDebugSignpost:(NSString *)string
{
GetWrapped(self)->insertDebugSignpost((NS::String *)string);
@@ -101,7 +110,7 @@
}
// MTLBlitCommandEncoder : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h
- (void)synchronizeResource:(id<MTLResource>)resource API_AVAILABLE(macos(10.11), macCatalyst(13.0))
API_UNAVAILABLE(ios)
@@ -335,4 +344,45 @@
GetWrapped(destinationBuffer), destinationOffset);
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (void)copyFromTensor:(id<MTLTensor>)sourceTensor
sourceOrigin:(MTLTensorExtents *)sourceOrigin
sourceDimensions:(MTLTensorExtents *)sourceDimensions
toTensor:(id<MTLTensor>)destinationTensor
destinationOrigin:(MTLTensorExtents *)destinationOrigin
destinationDimensions:(MTLTensorExtents *)destinationDimensions
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
[self.real copyFromTensor:sourceTensor
sourceOrigin:sourceOrigin
sourceDimensions:sourceDimensions
toTensor:destinationTensor
destinationOrigin:destinationOrigin
destinationDimensions:destinationDimensions];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_27_0
- (void)copyFromTensor:(id<MTLTensor>)sourceTensor
sourceOrigin:(MTLTensorExtents *)sourceOrigin
sourceDimensions:(MTLTensorExtents *)sourceDimensions
sourcePlane:(MTLTensorPlaneType)sourcePlane
toTensor:(id<MTLTensor>)destinationTensor
destinationOrigin:(MTLTensorExtents *)destinationOrigin
destinationDimensions:(MTLTensorExtents *)destinationDimensions
destinationPlane:(MTLTensorPlaneType)destinationPlane API_AVAILABLE(macos(27.0), ios(27.0))
{
METAL_NOT_HOOKED();
[self.real copyFromTensor:sourceTensor
sourceOrigin:sourceOrigin
sourceDimensions:sourceDimensions
sourcePlane:sourcePlane
toTensor:destinationTensor
destinationOrigin:destinationOrigin
destinationDimensions:destinationDimensions
destinationPlane:destinationPlane];
}
#endif
@end
+24 -2
View File
@@ -63,7 +63,7 @@
}
// MTLResource : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h
- (nullable NSString *)label
{
@@ -142,7 +142,7 @@
#endif
// MTLBuffer : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h
- (NSUInteger)length
{
@@ -169,6 +169,17 @@
return [self.real newTextureWithDescriptor:descriptor offset:offset bytesPerRow:bytesPerRow];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (nullable id<MTLTensor>)newTensorWithDescriptor:(MTLTensorDescriptor *)descriptor
offset:(NSUInteger)offset
error:(__autoreleasing NSError *_Nullable *_Nullable)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newTensorWithDescriptor:descriptor offset:offset error:error];
}
#endif
- (void)addDebugMarker:(NSString *)marker
range:(NSRange)range API_AVAILABLE(macos(10.12), ios(10.0))
{
@@ -196,10 +207,21 @@
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_13_0
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLGPUAddress)gpuAddress API_AVAILABLE(macos(13.0), ios(16.0))
#else
- (uint64_t)gpuAddress API_AVAILABLE(macos(13.0), ios(16.0))
#endif
{
return self.real.gpuAddress;
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLBufferSparseTier)sparseBufferTier API_AVAILABLE(macos(26.0), ios(26.0))
{
return self.real.sparseBufferTier;
}
#endif
@end
+187 -4
View File
@@ -66,7 +66,7 @@
}
// MTLDevice : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h
- (NSString *)name
{
@@ -873,6 +873,14 @@
return GetWrapped(self)->supportsRaytracing();
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_27_0
- (BOOL)supportsPlacementSparse API_AVAILABLE(macos(26.4), ios(26.4))
{
METAL_NOT_HOOKED();
return [self.real supportsPlacementSparse];
}
#endif
- (MTLAccelerationStructureSizes)accelerationStructureSizesWithDescriptor:
(MTLAccelerationStructureDescriptor *)descriptor API_AVAILABLE(macos(11.0), ios(14.0))
{
@@ -940,8 +948,7 @@
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_13_3
- (void)setShouldMaximizeConcurrentCompilation:(BOOL)value API_AVAILABLE(macos(13.3))
API_UNAVAILABLE(ios)
- (void)setShouldMaximizeConcurrentCompilation:(BOOL)value API_AVAILABLE(macos(13.3), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real setShouldMaximizeConcurrentCompilation:value];
@@ -949,7 +956,7 @@
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_13_3
- (NSUInteger)maximumConcurrentCompilationTaskCount API_AVAILABLE(macos(13.3))API_UNAVAILABLE(ios)
- (NSUInteger)maximumConcurrentCompilationTaskCount API_AVAILABLE(macos(13.3), ios(26.0))
{
return GetWrapped(self)->maximumConcurrentCompilationTaskCount();
}
@@ -963,4 +970,180 @@
return [self.real newResidencySetWithDescriptor:desc error:error];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLSizeAndAlign)tensorSizeAndAlignWithDescriptor:(MTLTensorDescriptor *)descriptor
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real tensorSizeAndAlignWithDescriptor:descriptor];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLTensor>)newTensorWithDescriptor:(MTLTensorDescriptor *)descriptor
error:(__autoreleasing NSError *_Nullable *_Nullable)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newTensorWithDescriptor:descriptor error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_27_0
- (nullable id<MTLTensor>)newTensorWithDescriptor:(MTLTensorDescriptor *)descriptor
attachments:(MTLTensorBufferAttachments *)attachments
error:(NSError **)error
API_AVAILABLE(macos(27.0), ios(27.0))
{
METAL_NOT_HOOKED();
return [self.real newTensorWithDescriptor:descriptor attachments:attachments error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLFunctionHandle>)functionHandleWithFunction:(id<MTLFunction>)function
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real functionHandleWithFunction:function];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4CommandAllocator>)newCommandAllocator API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newCommandAllocator];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4CommandAllocator>)newCommandAllocatorWithDescriptor:(MTL4CommandAllocatorDescriptor *)descriptor
error:(NSError **)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newCommandAllocatorWithDescriptor:descriptor error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4CommandQueue>)newMTL4CommandQueue API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newMTL4CommandQueue];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4CommandQueue>)
newMTL4CommandQueueWithDescriptor:(MTL4CommandQueueDescriptor *)descriptor
error:(__autoreleasing NSError *_Nullable *_Nullable)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newMTL4CommandQueueWithDescriptor:descriptor error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4CommandBuffer>)newCommandBuffer API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newCommandBuffer];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4ArgumentTable>)newArgumentTableWithDescriptor:(MTL4ArgumentTableDescriptor *)descriptor
error:(NSError *_Nullable *)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newArgumentTableWithDescriptor:descriptor error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLTextureViewPool>)newTextureViewPoolWithDescriptor:(MTLResourceViewPoolDescriptor *)descriptor
error:(NSError *_Nullable *)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newTextureViewPoolWithDescriptor:descriptor error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4Compiler>)newCompilerWithDescriptor:(MTL4CompilerDescriptor *)descriptor
error:(NSError **)error API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newCompilerWithDescriptor:descriptor error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4Archive>)newArchiveWithURL:(NSURL *)url
error:(NSError **)error API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newArchiveWithURL:url error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4PipelineDataSetSerializer>)newPipelineDataSetSerializerWithDescriptor:
(MTL4PipelineDataSetSerializerDescriptor *)descriptor API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newPipelineDataSetSerializerWithDescriptor:descriptor];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLBuffer>)newBufferWithLength:(NSUInteger)length
options:(MTLResourceOptions)options
placementSparsePageSize:(MTLSparsePageSize)placementSparsePageSize
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newBufferWithLength:length
options:options
placementSparsePageSize:placementSparsePageSize];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTL4CounterHeap>)newCounterHeapWithDescriptor:(MTL4CounterHeapDescriptor *)descriptor
error:(NSError *__nullable *)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newCounterHeapWithDescriptor:descriptor error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (NSUInteger)sizeOfCounterHeapEntry:(MTL4CounterHeapType)type API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (uint64_t)queryTimestampFrequency API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLFunctionHandle>)functionHandleWithBinaryFunction:(id<MTL4BinaryFunction>)function
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
}
#endif
@end
+10 -1
View File
@@ -63,7 +63,7 @@
}
// MTLLibrary : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLLibrrary.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLLibrrary.h
- (NSString *)label
{
@@ -106,6 +106,15 @@
completionHandler:completionHandler];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLFunctionReflection *)reflectionForFunctionWithName:(NSString *)functionName
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real reflectionForFunctionWithName:functionName];
}
#endif
- (void)newFunctionWithDescriptor:(nonnull MTLFunctionDescriptor *)descriptor
completionHandler:(void (^)(id<MTLFunction> __nullable function,
NSError *__nullable error))completionHandler
@@ -63,7 +63,7 @@
}
// MTLCommandEncoder : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h
- (id<MTLDevice>)device
{
@@ -85,6 +85,15 @@
GetWrapped(self)->endEncoding();
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (void)barrierAfterQueueStages:(MTLStages)afterQueueStages
beforeStages:(MTLStages)beforeStages API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real barrierAfterQueueStages:afterQueueStages beforeStages:beforeStages];
}
#endif
- (void)insertDebugSignpost:(NSString *)string
{
METAL_NOT_HOOKED();
@@ -104,7 +113,7 @@
}
// MTLRenderCommandEncoder : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h
- (void)setRenderPipelineState:(id<MTLRenderPipelineState>)pipelineState
{
@@ -322,6 +331,15 @@
return [self.real setDepthBias:depthBias slopeScale:slopeScale clamp:clamp];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (void)setDepthTestMinBound:(float)minBound
maxBound:(float)maxBound API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real setDepthTestMinBound:minBound maxBound:maxBound];
}
#endif
- (void)setScissorRect:(MTLScissorRect)rect
{
METAL_NOT_HOOKED();
@@ -1276,4 +1294,13 @@
withBarrier:barrier];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (void)setColorAttachmentMap:(nullable MTLLogicalToPhysicalColorAttachmentMap *)mapping
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real setColorAttachmentMap:mapping];
}
#endif
@end
@@ -62,8 +62,19 @@
[super forwardInvocation:invocation];
}
// MTLAllocation : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLAllocation
// .h
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (NSUInteger)allocatedSize API_AVAILABLE(macos(15.0), ios(18.0))
{
return self.real.allocatedSize;
}
#endif
// MTLRenderPipelineState : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h
- (nullable NSString *)label
{
@@ -75,6 +86,55 @@
return id<MTLDevice>(GetWrapped(self)->GetDevice());
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLRenderPipelineReflection *)reflection API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return self.real.reflection;
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLFunctionHandle>)functionHandleWithName:(NSString *)name
stage:(MTLRenderStages)stage
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real functionHandleWithName:name stage:stage];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLFunctionHandle>)functionHandleWithBinaryFunction:(id<MTL4BinaryFunction>)function
stage:(MTLRenderStages)stage
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real functionHandleWithBinaryFunction:function stage:stage];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (id<MTLRenderPipelineState>)newRenderPipelineStateWithBinaryFunctions:
(MTL4RenderPipelineBinaryFunctionsDescriptor *)binaryFunctionsDescriptor
error:(NSError **)error
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newRenderPipelineStateWithBinaryFunctions:binaryFunctionsDescriptor
error:error];
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTL4PipelineDescriptor *)newRenderPipelineDescriptorForSpecialization API_AVAILABLE(macos(26.0),
ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newRenderPipelineDescriptorForSpecialization];
}
#endif
- (NSUInteger)maxTotalThreadsPerThreadgroup API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0),
tvos(14.5))
{
@@ -189,4 +249,25 @@
return self.real.shaderValidation;
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLSize)requiredThreadsPerTileThreadgroup API_AVAILABLE(macos(26.0), ios(26.0))
{
return self.real.requiredThreadsPerTileThreadgroup;
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLSize)requiredThreadsPerObjectThreadgroup API_AVAILABLE(macos(26.0), ios(26.0))
{
return self.real.requiredThreadsPerObjectThreadgroup;
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLSize)requiredThreadsPerMeshThreadgroup API_AVAILABLE(macos(26.0), ios(26.0))
{
return self.real.requiredThreadsPerMeshThreadgroup;
}
#endif
@end
+25 -2
View File
@@ -63,7 +63,7 @@
}
// MTLResource : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h
- (nullable NSString *)label
{
@@ -142,7 +142,7 @@
#endif
// MTLTexture : based on the protocol defined in
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.0.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
@@ -358,6 +358,15 @@
return [self.real newSharedTextureHandle];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (nullable id<MTLTexture>)newTextureViewWithDescriptor:(MTLTextureViewDescriptor *)descriptor
API_AVAILABLE(macos(26.0), ios(26.0))
{
METAL_NOT_HOOKED();
return [self.real newTextureViewWithDescriptor:descriptor];
}
#endif
- (id<MTLTexture>)remoteStorageTexture API_AVAILABLE(macos(10.15))API_UNAVAILABLE(ios)
{
METAL_NOT_HOOKED();
@@ -391,4 +400,18 @@
swizzle:swizzle];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0
- (MTLTextureSparseTier)sparseTextureTier API_AVAILABLE(macos(26.0), ios(26.0))
{
return self.real.sparseTextureTier;
}
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_27_0
- (float)minLOD API_AVAILABLE(macos(27.0), ios(27.0))
{
return self.real.minLOD;
}
#endif
@end
@@ -75,3 +75,11 @@ inline WrappedMTLResource *GetWrapped(id<MTLResource> objC)
#ifndef __MAC_14_4
#define __MAC_14_4 140400
#endif
#ifndef __MAC_26_0
#define __MAC_26_0 260000
#endif
#ifndef __MAC_27_0
#define __MAC_27_0 270000
#endif