[MetalPerformanceShaders] Adopt XAMCORE_4_0 changes in .NET. (#13852)

This means removing obsolete/deprecated API.
This commit is contained in:
Rolf Bjarne Kvinge 2022-01-25 11:33:50 +01:00 коммит произвёл GitHub
Родитель f83e1cb4b7
Коммит d2673463a3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 7 добавлений и 21 удалений

Просмотреть файл

@ -1,4 +1,4 @@
#if !XAMCORE_4_0 #if !NET
using System; using System;
using Metal; using Metal;
@ -6,9 +6,7 @@ using System.Runtime.Versioning;
using ObjCRuntime; using ObjCRuntime;
#if !NET
using NativeHandle = System.IntPtr; using NativeHandle = System.IntPtr;
#endif
namespace MetalPerformanceShaders { namespace MetalPerformanceShaders {
@ -40,26 +38,14 @@ namespace MetalPerformanceShaders {
} }
public partial class MPSCnnConvolution { public partial class MPSCnnConvolution {
#if !NET
[TV (11, 0), iOS (11, 0)] [TV (11, 0), iOS (11, 0)]
[Obsolete ("Always throws 'NotSupportedException' (not a public API).")] [Obsolete ("Always throws 'NotSupportedException' (not a public API).")]
#else
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[Obsolete ("Always throws 'NotSupportedException' (not a public API).", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
public virtual void EncodeToCommandBuffer (IMTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSImage destinationImage, out MPSCnnConvolutionState state) public virtual void EncodeToCommandBuffer (IMTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSImage destinationImage, out MPSCnnConvolutionState state)
=> throw new NotSupportedException (); => throw new NotSupportedException ();
} }
#if !NET
[TV (11,0), Mac (10, 13), iOS (11,0)] [TV (11,0), Mac (10, 13), iOS (11,0)]
[Obsolete ("Empty stub (not a public API).")] [Obsolete ("Empty stub (not a public API).")]
#else
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[Obsolete ("Empty stub (not a public API).", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
public partial class MPSCnnConvolutionState : MPSState, IMPSImageSizeEncodingState { public partial class MPSCnnConvolutionState : MPSState, IMPSImageSizeEncodingState {
[Obsolete ("Always throws 'NotSupportedException' (not a public API).")] [Obsolete ("Always throws 'NotSupportedException' (not a public API).")]
@ -92,4 +78,4 @@ namespace MetalPerformanceShaders {
} }
} }
#endif #endif // !NET

Просмотреть файл

@ -23,7 +23,7 @@ namespace MetalPerformanceShaders {
InsertDebugGroups = 1 << 3, InsertDebugGroups = 1 << 3,
[iOS (11,0), TV (11,0)] [iOS (11,0), TV (11,0)]
Verbose = 1 << 4, Verbose = 1 << 4,
#if !XAMCORE_4_0 #if !NET
[Obsolete ("Use 'AllowReducedPrecision' instead.")] [Obsolete ("Use 'AllowReducedPrecision' instead.")]
MPSKernelOptionsAllowReducedPrecision = AllowReducedPrecision, MPSKernelOptionsAllowReducedPrecision = AllowReducedPrecision,
#endif #endif
@ -168,7 +168,7 @@ namespace MetalPerformanceShaders {
Logarithm, Logarithm,
[TV (13,0), Mac (10,15), iOS (13,0)] [TV (13,0), Mac (10,15), iOS (13,0)]
GeLU, GeLU,
#if !XAMCORE_4_0 #if !NET
[Obsolete ("The value changes when newer versions are released. It will be removed in the future.")] [Obsolete ("The value changes when newer versions are released. It will be removed in the future.")]
Count, // must always be last Count, // must always be last
#endif #endif

Просмотреть файл

@ -1,4 +1,4 @@
#if !MONOMAC && !XAMCORE_4_0 #if !MONOMAC && !NET
using System; using System;
using Metal; using Metal;
using Foundation; using Foundation;

Просмотреть файл

@ -1,4 +1,4 @@
#if !MONOMAC && !XAMCORE_4_0 && !__MACCATALYST__ #if !MONOMAC && !NET && !__MACCATALYST__
using System; using System;
using Metal; using Metal;
using Foundation; using Foundation;

Просмотреть файл

@ -2829,7 +2829,7 @@ namespace MetalPerformanceShaders {
[Export ("secondaryKernelHeight")] [Export ("secondaryKernelHeight")]
nuint SecondaryKernelHeight { get; } nuint SecondaryKernelHeight { get; }
#if !XAMCORE_4_0 #if !NET
// Apple answered to radar://38054031 and said that these were exposed by mistake in an older release // Apple answered to radar://38054031 and said that these were exposed by mistake in an older release
// and got removed because they are useless and no developers could have used it before. // and got removed because they are useless and no developers could have used it before.
// Keeping stubs for binary compat. // Keeping stubs for binary compat.