[metalperformanceshaders] Add nullability to (generated and manual) bindings (#15163)
* Go through the ignore files and confirm nullability * enable nullability * throw better exceptions * use is null * remove from maccatalyst todo * use a gethandle Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
This commit is contained in:
Родитель
f4380b65b2
Коммит
a0ba164cca
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using ObjCRuntime;
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using Metal;
|
||||
using Foundation;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using Metal;
|
||||
using Foundation;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
|
|
@ -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<MPSImage>' instead of `MPSImage[]` because image array 'Handle' matters.
|
||||
public static nuint IncrementReadCount (NSArray<MPSImage> 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<MPSImage>' instead of `MPSImage[]` because image array 'Handle' matters.
|
||||
public static void Synchronize (NSArray<MPSImage> 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<MPSImage> 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<MPSImage> 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;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// Copyright 2015 Xamarin Inc. All rights reserved.
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Foundation;
|
||||
|
|
|
@ -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<IMTLDevice> (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)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using Metal;
|
||||
using Foundation;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<MPSState>' instead of `MPSState[]` because array 'Handle' matters.
|
||||
public static nuint IncrementReadCount (NSArray<MPSState> 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<MPSState>' instead of `MPSState[]` because array 'Handle' matters.
|
||||
public static void Synchronize (NSArray<MPSState> 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<MPSState> stateBatch)
|
||||
{
|
||||
if (stateBatch == null)
|
||||
throw new ArgumentNullException (nameof (stateBatch));
|
||||
if (stateBatch is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (stateBatch));
|
||||
|
||||
return MPSStateBatchResourceSize (stateBatch.Handle);
|
||||
}
|
||||
|
|
|
@ -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<MPSStateResourceList> (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<MPSStateResourceList> (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));
|
||||
|
|
|
@ -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<MPSImage> intermediateImages, [NullAllowed] NSMutableArray<MPSState> destinationStates);
|
||||
|
||||
[TV (11,3), Mac (10,13,4), iOS (11,3)]
|
||||
|
@ -5494,6 +5495,7 @@ namespace MetalPerformanceShaders {
|
|||
NSArray<MPSImage> EncodeBatch (IMTLCommandBuffer commandBuffer, NSArray<MPSImage> [] sourceImages, [NullAllowed] NSArray<MPSState>[] sourceStates, [NullAllowed] NSMutableArray<NSArray<MPSImage>> intermediateImages, [NullAllowed] NSMutableArray<NSArray<MPSState>> destinationStates);
|
||||
|
||||
[Export ("encodeToCommandBuffer:sourceImages:")]
|
||||
[return: NullAllowed]
|
||||
MPSImage EncodeToCommandBuffer (IMTLCommandBuffer commandBuffer, MPSImage[] sourceImages);
|
||||
|
||||
[Export ("encodeBatchToCommandBuffer:sourceImages:sourceStates:")]
|
||||
|
|
|
@ -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<MetalPerformanceShaders.MPSImage>,Foundation.NSMutableArray`1<MetalPerformanceShaders.MPSState>)' is missing an [NullAllowed] on return type
|
||||
!missing-protocol! MPSCNNGroupNormalizationDataSource not bound
|
||||
!missing-protocol! MPSNNGramMatrixCallback not bound
|
||||
!missing-protocol! MPSSVGFTextureAllocator not bound
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<MetalPerformanceShaders.MPSImage>,Foundation.NSMutableArray`1<MetalPerformanceShaders.MPSState>)' is missing an [NullAllowed] on return type
|
|
@ -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<MetalPerformanceShaders.MPSImage>,Foundation.NSMutableArray`1<MetalPerformanceShaders.MPSState>)' is missing an [NullAllowed] on return type
|
|
@ -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<MetalPerformanceShaders.MPSImage>,Foundation.NSMutableArray`1<MetalPerformanceShaders.MPSState>)' is missing an [NullAllowed] on return type
|
|
@ -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
|
||||
|
|
|
@ -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<MetalPerformanceShaders.MPSImage>,Foundation.NSMutableArray`1<MetalPerformanceShaders.MPSState>)' is missing an [NullAllowed] on return type
|
|
@ -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<MetalPerformanceShaders.MPSImage>,Foundation.NSMutableArray`1<MetalPerformanceShaders.MPSState>)' is missing an [NullAllowed] on return type
|
|
@ -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<MetalPerformanceShaders.MPSImage>,Foundation.NSMutableArray`1<MetalPerformanceShaders.MPSState>)' is missing an [NullAllowed] on return type
|
Загрузка…
Ссылка в новой задаче