From 570308258150812de4773d2b9393cf9df499a3ce Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 23 Sep 2019 11:14:15 -0400 Subject: [PATCH] [Metal] Add support up to GM1 of metal. (#7007) --- src/Metal/Defs.cs | 40 + src/Metal/MTLCompat.cs | 11 +- src/Metal/MTLDevice.cs | 42 + src/Metal/MTLEnums.cs | 142 ++- .../MTLRasterizationRateLayerDescriptor.cs | 54 ++ src/Metal/MTLResourceStateCommandEncoder.cs | 47 + src/frameworks.sources | 2 + src/metal.cs | 841 +++++++++++++++++- tests/xtro-sharpie/common-Metal.ignore | 25 +- tests/xtro-sharpie/iOS-Metal.ignore | 47 + tests/xtro-sharpie/iOS-Metal.todo | 120 --- tests/xtro-sharpie/macOS-Metal.ignore | 29 +- tests/xtro-sharpie/macOS-Metal.todo | 105 --- tests/xtro-sharpie/tvOS-Metal.ignore | 20 + tests/xtro-sharpie/tvOS-Metal.todo | 72 -- 15 files changed, 1279 insertions(+), 318 deletions(-) create mode 100644 src/Metal/MTLRasterizationRateLayerDescriptor.cs create mode 100644 src/Metal/MTLResourceStateCommandEncoder.cs delete mode 100644 tests/xtro-sharpie/iOS-Metal.todo delete mode 100644 tests/xtro-sharpie/macOS-Metal.todo delete mode 100644 tests/xtro-sharpie/tvOS-Metal.todo diff --git a/src/Metal/Defs.cs b/src/Metal/Defs.cs index b547b82aeff0..68341993b44c 100644 --- a/src/Metal/Defs.cs +++ b/src/Metal/Defs.cs @@ -342,5 +342,45 @@ public MTLIndirectCommandBufferExecutionRange (uint location, uint length) } } #endif // MONOMAC + + [Mac (10,15), iOS (13,0), TV (13,0)] + public enum MTLTextureSwizzle : byte { + Zero = 0, + One = 1, + Red = 2, + Green = 3, + Blue = 4, + Alpha = 5, + } + + [StructLayout (LayoutKind.Sequential)] + public struct MTLTextureSwizzleChannels { + public MTLTextureSwizzle Red; + + public MTLTextureSwizzle Green; + + public MTLTextureSwizzle Blue; + + public MTLTextureSwizzle Alpha; + } + +#if IOS + [Introduced (PlatformName.iOS, 13,0, PlatformArchitecture.All)] + [StructLayout (LayoutKind.Sequential)] + public struct MTLVertexAmplificationViewMapping { + public uint ViewportArrayIndexOffset; + + public uint RenderTargetArrayIndexOffset; + } + + [Introduced (PlatformName.iOS, 13,0, PlatformArchitecture.All)] + [StructLayout (LayoutKind.Sequential)] + public struct MTLCoordinate2D { + public float X; + + public float Y; + } +#endif + } #endif diff --git a/src/Metal/MTLCompat.cs b/src/Metal/MTLCompat.cs index c599682f6250..eebf54fc2574 100644 --- a/src/Metal/MTLCompat.cs +++ b/src/Metal/MTLCompat.cs @@ -1,9 +1,12 @@ -#if XAMCORE_2_0 || !MONOMAC - +using System; using ObjCRuntime; namespace Metal { -} + public partial class MTLSharedTextureHandle { + + [Obsolete ("Default constructor was removed. Do not use.")] + public MTLSharedTextureHandle () {} + } -#endif +} \ No newline at end of file diff --git a/src/Metal/MTLDevice.cs b/src/Metal/MTLDevice.cs index 0f674a0b93a0..f9e0110596e6 100644 --- a/src/Metal/MTLDevice.cs +++ b/src/Metal/MTLDevice.cs @@ -148,6 +148,48 @@ public unsafe static void GetDefaultSamplePositions (this IMTLDevice This, MTLSa fixed (void * handle = positions) GetDefaultSamplePositions (This, (IntPtr)handle, count); } +#if IOS + + [NoMac, NoTV, iOS (13,0)] + public static void ConvertSparseTileRegions (this IMTLDevice This, MTLRegion [] tileRegions, MTLRegion [] pixelRegions, MTLSize tileSize, nuint numRegions) + { + if (tileRegions == null) + throw new ArgumentNullException (nameof (tileRegions)); + if (pixelRegions == null) + throw new ArgumentNullException (nameof (pixelRegions)); + + var tileRegionsHandle = GCHandle.Alloc (tileRegions, GCHandleType.Pinned); + var pixelRegionsHandle = GCHandle.Alloc (pixelRegions, GCHandleType.Pinned); + try { + IntPtr tilePtr = tileRegionsHandle.AddrOfPinnedObject (); + IntPtr pixelPtr = pixelRegionsHandle.AddrOfPinnedObject (); + This.ConvertSparseTileRegions (tilePtr, pixelPtr, tileSize, numRegions); + } finally { + tileRegionsHandle.Free (); + pixelRegionsHandle.Free (); + } + } + + [NoMac, NoTV, iOS (13,0)] + public static void ConvertSparsePixelRegions (this IMTLDevice This, MTLRegion [] pixelRegions, MTLRegion [] tileRegions, MTLSize tileSize, MTLSparseTextureRegionAlignmentMode mode, nuint numRegions) + { + if (tileRegions == null) + throw new ArgumentNullException (nameof (tileRegions)); + if (pixelRegions == null) + throw new ArgumentNullException (nameof (pixelRegions)); + + var tileRegionsHandle = GCHandle.Alloc (tileRegions, GCHandleType.Pinned); + var pixelRegionsHandle = GCHandle.Alloc (pixelRegions, GCHandleType.Pinned); + try { + IntPtr tilePtr = tileRegionsHandle.AddrOfPinnedObject (); + IntPtr pixelPtr = pixelRegionsHandle.AddrOfPinnedObject (); + This.ConvertSparsePixelRegions (pixelPtr, tilePtr, tileSize, mode, numRegions); + } finally { + tileRegionsHandle.Free (); + pixelRegionsHandle.Free (); + } + } +#endif #if !XAMCORE_4_0 [return: Release] diff --git a/src/Metal/MTLEnums.cs b/src/Metal/MTLEnums.cs index 340c6558e719..f0c7273e1aec 100644 --- a/src/Metal/MTLEnums.cs +++ b/src/Metal/MTLEnums.cs @@ -784,7 +784,7 @@ public enum MTLSamplerBorderColor : ulong { OpaqueWhite = 2 } - [NoTV] + [TV (13,0)] [iOS (12,0)] [Mac (10,11)] [Native] @@ -1003,5 +1003,145 @@ public enum MTLMultisampleStencilResolveFilter : ulong Sample0 = 0, DepthResolvedSample = 1, } + + [Unavailable (PlatformName.MacCatalyst)] + [Flags, NoMac, NoTV, iOS (13,0)] + [Native, Advice ("This API is not available when using UIKit on macOS.")] + public enum MTLSparseTextureRegionAlignmentMode : ulong { + Outward = 0x0, + Inward = 0x1, + } + + [Unavailable (PlatformName.MacCatalyst)] + [Flags, NoMac, NoTV, iOS (13,0)] + [Native, Advice ("This API is not available when using UIKit on macOS.")] + public enum MTLSparseTextureMappingMode : ulong { + Map = 0x0, + Unmap = 0x1, + } + + [Mac (10,15), iOS (13,0)] + [Native] + public enum MTLHazardTrackingMode : ulong { + Default = 0, + Untracked = 1, + Tracked = 2, + } + + [TV (13,0), Mac (10,15), iOS (13,0)] + [Native] + [ErrorDomain ("MTLCaptureErrorDomain")] + public enum MTLCaptureError : long { + NotSupported = 1, + AlreadyCapturing, + InvalidDescriptor, + } + + [TV (13,0), Mac (10,15), iOS (13,0)] + [Native] + public enum MTLGpuFamily : long { + Apple1 = 1001, + Apple2 = 1002, + Apple3 = 1003, + Apple4 = 1004, + Apple5 = 1005, + Mac1 = 2001, + Mac2 = 2002, + Common1 = 3001, + Common2 = 3002, + Common3 = 3003, + iOSMac1 = 4001, + iOSMac2 = 4002, + } + + [TV (13,0), Mac (10,15), iOS (13,0)] + [Native] + public enum MTLHeapType : long { + Automatic = 0, + Placement = 1, + } + + [Mac (10,15), iOS (13,0), TV (13,0)] + [Native] + public enum MTLCaptureDestination : long { + DeveloperTools = 1, + GpuTraceDocument, + } + + [NoiOS, NoTV, Mac (10,15)] + [Native] + public enum MTLDeviceLocation : ulong { + BuiltIn = 0, + Slot = 1, + External = 2, + Unspecified = ulong.MaxValue, + } + + [NoiOS, NoTV, Mac (10,15)] + [Native] + [ErrorDomain ("MTLCounterErrorDomain")] + public enum MTLCounterSampleBufferError : long { + OutOfMemory, + Internal, + } +#if MONOMAC + [NoiOS, NoTV, Mac (10,15)] + public enum MTLCommonCounter { + [Field ("MTLCommonCounterTimestamp")] + Timestamp, + + [Field ("MTLCommonCounterTessellationInputPatches")] + TessellationInputPatches, + + [Field ("MTLCommonCounterVertexInvocations")] + VertexInvocations, + + [Field ("MTLCommonCounterPostTessellationVertexInvocations")] + PostTessellationVertexInvocations, + + [Field ("MTLCommonCounterClipperInvocations")] + ClipperInvocations, + + [Field ("MTLCommonCounterClipperPrimitivesOut")] + ClipperPrimitivesOut, + + [Field ("MTLCommonCounterFragmentInvocations")] + FragmentInvocations, + + [Field ("MTLCommonCounterFragmentsPassed")] + FragmentsPassed, + + [Field ("MTLCommonCounterComputeKernelInvocations")] + ComputeKernelInvocations, + + [Field ("MTLCommonCounterTotalCycles")] + TotalCycles, + + [Field ("MTLCommonCounterVertexCycles")] + VertexCycles, + + [Field ("MTLCommonCounterTessellationCycles")] + TessellationCycles, + + [Field ("MTLCommonCounterPostTessellationVertexCycles")] + PostTessellationVertexCycles, + + [Field ("MTLCommonCounterFragmentCycles")] + FragmentCycles, + + [Field ("MTLCommonCounterRenderTargetWriteCycles")] + RenderTargetWriteCycles, + + [Field ("MTLCommonCounterSetTimestamp")] + SetTimestamp, + + [Field ("MTLCommonCounterSetStageUtilization")] + SetStageUtilization, + + [Field ("MTLCommonCounterSetStatistic")] + SetStatistic, + } + +#endif } #endif diff --git a/src/Metal/MTLRasterizationRateLayerDescriptor.cs b/src/Metal/MTLRasterizationRateLayerDescriptor.cs new file mode 100644 index 000000000000..87359c5ebddd --- /dev/null +++ b/src/Metal/MTLRasterizationRateLayerDescriptor.cs @@ -0,0 +1,54 @@ +#if IOS +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; + +using Foundation; +using ObjCRuntime; + +namespace Metal { + public partial class MTLRasterizationRateLayerDescriptor + { +/* Selectors reported as not working by instrospection: https://github.com/xamarin/maccore/issues/1976 + [NoMac, NoTV, iOS (13,0)] + public double[] HorizontalSampleStorage { + get { + var width = (int)SampleCount.Width; + var floatArray = new double[width]; + Marshal.Copy (_HorizontalSampleStorage, floatArray, 0, width); + return floatArray; + } + } + + [NoMac, NoTV, iOS (13,0)] + public double[] VerticalSampleStorage { + get { + var height = (int)SampleCount.Height; + var floatArray = new double[height]; + Marshal.Copy (_VerticalSampleStorage, floatArray, 0, height); + return floatArray; + } + } +*/ + [NoMac, NoTV, iOS (13,0)] + static public MTLRasterizationRateLayerDescriptor Create (MTLSize sampleCount, float[] horizontal, float[] vertical) + { + if (horizontal == null) + throw new ArgumentNullException (nameof (horizontal)); + if (vertical == null) + throw new ArgumentNullException (nameof (vertical)); + if (sampleCount.Width != horizontal.Length) + throw new ArgumentOutOfRangeException ("Horizontal length should be equal to the sampleCount.Width."); + if (sampleCount.Height != vertical.Length) + throw new ArgumentOutOfRangeException ("Vertical length should be equal to the sampleCount.Height."); + + unsafe { + fixed (void* horizontalHandle = horizontal) + fixed (void* verticalHandle = vertical) { + return new MTLRasterizationRateLayerDescriptor (sampleCount, (IntPtr) horizontalHandle, (IntPtr) verticalHandle); + } + } + } + } +} +#endif diff --git a/src/Metal/MTLResourceStateCommandEncoder.cs b/src/Metal/MTLResourceStateCommandEncoder.cs new file mode 100644 index 000000000000..7fa4d45c7cfc --- /dev/null +++ b/src/Metal/MTLResourceStateCommandEncoder.cs @@ -0,0 +1,47 @@ +// +// API for the Metal framework +// +// Authors: +// Manuel de la Pena +// +#if IOS +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; + +using Foundation; +using ObjCRuntime; + +namespace Metal { + + public static partial class MTLResourceStateCommandEncoder_Extensions { + + [NoMac, NoTV, iOS (13,0)] + public static void Update (this IMTLResourceStateCommandEncoder This, IMTLTexture texture, MTLSparseTextureMappingMode mode, MTLRegion[] regions, nuint[] mipLevels, nuint[] slices) + { + if (texture == null) + throw new ArgumentNullException (nameof (texture)); + if (regions == null) + throw new ArgumentNullException (nameof (regions)); + if (mipLevels == null) + throw new ArgumentNullException (nameof (mipLevels)); + if (slices == null) + throw new ArgumentNullException (nameof (slices)); + + var regionsHandle = GCHandle.Alloc (regions, GCHandleType.Pinned); + var mipLevelsHandle = GCHandle.Alloc (mipLevels, GCHandleType.Pinned); + var slicesHandle = GCHandle.Alloc (slices, GCHandleType.Pinned); + try { + var regionsPtr = regionsHandle.AddrOfPinnedObject (); + var mipLevelsPtr = mipLevelsHandle.AddrOfPinnedObject (); + var slicesPtr = slicesHandle.AddrOfPinnedObject (); + This.Update (texture, mode, regionsPtr, mipLevelsPtr, slicesPtr, (nuint)regions.Length); + } finally { + regionsHandle.Free (); + mipLevelsHandle.Free (); + slicesHandle.Free (); + } + } + } +} +#endif \ No newline at end of file diff --git a/src/frameworks.sources b/src/frameworks.sources index 5071a543ea51..cebd12123514 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1083,8 +1083,10 @@ METAL_SOURCES = \ Metal/MTLCompat.cs \ Metal/MTLDevice.cs \ Metal/MTLArrays.cs \ + Metal/MTLRasterizationRateLayerDescriptor.cs \ Metal/MTLRenderCommandEncoder.cs \ Metal/MTLRenderPassDescriptor.cs \ + Metal/MTLResourceStateCommandEncoder.cs \ Metal/MTLVertexDescriptor.cs \ # MetalKit diff --git a/src/metal.cs b/src/metal.cs index 4065db010c0a..30dc3755484e 100644 --- a/src/metal.cs +++ b/src/metal.cs @@ -25,6 +25,11 @@ using ObjCRuntime; namespace Metal { + +#if !IOS + interface MTLVertexAmplificationViewMapping {} + interface MTLCoordinate2D {} +#endif delegate void MTLDeallocator (IntPtr pointer, nuint length); delegate void MTLNewComputePipelineStateWithReflectionCompletionHandler (IMTLComputePipelineState computePipelineState, MTLComputePipelineReflection reflection, NSError error); @@ -180,6 +185,21 @@ partial interface MTLBuffer : MTLResource { #endif [Export ("removeAllDebugMarkers")] void RemoveAllDebugMarkers (); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [NullAllowed, Export ("remoteStorageBuffer")] + IMTLBuffer RemoteStorageBuffer { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("newRemoteBufferViewForDevice:")] + [return: NullAllowed] + IMTLBuffer CreateRemoteBuffer (IMTLDevice device); } [iOS (10,0), TV (10,0), NoWatch, Mac (10,12)] @@ -358,6 +378,13 @@ partial interface MTLCommandBuffer { #endif [Export ("popDebugGroup")] void PopDebugGroup (); + +#if XAMCORE_4_0 + [Abstract] // @required but we can't add abstract members in C# and keep binary compatibility +#endif + [NoMac, iOS (13, 0), NoTV] + [NullAllowed, Export ("resourceStateCommandEncoder")] + IMTLResourceStateCommandEncoder ResourceStateCommandEncoder { get; } } interface IMTLCommandQueue {} @@ -550,6 +577,27 @@ partial interface MTLComputeCommandEncoder : MTLCommandEncoder { #endif [Export ("memoryBarrierWithResources:count:")] void MemoryBarrier (IMTLResource[] resources, nuint count); + + [TV (13,0), NoMac, iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("executeCommandsInBuffer:withRange:")] + void ExecuteCommands (IMTLIndirectCommandBuffer indirectCommandBuffer, NSRange executionRange); + + [TV (13,0), NoMac, iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:")] + void ExecuteCommands (IMTLIndirectCommandBuffer indirectCommandbuffer, IMTLBuffer indirectRangeBuffer, nuint indirectBufferOffset); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("sampleCountersInBuffer:atSampleIndex:withBarrier:")] + void SampleCounters (MTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier); } [iOS (8,0)][Mac (10,11)] @@ -596,6 +644,13 @@ partial interface MTLComputePipelineState { #endif [Export ("imageblockMemoryLengthForDimensions:")] nuint GetImageblockMemoryLength (MTLSize imageblockDimensions); + + [TV (13, 0), NoMac, iOS (13, 0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("supportIndirectCommandBuffers")] + bool SupportIndirectCommandBuffers { get; } } interface IMTLBlitCommandEncoder {} @@ -708,6 +763,52 @@ partial interface MTLBlitCommandEncoder : MTLCommandEncoder { #endif [Export ("optimizeIndirectCommandBuffer:withRange:")] void Optimize (IMTLIndirectCommandBuffer indirectCommandBuffer, NSRange range); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("getTextureAccessCounters:region:mipLevel:slice:resetCounters:countersBuffer:countersBufferOffset:")] + void GetTextureAccessCounters (IMTLTexture texture, MTLRegion region, nuint mipLevel, nuint slice, bool resetCounters, IMTLBuffer countersBuffer, nuint countersBufferOffset); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("resetTextureAccessCounters:region:mipLevel:slice:")] + void ResetTextureAccessCounters (IMTLTexture texture, MTLRegion region, nuint mipLevel, nuint slice); + + [TV (13,0), Mac (10,15), iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount:")] + void Copy (IMTLTexture sourceTexture, nuint sourceSlice, nuint sourceLevel, IMTLTexture destinationTexture, nuint destinationSlice, nuint destinationLevel, nuint sliceCount, nuint levelCount); + + [TV (13,0), Mac (10,15), iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("copyFromTexture:toTexture:")] + void Copy (IMTLTexture sourceTexture, IMTLTexture destinationTexture); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("sampleCountersInBuffer:atSampleIndex:withBarrier:")] + void SampleCounters (MTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("resolveCounters:inRange:destinationBuffer:destinationOffset:")] + void ResolveCounters (MTLCounterSampleBuffer sampleBuffer, NSRange range, IMTLBuffer destinationBuffer, nuint destinationOffset); } interface IMTLFence {} @@ -839,7 +940,7 @@ partial interface MTLDevice { [Export ("newTextureWithDescriptor:iosurface:plane:")] IMTLTexture CreateTexture (MTLTextureDescriptor descriptor, IOSurface.IOSurface iosurface, nuint plane); - [NoiOS, NoTV, Mac (10,14)] + [iOS (13,0), TV (13,0), Mac (10,14)] #if XAMCORE_4_0 [Abstract] #endif @@ -848,7 +949,7 @@ partial interface MTLDevice { [return: Release] IMTLTexture CreateSharedTexture (MTLTextureDescriptor descriptor); - [NoiOS, NoTV, Mac (10,14)] + [iOS (13,0), TV (13,0), Mac (10,14)] #if XAMCORE_4_0 [Abstract] #endif @@ -1156,6 +1257,156 @@ partial interface MTLDevice { #endif [Export ("newRenderPipelineStateWithTileDescriptor:options:completionHandler:")] void CreateRenderPipelineState (MTLTileRenderPipelineDescriptor descriptor, MTLPipelineOption options, MTLNewRenderPipelineStateWithReflectionCompletionHandler completionHandler); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("supportsVertexAmplificationCount:")] + bool SupportsVertexAmplification (nuint count); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("supportsRasterizationRateMapWithLayerCount:")] + bool SupportsRasterizationRateMap (nuint layerCount); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("sparseTileSizeWithTextureType:pixelFormat:sampleCount:")] + MTLSize GetSparseTileSize (MTLTextureType textureType, MTLPixelFormat pixelFormat, nuint sampleCount); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13, 0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("sparseTileSizeInBytes")] + nuint SparseTileSizeInBytes { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("newRasterizationRateMapWithDescriptor:")] + [return: NullAllowed] + IMTLRasterizationRateMap CreateRasterizationRateMap (MTLRasterizationRateMapDescriptor descriptor); + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:")] + void ConvertSparseTileRegions (IntPtr tileRegions, IntPtr pixelRegions, MTLSize tileSize, nuint numRegions); + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:")] + void ConvertSparsePixelRegions (IntPtr pixelRegions, IntPtr tileRegions, MTLSize tileSize, MTLSparseTextureRegionAlignmentMode mode, nuint numRegions); + + [TV (13, 0), Mac (10, 15), iOS (13, 0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("hasUnifiedMemory")] + bool HasUnifiedMemory { get; } + + [TV (13,0), Mac (10,15), iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("supportsFamily:")] + bool SupportsFamily (MTLGpuFamily gpuFamily); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("barycentricCoordsSupported")] + bool BarycentricCoordsSupported { [Bind ("areBarycentricCoordsSupported")] get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("supportsShaderBarycentricCoordinates")] + bool SupportsShaderBarycentricCoordinates { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("peerIndex")] + uint PeerIndex { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("peerCount")] + uint PeerCount { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [NullAllowed, Export ("counterSets")] + MTLCounterSet[] CounterSets { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("newCounterSampleBufferWithDescriptor:error:")] + [return: NullAllowed] + MTLCounterSampleBuffer CreateCounterSampleBuffer (MTLCounterSampleBufferDescriptor descriptor, [NullAllowed] out NSError error); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("sampleTimestamps:gpuTimestamp:")] + void GetSampleTimestamps (nuint cpuTimestamp, nuint gpuTimestamp); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("peerGroupID")] + ulong PeerGroupId { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("maxTransferRate")] + ulong MaxTransferRate { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("location")] + MTLDeviceLocation Location { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [Export ("locationNumber")] + nuint LocationNumber { get; } } interface IMTLDrawable {} @@ -1344,14 +1595,14 @@ partial interface MTLTexture : MTLResource { [Export ("iosurfacePlane")] nuint IOSurfacePlane { get; } - [NoiOS, NoTV, Mac (10, 14)] + [iOS (13,0), TV (13,0), Mac (10, 14)] #if XAMCORE_4_0 [Abstract] #endif [Export ("shareable")] bool Shareable { [Bind ("isShareable")] get; } - [NoiOS, NoTV, Mac (10, 14)] + [iOS (13,0), TV (13,0), Mac (10, 14)] #if XAMCORE_4_0 [Abstract] #endif @@ -1359,6 +1610,63 @@ partial interface MTLTexture : MTLResource { [return: Release] [Export ("newSharedTextureHandle")] MTLSharedTextureHandle CreateSharedTextureHandle (); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13, 0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("firstMipmapInTail")] + nuint FirstMipmapInTail { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13, 0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("tailSizeInBytes")] + nuint TailSizeInBytes { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13, 0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("isSparse")] + bool IsSparse { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [Mac (10, 15), TV (13,0), iOS (13, 0)] + [Export ("swizzle")] + MTLTextureSwizzleChannels Swizzle { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [Mac (10,15), TV (13,0), iOS (13,0)] + [Export ("newTextureViewWithPixelFormat:textureType:levels:slices:swizzle:")] + [return: NullAllowed] + IMTLTexture Create (MTLPixelFormat pixelFormat, MTLTextureType textureType, NSRange levelRange, NSRange sliceRange, MTLTextureSwizzleChannels swizzle); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10, 15)] + [NullAllowed, Export ("remoteStorageTexture")] + IMTLTexture RemoteStorageTexture { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("newRemoteTextureViewForDevice:")] + [return: NullAllowed] + IMTLTexture CreateRemoteTexture (IMTLDevice device); } @@ -1418,6 +1726,14 @@ partial interface MTLTextureDescriptor : NSCopying { [Mac (10,14), iOS (12,0), TV (12,0)] [Export ("allowGPUOptimizedContents")] bool AllowGpuOptimizedContents { get; set; } + + [Mac (10, 15), iOS (13, 0), TV (13,0)] + [Export ("hazardTrackingMode", ArgumentSemantic.Assign)] + MTLHazardTrackingMode HazardTrackingMode { get; set; } + + [TV (13, 0), Mac (10, 15), iOS (13, 0)] + [Export ("swizzle", ArgumentSemantic.Assign)] + MTLTextureSwizzleChannels Swizzle { get; set; } } [iOS (8,0)][Mac (10,11)] @@ -1582,6 +1898,12 @@ partial interface MTLRenderPipelineDescriptor : NSCopying { [Mac (10,14), iOS (12,0), TV (12,0)] [Export ("supportIndirectCommandBuffers")] bool SupportIndirectCommandBuffers { get; set; } + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13, 0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("maxVertexAmplificationCount")] + nuint MaxVertexAmplificationCount { get; set; } } [iOS (8,0)][Mac (10,11)] @@ -2442,7 +2764,7 @@ partial interface MTLRenderCommandEncoder : MTLCommandEncoder { [Export ("executeCommandsInBuffer:withRange:")] void ExecuteCommands (IMTLIndirectCommandBuffer indirectCommandBuffer, NSRange executionRange); - [NoiOS, NoTV, Mac (10,14)] + [iOS (13,0), TV (13,0), Mac (10,14)] #if XAMCORE_4_0 [Abstract] #endif @@ -2560,6 +2882,50 @@ partial interface MTLRenderCommandEncoder : MTLCommandEncoder { #endif [Export ("setThreadgroupMemoryLength:offset:atIndex:")] void SetThreadgroupMemoryLength (nuint length, nuint offset, nuint index); + +#if XAMCORE_4_0 + [Abstract] +#endif + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("setVertexAmplificationCount:viewMappings:")] + void SetVertexAmplificationCount (nuint count, MTLVertexAmplificationViewMapping viewMappings); + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV (13,0), Mac (10,15), iOS (13,0)] + [Export ("useResource:usage:stages:")] + void UseResource (IMTLResource resource, MTLResourceUsage usage, MTLRenderStages stages); + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV (13,0), Mac (10,15), iOS (13,0)] + [Export ("useResources:count:usage:stages:")] + void UseResources (IMTLResource[] resources, nuint count, MTLResourceUsage usage, MTLRenderStages stages); + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV (13,0), Mac (10,15), iOS (13,0)] + [Export ("useHeap:stages:")] + void UseHeap (IMTLHeap heap, MTLRenderStages stages); + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV(13,0), Mac (10,15), iOS (13,0)] + [Export ("useHeaps:count:stages:")] + void UseHeaps (IMTLHeap[] heaps, nuint count, MTLRenderStages stages); + +#if XAMCORE_4_0 + [Abstract] +#endif + [NoiOS, NoTV, Mac (10,15)] + [Export ("sampleCountersInBuffer:atSampleIndex:withBarrier:")] + void SampleCounters (MTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier); } [iOS (8,0)][Mac (10,11)] @@ -2752,17 +3118,31 @@ interface MTLRenderPassDescriptor : NSCopying { [Export ("tileHeight")] nuint TileHeight { get; set; } - [iOS (11, 0), NoTV, NoWatch, NoMac] + [iOS (11, 0), NoTV, NoWatch, Mac (10,15)] [Export ("defaultRasterSampleCount")] nuint DefaultRasterSampleCount { get; set; } - [iOS (11, 0), NoTV, NoWatch, NoMac] + [iOS (11, 0), NoTV, NoWatch, Mac(10,15)] [Export ("renderTargetWidth")] nuint RenderTargetWidth { get; set; } - [iOS (11, 0), NoTV, NoWatch, NoMac] + [iOS (11, 0), NoTV, NoWatch, Mac (10,15)] [Export ("renderTargetHeight")] nuint RenderTargetHeight { get; set; } + +/* Selectors reported missing by instrospection: https://github.com/xamarin/maccore/issues/1978 + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13, 0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [Export ("maxVertexAmplificationCount")] + nuint MaxVertexAmplificationCount { get; set; } +*/ + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13, 0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [NullAllowed, Export ("rasterizationRateMap", ArgumentSemantic.Strong)] + IMTLRasterizationRateMap RasterizationRateMap { get; set; } } @@ -2779,6 +3159,20 @@ interface MTLHeapDescriptor : NSCopying [Export ("cpuCacheMode", ArgumentSemantic.Assign)] MTLCpuCacheMode CpuCacheMode { get; set; } + +/* Selectors missing reported by introspection: https://github.com/xamarin/maccore/issues/1978 + [Mac (10, 15), iOS (13, 0)] + [Export ("hazardTrackingMode", ArgumentSemantic.Assign)] + MTLHazardTrackingMode HazardTrackingMode { get; set; } + + [Mac (10, 15), iOS (13, 0)] + [Export ("resourceOptions", ArgumentSemantic.Assign)] + MTLResourceOptions ResourceOptions { get; set; } + + [Mac (10, 15), iOS (13, 0)] + [Export ("type", ArgumentSemantic.Assign)] + MTLHeapType Type { get; set; } + */ } [iOS (10, 0), TV (10,0), NoWatch, Mac (10,13)] @@ -2835,6 +3229,43 @@ interface MTLHeap #endif [Export ("currentAllocatedSize")] nuint CurrentAllocatedSize { get; } + + [TV (13, 0), Mac (10, 15), iOS (13, 0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("hazardTrackingMode")] + MTLHazardTrackingMode HazardTrackingMode { get; } + + [TV (13, 0), Mac (10, 15), iOS (13, 0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("resourceOptions")] + MTLResourceOptions ResourceOptions { get; } + + [TV (13, 0), Mac (10, 15), iOS (13, 0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("type")] + MTLHeapType Type { get; } + + [TV (13,0), Mac (10,15), iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("newBufferWithLength:options:offset:")] + [return: NullAllowed] + IMTLBuffer CreateBuffer (nuint length, MTLResourceOptions options, nuint offset); + + [TV (13,0), Mac (10,15), iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("newTextureWithDescriptor:offset:")] + [return: NullAllowed] + IMTLTexture CreateTexture (MTLTextureDescriptor descriptor, nuint offset); } interface IMTLResource {} @@ -2889,6 +3320,27 @@ partial interface MTLResource { #endif [Export ("allocatedSize")] nuint AllocatedSize { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV (13, 0), Mac (10, 15), iOS (13, 0)] + [Export ("resourceOptions")] + MTLResourceOptions ResourceOptions { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV (13, 0), Mac (10, 15), iOS (13, 0)] + [Export ("heapOffset")] + nuint HeapOffset { get; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV (13, 0), Mac (10, 15), iOS (13, 0)] + [Export ("hazardTrackingMode")] + MTLHazardTrackingMode HazardTrackingMode { get; } } [iOS (9,0)][Mac (10,11)] @@ -2921,6 +3373,10 @@ interface MTLComputePipelineDescriptor : NSCopying { [Mac (10, 13), iOS (11,0), TV (11,0), NoWatch] [Export ("buffers")] MTLPipelineBufferDescriptorArray Buffers { get; } + + [NoMac, iOS (13, 0), TV (13,0)] + [Export ("supportIndirectCommandBuffers")] + bool SupportIndirectCommandBuffers { get; set; } } [iOS (10,0), TV (10,0), NoWatch, Mac (10,12)] @@ -3045,12 +3501,21 @@ interface MTLCaptureManager [return: Release] IMTLCaptureScope CreateNewCaptureScope (IMTLCommandQueue commandQueue); + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] + [Deprecated (PlatformName.iOS, 13, 0, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] + [Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] [Export ("startCaptureWithDevice:")] void StartCapture (IMTLDevice device); + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] + [Deprecated (PlatformName.iOS, 13, 0, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] + [Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] [Export ("startCaptureWithCommandQueue:")] void StartCapture (IMTLCommandQueue commandQueue); + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] + [Deprecated (PlatformName.iOS, 13, 0, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] + [Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'StartCapture (MTLCaptureDescriptor, NSError)' instead.")] [Export ("startCaptureWithScope:")] void StartCapture (IMTLCaptureScope captureScope); @@ -3062,6 +3527,14 @@ interface MTLCaptureManager [Export ("isCapturing")] bool IsCapturing { get; } + + [Mac (10,15), iOS (13,0), TV (13,0)] + [Export ("supportsDestination:")] + bool SupportsDestination (MTLCaptureDestination destination); + + [Mac (10,15), iOS (13,0), TV (13,0)] + [Export ("startCaptureWithDescriptor:error:")] + bool StartCapture (MTLCaptureDescriptor descriptor, [NullAllowed] out NSError error); } [Mac (10,13), iOS (11,0), TV (11,0), NoWatch] @@ -3170,7 +3643,7 @@ interface MTLArgumentEncoder [Export ("constantDataAtIndex:")] IntPtr GetConstantData (nuint index); - [NoiOS, NoTV] + [iOS (13,0), TV (13,0)] [Mac (10,14)] #if XAMCORE_4_0 [Abstract] @@ -3178,7 +3651,7 @@ interface MTLArgumentEncoder [Export ("setRenderPipelineState:atIndex:")] void SetRenderPipelineState ([NullAllowed] IMTLRenderPipelineState pipeline, nuint index); - [NoiOS, NoTV] + [iOS (13,0), TV (13,0)] [Mac (10,14)] #if XAMCORE_4_0 [Abstract] @@ -3207,6 +3680,21 @@ interface MTLArgumentEncoder [return: NullAllowed] [return: Release] IMTLArgumentEncoder CreateArgumentEncoder (nuint index); + + [TV (13,0), NoMac, iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("setComputePipelineState:atIndex:")] + void SetComputePipelineState ([NullAllowed] IMTLComputePipelineState pipeline, nuint index); + + [TV (13,0), NoMac, iOS (13,0)] +#if XAMCORE_4_0 + [Abstract] +#endif + [Export ("setComputePipelineStates:withRange:")] + void SetComputePipelineStates (IMTLComputePipelineState[] pipelines, NSRange range); + } [iOS (11, 0), NoTV, NoMac, NoWatch] @@ -3316,8 +3804,14 @@ interface IMTLIndirectRenderCommand {} [Mac (10,14), iOS (12,0)] [Protocol] interface MTLIndirectRenderCommand { - [NoiOS, NoTV, Mac (10,14)] + +#if MONOMAC && !XAMCORE_4_0 [Abstract] +#endif +#if XAMCORE_4_0 + [Abstract] +#endif + [iOS (13,0), TV (13,0), Mac (10,14)] [Export ("setRenderPipelineState:")] void SetRenderPipelineState (IMTLRenderPipelineState pipelineState); @@ -3358,7 +3852,7 @@ interface MTLIndirectCommandBufferDescriptor { [Export ("commandTypes", ArgumentSemantic.Assign)] MTLIndirectCommandType CommandTypes { get; set; } - [NoiOS, NoTV] + [iOS (13,0), TV (13,0)] [Export ("inheritPipelineState")] bool InheritPipelineState { get; set; } @@ -3370,6 +3864,11 @@ interface MTLIndirectCommandBufferDescriptor { [Export ("maxFragmentBufferBindCount")] nuint MaxFragmentBufferBindCount { get; set; } +/* Fails introspection issue: https://github.com/xamarin/maccore/issues/1979 + [NoMac, iOS (13, 0)] + [Export ("maxKernelBufferBindCount")] + nuint MaxKernelBufferBindCount { get; set; } +*/ } interface IMTLIndirectCommandBuffer {} @@ -3388,10 +3887,18 @@ interface MTLIndirectCommandBuffer : MTLResource { [Abstract] [Export ("indirectRenderCommandAtIndex:")] IMTLIndirectRenderCommand GetCommand (nuint commandIndex); + +#if XAMCORE_4_0 + [Abstract] +#endif + [TV (13,0), NoMac, iOS (13,0)] + [Export ("indirectComputeCommandAtIndex:")] + IMTLIndirectComputeCommand GetIndirectComputeCommand (nuint commandIndex); } - [NoiOS, NoTV, Mac (10,14)] + [iOS (13,0), TV (13,0), Mac (10,14)] [BaseType (typeof(NSObject))] + [DisableDefaultCtor] interface MTLSharedTextureHandle : NSSecureCoding { [Export ("device")] IMTLDevice Device { get; } @@ -3399,5 +3906,313 @@ interface MTLSharedTextureHandle : NSSecureCoding { [NullAllowed, Export ("label")] string Label { get; } } + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [BaseType (typeof(NSObject))] + interface MTLRasterizationRateSampleArray { + [Export ("objectAtIndexedSubscript:")] + NSNumber GetObject (nuint index); + + [Export ("setObject:atIndexedSubscript:")] + void SetObject (NSNumber value, nuint index); + } + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [BaseType (typeof(NSObject))] + interface MTLRasterizationRateMapDescriptor : NSCopying { + [Static] + [Export ("rasterizationRateMapDescriptorWithScreenSize:")] + MTLRasterizationRateMapDescriptor Create (MTLSize screenSize); + + [Static] + [Export ("rasterizationRateMapDescriptorWithScreenSize:layer:")] + MTLRasterizationRateMapDescriptor Create (MTLSize screenSize, MTLRasterizationRateLayerDescriptor layer); + + [Static] + [Export ("rasterizationRateMapDescriptorWithScreenSize:layerCount:layers:")] + MTLRasterizationRateMapDescriptor Create (MTLSize screenSize, nuint layerCount, out MTLRasterizationRateLayerDescriptor layers); + + [Export ("layerAtIndex:")] + [return: NullAllowed] + MTLRasterizationRateLayerDescriptor GetLayer (nuint layerIndex); + + [Export ("setLayer:atIndex:")] + void SetLayer ([NullAllowed] MTLRasterizationRateLayerDescriptor layer, nuint layerIndex); + +/* Selectors reported as missing by introspection: https://github.com/xamarin/maccore/issues/1980 + [Export ("layers")] + MTLRasterizationRateLayerArray Layers { get; } + + [Export ("screenSize", ArgumentSemantic.Assign)] + MTLSize ScreenSize { get; set; } + + [NullAllowed, Export ("label")] + string Label { get; set; } + + [Export ("layerCount")] + nuint LayerCount { get; } +*/ + } + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface MTLRasterizationRateLayerDescriptor : NSCopying { + + [Export ("initWithSampleCount:")] + [DesignatedInitializer] + IntPtr Constructor (MTLSize sampleCount); + + [Internal] + [Export ("initWithSampleCount:horizontal:vertical:")] + IntPtr Constructor (MTLSize sampleCount, IntPtr horizontal, IntPtr vertical); + +/* Selectors reported as not working by introspection: https://github.com/xamarin/maccore/issues/1976 + [Export ("sampleCount")] + MTLSize SampleCount { get; } + + [Internal] + [Export ("horizontalSampleStorage")] + IntPtr _HorizontalSampleStorage { get; } + + [Internal] + [Export ("verticalSampleStorage")] + IntPtr _VerticalSampleStorage { get; } + + [Export ("horizontal")] + MTLRasterizationRateSampleArray Horizontal { get; } + + [Export ("vertical")] + MTLRasterizationRateSampleArray Vertical { get; } + */ + } + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Advice ("This API is not available when using UIKit on macOS.")] + [BaseType (typeof(NSObject))] + interface MTLRasterizationRateLayerArray { + [Export ("objectAtIndexedSubscript:")] + [return: NullAllowed] + MTLRasterizationRateLayerDescriptor GetObject (nuint layerIndex); + + [Export ("setObject:atIndexedSubscript:")] + void SetObject ([NullAllowed] MTLRasterizationRateLayerDescriptor layer, nuint layerIndex); + } + + interface IMTLRasterizationRateMap {} + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac, NoTV, iOS (13,0)] + [Protocol, Advice ("This API is not available when using UIKit on macOS.")] + interface MTLRasterizationRateMap { + [Abstract] + [Export ("device")] + IMTLDevice Device { get; } + + [Abstract] + [NullAllowed, Export ("label")] + string Label { get; } + + [Abstract] + [Export ("screenSize")] + MTLSize ScreenSize { get; } + + [Abstract] + [Export ("physicalGranularity")] + MTLSize PhysicalGranularity { get; } + + [Abstract] + [Export ("layerCount")] + nuint LayerCount { get; } + + [Abstract] + [Export ("parameterBufferSizeAndAlign")] + MTLSizeAndAlign ParameterBufferSizeAndAlign { get; } + + [Abstract] + [Export ("copyParameterDataToBuffer:offset:")] + void CopyParameterData (IMTLBuffer buffer, nuint offset); + + [Abstract] + [Export ("physicalSizeForLayer:")] + MTLSize GetPhysicalSize (nuint layerIndex); + + [Abstract] + [Export ("mapScreenToPhysicalCoordinates:forLayer:")] + MTLCoordinate2D MapScreenToPhysicalCoordinates (MTLCoordinate2D screenCoordinates, nuint layerIndex); + + [Abstract] + [Export ("mapPhysicalToScreenCoordinates:forLayer:")] + MTLCoordinate2D MapPhysicalToScreenCoordinates (MTLCoordinate2D physicalCoordinates, nuint layerIndex); + } + + interface IMTLResourceStateCommandEncoder {} + + [NoMac, iOS (13,0), NoTV] + [Protocol] + interface MTLResourceStateCommandEncoder : MTLCommandEncoder { + [Unavailable (PlatformName.MacCatalyst)] + [NoMac] + [Advice ("This API is not available when using UIKit on macOS."), Abstract] + [Export ("updateTextureMappings:mode:regions:mipLevels:slices:numRegions:")] + void Update (IMTLTexture texture, MTLSparseTextureMappingMode mode, IntPtr regions, IntPtr mipLevels, IntPtr slices, nuint numRegions); + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac] + [Advice ("This API is not available when using UIKit on macOS."), Abstract] + [Export ("updateTextureMapping:mode:region:mipLevel:slice:")] + void Update (IMTLTexture texture, MTLSparseTextureMappingMode mode, MTLRegion region, nuint mipLevel, nuint slice); + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac] + [Advice ("This API is not available when using UIKit on macOS."), Abstract] + [Export ("updateTextureMapping:mode:indirectBuffer:indirectBufferOffset:")] + void Update (IMTLTexture texture, MTLSparseTextureMappingMode mode, IMTLBuffer indirectBuffer, nuint indirectBufferOffset); + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac] + [Advice ("This API is not available when using UIKit on macOS."), Abstract] + [Export ("updateFence:")] + void Update (IMTLFence fence); + + [Unavailable (PlatformName.MacCatalyst)] + [NoMac] + [Advice ("This API is not available when using UIKit on macOS."), Abstract] + [Export ("waitForFence:")] + void Wait (IMTLFence fence); + } + + [Mac (10,15), iOS (13,0), TV (13,0)] + [BaseType (typeof(NSObject))] + interface MTLCaptureDescriptor : NSCopying { + [NullAllowed, Export ("captureObject", ArgumentSemantic.Strong)] + NSObject CaptureObject { get; set; } + + [Export ("destination", ArgumentSemantic.Assign)] + MTLCaptureDestination Destination { get; set; } + + [NullAllowed, Export ("outputURL", ArgumentSemantic.Copy)] + NSUrl OutputUrl { get; set; } + } + + interface IMTLIndirectComputeCommand {} + + [TV (13,0), iOS (13,0), NoMac] + [Protocol] + interface MTLIndirectComputeCommand { + [Abstract] + [Export ("setComputePipelineState:")] + void SetComputePipelineState (IMTLComputePipelineState pipelineState); + + [Abstract] + [Export ("setKernelBuffer:offset:atIndex:")] + void SetKernelBuffer (IMTLBuffer buffer, nuint offset, nuint index); + + [Abstract] + [Export ("concurrentDispatchThreadgroups:threadsPerThreadgroup:")] + void ConcurrentDispatchThreadgroups (MTLSize threadgroupsPerGrid, MTLSize threadsPerThreadgroup); + + [Abstract] + [Export ("concurrentDispatchThreads:threadsPerThreadgroup:")] + void ConcurrentDispatchThreads (MTLSize threadsPerGrid, MTLSize threadsPerThreadgroup); + + [Abstract] + [Export ("setBarrier")] + void SetBarrier (); + + [Abstract] + [Export ("clearBarrier")] + void ClearBarrier (); + + [Abstract] + [Export ("reset")] + void Reset (); + + [Abstract] + [Export ("setThreadgroupMemoryLength:atIndex:")] + void SetThreadgroupMemoryLength (nuint length, nuint index); + + [Abstract] + [Export ("setStageInRegion:")] + void SetStageInRegion (MTLRegion region); + } + + interface IMTLCounter {} + + [NoiOS, NoTV, Mac (10,15)] + [Protocol] + [BaseType (typeof(NSObject))] + interface MTLCounter { + [Abstract] + [Export ("name")] + string Name { get; } + } + + interface IMTLCounterSet {} + + [NoiOS, NoTV, Mac (10,15)] + [Protocol] + [BaseType (typeof(NSObject))] + interface MTLCounterSet { + [Abstract] + [Export ("name")] + string Name { get; } + + [Abstract] + [Export ("counters", ArgumentSemantic.Copy)] + IMTLCounter[] Counters { get; } + } + + interface IMTLCounterSampleBuffer {} + + [NoiOS, NoTV, Mac (10,15)] + [Protocol] + [BaseType (typeof(NSObject))] + interface MTLCounterSampleBuffer { + [Abstract] + [Export ("device")] + IMTLDevice Device { get; } + + [Abstract] + [Export ("label")] + string Label { get; } + + [Abstract] + [Export ("sampleCount")] + nuint SampleCount { get; } + + [Abstract] + [Export ("resolveCounterRange:")] + [return: NullAllowed] + NSData ResolveCounterRange (NSRange range); + } + + [NoiOS, NoTV, Mac (10,15)] + [BaseType (typeof(NSObject))] + interface MTLCounterSampleBufferDescriptor : NSCopying + { + [NoiOS, Mac (10, 15)] + [Export ("counterSet", ArgumentSemantic.Retain)] + IMTLCounterSet CounterSet { get; set; } + + [NoiOS, Mac (10, 15)] + [Export ("label")] + string Label { get; set; } + + [NoiOS, Mac (10, 15)] + [Export ("storageMode", ArgumentSemantic.Assign)] + MTLStorageMode StorageMode { get; set; } + + [NoiOS, Mac (10, 15)] + [Export ("sampleCount")] + nuint SampleCount { get; set; } + } } #endif diff --git a/tests/xtro-sharpie/common-Metal.ignore b/tests/xtro-sharpie/common-Metal.ignore index b71377e1cea1..b18f8299d3d9 100644 --- a/tests/xtro-sharpie/common-Metal.ignore +++ b/tests/xtro-sharpie/common-Metal.ignore @@ -69,7 +69,30 @@ !incorrect-protocol-member! MTLResource::makeAliasable is REQUIRED and should be abstract !incorrect-protocol-member! MTLTexture::iosurface is REQUIRED and should be abstract !incorrect-protocol-member! MTLTexture::iosurfacePlane is REQUIRED and should be abstract - +!incorrect-protocol-member! MTLHeap::hazardTrackingMode is REQUIRED and should be abstract +!incorrect-protocol-member! MTLHeap::newBufferWithLength:options:offset: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLHeap::newTextureWithDescriptor:offset: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLHeap::resourceOptions is REQUIRED and should be abstract +!incorrect-protocol-member! MTLHeap::type is REQUIRED and should be abstract +!incorrect-protocol-member! MTLIndirectCommandBuffer::indirectComputeCommandAtIndex: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLIndirectRenderCommand::setRenderPipelineState: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLResource::hazardTrackingMode is REQUIRED and should be abstract +!incorrect-protocol-member! MTLResource::heapOffset is REQUIRED and should be abstract +!incorrect-protocol-member! MTLResource::resourceOptions is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::useHeap:stages: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::useHeaps:count:stages: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::useResource:usage:stages: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::useResources:count:usage:stages: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::newTextureViewWithPixelFormat:textureType:levels:slices:swizzle: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::swizzle is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBlitCommandEncoder::copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBlitCommandEncoder::copyFromTexture:toTexture: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLComputeCommandEncoder::executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLComputeCommandEncoder::executeCommandsInBuffer:withRange: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::newSharedTextureWithHandle: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::supportsFamily: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLArgumentEncoder::setRenderPipelineStates:withRange: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::hasUnifiedMemory is REQUIRED and should be abstract ## unsorted diff --git a/tests/xtro-sharpie/iOS-Metal.ignore b/tests/xtro-sharpie/iOS-Metal.ignore index 5bee1230a54d..8228750999db 100644 --- a/tests/xtro-sharpie/iOS-Metal.ignore +++ b/tests/xtro-sharpie/iOS-Metal.ignore @@ -57,3 +57,50 @@ !incorrect-protocol-member! MTLArgumentEncoder::newArgumentEncoderForBufferAtIndex: is REQUIRED and should be abstract !incorrect-protocol-member! MTLArgumentEncoder::setIndirectCommandBuffer:atIndex: is REQUIRED and should be abstract !incorrect-protocol-member! MTLArgumentEncoder::setIndirectCommandBuffers:withRange: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLCommandBuffer::resourceStateCommandEncoder is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::newRasterizationRateMapWithDescriptor: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::sparseTileSizeInBytes is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::sparseTileSizeWithTextureType:pixelFormat:sampleCount: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::supportsRasterizationRateMapWithLayerCount: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::supportsVertexAmplificationCount: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::setVertexAmplificationCount:viewMappings: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::firstMipmapInTail is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::isSparse is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::tailSizeInBytes is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBlitCommandEncoder::getTextureAccessCounters:region:mipLevel:slice:resetCounters:countersBuffer:countersBufferOffset: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBlitCommandEncoder::resetTextureAccessCounters:region:mipLevel:slice: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::isShareable is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::newSharedTextureHandle is REQUIRED and should be abstract +!incorrect-protocol-member! MTLArgumentEncoder::setRenderPipelineState:atIndex: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLComputePipelineState::supportIndirectCommandBuffers is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::newSharedTextureWithDescriptor: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLArgumentEncoder::setComputePipelineState:atIndex: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLArgumentEncoder::setComputePipelineStates:withRange: is REQUIRED and should be abstract + +# Selectors missing reported by introspection: https://github.com/xamarin/maccore/issues/1978 +!missing-selector! MTLHeapDescriptor::hazardTrackingMode not bound +!missing-selector! MTLHeapDescriptor::resourceOptions not bound +!missing-selector! MTLHeapDescriptor::setHazardTrackingMode: not bound +!missing-selector! MTLHeapDescriptor::setResourceOptions: not bound +!missing-selector! MTLHeapDescriptor::setType: not bound +!missing-selector! MTLHeapDescriptor::type not bound + +# Fails instrospection issue: https://github.com/xamarin/maccore/issues/1979 +!missing-selector! MTLIndirectCommandBufferDescriptor::maxKernelBufferBindCount not bound +!missing-selector! MTLIndirectCommandBufferDescriptor::setMaxKernelBufferBindCount: not bound + +# Selectors reported as not working by instrospection: https://github.com/xamarin/maccore/issues/1976 +!missing-selector! MTLRasterizationRateLayerDescriptor::horizontal not bound +!missing-selector! MTLRasterizationRateLayerDescriptor::horizontalSampleStorage not bound +!missing-selector! MTLRasterizationRateLayerDescriptor::sampleCount not bound +!missing-selector! MTLRasterizationRateLayerDescriptor::vertical not bound +!missing-selector! MTLRasterizationRateLayerDescriptor::verticalSampleStorage not bound + +# Selectors reported as missing by introspection: https://github.com/xamarin/maccore/issues/1980 +!missing-selector! MTLRasterizationRateMapDescriptor::label not bound +!missing-selector! MTLRasterizationRateMapDescriptor::layerCount not bound +!missing-selector! MTLRasterizationRateMapDescriptor::layers not bound +!missing-selector! MTLRasterizationRateMapDescriptor::screenSize not bound +!missing-selector! MTLRasterizationRateMapDescriptor::setLabel: not bound +!missing-selector! MTLRasterizationRateMapDescriptor::setScreenSize: not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/iOS-Metal.todo b/tests/xtro-sharpie/iOS-Metal.todo deleted file mode 100644 index a5f371e898e3..000000000000 --- a/tests/xtro-sharpie/iOS-Metal.todo +++ /dev/null @@ -1,120 +0,0 @@ -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithCommandQueue: missing a [Deprecated] attribute -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithDevice: missing a [Deprecated] attribute -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithScope: missing a [Deprecated] attribute -!missing-enum! MTLCaptureDestination not bound -!missing-enum! MTLCaptureError not bound -!missing-enum! MTLGPUFamily not bound -!missing-enum! MTLHazardTrackingMode not bound -!missing-enum! MTLHeapType not bound -!missing-enum! MTLTextureSwizzle not bound -!missing-field! MTLCaptureErrorDomain not bound -!missing-protocol! MTLIndirectComputeCommand not bound -!missing-protocol-member! MTLArgumentEncoder::setComputePipelineState:atIndex: not found -!missing-protocol-member! MTLArgumentEncoder::setComputePipelineStates:withRange: not found -!missing-protocol-member! MTLArgumentEncoder::setRenderPipelineState:atIndex: not found -!missing-protocol-member! MTLArgumentEncoder::setRenderPipelineStates:withRange: not found -!missing-protocol-member! MTLBlitCommandEncoder::copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount: not found -!missing-protocol-member! MTLBlitCommandEncoder::copyFromTexture:toTexture: not found -!missing-protocol-member! MTLComputeCommandEncoder::executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: not found -!missing-protocol-member! MTLComputeCommandEncoder::executeCommandsInBuffer:withRange: not found -!missing-protocol-member! MTLComputePipelineState::supportIndirectCommandBuffers not found -!missing-protocol-member! MTLDevice::hasUnifiedMemory not found -!missing-protocol-member! MTLDevice::newSharedTextureWithDescriptor: not found -!missing-protocol-member! MTLDevice::newSharedTextureWithHandle: not found -!missing-protocol-member! MTLDevice::supportsFamily: not found -!missing-protocol-member! MTLHeap::hazardTrackingMode not found -!missing-protocol-member! MTLHeap::newBufferWithLength:options:offset: not found -!missing-protocol-member! MTLHeap::newTextureWithDescriptor:offset: not found -!missing-protocol-member! MTLHeap::resourceOptions not found -!missing-protocol-member! MTLHeap::type not found -!missing-protocol-member! MTLIndirectCommandBuffer::indirectComputeCommandAtIndex: not found -!missing-protocol-member! MTLIndirectRenderCommand::setRenderPipelineState: not found -!missing-protocol-member! MTLRenderCommandEncoder::executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: not found -!missing-protocol-member! MTLRenderCommandEncoder::useHeap:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useHeaps:count:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useResource:usage:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useResources:count:usage:stages: not found -!missing-protocol-member! MTLResource::hazardTrackingMode not found -!missing-protocol-member! MTLResource::heapOffset not found -!missing-protocol-member! MTLResource::resourceOptions not found -!missing-protocol-member! MTLTexture::isShareable not found -!missing-protocol-member! MTLTexture::newSharedTextureHandle not found -!missing-protocol-member! MTLTexture::newTextureViewWithPixelFormat:textureType:levels:slices:swizzle: not found -!missing-protocol-member! MTLTexture::swizzle not found -!missing-selector! MTLCaptureDescriptor::captureObject not bound -!missing-selector! MTLCaptureDescriptor::destination not bound -!missing-selector! MTLCaptureDescriptor::outputURL not bound -!missing-selector! MTLCaptureDescriptor::setCaptureObject: not bound -!missing-selector! MTLCaptureDescriptor::setDestination: not bound -!missing-selector! MTLCaptureDescriptor::setOutputURL: not bound -!missing-selector! MTLCaptureManager::startCaptureWithDescriptor:error: not bound -!missing-selector! MTLCaptureManager::supportsDestination: not bound -!missing-selector! MTLComputePipelineDescriptor::setSupportIndirectCommandBuffers: not bound -!missing-selector! MTLComputePipelineDescriptor::supportIndirectCommandBuffers not bound -!missing-selector! MTLHeapDescriptor::hazardTrackingMode not bound -!missing-selector! MTLHeapDescriptor::resourceOptions not bound -!missing-selector! MTLHeapDescriptor::setHazardTrackingMode: not bound -!missing-selector! MTLHeapDescriptor::setResourceOptions: not bound -!missing-selector! MTLHeapDescriptor::setType: not bound -!missing-selector! MTLHeapDescriptor::type not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::inheritPipelineState not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::maxKernelBufferBindCount not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::setInheritPipelineState: not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::setMaxKernelBufferBindCount: not bound -!missing-selector! MTLSharedTextureHandle::device not bound -!missing-selector! MTLSharedTextureHandle::label not bound -!missing-selector! MTLTextureDescriptor::hazardTrackingMode not bound -!missing-selector! MTLTextureDescriptor::setHazardTrackingMode: not bound -!missing-selector! MTLTextureDescriptor::setSwizzle: not bound -!missing-selector! MTLTextureDescriptor::swizzle not bound -!missing-type! MTLCaptureDescriptor not bound -!missing-type! MTLSharedTextureHandle not bound -## appended from unclassified file -!missing-enum! MTLSparseTextureMappingMode not bound -!missing-enum! MTLSparseTextureRegionAlignmentMode not bound -!missing-protocol! MTLRasterizationRateMap not bound -!missing-protocol! MTLResourceStateCommandEncoder not bound -!missing-protocol-member! MTLBlitCommandEncoder::getTextureAccessCounters:region:mipLevel:slice:resetCounters:countersBuffer:countersBufferOffset: not found -!missing-protocol-member! MTLBlitCommandEncoder::resetTextureAccessCounters:region:mipLevel:slice: not found -!missing-protocol-member! MTLCommandBuffer::resourceStateCommandEncoder not found -!missing-protocol-member! MTLDevice::convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions: not found -!missing-protocol-member! MTLDevice::convertSparseTileRegions:toPixelRegions:withTileSize:numRegions: not found -!missing-protocol-member! MTLDevice::newRasterizationRateMapWithDescriptor: not found -!missing-protocol-member! MTLDevice::sparseTileSizeInBytes not found -!missing-protocol-member! MTLDevice::sparseTileSizeWithTextureType:pixelFormat:sampleCount: not found -!missing-protocol-member! MTLDevice::supportsRasterizationRateMapWithLayerCount: not found -!missing-protocol-member! MTLDevice::supportsVertexAmplificationCount: not found -!missing-protocol-member! MTLRenderCommandEncoder::setVertexAmplificationCount:viewMappings: not found -!missing-protocol-member! MTLTexture::firstMipmapInTail not found -!missing-protocol-member! MTLTexture::isSparse not found -!missing-protocol-member! MTLTexture::tailSizeInBytes not found -!missing-selector! +MTLRasterizationRateMapDescriptor::rasterizationRateMapDescriptorWithScreenSize: not bound -!missing-selector! +MTLRasterizationRateMapDescriptor::rasterizationRateMapDescriptorWithScreenSize:layer: not bound -!missing-selector! +MTLRasterizationRateMapDescriptor::rasterizationRateMapDescriptorWithScreenSize:layerCount:layers: not bound -!missing-selector! MTLRasterizationRateLayerArray::objectAtIndexedSubscript: not bound -!missing-selector! MTLRasterizationRateLayerArray::setObject:atIndexedSubscript: not bound -!missing-selector! MTLRasterizationRateLayerDescriptor::horizontal not bound -!missing-selector! MTLRasterizationRateLayerDescriptor::horizontalSampleStorage not bound -!missing-selector! MTLRasterizationRateLayerDescriptor::initWithSampleCount: not bound -!missing-selector! MTLRasterizationRateLayerDescriptor::initWithSampleCount:horizontal:vertical: not bound -!missing-selector! MTLRasterizationRateLayerDescriptor::sampleCount not bound -!missing-selector! MTLRasterizationRateLayerDescriptor::vertical not bound -!missing-selector! MTLRasterizationRateLayerDescriptor::verticalSampleStorage not bound -!missing-selector! MTLRasterizationRateMapDescriptor::label not bound -!missing-selector! MTLRasterizationRateMapDescriptor::layerAtIndex: not bound -!missing-selector! MTLRasterizationRateMapDescriptor::layerCount not bound -!missing-selector! MTLRasterizationRateMapDescriptor::layers not bound -!missing-selector! MTLRasterizationRateMapDescriptor::screenSize not bound -!missing-selector! MTLRasterizationRateMapDescriptor::setLabel: not bound -!missing-selector! MTLRasterizationRateMapDescriptor::setLayer:atIndex: not bound -!missing-selector! MTLRasterizationRateMapDescriptor::setScreenSize: not bound -!missing-selector! MTLRasterizationRateSampleArray::objectAtIndexedSubscript: not bound -!missing-selector! MTLRasterizationRateSampleArray::setObject:atIndexedSubscript: not bound -!missing-selector! MTLRenderPassDescriptor::rasterizationRateMap not bound -!missing-selector! MTLRenderPassDescriptor::setRasterizationRateMap: not bound -!missing-selector! MTLRenderPipelineDescriptor::maxVertexAmplificationCount not bound -!missing-selector! MTLRenderPipelineDescriptor::setMaxVertexAmplificationCount: not bound -!missing-type! MTLRasterizationRateLayerArray not bound -!missing-type! MTLRasterizationRateLayerDescriptor not bound -!missing-type! MTLRasterizationRateMapDescriptor not bound -!missing-type! MTLRasterizationRateSampleArray not bound diff --git a/tests/xtro-sharpie/macOS-Metal.ignore b/tests/xtro-sharpie/macOS-Metal.ignore index 29b60e8c725f..264ec31c71b7 100644 --- a/tests/xtro-sharpie/macOS-Metal.ignore +++ b/tests/xtro-sharpie/macOS-Metal.ignore @@ -19,7 +19,6 @@ !incorrect-protocol-member! MTLArgumentEncoder::setIndirectCommandBuffer:atIndex: is REQUIRED and should be abstract !incorrect-protocol-member! MTLArgumentEncoder::setIndirectCommandBuffers:withRange: is REQUIRED and should be abstract !incorrect-protocol-member! MTLArgumentEncoder::setRenderPipelineState:atIndex: is REQUIRED and should be abstract -!incorrect-protocol-member! MTLArgumentEncoder::setRenderPipelineStates:withRange: is REQUIRED and should be abstract !incorrect-protocol-member! MTLBlitCommandEncoder::copyIndirectCommandBuffer:sourceRange:destination:destinationIndex: is REQUIRED and should be abstract !incorrect-protocol-member! MTLBlitCommandEncoder::optimizeContentsForCPUAccess: is REQUIRED and should be abstract !incorrect-protocol-member! MTLBlitCommandEncoder::optimizeContentsForCPUAccess:slice:level: is REQUIRED and should be abstract @@ -48,6 +47,32 @@ !incorrect-protocol-member! MTLRenderPipelineState::supportIndirectCommandBuffers is REQUIRED and should be abstract !incorrect-protocol-member! MTLTexture::allowGPUOptimizedContents is REQUIRED and should be abstract !incorrect-protocol-member! MTLDevice::newSharedTextureWithDescriptor: is REQUIRED and should be abstract -!incorrect-protocol-member! MTLDevice::newSharedTextureWithHandle: is REQUIRED and should be abstract !incorrect-protocol-member! MTLTexture::isShareable is REQUIRED and should be abstract !incorrect-protocol-member! MTLTexture::newSharedTextureHandle is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBlitCommandEncoder::resolveCounters:inRange:destinationBuffer:destinationOffset: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBlitCommandEncoder::sampleCountersInBuffer:atSampleIndex:withBarrier: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBuffer::newRemoteBufferViewForDevice: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLBuffer::remoteStorageBuffer is REQUIRED and should be abstract +!incorrect-protocol-member! MTLComputeCommandEncoder::sampleCountersInBuffer:atSampleIndex:withBarrier: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::areBarycentricCoordsSupported is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::counterSets is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::location is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::locationNumber is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::maxTransferRate is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::newCounterSampleBufferWithDescriptor:error: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::peerCount is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::peerGroupID is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::peerIndex is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::sampleTimestamps:gpuTimestamp: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::supportsShaderBarycentricCoordinates is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::sampleCountersInBuffer:atSampleIndex:withBarrier: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::newRemoteTextureViewForDevice: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::remoteStorageTexture is REQUIRED and should be abstract + +# Selectors missing reported by introspection: https://github.com/xamarin/maccore/issues/1978 +!missing-selector! MTLHeapDescriptor::hazardTrackingMode not bound +!missing-selector! MTLHeapDescriptor::resourceOptions not bound +!missing-selector! MTLHeapDescriptor::setHazardTrackingMode: not bound +!missing-selector! MTLHeapDescriptor::setResourceOptions: not bound +!missing-selector! MTLHeapDescriptor::setType: not bound +!missing-selector! MTLHeapDescriptor::type not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-Metal.todo b/tests/xtro-sharpie/macOS-Metal.todo deleted file mode 100644 index 477354da09dc..000000000000 --- a/tests/xtro-sharpie/macOS-Metal.todo +++ /dev/null @@ -1,105 +0,0 @@ -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithCommandQueue: missing a [Deprecated] attribute -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithDevice: missing a [Deprecated] attribute -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithScope: missing a [Deprecated] attribute -!missing-enum! MTLCaptureDestination not bound -!missing-enum! MTLCaptureError not bound -!missing-enum! MTLCounterSampleBufferError not bound -!missing-enum! MTLDeviceLocation not bound -!missing-enum! MTLGPUFamily not bound -!missing-enum! MTLHazardTrackingMode not bound -!missing-enum! MTLHeapType not bound -!missing-enum! MTLTextureSwizzle not bound -!missing-field! MTLCaptureErrorDomain not bound -!missing-field! MTLCommonCounterClipperInvocations not bound -!missing-field! MTLCommonCounterClipperPrimitivesOut not bound -!missing-field! MTLCommonCounterComputeKernelInvocations not bound -!missing-field! MTLCommonCounterFragmentCycles not bound -!missing-field! MTLCommonCounterFragmentInvocations not bound -!missing-field! MTLCommonCounterFragmentsPassed not bound -!missing-field! MTLCommonCounterPostTessellationVertexCycles not bound -!missing-field! MTLCommonCounterPostTessellationVertexInvocations not bound -!missing-field! MTLCommonCounterRenderTargetWriteCycles not bound -!missing-field! MTLCommonCounterSetStageUtilization not bound -!missing-field! MTLCommonCounterSetStatistic not bound -!missing-field! MTLCommonCounterSetTimestamp not bound -!missing-field! MTLCommonCounterTessellationCycles not bound -!missing-field! MTLCommonCounterTessellationInputPatches not bound -!missing-field! MTLCommonCounterTimestamp not bound -!missing-field! MTLCommonCounterTotalCycles not bound -!missing-field! MTLCommonCounterVertexCycles not bound -!missing-field! MTLCommonCounterVertexInvocations not bound -!missing-field! MTLCounterErrorDomain not bound -!missing-protocol! MTLCounter not bound -!missing-protocol! MTLCounterSampleBuffer not bound -!missing-protocol! MTLCounterSet not bound -!missing-protocol-member! MTLBlitCommandEncoder::copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount: not found -!missing-protocol-member! MTLBlitCommandEncoder::copyFromTexture:toTexture: not found -!missing-protocol-member! MTLBlitCommandEncoder::resolveCounters:inRange:destinationBuffer:destinationOffset: not found -!missing-protocol-member! MTLBlitCommandEncoder::sampleCountersInBuffer:atSampleIndex:withBarrier: not found -!missing-protocol-member! MTLBuffer::newRemoteBufferViewForDevice: not found -!missing-protocol-member! MTLBuffer::remoteStorageBuffer not found -!missing-protocol-member! MTLComputeCommandEncoder::sampleCountersInBuffer:atSampleIndex:withBarrier: not found -!missing-protocol-member! MTLDevice::areBarycentricCoordsSupported not found -!missing-protocol-member! MTLDevice::counterSets not found -!missing-protocol-member! MTLDevice::hasUnifiedMemory not found -!missing-protocol-member! MTLDevice::location not found -!missing-protocol-member! MTLDevice::locationNumber not found -!missing-protocol-member! MTLDevice::maxTransferRate not found -!missing-protocol-member! MTLDevice::newCounterSampleBufferWithDescriptor:error: not found -!missing-protocol-member! MTLDevice::peerCount not found -!missing-protocol-member! MTLDevice::peerGroupID not found -!missing-protocol-member! MTLDevice::peerIndex not found -!missing-protocol-member! MTLDevice::sampleTimestamps:gpuTimestamp: not found -!missing-protocol-member! MTLDevice::supportsFamily: not found -!missing-protocol-member! MTLDevice::supportsShaderBarycentricCoordinates not found -!missing-protocol-member! MTLHeap::hazardTrackingMode not found -!missing-protocol-member! MTLHeap::newBufferWithLength:options:offset: not found -!missing-protocol-member! MTLHeap::newTextureWithDescriptor:offset: not found -!missing-protocol-member! MTLHeap::resourceOptions not found -!missing-protocol-member! MTLHeap::type not found -!missing-protocol-member! MTLRenderCommandEncoder::sampleCountersInBuffer:atSampleIndex:withBarrier: not found -!missing-protocol-member! MTLRenderCommandEncoder::useHeap:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useHeaps:count:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useResource:usage:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useResources:count:usage:stages: not found -!missing-protocol-member! MTLResource::hazardTrackingMode not found -!missing-protocol-member! MTLResource::heapOffset not found -!missing-protocol-member! MTLResource::resourceOptions not found -!missing-protocol-member! MTLTexture::newRemoteTextureViewForDevice: not found -!missing-protocol-member! MTLTexture::newTextureViewWithPixelFormat:textureType:levels:slices:swizzle: not found -!missing-protocol-member! MTLTexture::remoteStorageTexture not found -!missing-protocol-member! MTLTexture::swizzle not found -!missing-selector! MTLCaptureDescriptor::captureObject not bound -!missing-selector! MTLCaptureDescriptor::destination not bound -!missing-selector! MTLCaptureDescriptor::outputURL not bound -!missing-selector! MTLCaptureDescriptor::setCaptureObject: not bound -!missing-selector! MTLCaptureDescriptor::setDestination: not bound -!missing-selector! MTLCaptureDescriptor::setOutputURL: not bound -!missing-selector! MTLCaptureManager::startCaptureWithDescriptor:error: not bound -!missing-selector! MTLCaptureManager::supportsDestination: not bound -!missing-selector! MTLCounterSampleBufferDescriptor::counterSet not bound -!missing-selector! MTLCounterSampleBufferDescriptor::label not bound -!missing-selector! MTLCounterSampleBufferDescriptor::sampleCount not bound -!missing-selector! MTLCounterSampleBufferDescriptor::setCounterSet: not bound -!missing-selector! MTLCounterSampleBufferDescriptor::setLabel: not bound -!missing-selector! MTLCounterSampleBufferDescriptor::setSampleCount: not bound -!missing-selector! MTLCounterSampleBufferDescriptor::setStorageMode: not bound -!missing-selector! MTLCounterSampleBufferDescriptor::storageMode not bound -!missing-selector! MTLHeapDescriptor::hazardTrackingMode not bound -!missing-selector! MTLHeapDescriptor::resourceOptions not bound -!missing-selector! MTLHeapDescriptor::setHazardTrackingMode: not bound -!missing-selector! MTLHeapDescriptor::setResourceOptions: not bound -!missing-selector! MTLHeapDescriptor::setType: not bound -!missing-selector! MTLHeapDescriptor::type not bound -!missing-selector! MTLRenderPassDescriptor::defaultRasterSampleCount not bound -!missing-selector! MTLRenderPassDescriptor::renderTargetHeight not bound -!missing-selector! MTLRenderPassDescriptor::renderTargetWidth not bound -!missing-selector! MTLRenderPassDescriptor::setDefaultRasterSampleCount: not bound -!missing-selector! MTLRenderPassDescriptor::setRenderTargetHeight: not bound -!missing-selector! MTLRenderPassDescriptor::setRenderTargetWidth: not bound -!missing-selector! MTLTextureDescriptor::hazardTrackingMode not bound -!missing-selector! MTLTextureDescriptor::setHazardTrackingMode: not bound -!missing-selector! MTLTextureDescriptor::setSwizzle: not bound -!missing-selector! MTLTextureDescriptor::swizzle not bound -!missing-type! MTLCaptureDescriptor not bound -!missing-type! MTLCounterSampleBufferDescriptor not bound diff --git a/tests/xtro-sharpie/tvOS-Metal.ignore b/tests/xtro-sharpie/tvOS-Metal.ignore index 59da63544778..8c265fbd4a7d 100644 --- a/tests/xtro-sharpie/tvOS-Metal.ignore +++ b/tests/xtro-sharpie/tvOS-Metal.ignore @@ -29,3 +29,23 @@ !incorrect-protocol-member! MTLArgumentEncoder::newArgumentEncoderForBufferAtIndex: is REQUIRED and should be abstract !incorrect-protocol-member! MTLArgumentEncoder::setIndirectCommandBuffer:atIndex: is REQUIRED and should be abstract !incorrect-protocol-member! MTLArgumentEncoder::setIndirectCommandBuffers:withRange: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLDevice::newSharedTextureWithDescriptor: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLArgumentEncoder::setRenderPipelineState:atIndex: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLComputePipelineState::supportIndirectCommandBuffers is REQUIRED and should be abstract +!incorrect-protocol-member! MTLArgumentEncoder::setComputePipelineState:atIndex: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLArgumentEncoder::setComputePipelineStates:withRange: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLRenderCommandEncoder::executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::isShareable is REQUIRED and should be abstract +!incorrect-protocol-member! MTLTexture::newSharedTextureHandle is REQUIRED and should be abstract + +# Selectors missing reported by introspection: https://github.com/xamarin/maccore/issues/1978 +!missing-selector! MTLHeapDescriptor::hazardTrackingMode not bound +!missing-selector! MTLHeapDescriptor::resourceOptions not bound +!missing-selector! MTLHeapDescriptor::setHazardTrackingMode: not bound +!missing-selector! MTLHeapDescriptor::setResourceOptions: not bound +!missing-selector! MTLHeapDescriptor::setType: not bound +!missing-selector! MTLHeapDescriptor::type not bound + +# Fails instrospection issue: https://github.com/xamarin/maccore/issues/1979 +!missing-selector! MTLIndirectCommandBufferDescriptor::maxKernelBufferBindCount not bound +!missing-selector! MTLIndirectCommandBufferDescriptor::setMaxKernelBufferBindCount: not bound diff --git a/tests/xtro-sharpie/tvOS-Metal.todo b/tests/xtro-sharpie/tvOS-Metal.todo deleted file mode 100644 index 492d7b94e552..000000000000 --- a/tests/xtro-sharpie/tvOS-Metal.todo +++ /dev/null @@ -1,72 +0,0 @@ -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithCommandQueue: missing a [Deprecated] attribute -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithDevice: missing a [Deprecated] attribute -!deprecated-attribute-missing! MTLCaptureManager::startCaptureWithScope: missing a [Deprecated] attribute -!missing-enum! MTLCaptureDestination not bound -!missing-enum! MTLCaptureError not bound -!missing-enum! MTLGPUFamily not bound -!missing-enum! MTLHazardTrackingMode not bound -!missing-enum! MTLHeapType not bound -!missing-enum! MTLPrimitiveTopologyClass not bound -!missing-enum! MTLTextureSwizzle not bound -!missing-field! MTLCaptureErrorDomain not bound -!missing-protocol! MTLIndirectComputeCommand not bound -!missing-protocol-member! MTLArgumentEncoder::setComputePipelineState:atIndex: not found -!missing-protocol-member! MTLArgumentEncoder::setComputePipelineStates:withRange: not found -!missing-protocol-member! MTLArgumentEncoder::setRenderPipelineState:atIndex: not found -!missing-protocol-member! MTLArgumentEncoder::setRenderPipelineStates:withRange: not found -!missing-protocol-member! MTLBlitCommandEncoder::copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount: not found -!missing-protocol-member! MTLBlitCommandEncoder::copyFromTexture:toTexture: not found -!missing-protocol-member! MTLComputeCommandEncoder::executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: not found -!missing-protocol-member! MTLComputeCommandEncoder::executeCommandsInBuffer:withRange: not found -!missing-protocol-member! MTLComputePipelineState::supportIndirectCommandBuffers not found -!missing-protocol-member! MTLDevice::hasUnifiedMemory not found -!missing-protocol-member! MTLDevice::newSharedTextureWithDescriptor: not found -!missing-protocol-member! MTLDevice::newSharedTextureWithHandle: not found -!missing-protocol-member! MTLDevice::supportsFamily: not found -!missing-protocol-member! MTLHeap::hazardTrackingMode not found -!missing-protocol-member! MTLHeap::newBufferWithLength:options:offset: not found -!missing-protocol-member! MTLHeap::newTextureWithDescriptor:offset: not found -!missing-protocol-member! MTLHeap::resourceOptions not found -!missing-protocol-member! MTLHeap::type not found -!missing-protocol-member! MTLIndirectCommandBuffer::indirectComputeCommandAtIndex: not found -!missing-protocol-member! MTLIndirectRenderCommand::setRenderPipelineState: not found -!missing-protocol-member! MTLRenderCommandEncoder::executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: not found -!missing-protocol-member! MTLRenderCommandEncoder::useHeap:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useHeaps:count:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useResource:usage:stages: not found -!missing-protocol-member! MTLRenderCommandEncoder::useResources:count:usage:stages: not found -!missing-protocol-member! MTLResource::hazardTrackingMode not found -!missing-protocol-member! MTLResource::heapOffset not found -!missing-protocol-member! MTLResource::resourceOptions not found -!missing-protocol-member! MTLTexture::isShareable not found -!missing-protocol-member! MTLTexture::newSharedTextureHandle not found -!missing-protocol-member! MTLTexture::newTextureViewWithPixelFormat:textureType:levels:slices:swizzle: not found -!missing-protocol-member! MTLTexture::swizzle not found -!missing-selector! MTLCaptureDescriptor::captureObject not bound -!missing-selector! MTLCaptureDescriptor::destination not bound -!missing-selector! MTLCaptureDescriptor::outputURL not bound -!missing-selector! MTLCaptureDescriptor::setCaptureObject: not bound -!missing-selector! MTLCaptureDescriptor::setDestination: not bound -!missing-selector! MTLCaptureDescriptor::setOutputURL: not bound -!missing-selector! MTLCaptureManager::startCaptureWithDescriptor:error: not bound -!missing-selector! MTLCaptureManager::supportsDestination: not bound -!missing-selector! MTLComputePipelineDescriptor::setSupportIndirectCommandBuffers: not bound -!missing-selector! MTLComputePipelineDescriptor::supportIndirectCommandBuffers not bound -!missing-selector! MTLHeapDescriptor::hazardTrackingMode not bound -!missing-selector! MTLHeapDescriptor::resourceOptions not bound -!missing-selector! MTLHeapDescriptor::setHazardTrackingMode: not bound -!missing-selector! MTLHeapDescriptor::setResourceOptions: not bound -!missing-selector! MTLHeapDescriptor::setType: not bound -!missing-selector! MTLHeapDescriptor::type not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::inheritPipelineState not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::maxKernelBufferBindCount not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::setInheritPipelineState: not bound -!missing-selector! MTLIndirectCommandBufferDescriptor::setMaxKernelBufferBindCount: not bound -!missing-selector! MTLSharedTextureHandle::device not bound -!missing-selector! MTLSharedTextureHandle::label not bound -!missing-selector! MTLTextureDescriptor::hazardTrackingMode not bound -!missing-selector! MTLTextureDescriptor::setHazardTrackingMode: not bound -!missing-selector! MTLTextureDescriptor::setSwizzle: not bound -!missing-selector! MTLTextureDescriptor::swizzle not bound -!missing-type! MTLCaptureDescriptor not bound -!missing-type! MTLSharedTextureHandle not bound