[metal] Add nullability to (generated and manual) bindings (#10823)
Removed some outdated comments (intro runs fine with them now) See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
This commit is contained in:
Родитель
98c8649d0c
Коммит
c086b57358
|
@ -14,6 +14,8 @@ using Foundation;
|
|||
using ModelIO;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public struct MTLOrigin {
|
||||
|
|
|
@ -3,6 +3,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
|
||||
|
@ -11,9 +13,9 @@ namespace Metal {
|
|||
public static void SetBuffers (this IMTLArgumentEncoder encoder, IMTLBuffer[] buffers, nuint[] offsets, NSRange range)
|
||||
{
|
||||
if (buffers == null)
|
||||
throw new ArgumentNullException (nameof (buffers));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (buffers));
|
||||
if (offsets == null)
|
||||
throw new ArgumentNullException (nameof (offsets));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (offsets));
|
||||
|
||||
var bufferPtrArray = buffers.Length <= 1024 ? stackalloc IntPtr[buffers.Length] : new IntPtr [buffers.Length];
|
||||
// get all intptr from the array to pass to the lower level call
|
||||
|
|
|
@ -14,6 +14,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial class MTLRenderPipelineColorAttachmentDescriptorArray {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial class MTLBlitPassSampleBufferAttachmentDescriptorArray {
|
||||
|
|
|
@ -4,6 +4,8 @@ using System;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial class MTLSharedTextureHandle {
|
||||
|
@ -27,7 +29,7 @@ namespace Metal {
|
|||
public static IMTLCounterSampleBuffer CreateIMTLCounterSampleBuffer (this IMTLDevice This, MTLCounterSampleBufferDescriptor descriptor, out NSError error)
|
||||
{
|
||||
if (descriptor == null)
|
||||
throw new ArgumentNullException ("descriptor");
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (descriptor));
|
||||
IntPtr errorValue = IntPtr.Zero;
|
||||
|
||||
var ret = Runtime.GetINativeObject<IMTLCounterSampleBuffer> (global::ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr_ref_IntPtr (This.Handle, Selector.GetHandle ("newCounterSampleBufferWithDescriptor:error:"), descriptor.Handle, ref errorValue), owns: false);
|
||||
|
@ -45,7 +47,7 @@ namespace Metal {
|
|||
public static void SampleCounters (this IMTLComputeCommandEncoder This, IMTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier)
|
||||
{
|
||||
if (sampleBuffer == null)
|
||||
throw new ArgumentNullException ("sampleBuffer");
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (sampleBuffer));
|
||||
global::ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_nuint_bool (This.Handle, Selector.GetHandle ("sampleCountersInBuffer:atSampleIndex:withBarrier:"), sampleBuffer.Handle, sampleIndex, barrier);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
#if XAMCORE_4_0
|
||||
|
@ -13,9 +15,9 @@ namespace Metal {
|
|||
public static void SetBuffers (this IMTLComputeCommandEncoder table, IMTLBuffer[] buffers, nuint[] offsets, NSRange range)
|
||||
{
|
||||
if (buffers == null)
|
||||
throw new ArgumentNullException (nameof (buffers));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (buffers));
|
||||
if (offsets == null)
|
||||
throw new ArgumentNullException (nameof (offsets));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (offsets));
|
||||
|
||||
var bufferPtrArray = buffers.Length <= 1024 ? stackalloc IntPtr[buffers.Length] : new IntPtr [buffers.Length];
|
||||
// get all intptr from the array to pass to the lower level call
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial class MTLComputePassSampleBufferAttachmentDescriptorArray {
|
||||
|
|
|
@ -14,6 +14,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
#if MONOMAC
|
||||
[Advice ("The 'NSString' argument will match a property of 'MTLDeviceNotificationHandler'.")]
|
||||
|
@ -25,9 +27,9 @@ namespace Metal {
|
|||
[DllImport (Constants.MetalLibrary)]
|
||||
extern static IntPtr MTLCreateSystemDefaultDevice ();
|
||||
|
||||
static IMTLDevice system_default;
|
||||
static IMTLDevice? system_default;
|
||||
|
||||
public static IMTLDevice SystemDefault {
|
||||
public static IMTLDevice? SystemDefault {
|
||||
get {
|
||||
// Metal could be unavailable on the hardware (and we don't want to return an invalid instance)
|
||||
// also the instance could be disposed (by mistake) which would make the app unusable
|
||||
|
@ -67,7 +69,7 @@ namespace Metal {
|
|||
public static IMTLDevice [] GetAllDevices (ref NSObject observer, MTLDeviceNotificationHandler handler)
|
||||
{
|
||||
if (observer == null)
|
||||
throw new ArgumentNullException ("observer");
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (observer));
|
||||
|
||||
IntPtr handle = observer.Handle;
|
||||
|
||||
|
@ -108,7 +110,7 @@ namespace Metal {
|
|||
public static void RemoveObserver (NSObject observer)
|
||||
{
|
||||
if (observer == null)
|
||||
throw new ArgumentNullException ("observer");
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (observer));
|
||||
|
||||
MTLRemoveDeviceObserver (observer.Handle);
|
||||
}
|
||||
|
@ -116,8 +118,11 @@ namespace Metal {
|
|||
}
|
||||
|
||||
public static partial class MTLDevice_Extensions {
|
||||
public static IMTLBuffer CreateBuffer<T> (this IMTLDevice This, T [] data, MTLResourceOptions options) where T : struct
|
||||
public static IMTLBuffer? CreateBuffer<T> (this IMTLDevice This, T [] data, MTLResourceOptions options) where T : struct
|
||||
{
|
||||
if (data == null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
|
||||
|
||||
var handle = GCHandle.Alloc (data, GCHandleType.Pinned); // This requires a pinned GCHandle, since it's not possible to use unsafe code to get the address of a generic object.
|
||||
try {
|
||||
IntPtr ptr = handle.AddrOfPinnedObject ();
|
||||
|
@ -129,8 +134,11 @@ namespace Metal {
|
|||
|
||||
#if !XAMCORE_4_0
|
||||
[Obsolete ("Use the overload that takes an IntPtr instead. The 'data' parameter must be page-aligned and allocated using vm_allocate or mmap, which won't be the case for managed arrays, so this method will always fail.")]
|
||||
public static IMTLBuffer CreateBufferNoCopy<T> (this IMTLDevice This, T [] data, MTLResourceOptions options, MTLDeallocator deallocator) where T : struct
|
||||
public static IMTLBuffer? CreateBufferNoCopy<T> (this IMTLDevice This, T [] data, MTLResourceOptions options, MTLDeallocator deallocator) where T : struct
|
||||
{
|
||||
if (data == null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
|
||||
|
||||
var handle = GCHandle.Alloc (data, GCHandleType.Pinned); // This requires a pinned GCHandle, since it's not possible to use unsafe code to get the address of a generic object.
|
||||
IntPtr ptr = handle.AddrOfPinnedObject ();
|
||||
return This.CreateBufferNoCopy (ptr, (nuint)(data.Length * Marshal.SizeOf (typeof (T))), options, (pointer, length) => {
|
||||
|
@ -142,6 +150,9 @@ namespace Metal {
|
|||
|
||||
public unsafe static void GetDefaultSamplePositions (this IMTLDevice This, MTLSamplePosition [] positions, nuint count)
|
||||
{
|
||||
if (positions == null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (positions));
|
||||
|
||||
if (positions.Length < (nint)count)
|
||||
throw new ArgumentException ("Length of 'positions' cannot be less than 'count'.");
|
||||
fixed (void * handle = positions)
|
||||
|
@ -153,9 +164,9 @@ namespace Metal {
|
|||
public static void ConvertSparseTileRegions (this IMTLDevice This, MTLRegion [] tileRegions, MTLRegion [] pixelRegions, MTLSize tileSize, nuint numRegions)
|
||||
{
|
||||
if (tileRegions == null)
|
||||
throw new ArgumentNullException (nameof (tileRegions));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (tileRegions));
|
||||
if (pixelRegions == null)
|
||||
throw new ArgumentNullException (nameof (pixelRegions));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (pixelRegions));
|
||||
|
||||
var tileRegionsHandle = GCHandle.Alloc (tileRegions, GCHandleType.Pinned);
|
||||
var pixelRegionsHandle = GCHandle.Alloc (pixelRegions, GCHandleType.Pinned);
|
||||
|
@ -173,9 +184,9 @@ namespace Metal {
|
|||
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));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (tileRegions));
|
||||
if (pixelRegions == null)
|
||||
throw new ArgumentNullException (nameof (pixelRegions));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (pixelRegions));
|
||||
|
||||
var tileRegionsHandle = GCHandle.Alloc (tileRegions, GCHandleType.Pinned);
|
||||
var pixelRegionsHandle = GCHandle.Alloc (pixelRegions, GCHandleType.Pinned);
|
||||
|
@ -193,10 +204,10 @@ namespace Metal {
|
|||
#if !XAMCORE_4_0
|
||||
[return: Release]
|
||||
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
|
||||
public static IMTLLibrary CreateLibrary (this IMTLDevice This, global::CoreFoundation.DispatchData data, out NSError error)
|
||||
public static IMTLLibrary? CreateLibrary (this IMTLDevice This, global::CoreFoundation.DispatchData data, out NSError error)
|
||||
{
|
||||
if (data == null)
|
||||
throw new ArgumentNullException ("data");
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
|
||||
IntPtr errorValue = IntPtr.Zero;
|
||||
|
||||
IMTLLibrary ret;
|
||||
|
@ -206,7 +217,7 @@ namespace Metal {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public static IMTLLibrary CreateDefaultLibrary (this IMTLDevice This, NSBundle bundle, out NSError error)
|
||||
public static IMTLLibrary? CreateDefaultLibrary (this IMTLDevice This, NSBundle bundle, out NSError error)
|
||||
{
|
||||
return MTLDevice_Extensions.CreateLibrary (This, bundle, out error);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ using Foundation;
|
|||
using ModelIO;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
[Native]
|
||||
|
|
|
@ -4,6 +4,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
// add some extension methods to make the API of the protocol nicer
|
||||
|
@ -13,9 +15,9 @@ namespace Metal {
|
|||
public static void SetBuffers (this IMTLIntersectionFunctionTable table, IMTLBuffer[] buffers, nuint[] offsets, NSRange range)
|
||||
{
|
||||
if (buffers == null)
|
||||
throw new ArgumentNullException (nameof (buffers));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (buffers));
|
||||
if (offsets == null)
|
||||
throw new ArgumentNullException (nameof (offsets));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (offsets));
|
||||
|
||||
var bufferPtrArray = buffers.Length <= 1024 ? stackalloc IntPtr[buffers.Length] : new IntPtr [buffers.Length];
|
||||
// get all intptr from the array to pass to the lower level call
|
||||
|
|
|
@ -6,6 +6,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
public partial class MTLRasterizationRateLayerDescriptor
|
||||
{
|
||||
|
@ -34,9 +36,9 @@ namespace Metal {
|
|||
static public MTLRasterizationRateLayerDescriptor Create (MTLSize sampleCount, float[] horizontal, float[] vertical)
|
||||
{
|
||||
if (horizontal == null)
|
||||
throw new ArgumentNullException (nameof (horizontal));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (horizontal));
|
||||
if (vertical == null)
|
||||
throw new ArgumentNullException (nameof (vertical));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (vertical));
|
||||
if (sampleCount.Width != horizontal.Length)
|
||||
throw new ArgumentOutOfRangeException ("Horizontal length should be equal to the sampleCount.Width.");
|
||||
if (sampleCount.Height != vertical.Length)
|
||||
|
|
|
@ -6,6 +6,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
public static class IMTLRenderCommandEncoder_Extensions {
|
||||
[Mac (10,13), NoiOS, NoTV, NoWatch]
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#if !COREBUILD
|
||||
using System;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
public partial class MTLRenderPassDescriptor {
|
||||
public unsafe void SetSamplePositions (MTLSamplePosition [] positions)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public partial class MTLRenderPassSampleBufferAttachmentDescriptorArray {
|
||||
|
|
|
@ -12,6 +12,8 @@ using System.Runtime.InteropServices;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
public static partial class MTLResourceStateCommandEncoder_Extensions {
|
||||
|
@ -20,13 +22,13 @@ namespace Metal {
|
|||
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));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (texture));
|
||||
if (regions == null)
|
||||
throw new ArgumentNullException (nameof (regions));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (regions));
|
||||
if (mipLevels == null)
|
||||
throw new ArgumentNullException (nameof (mipLevels));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (mipLevels));
|
||||
if (slices == null)
|
||||
throw new ArgumentNullException (nameof (slices));
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (slices));
|
||||
|
||||
var regionsHandle = GCHandle.Alloc (regions, GCHandleType.Pinned);
|
||||
var mipLevelsHandle = GCHandle.Alloc (mipLevels, GCHandleType.Pinned);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
|
||||
#if !TVOS
|
||||
|
|
|
@ -6,6 +6,8 @@ using ModelIO;
|
|||
using ObjCRuntime;
|
||||
using Metal;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Metal {
|
||||
public partial class MTLVertexDescriptor {
|
||||
|
||||
|
|
38
src/metal.cs
38
src/metal.cs
|
@ -105,9 +105,11 @@ namespace Metal {
|
|||
nuint Stride { get; }
|
||||
|
||||
[Export ("elementStructType")]
|
||||
[return: NullAllowed]
|
||||
MTLStructType ElementStructType ();
|
||||
|
||||
[Export ("elementArrayType")]
|
||||
[return: NullAllowed]
|
||||
MTLArrayType ElementArrayType ();
|
||||
|
||||
[Mac (10,13), iOS (11,0), TV (11,0), NoWatch]
|
||||
|
@ -1992,9 +1994,8 @@ namespace Metal {
|
|||
[Export ("compareFunction")]
|
||||
MTLCompareFunction CompareFunction { get; set; }
|
||||
|
||||
// [NullAllowed] we can't allow setting null - even if the default value is null
|
||||
// /SourceCache/AcceleratorKit/AcceleratorKit-14.9/Framework/MTLSampler.m:240: failed assertion `label must not be nil.'
|
||||
[Export ("label")]
|
||||
[NullAllowed]
|
||||
string Label { get; set; }
|
||||
|
||||
[Mac (10, 13), iOS (11,0), TV (11,0), NoWatch]
|
||||
|
@ -2018,9 +2019,8 @@ namespace Metal {
|
|||
[BaseType (typeof (NSObject))]
|
||||
partial interface MTLRenderPipelineDescriptor : NSCopying {
|
||||
|
||||
// [NullAllowed] we can't allow setting null - even if the default value is null
|
||||
// /SourceCache/AcceleratorKit/AcceleratorKit-14.9/Framework/MTLRenderPipeline.mm:627: failed assertion `label must not be nil.'
|
||||
[Export ("label")]
|
||||
[NullAllowed]
|
||||
string Label { get; set; }
|
||||
|
||||
[NullAllowed] // by default this property is null
|
||||
|
@ -2032,6 +2032,7 @@ namespace Metal {
|
|||
IMTLFunction FragmentFunction { get; set; }
|
||||
|
||||
[Export ("vertexDescriptor", ArgumentSemantic.Copy)]
|
||||
[NullAllowed]
|
||||
MTLVertexDescriptor VertexDescriptor { get; set; }
|
||||
|
||||
[Export ("sampleCount")]
|
||||
|
@ -2126,7 +2127,7 @@ namespace Metal {
|
|||
MTLRenderPipelineColorAttachmentDescriptor ObjectAtIndexedSubscript (nuint attachmentIndex);
|
||||
|
||||
[Export ("setObject:atIndexedSubscript:"), Internal]
|
||||
void SetObject (MTLRenderPipelineColorAttachmentDescriptor attachment, nuint attachmentIndex);
|
||||
void SetObject ([NullAllowed] MTLRenderPipelineColorAttachmentDescriptor attachment, nuint attachmentIndex);
|
||||
}
|
||||
|
||||
interface IMTLRenderPipelineState {}
|
||||
|
@ -2198,14 +2199,14 @@ namespace Metal {
|
|||
MTLVertexBufferLayoutDescriptor ObjectAtIndexedSubscript (nuint index);
|
||||
|
||||
[Export ("setObject:atIndexedSubscript:"), Internal]
|
||||
void SetObject (MTLVertexBufferLayoutDescriptor bufferDesc, nuint index);
|
||||
void SetObject ([NullAllowed] MTLVertexBufferLayoutDescriptor bufferDesc, nuint index);
|
||||
}
|
||||
|
||||
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
|
||||
[BaseType (typeof(NSObject))]
|
||||
interface MTLAttribute
|
||||
{
|
||||
[NullAllowed, Export ("name")]
|
||||
[Export ("name")]
|
||||
string Name { get; }
|
||||
|
||||
[Export ("attributeIndex")]
|
||||
|
@ -2588,15 +2589,19 @@ namespace Metal {
|
|||
|
||||
#if XAMCORE_4_0
|
||||
[Export ("structType")]
|
||||
[NullAllowed]
|
||||
MTLStructType StructType { get; }
|
||||
|
||||
[Export ("arrayType")]
|
||||
[NullAllowed]
|
||||
MTLArrayType ArrayType { get; }
|
||||
#else
|
||||
[Export ("structType")]
|
||||
[return: NullAllowed]
|
||||
MTLStructType StructType ();
|
||||
|
||||
[Export ("arrayType")]
|
||||
[return: NullAllowed]
|
||||
MTLArrayType ArrayType ();
|
||||
#endif
|
||||
|
||||
|
@ -2620,6 +2625,7 @@ namespace Metal {
|
|||
MTLStructMember [] Members { get; }
|
||||
|
||||
[Export ("memberByName:")]
|
||||
[return: NullAllowed]
|
||||
MTLStructMember Lookup (string name);
|
||||
}
|
||||
|
||||
|
@ -2648,14 +2654,15 @@ namespace Metal {
|
|||
bool DepthWriteEnabled { [Bind ("isDepthWriteEnabled")] get; set; }
|
||||
|
||||
[Export ("frontFaceStencil", ArgumentSemantic.Copy)]
|
||||
[NullAllowed]
|
||||
MTLStencilDescriptor FrontFaceStencil { get; set; }
|
||||
|
||||
[Export ("backFaceStencil", ArgumentSemantic.Copy)]
|
||||
[NullAllowed]
|
||||
MTLStencilDescriptor BackFaceStencil { get; set; }
|
||||
|
||||
// [NullAllowed] we can't allow setting null - even if the default value is null
|
||||
// /SourceCache/AcceleratorKit/AcceleratorKit-14.9/Framework/MTLDepthStencil.m:393: failed assertion `label must not be nil.'
|
||||
[Export ("label")]
|
||||
[NullAllowed]
|
||||
string Label { get; set; }
|
||||
}
|
||||
|
||||
|
@ -3238,6 +3245,7 @@ namespace Metal {
|
|||
[BaseType (typeof (NSObject))]
|
||||
interface MTLRenderPipelineReflection {
|
||||
[Export ("vertexArguments")]
|
||||
[NullAllowed]
|
||||
#if XAMCORE_4_0
|
||||
MTLArgument [] VertexArguments { get; }
|
||||
#else
|
||||
|
@ -3245,6 +3253,7 @@ namespace Metal {
|
|||
#endif
|
||||
|
||||
[Export ("fragmentArguments")]
|
||||
[NullAllowed]
|
||||
#if XAMCORE_4_0
|
||||
MTLArgument [] FragmentArguments { get; }
|
||||
#else
|
||||
|
@ -3338,7 +3347,7 @@ namespace Metal {
|
|||
MTLRenderPassColorAttachmentDescriptor ObjectAtIndexedSubscript (nuint attachmentIndex);
|
||||
|
||||
[Export ("setObject:atIndexedSubscript:"), Internal]
|
||||
void SetObject (MTLRenderPassColorAttachmentDescriptor attachment, nuint attachmentIndex);
|
||||
void SetObject ([NullAllowed] MTLRenderPassColorAttachmentDescriptor attachment, nuint attachmentIndex);
|
||||
}
|
||||
|
||||
[iOS (8,0)][Mac (10,11)]
|
||||
|
@ -3349,9 +3358,11 @@ namespace Metal {
|
|||
MTLRenderPassColorAttachmentDescriptorArray ColorAttachments { get; }
|
||||
|
||||
[Export ("depthAttachment", ArgumentSemantic.Copy)]
|
||||
[NullAllowed]
|
||||
MTLRenderPassDepthAttachmentDescriptor DepthAttachment { get; set; }
|
||||
|
||||
[Export ("stencilAttachment", ArgumentSemantic.Copy)]
|
||||
[NullAllowed]
|
||||
MTLRenderPassStencilAttachmentDescriptor StencilAttachment { get; set; }
|
||||
|
||||
[NullAllowed] // by default this property is null
|
||||
|
@ -3622,14 +3633,13 @@ namespace Metal {
|
|||
[iOS (9,0)][Mac (10,11)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
interface MTLComputePipelineDescriptor : NSCopying {
|
||||
// it's marked as `nullable` but it asserts with
|
||||
// /BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-54.18/Framework/MTLComputePipeline.mm:216: failed assertion `label must not be nil.'
|
||||
|
||||
[Export ("label")]
|
||||
[NullAllowed]
|
||||
string Label { get; set; }
|
||||
|
||||
// it's marked as `nullable` but it asserts with
|
||||
// /BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-54.18/Framework/MTLComputePipeline.mm:230: failed assertion `computeFunction must not be nil.'
|
||||
[Export ("computeFunction", ArgumentSemantic.Strong)]
|
||||
[NullAllowed]
|
||||
IMTLFunction ComputeFunction { get; set; }
|
||||
|
||||
[Export ("threadGroupSizeIsMultipleOfThreadExecutionWidth")]
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
!extra-null-allowed! 'System.String Metal.MTLAttribute::get_Name()' has a extraneous [NullAllowed] on return type
|
||||
!incorrect-protocol-member! MTLArgumentEncoder::newArgumentEncoderForBufferAtIndex: is REQUIRED and should be abstract
|
||||
!incorrect-protocol-member! MTLArgumentEncoder::setAccelerationStructure:atIndex: is REQUIRED and should be abstract
|
||||
!incorrect-protocol-member! MTLArgumentEncoder::setComputePipelineState:atIndex: is REQUIRED and should be abstract
|
||||
|
@ -123,26 +122,6 @@
|
|||
!missing-field! MTLDeviceRemovalRequestedNotification not bound
|
||||
!missing-field! MTLDeviceWasAddedNotification not bound
|
||||
!missing-field! MTLDeviceWasRemovedNotification not bound
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_FragmentArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_VertexArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLArrayType::ElementArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLStructMember::ArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructMember Metal.MTLStructType::Lookup(System.String)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLArrayType::ElementStructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLStructMember::StructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_ComputeFunction(Metal.IMTLFunction)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_BackFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_FrontFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPassColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_DepthAttachment(Metal.MTLRenderPassDepthAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_StencilAttachment(Metal.MTLRenderPassStencilAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPipelineColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_VertexDescriptor(Metal.MTLVertexDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLSamplerDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLVertexBufferLayoutDescriptorArray::SetObject(Metal.MTLVertexBufferLayoutDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-pinvoke! MTLCopyAllDevices is not bound
|
||||
!missing-pinvoke! MTLCopyAllDevicesWithObserver is not bound
|
||||
!missing-pinvoke! MTLRemoveDeviceObserver is not bound
|
||||
|
|
|
@ -97,31 +97,6 @@
|
|||
!missing-selector! MTLRasterizationRateMapDescriptor::setLabel: not bound
|
||||
!missing-selector! MTLRasterizationRateMapDescriptor::setScreenSize: not bound
|
||||
|
||||
# Initial result from new rule extra-null-allowed
|
||||
!extra-null-allowed! 'System.String Metal.MTLAttribute::get_Name()' has a extraneous [NullAllowed] on return type
|
||||
|
||||
# Initial result from new rule missing-null-allowed
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_FragmentArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_VertexArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLArrayType::ElementArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLStructMember::ArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructMember Metal.MTLStructType::Lookup(System.String)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLArrayType::ElementStructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLStructMember::StructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_ComputeFunction(Metal.IMTLFunction)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_BackFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_FrontFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPassColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_DepthAttachment(Metal.MTLRenderPassDepthAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_StencilAttachment(Metal.MTLRenderPassStencilAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPipelineColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_VertexDescriptor(Metal.MTLVertexDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLSamplerDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLVertexBufferLayoutDescriptorArray::SetObject(Metal.MTLVertexBufferLayoutDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
|
||||
# new methods added to a protocol, they will be abstract in XAMCORE_4
|
||||
!incorrect-protocol-member! MTLArgumentEncoder::setAccelerationStructure:atIndex: is REQUIRED and should be abstract
|
||||
!incorrect-protocol-member! MTLArgumentEncoder::setIntersectionFunctionTable:atIndex: is REQUIRED and should be abstract
|
||||
|
|
|
@ -94,31 +94,6 @@
|
|||
!missing-selector! MTLRasterizationRateMapDescriptor::setLabel: not bound
|
||||
!missing-selector! MTLRasterizationRateMapDescriptor::setScreenSize: not bound
|
||||
|
||||
# Initial result from new rule extra-null-allowed
|
||||
!extra-null-allowed! 'System.String Metal.MTLAttribute::get_Name()' has a extraneous [NullAllowed] on return type
|
||||
|
||||
# Initial result from new rule missing-null-allowed
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_FragmentArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_VertexArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLArrayType::ElementArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLStructMember::ArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructMember Metal.MTLStructType::Lookup(System.String)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLArrayType::ElementStructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLStructMember::StructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_ComputeFunction(Metal.IMTLFunction)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_BackFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_FrontFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPassColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_DepthAttachment(Metal.MTLRenderPassDepthAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_StencilAttachment(Metal.MTLRenderPassStencilAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPipelineColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_VertexDescriptor(Metal.MTLVertexDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLSamplerDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLVertexBufferLayoutDescriptorArray::SetObject(Metal.MTLVertexBufferLayoutDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
|
||||
# new methods added to a protocol, they will be abstract in XAMCORE_4
|
||||
!incorrect-protocol-member! MTLArgumentEncoder::setAccelerationStructure:atIndex: is REQUIRED and should be abstract
|
||||
!incorrect-protocol-member! MTLArgumentEncoder::setComputePipelineState:atIndex: is REQUIRED and should be abstract
|
||||
|
|
|
@ -46,31 +46,6 @@
|
|||
!missing-selector! MTLHeapDescriptor::setType: not bound
|
||||
!missing-selector! MTLHeapDescriptor::type not bound
|
||||
|
||||
# Initial result from new rule extra-null-allowed
|
||||
!extra-null-allowed! 'System.String Metal.MTLAttribute::get_Name()' has a extraneous [NullAllowed] on return type
|
||||
|
||||
# Initial result from new rule missing-null-allowed
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_FragmentArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Foundation.NSObject[] Metal.MTLRenderPipelineReflection::get_VertexArguments()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLArrayType::ElementArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLArrayType Metal.MTLStructMember::ArrayType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructMember Metal.MTLStructType::Lookup(System.String)' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLArrayType::ElementStructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'Metal.MTLStructType Metal.MTLStructMember::StructType()' is missing an [NullAllowed] on return type
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_ComputeFunction(Metal.IMTLFunction)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLComputePipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_BackFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_FrontFaceStencil(Metal.MTLStencilDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLDepthStencilDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPassColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_DepthAttachment(Metal.MTLRenderPassDepthAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPassDescriptor::set_StencilAttachment(Metal.MTLRenderPassStencilAttachmentDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineColorAttachmentDescriptorArray::SetObject(Metal.MTLRenderPipelineColorAttachmentDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLRenderPipelineDescriptor::set_VertexDescriptor(Metal.MTLVertexDescriptor)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLSamplerDescriptor::set_Label(System.String)' is missing an [NullAllowed] on parameter #0
|
||||
!missing-null-allowed! 'System.Void Metal.MTLVertexBufferLayoutDescriptorArray::SetObject(Metal.MTLVertexBufferLayoutDescriptor,System.nuint)' is missing an [NullAllowed] on parameter #0
|
||||
|
||||
# new methods added to a protocol, they will be abstract in XAMCORE_4
|
||||
!incorrect-protocol-member! MTLDevice::newBinaryArchiveWithDescriptor:error: is REQUIRED and should be abstract
|
||||
!incorrect-protocol-member! MTLDevice::newDynamicLibrary:error: is REQUIRED and should be abstract
|
||||
|
|
Загрузка…
Ссылка в новой задаче