Skip to content

Metal iOS xcode13.1 rc

Alex Soto edited this page Oct 26, 2021 · 4 revisions

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

diff -ruN /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h
--- /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h	2021-08-09 03:26:47.000000000 -0400
+++ /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h	2021-09-09 16:50:24.000000000 -0400
@@ -142,6 +142,7 @@
     MTLGPUFamilyApple5 = 1005,
     MTLGPUFamilyApple6 = 1006,
     MTLGPUFamilyApple7 = 1007,
+    MTLGPUFamilyApple8 = 1008,
     
     MTLGPUFamilyMac1 = 2001,
     MTLGPUFamilyMac2 = 2002,
diff -ruN /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h
--- /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h	2021-08-09 03:26:47.000000000 -0400
+++ /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h	2021-09-09 16:50:24.000000000 -0400
@@ -103,6 +103,11 @@
     MTLTextureUsagePixelFormatView = 0x0010,
 } API_AVAILABLE(macos(10.11), ios(9.0));
 
+typedef NS_ENUM(NSInteger, MTLTextureCompressionType)
+{
+    MTLTextureCompressionTypeLossless = 0,
+    MTLTextureCompressionTypeLossy = 1,
+} API_AVAILABLE(macos(12.0), ios(15.0));
 
 MTL_EXPORT API_AVAILABLE(macos(10.11), ios(8.0))
 @interface MTLTextureDescriptor : NSObject <NSCopying>
@@ -227,6 +232,19 @@
 @property (readwrite, nonatomic) BOOL allowGPUOptimizedContents API_AVAILABLE(macos(10.14), ios(12.0));
 
 /*!
+ @property compressionType
+ @abstract Controls how the texture contents will be compressed when written to by the GPU. Compression can be used to reduce the bandwidth usage and storage requirements of a texture.
+ @discussion The default compression type is lossless, meaning that no loss of precision will occur when the texture content is modified.
+ Losslessly compressed textures may benefit from reduced bandwidth usage when regions of correlated color values are written, but do not benefit from reduced storage requirements.
+ Enabling lossy compression for textures that can tolerate some precision loss will guarantee both reduced bandwidth usage and reduced storage requirements.
+ The amount of precision loss depends on the color values stored; regions with correlated color values can be represented with limited to no precision loss, whereas regions with unrelated color values suffer more precision loss.
+ Enabling lossy compression requires both storageMode == MTLStorageModePrivate, allowGPUOptimizedContents == YES, and cannot be combined with either MTLTextureUsagePixelFormatView, MTLTextureUsageShaderWrite, MTLTextureType1D(Array) or MTLTextureTypeTextureBuffer.
+ Moreover, not all MTLPixelFormat are supported with lossy compression, verify that the MTLDevice's GPU family supports the lossy compression feature for the pixelFormat requested.
+ Set allowGPUOptimizedContents to NO to opt out of both lossless and lossy compression; such textures do not benefit from either reduced bandwidth usage or reduced storage requirements, but have predictable CPU readback performance.
+ */
+@property (readwrite, nonatomic) MTLTextureCompressionType compressionType API_AVAILABLE(macos(12.0), ios(15.0));
+
+/*!
  @property swizzle
  @abstract Channel swizzle to use when reading or sampling from the texture, the default value is MTLTextureSwizzleChannelsDefault.
  */
@@ -395,6 +413,13 @@
 @property (readonly) BOOL allowGPUOptimizedContents API_AVAILABLE(macos(10.14), ios(12.0));
 
 /*!
+ @property compressionType
+ @abstract Returns the compression type of the texture
+ @discussion See the compressionType property on MTLTextureDescriptor
+ */
+@property (readonly) MTLTextureCompressionType compressionType API_AVAILABLE(macos(12.0), ios(15.0));
+
+/*!
  @method getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice:
  @abstract Copies a block of pixels from a texture slice into the application's memory.
  */
Clone this wiki locally