diff --git a/src/MetalPerformanceShaders/MPSCnnConvolutionDescriptor.cs b/src/MetalPerformanceShaders/MPSCnnConvolutionDescriptor.cs index 191ca662ac..c60f58dbc3 100644 --- a/src/MetalPerformanceShaders/MPSCnnConvolutionDescriptor.cs +++ b/src/MetalPerformanceShaders/MPSCnnConvolutionDescriptor.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using ObjCRuntime; diff --git a/src/MetalPerformanceShaders/MPSCnnKernel.cs b/src/MetalPerformanceShaders/MPSCnnKernel.cs index 14085266c1..07158f00b8 100644 --- a/src/MetalPerformanceShaders/MPSCnnKernel.cs +++ b/src/MetalPerformanceShaders/MPSCnnKernel.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using Metal; using Foundation; diff --git a/src/MetalPerformanceShaders/MPSCnnNeuron.cs b/src/MetalPerformanceShaders/MPSCnnNeuron.cs index 57c41fae7a..f14081d0e2 100644 --- a/src/MetalPerformanceShaders/MPSCnnNeuron.cs +++ b/src/MetalPerformanceShaders/MPSCnnNeuron.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using Metal; using Foundation; diff --git a/src/MetalPerformanceShaders/MPSDefs.cs b/src/MetalPerformanceShaders/MPSDefs.cs index 39d95cc04d..de9b2af0a8 100644 --- a/src/MetalPerformanceShaders/MPSDefs.cs +++ b/src/MetalPerformanceShaders/MPSDefs.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using System.Runtime.InteropServices; diff --git a/src/MetalPerformanceShaders/MPSImageBatch.cs b/src/MetalPerformanceShaders/MPSImageBatch.cs index af56c464d8..d7d3d4044b 100644 --- a/src/MetalPerformanceShaders/MPSImageBatch.cs +++ b/src/MetalPerformanceShaders/MPSImageBatch.cs @@ -7,6 +7,8 @@ // Copyright 2019 Microsoft Corporation. // +#nullable enable + using System; using System.Runtime.InteropServices; using ObjCRuntime; @@ -32,8 +34,8 @@ namespace MetalPerformanceShaders { // Using 'NSArray' instead of `MPSImage[]` because image array 'Handle' matters. public static nuint IncrementReadCount (NSArray imageBatch, nint amount) { - if (imageBatch == null) - throw new ArgumentNullException (nameof (imageBatch)); + if (imageBatch is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (imageBatch)); return MPSImageBatchIncrementReadCount (imageBatch.Handle, amount); } @@ -44,10 +46,10 @@ namespace MetalPerformanceShaders { // Using 'NSArray' instead of `MPSImage[]` because image array 'Handle' matters. public static void Synchronize (NSArray imageBatch, IMTLCommandBuffer commandBuffer) { - if (imageBatch == null) - throw new ArgumentNullException (nameof (imageBatch)); - if (commandBuffer == null) - throw new ArgumentNullException (nameof (commandBuffer)); + if (imageBatch is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (imageBatch)); + if (commandBuffer is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (commandBuffer)); MPSImageBatchSynchronize (imageBatch.Handle, commandBuffer.Handle); } @@ -78,8 +80,8 @@ namespace MetalPerformanceShaders { #endif public static nuint GetResourceSize (NSArray imageBatch) { - if (imageBatch == null) - throw new ArgumentNullException (nameof (imageBatch)); + if (imageBatch is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (imageBatch)); return MPSImageBatchResourceSize (imageBatch.Handle); } @@ -116,10 +118,10 @@ namespace MetalPerformanceShaders { //[BindingImpl (BindingImplOptions.Optimizable)] //public static nint Iterate (NSArray imageBatch, MPSImageBatchIterator iterator) //{ - // if (imageBatch == null) - // throw new ArgumentNullException (nameof (imageBatch)); - // if (iterator == null) - // throw new ArgumentNullException (nameof (iterator)); + // if (imageBatch is null) + // ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (imageBatch)); + // if (iterator is null) + // ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (iterator)); // unsafe { // BlockLiteral* block_ptr_iterator; // BlockLiteral block_iterator; diff --git a/src/MetalPerformanceShaders/MPSImageScale.cs b/src/MetalPerformanceShaders/MPSImageScale.cs index e851a4f0ca..dfab5e74c0 100644 --- a/src/MetalPerformanceShaders/MPSImageScale.cs +++ b/src/MetalPerformanceShaders/MPSImageScale.cs @@ -1,5 +1,7 @@ // Copyright 2015 Xamarin Inc. All rights reserved. +#nullable enable + using System; using System.Runtime.InteropServices; using Foundation; diff --git a/src/MetalPerformanceShaders/MPSKernel.cs b/src/MetalPerformanceShaders/MPSKernel.cs index ab7d7ea668..083c9fed30 100644 --- a/src/MetalPerformanceShaders/MPSKernel.cs +++ b/src/MetalPerformanceShaders/MPSKernel.cs @@ -1,5 +1,7 @@ // Copyright 2015-2016 Xamarin Inc. All rights reserved. +#nullable enable + using System; using System.Runtime.InteropServices; using CoreGraphics; @@ -17,7 +19,7 @@ namespace MetalPerformanceShaders { public static bool Supports (IMTLDevice device) { - return MPSSupportsMTLDevice (device == null ? IntPtr.Zero : device.Handle); + return MPSSupportsMTLDevice (device.GetHandle ()); } #if NET @@ -43,16 +45,16 @@ namespace MetalPerformanceShaders { [Mac (10,15)] [iOS (13,0)] #endif - public static IMTLDevice GetPreferredDevice (MPSDeviceOptions options) + public static IMTLDevice? GetPreferredDevice (MPSDeviceOptions options) { var h = MPSGetPreferredDevice ((nuint)(ulong) options); return Runtime.GetINativeObject (h, false); } - internal unsafe static float [] GetTransform (IntPtr transform) + internal unsafe static float []? GetTransform (IntPtr transform) { var t = (float*) transform; - if (t == null) + if (t is null) return null; return new float [3] { t [0], t [1], t [2] }; } @@ -93,7 +95,7 @@ namespace MetalPerformanceShaders { [Mac (10,14)] [iOS (12,0)] #endif - public static void HintTemporaryMemoryHighWaterMark (IMTLCommandBuffer commandBuffer, nuint sizeInBytes) => MPSHintTemporaryMemoryHighWaterMark (commandBuffer == null ? IntPtr.Zero : commandBuffer.Handle, sizeInBytes); + public static void HintTemporaryMemoryHighWaterMark (IMTLCommandBuffer commandBuffer, nuint sizeInBytes) => MPSHintTemporaryMemoryHighWaterMark (commandBuffer.GetHandle (), sizeInBytes); #if NET [SupportedOSPlatform ("tvos12.0")] @@ -118,7 +120,7 @@ namespace MetalPerformanceShaders { [Mac (10,14)] [iOS (12,0)] #endif - public static void SetHeapCacheDuration (IMTLCommandBuffer commandBuffer, double seconds) => MPSSetHeapCacheDuration (commandBuffer == null ? IntPtr.Zero : commandBuffer.Handle, seconds); + public static void SetHeapCacheDuration (IMTLCommandBuffer commandBuffer, double seconds) => MPSSetHeapCacheDuration (commandBuffer.GetHandle (), seconds); #endif } @@ -157,8 +159,8 @@ namespace MetalPerformanceShaders { public MPSImageDilate (IMTLDevice device, nuint kernelWidth, nuint kernelHeight, float[] values) : base (NSObjectFlag.Empty) { - if (values == null) - throw new ArgumentNullException (nameof (values)); + if (values is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (values)); unsafe { fixed (float* ptr = values) @@ -188,7 +190,7 @@ namespace MetalPerformanceShaders { } } - public float[] Transform { + public float[]? Transform { get { return MPSKernel.GetTransform (_Transform); } } } @@ -205,7 +207,7 @@ namespace MetalPerformanceShaders { } } - public float[] Transform { + public float[]? Transform { get { return MPSKernel.GetTransform (_Transform); } } } @@ -222,7 +224,7 @@ namespace MetalPerformanceShaders { } } - public float[] Transform { + public float[]? Transform { get { return MPSKernel.GetTransform (_Transform); } } } @@ -239,7 +241,7 @@ namespace MetalPerformanceShaders { } } - public float[] Transform { + public float[]? Transform { get { return MPSKernel.GetTransform (_Transform); } } } @@ -256,7 +258,7 @@ namespace MetalPerformanceShaders { } } - public float[] Transform { + public float[]? Transform { get { return MPSKernel.GetTransform (_Transform); } } } @@ -267,8 +269,8 @@ namespace MetalPerformanceShaders { public MPSImageSobel (IMTLDevice device, float[] transform) : base (NSObjectFlag.Empty) { - if (transform == null) - throw new ArgumentNullException (nameof (transform)); + if (transform is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (transform)); unsafe { fixed (float* ptr = transform) @@ -276,7 +278,7 @@ namespace MetalPerformanceShaders { } } - public float[] ColorTransform { + public float[]? ColorTransform { get { return MPSKernel.GetTransform (_ColorTransform); } } } @@ -287,8 +289,8 @@ namespace MetalPerformanceShaders { public MPSCnnConvolution (IMTLDevice device, MPSCnnConvolutionDescriptor convolutionDescriptor, float[] kernelWeights, float[] biasTerms, MPSCnnConvolutionFlags flags) : base (NSObjectFlag.Empty) { - if (kernelWeights == null) - throw new ArgumentNullException (nameof (kernelWeights)); + if (kernelWeights is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (kernelWeights)); unsafe { fixed (float* kernelWeightsptr = kernelWeights) @@ -319,8 +321,8 @@ namespace MetalPerformanceShaders { public MPSCnnFullyConnected (IMTLDevice device, MPSCnnConvolutionDescriptor convolutionDescriptor, float[] kernelWeights, float[] biasTerms, MPSCnnConvolutionFlags flags) : base (NSObjectFlag.Empty) { - if (kernelWeights == null) - throw new ArgumentNullException (nameof (kernelWeights)); + if (kernelWeights is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (kernelWeights)); unsafe { fixed (float* kernelWeightsptr = kernelWeights) @@ -347,8 +349,8 @@ namespace MetalPerformanceShaders { public MPSImagePyramid (IMTLDevice device, nuint kernelWidth, nuint kernelHeight, float[] kernelWeights) : base (NSObjectFlag.Empty) { - if (kernelWeights == null) - throw new ArgumentNullException (nameof (kernelWeights)); + if (kernelWeights is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (kernelWeights)); unsafe { fixed (float* ptr = kernelWeights) @@ -363,8 +365,8 @@ namespace MetalPerformanceShaders { public MPSImageGaussianPyramid (IMTLDevice device, nuint kernelWidth, nuint kernelHeight, float[] kernelWeights) : base (NSObjectFlag.Empty) { - if (kernelWeights == null) - throw new ArgumentNullException (nameof (kernelWeights)); + if (kernelWeights is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (kernelWeights)); unsafe { fixed (float* ptr = kernelWeights) @@ -377,8 +379,8 @@ namespace MetalPerformanceShaders { [DesignatedInitializer] public MPSImageLaplacianPyramid (IMTLDevice device, nuint kernelWidth, nuint kernelHeight, float[] kernelWeights) : base (NSObjectFlag.Empty) { - if (kernelWeights == null) - throw new ArgumentNullException (nameof (kernelWeights)); + if (kernelWeights is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (kernelWeights)); if ((nuint) kernelWeights.Length < kernelWidth * kernelHeight) throw new ArgumentException ($"'{nameof (kernelWeights)}' size must be at least '{nameof (kernelWidth)}' * '{nameof (kernelHeight)}'."); @@ -393,8 +395,8 @@ namespace MetalPerformanceShaders { [DesignatedInitializer] public MPSImageLaplacianPyramidSubtract (IMTLDevice device, nuint kernelWidth, nuint kernelHeight, float[] kernelWeights) : base (NSObjectFlag.Empty) { - if (kernelWeights == null) - throw new ArgumentNullException (nameof (kernelWeights)); + if (kernelWeights is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (kernelWeights)); if ((nuint) kernelWeights.Length < kernelWidth * kernelHeight) throw new ArgumentException ($"'{nameof (kernelWeights)}' size must be at least '{nameof (kernelWidth)}' * '{nameof (kernelHeight)}'."); @@ -409,8 +411,8 @@ namespace MetalPerformanceShaders { [DesignatedInitializer] public MPSImageLaplacianPyramidAdd (IMTLDevice device, nuint kernelWidth, nuint kernelHeight, float[] kernelWeights) : base (NSObjectFlag.Empty) { - if (kernelWeights == null) - throw new ArgumentNullException (nameof (kernelWeights)); + if (kernelWeights is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (kernelWeights)); if ((nuint) kernelWeights.Length < kernelWidth * kernelHeight) throw new ArgumentException ($"'{nameof (kernelWeights)}' size must be at least '{nameof (kernelWidth)}' * '{nameof (kernelHeight)}'."); @@ -476,7 +478,7 @@ namespace MetalPerformanceShaders { [Mac (10,13,4)] [iOS (11,3)] #endif - public static MPSCnnBinaryFullyConnectedNode Create (MPSNNImageNode sourceNode, IMPSCnnConvolutionDataSource weights, float [] outputBiasTerms, float [] outputScaleTerms, float [] inputBiasTerms, float [] inputScaleTerms, MPSCnnBinaryConvolutionType type, MPSCnnBinaryConvolutionFlags flags) + public new static MPSCnnBinaryFullyConnectedNode Create (MPSNNImageNode sourceNode, IMPSCnnConvolutionDataSource weights, float [] outputBiasTerms, float [] outputScaleTerms, float [] inputBiasTerms, float [] inputScaleTerms, MPSCnnBinaryConvolutionType type, MPSCnnBinaryConvolutionFlags flags) { unsafe { fixed (void* outputBiasTermsHandle = outputBiasTerms) diff --git a/src/MetalPerformanceShaders/MPSNDArray.cs b/src/MetalPerformanceShaders/MPSNDArray.cs index 8286efcd8f..704ab6c5a1 100644 --- a/src/MetalPerformanceShaders/MPSNDArray.cs +++ b/src/MetalPerformanceShaders/MPSNDArray.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using Metal; using Foundation; diff --git a/src/MetalPerformanceShaders/MPSNNGraph.cs b/src/MetalPerformanceShaders/MPSNNGraph.cs index 4abc9eb246..bd52280fec 100644 --- a/src/MetalPerformanceShaders/MPSNNGraph.cs +++ b/src/MetalPerformanceShaders/MPSNNGraph.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using System.Runtime.InteropServices; using CoreGraphics; @@ -17,7 +19,7 @@ namespace MetalPerformanceShaders { [Mac (10,15)] [iOS (13,0)] #endif - public unsafe static MPSNNGraph Create (IMTLDevice device, MPSNNImageNode[] resultImages, bool[] resultsAreNeeded) + public unsafe static MPSNNGraph? Create (IMTLDevice device, MPSNNImageNode[] resultImages, bool[] resultsAreNeeded) { fixed (void *resultsAreNeededHandle = resultsAreNeeded) return Create (device, resultImages, (IntPtr) resultsAreNeededHandle); diff --git a/src/MetalPerformanceShaders/MPSStateBatch.cs b/src/MetalPerformanceShaders/MPSStateBatch.cs index bc3dac66ed..30f284b210 100644 --- a/src/MetalPerformanceShaders/MPSStateBatch.cs +++ b/src/MetalPerformanceShaders/MPSStateBatch.cs @@ -7,6 +7,8 @@ // Copyright 2019 Microsoft Corporation. // +#nullable enable + using System; using System.Runtime.InteropServices; using ObjCRuntime; @@ -32,8 +34,8 @@ namespace MetalPerformanceShaders { // Using 'NSArray' instead of `MPSState[]` because array 'Handle' matters. public static nuint IncrementReadCount (NSArray stateBatch, nint amount) { - if (stateBatch == null) - throw new ArgumentNullException (nameof (stateBatch)); + if (stateBatch is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (stateBatch)); return MPSStateBatchIncrementReadCount (stateBatch.Handle, amount); } @@ -44,10 +46,10 @@ namespace MetalPerformanceShaders { // Using 'NSArray' instead of `MPSState[]` because array 'Handle' matters. public static void Synchronize (NSArray stateBatch, IMTLCommandBuffer commandBuffer) { - if (stateBatch == null) - throw new ArgumentNullException (nameof (stateBatch)); - if (commandBuffer == null) - throw new ArgumentNullException (nameof (commandBuffer)); + if (stateBatch is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (stateBatch)); + if (commandBuffer is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (commandBuffer)); MPSStateBatchSynchronize (stateBatch.Handle, commandBuffer.Handle); } @@ -78,8 +80,8 @@ namespace MetalPerformanceShaders { #endif public static nuint GetResourceSize (NSArray stateBatch) { - if (stateBatch == null) - throw new ArgumentNullException (nameof (stateBatch)); + if (stateBatch is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (stateBatch)); return MPSStateBatchResourceSize (stateBatch.Handle); } diff --git a/src/MetalPerformanceShaders/MPSStateResourceList.cs b/src/MetalPerformanceShaders/MPSStateResourceList.cs index fa9e0cb69e..33c8698064 100644 --- a/src/MetalPerformanceShaders/MPSStateResourceList.cs +++ b/src/MetalPerformanceShaders/MPSStateResourceList.cs @@ -7,6 +7,8 @@ // Copyright 2019 Microsoft Corporation. // +#nullable enable + using System; using System.Runtime.InteropServices; using Foundation; @@ -15,21 +17,21 @@ using ObjCRuntime; namespace MetalPerformanceShaders { public partial class MPSStateResourceList { - public static MPSStateResourceList Create (params MTLTextureDescriptor [] descriptors) + public static MPSStateResourceList? Create (params MTLTextureDescriptor [] descriptors) { - if (descriptors == null) - throw new ArgumentNullException (nameof (descriptors)); + if (descriptors is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (descriptors)); if (descriptors.Length > 10) throw new ArgumentException ("Only 10 parameters are currently supported."); var arr = new IntPtr [10]; for (int i = 0; i < descriptors.Length; ++i) { - if (descriptors [i] == null) + if (descriptors [i] is null) throw new ArgumentException ($"'{nameof (descriptors)}[{i}]' was null."); arr [i] = descriptors [i].Handle; } - MPSStateResourceList ret; + MPSStateResourceList? ret; // Learned the hard way about arm64's variadic arguments calling conventions are different... if (Runtime.IsARM64CallingConvention) ret = Runtime.GetNSObject (IntPtr_objc_msgSend_IntPtrx3_FakeIntPtrx5_IntPtrx10 (class_ptr, Selector.GetHandle ("resourceListWithTextureDescriptors:"), arr [0], IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, arr [1], arr [2], arr [3], arr [4], arr [5], arr [6], arr [7], arr [8], arr [9], IntPtr.Zero)); @@ -39,10 +41,10 @@ namespace MetalPerformanceShaders { return ret; } - public static MPSStateResourceList Create (params nuint [] bufferSizes) + public static MPSStateResourceList? Create (params nuint [] bufferSizes) { - if (bufferSizes == null) - throw new ArgumentNullException (nameof (bufferSizes)); + if (bufferSizes is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (bufferSizes)); if (bufferSizes.Length > 10) throw new ArgumentException ("Only 10 parameters are currently supported."); @@ -52,7 +54,7 @@ namespace MetalPerformanceShaders { Marshal.Copy ((IntPtr) ptr, arr, 0, bufferSizes.Length); } - MPSStateResourceList ret; + MPSStateResourceList? ret; // Learned the hard way about arm64's variadic arguments calling conventions are different... if (Runtime.IsARM64CallingConvention) ret = Runtime.GetNSObject (IntPtr_objc_msgSend_IntPtrx3_FakeIntPtrx5_IntPtrx10 (class_ptr, Selector.GetHandle ("resourceListWithBufferSizes:"), arr [0], IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, arr [1], arr [2], arr [3], arr [4], arr [5], arr [6], arr [7], arr [8], arr [9], IntPtr.Zero)); diff --git a/src/metalperformanceshaders.cs b/src/metalperformanceshaders.cs index 9bc8dbceb9..88f32960cf 100644 --- a/src/metalperformanceshaders.cs +++ b/src/metalperformanceshaders.cs @@ -5486,6 +5486,7 @@ namespace MetalPerformanceShaders { void ReloadFromDataSources (); [Export ("encodeToCommandBuffer:sourceImages:sourceStates:intermediateImages:destinationStates:")] + [return: NullAllowed] MPSImage EncodeToCommandBuffer (IMTLCommandBuffer commandBuffer, MPSImage[] sourceImages, [NullAllowed] MPSState[] sourceStates, [NullAllowed] NSMutableArray intermediateImages, [NullAllowed] NSMutableArray destinationStates); [TV (11,3), Mac (10,13,4), iOS (11,3)] @@ -5494,6 +5495,7 @@ namespace MetalPerformanceShaders { NSArray EncodeBatch (IMTLCommandBuffer commandBuffer, NSArray [] sourceImages, [NullAllowed] NSArray[] sourceStates, [NullAllowed] NSMutableArray> intermediateImages, [NullAllowed] NSMutableArray> destinationStates); [Export ("encodeToCommandBuffer:sourceImages:")] + [return: NullAllowed] MPSImage EncodeToCommandBuffer (IMTLCommandBuffer commandBuffer, MPSImage[] sourceImages); [Export ("encodeBatchToCommandBuffer:sourceImages:sourceStates:")] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MetalPerformanceShaders.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MetalPerformanceShaders.todo index 66681e9d62..95f7b176d4 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MetalPerformanceShaders.todo +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MetalPerformanceShaders.todo @@ -1,13 +1,7 @@ -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 !missing-enum! MPSCNNConvolutionWeightsLayout not bound !missing-enum! MPSPolygonType not bound !missing-enum! MPSRayMaskOperator not bound !missing-enum! MPSTemporalWeighting not bound -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[],MetalPerformanceShaders.MPSState[],Foundation.NSMutableArray`1,Foundation.NSMutableArray`1)' is missing an [NullAllowed] on return type !missing-protocol! MPSCNNGroupNormalizationDataSource not bound !missing-protocol! MPSNNGramMatrixCallback not bound !missing-protocol! MPSSVGFTextureAllocator not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-MetalPerformanceShaders.ignore index 316f65fb59..07b2834a43 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/common-MetalPerformanceShaders.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/common-MetalPerformanceShaders.ignore @@ -40,3 +40,9 @@ # unused (came along some API yet to be bound) !unknown-simd-type-mapping! The Simd type vector_uchar16 does not have a mapping to a managed type. Please add one in SimdCheck.cs + +# These four below just have a 'ref' in front of the parameters in question and are okay. +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/api-annotations-dotnet/iOS-MetalPerformanceShaders.ignore deleted file mode 100644 index 0ef0fab5b1..0000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-MetalPerformanceShaders.ignore +++ /dev/null @@ -1,10 +0,0 @@ - -# Initial result from new rule extra-null-allowed -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 - -# Initial result from new rule missing-null-allowed -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[],MetalPerformanceShaders.MPSState[],Foundation.NSMutableArray`1,Foundation.NSMutableArray`1)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-MetalPerformanceShaders.ignore deleted file mode 100644 index 0ef0fab5b1..0000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-MetalPerformanceShaders.ignore +++ /dev/null @@ -1,10 +0,0 @@ - -# Initial result from new rule extra-null-allowed -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 - -# Initial result from new rule missing-null-allowed -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[],MetalPerformanceShaders.MPSState[],Foundation.NSMutableArray`1,Foundation.NSMutableArray`1)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-MetalPerformanceShaders.ignore deleted file mode 100644 index 0ef0fab5b1..0000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-MetalPerformanceShaders.ignore +++ /dev/null @@ -1,10 +0,0 @@ - -# Initial result from new rule extra-null-allowed -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 - -# Initial result from new rule missing-null-allowed -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[],MetalPerformanceShaders.MPSState[],Foundation.NSMutableArray`1,Foundation.NSMutableArray`1)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/common-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/common-MetalPerformanceShaders.ignore index 316f65fb59..07b2834a43 100644 --- a/tests/xtro-sharpie/common-MetalPerformanceShaders.ignore +++ b/tests/xtro-sharpie/common-MetalPerformanceShaders.ignore @@ -40,3 +40,9 @@ # unused (came along some API yet to be bound) !unknown-simd-type-mapping! The Simd type vector_uchar16 does not have a mapping to a managed type. Please add one in SimdCheck.cs + +# These four below just have a 'ref' in front of the parameters in question and are okay. +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 +!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 diff --git a/tests/xtro-sharpie/iOS-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/iOS-MetalPerformanceShaders.ignore deleted file mode 100644 index 0ef0fab5b1..0000000000 --- a/tests/xtro-sharpie/iOS-MetalPerformanceShaders.ignore +++ /dev/null @@ -1,10 +0,0 @@ - -# Initial result from new rule extra-null-allowed -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 - -# Initial result from new rule missing-null-allowed -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[],MetalPerformanceShaders.MPSState[],Foundation.NSMutableArray`1,Foundation.NSMutableArray`1)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/macOS-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/macOS-MetalPerformanceShaders.ignore deleted file mode 100644 index 0ef0fab5b1..0000000000 --- a/tests/xtro-sharpie/macOS-MetalPerformanceShaders.ignore +++ /dev/null @@ -1,10 +0,0 @@ - -# Initial result from new rule extra-null-allowed -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 - -# Initial result from new rule missing-null-allowed -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[],MetalPerformanceShaders.MPSState[],Foundation.NSMutableArray`1,Foundation.NSMutableArray`1)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/tvOS-MetalPerformanceShaders.ignore b/tests/xtro-sharpie/tvOS-MetalPerformanceShaders.ignore deleted file mode 100644 index 0ef0fab5b1..0000000000 --- a/tests/xtro-sharpie/tvOS-MetalPerformanceShaders.ignore +++ /dev/null @@ -1,10 +0,0 @@ - -# Initial result from new rule extra-null-allowed -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramEqualization::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageHistogramSpecification::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 -!extra-null-allowed! 'System.Void MetalPerformanceShaders.MPSImageNormalizedHistogram::.ctor(Metal.IMTLDevice,MetalPerformanceShaders.MPSImageHistogramInfo&)' has a extraneous [NullAllowed] on parameter #1 - -# Initial result from new rule missing-null-allowed -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'MetalPerformanceShaders.MPSImage MetalPerformanceShaders.MPSNNGraph::EncodeToCommandBuffer(Metal.IMTLCommandBuffer,MetalPerformanceShaders.MPSImage[],MetalPerformanceShaders.MPSState[],Foundation.NSMutableArray`1,Foundation.NSMutableArray`1)' is missing an [NullAllowed] on return type