diff --git a/src/ComputeSharp.Core/Polyfills/ArgumentNullExceptionExtensions.cs b/src/ComputeSharp.Core/Polyfills/ArgumentNullExceptionExtensions.cs
new file mode 100644
index 00000000..7f6e276d
--- /dev/null
+++ b/src/ComputeSharp.Core/Polyfills/ArgumentNullExceptionExtensions.cs
@@ -0,0 +1,62 @@
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.CompilerServices;
+
+namespace System;
+
+///
+/// Throw helper extensions for .
+///
+internal static class ArgumentNullExceptionExtensions
+{
+ ///
+ /// Throws an for a given parameter name.
+ ///
+ /// Dummy value to invoke the extension upon (always pass .
+ /// The name of the parameter to report in the exception.
+ /// Thrown with .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [DoesNotReturn]
+ public static void Throw(this ArgumentNullException? _, string? parameterName)
+ {
+ Throw(parameterName);
+ }
+
+ ///
+ /// Throws an if is .
+ ///
+ /// Dummy value to invoke the extension upon (always pass .
+ /// The reference type argument to validate as non-.
+ /// The name of the parameter with which corresponds.
+ /// Thrown if is .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static void ThrowIfNull(this ArgumentNullException? _, [NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? parameterName = null)
+ {
+ if (argument is null)
+ {
+ Throw(parameterName);
+ }
+ }
+
+ ///
+ /// Throws an if is .
+ ///
+ /// Dummy value to invoke the extension upon (always pass .
+ /// The pointer argument to validate as non-.
+ /// The name of the parameter with which corresponds.
+ /// Thrown if is .
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static unsafe void ThrowIfNull(this ArgumentNullException? _, [NotNull] void* argument, [CallerArgumentExpression(nameof(argument))] string? parameterName = null)
+ {
+ if (argument is null)
+ {
+ Throw(parameterName);
+ }
+ }
+
+ ///
+ [DoesNotReturn]
+ public static void Throw(string? parameterName)
+ {
+ throw new ArgumentNullException(parameterName);
+ }
+}
diff --git a/src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs b/src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs
index 05db8cad..d35d92b4 100644
--- a/src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs
+++ b/src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs
@@ -2,7 +2,6 @@ using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
-using CommunityToolkit.Diagnostics;
using ComputeSharp.Interop;
#if WINDOWS_UWP
using ComputeSharp.Uwp.Extensions;
@@ -28,7 +27,7 @@ partial class SwapChainManager
/// The instance to use to render frames.
public async void StartRenderLoop(IFrameRequestQueue? frameRequestQueue, IShaderRunner shaderRunner)
{
- Guard.IsNotNull(shaderRunner);
+ default(ArgumentNullException).ThrowIfNull(shaderRunner);
using (await this.setupSemaphore.LockAsync())
{
diff --git a/src/ComputeSharp.UI/ShaderRunner{T}.cs b/src/ComputeSharp.UI/ShaderRunner{T}.cs
index 08bca82b..8b355863 100644
--- a/src/ComputeSharp.UI/ShaderRunner{T}.cs
+++ b/src/ComputeSharp.UI/ShaderRunner{T}.cs
@@ -1,5 +1,4 @@
using System;
-using CommunityToolkit.Diagnostics;
#if WINDOWS_UWP
namespace ComputeSharp.Uwp;
@@ -40,7 +39,7 @@ public sealed class ShaderRunner : IShaderRunner
/// The instance used to create shaders to run.
public ShaderRunner(Func shaderFactory)
{
- Guard.IsNotNull(shaderFactory);
+ default(ArgumentNullException).ThrowIfNull(shaderFactory);
this.shaderFactory = shaderFactory;
}
@@ -51,7 +50,7 @@ public sealed class ShaderRunner : IShaderRunner
/// The instance used to create shaders to run.
public ShaderRunner(Func shaderFactory)
{
- Guard.IsNotNull(shaderFactory);
+ default(ArgumentNullException).ThrowIfNull(shaderFactory);
this.statefulShaderFactory = shaderFactory;
}
diff --git a/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs
index c6cd4389..1534cc01 100644
--- a/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs
+++ b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs
@@ -22,7 +22,7 @@ public static class BufferExtensions
public static T[] ToArray(this Buffer source)
where T : unmanaged
{
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(source);
return source.ToArray(0, source.Length);
}
@@ -38,7 +38,7 @@ public static class BufferExtensions
public static T[] ToArray(this Buffer source, int offset, int count)
where T : unmanaged
{
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(source);
Guard.IsGreaterThanOrEqualTo(count, 0);
T[] data = GC.AllocateUninitializedArray(count);
@@ -57,8 +57,8 @@ public static class BufferExtensions
public static void CopyTo(this Buffer source, T[] destination)
where T : unmanaged
{
- Guard.IsNotNull(source);
- Guard.IsNotNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
source.CopyTo(destination.AsSpan(), 0);
}
@@ -75,8 +75,8 @@ public static class BufferExtensions
public static void CopyTo(this Buffer source, T[] destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
- Guard.IsNotNull(source);
- Guard.IsNotNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
Span span = destination.AsSpan(destinationOffset, count);
@@ -92,7 +92,7 @@ public static class BufferExtensions
public static void CopyTo(this Buffer source, Span destination)
where T : unmanaged
{
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(source);
source.CopyTo(destination, 0);
}
@@ -107,7 +107,7 @@ public static class BufferExtensions
public static void CopyTo(this Buffer source, Span destination, int sourceOffset)
where T : unmanaged
{
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(source);
source.CopyTo(ref MemoryMarshal.GetReference(destination), sourceOffset, destination.Length);
}
@@ -121,8 +121,8 @@ public static class BufferExtensions
public static void CopyTo(this Buffer source, Buffer destination)
where T : unmanaged
{
- Guard.IsNotNull(source);
- Guard.IsNotNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
source.CopyTo(destination, 0, 0, source.Length);
}
@@ -139,8 +139,8 @@ public static class BufferExtensions
public static void CopyTo(this Buffer source, Buffer destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
- Guard.IsNotNull(source);
- Guard.IsNotNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
@@ -154,8 +154,8 @@ public static class BufferExtensions
public static void CopyFrom(this Buffer destination, T[] source)
where T : unmanaged
{
- Guard.IsNotNull(destination);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
destination.CopyFrom(source.AsSpan(), 0);
}
@@ -172,8 +172,8 @@ public static class BufferExtensions
public static void CopyFrom(this Buffer destination, T[] source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
- Guard.IsNotNull(destination);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlySpan span = source.AsSpan(sourceOffset, count);
@@ -189,7 +189,7 @@ public static class BufferExtensions
public static void CopyFrom(this Buffer destination, ReadOnlySpan source)
where T : unmanaged
{
- Guard.IsNotNull(destination);
+ default(ArgumentNullException).ThrowIfNull(destination);
destination.CopyFrom(source, 0);
}
@@ -204,7 +204,7 @@ public static class BufferExtensions
public static void CopyFrom(this Buffer destination, ReadOnlySpan source, int destinationOffset)
where T : unmanaged
{
- Guard.IsNotNull(destination);
+ default(ArgumentNullException).ThrowIfNull(destination);
destination.CopyFrom(ref MemoryMarshal.GetReference(source), destinationOffset, source.Length);
}
@@ -218,8 +218,8 @@ public static class BufferExtensions
public static void CopyFrom(this Buffer destination, Buffer source)
where T : unmanaged
{
- Guard.IsNotNull(destination);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
source.CopyTo(destination, 0, 0, source.Length);
}
@@ -236,8 +236,8 @@ public static class BufferExtensions
public static void CopyFrom(this Buffer destination, Buffer source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
- Guard.IsNotNull(destination);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(destination);
+ default(ArgumentNullException).ThrowIfNull(source);
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
diff --git a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs
index 826d8f71..322b9166 100644
--- a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs
+++ b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs
@@ -1,5 +1,5 @@
+using System;
using System.Runtime.CompilerServices;
-using CommunityToolkit.Diagnostics;
using ComputeSharp.Interop;
namespace ComputeSharp;
@@ -19,7 +19,7 @@ public static partial class GraphicsDeviceExtensions
public static void For(this GraphicsDevice device, int x, in T shader)
where T : struct, IComputeShader
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -37,7 +37,7 @@ public static partial class GraphicsDeviceExtensions
public static void For(this GraphicsDevice device, int x, int y, in T shader)
where T : struct, IComputeShader
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -56,7 +56,7 @@ public static partial class GraphicsDeviceExtensions
public static void For(this GraphicsDevice device, int x, int y, int z, in T shader)
where T : struct, IComputeShader
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -78,7 +78,7 @@ public static partial class GraphicsDeviceExtensions
public static void For(this GraphicsDevice device, int x, int y, int z, int threadsX, int threadsY, int threadsZ, in T shader)
where T : struct, IComputeShader
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -96,8 +96,8 @@ public static partial class GraphicsDeviceExtensions
where T : struct, IPixelShader
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(texture);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(texture);
using ComputeContext context = device.CreateComputeContext();
@@ -116,8 +116,8 @@ public static partial class GraphicsDeviceExtensions
where T : struct, IPixelShader
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(texture);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(texture);
using ComputeContext context = device.CreateComputeContext();
@@ -149,7 +149,7 @@ public static partial class GraphicsDeviceExtensions
///
public static ComputeContext CreateComputeContext(this GraphicsDevice device)
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
using ReferenceTracker.Lease _0 = device.GetReferenceTracker().GetLease();
diff --git a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs
index 320d05dc..631cb35b 100644
--- a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs
+++ b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs
@@ -1,7 +1,6 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
-using CommunityToolkit.Diagnostics;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Resources;
@@ -22,7 +21,7 @@ partial class GraphicsDeviceExtensions
public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, length, allocationMode);
}
@@ -38,8 +37,8 @@ partial class GraphicsDeviceExtensions
public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateConstantBuffer(source.AsSpan());
}
@@ -55,7 +54,7 @@ partial class GraphicsDeviceExtensions
public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, ReadOnlySpan source)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ConstantBuffer buffer = new(device, source.Length, AllocationMode.Default);
@@ -75,8 +74,8 @@ partial class GraphicsDeviceExtensions
public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, Buffer source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ConstantBuffer constantBuffer = new(device, source.Length, AllocationMode.Default);
@@ -97,7 +96,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, length, allocationMode);
}
@@ -113,8 +112,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyBuffer(source.AsSpan());
}
@@ -130,7 +129,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, ReadOnlySpan source)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadOnlyBuffer buffer = new(device, source.Length, AllocationMode.Default);
@@ -150,8 +149,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, Buffer source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlyBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default);
@@ -171,7 +170,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture1D AllocateReadOnlyTexture1D(this GraphicsDevice device, int width, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, allocationMode);
}
@@ -187,8 +186,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture1D AllocateReadOnlyTexture1D(this GraphicsDevice device, T[] source, int width)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture1D(source.AsSpan(0, width));
}
@@ -205,8 +204,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture1D AllocateReadOnlyTexture1D(this GraphicsDevice device, T[] source, int offset, int width)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture1D(source.AsSpan(offset, width));
}
@@ -221,8 +220,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture1D AllocateReadOnlyTexture1D(this GraphicsDevice device, T[] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlyTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -241,7 +240,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture1D AllocateReadOnlyTexture1D(this GraphicsDevice device, ReadOnlySpan source)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadOnlyTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -263,7 +262,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, allocationMode);
}
@@ -281,8 +280,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture1D(source.AsSpan(0, width));
}
@@ -301,8 +300,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture1D(source.AsSpan(offset, width));
}
@@ -319,8 +318,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlyTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -341,7 +340,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadOnlyTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -362,7 +361,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, allocationMode);
}
@@ -379,8 +378,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int width, int height)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height);
}
@@ -398,8 +397,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height);
}
@@ -414,8 +413,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[,] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -436,7 +435,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default);
@@ -459,7 +458,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, allocationMode);
}
@@ -478,8 +477,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height);
}
@@ -499,8 +498,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height);
}
@@ -517,8 +516,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -541,7 +540,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default);
@@ -563,7 +562,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -581,8 +580,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth);
}
@@ -601,8 +600,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth);
}
@@ -621,8 +620,8 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[,,] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -644,7 +643,7 @@ partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default);
@@ -668,7 +667,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -688,8 +687,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth);
}
@@ -710,8 +709,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth);
}
@@ -732,8 +731,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -757,7 +756,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default);
@@ -778,7 +777,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, length, allocationMode);
}
@@ -794,8 +793,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteBuffer(source.AsSpan());
}
@@ -811,7 +810,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, ReadOnlySpan source)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadWriteBuffer buffer = new(device, source.Length, AllocationMode.Default);
@@ -831,8 +830,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, Buffer source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadWriteBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default);
@@ -852,7 +851,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture1D AllocateReadWriteTexture1D(this GraphicsDevice device, int width, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, allocationMode);
}
@@ -868,8 +867,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture1D AllocateReadWriteTexture1D(this GraphicsDevice device, T[] source, int width)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture1D(source.AsSpan(0, width));
}
@@ -886,8 +885,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture1D AllocateReadWriteTexture1D(this GraphicsDevice device, T[] source, int offset, int width)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture1D(source.AsSpan(offset, width));
}
@@ -902,8 +901,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture1D AllocateReadWriteTexture1D(this GraphicsDevice device, T[] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadWriteTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -922,7 +921,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture1D AllocateReadWriteTexture1D(this GraphicsDevice device, ReadOnlySpan source)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadWriteTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -944,7 +943,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, allocationMode);
}
@@ -962,8 +961,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture1D(source.AsSpan(0, width));
}
@@ -982,8 +981,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture1D(source.AsSpan(offset, width));
}
@@ -1000,8 +999,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadWriteTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -1022,7 +1021,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadWriteTexture1D texture = new(device, source.Length, AllocationMode.Default);
@@ -1043,7 +1042,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, allocationMode);
}
@@ -1060,8 +1059,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int width, int height)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height);
}
@@ -1079,8 +1078,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height);
}
@@ -1095,8 +1094,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[,] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -1117,7 +1116,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default);
@@ -1140,7 +1139,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, allocationMode);
}
@@ -1159,8 +1158,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height);
}
@@ -1180,8 +1179,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height);
}
@@ -1198,8 +1197,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -1222,7 +1221,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default);
@@ -1244,7 +1243,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -1262,8 +1261,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth);
}
@@ -1282,8 +1281,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth);
}
@@ -1302,8 +1301,8 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[,,] source)
where T : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -1325,7 +1324,7 @@ partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default);
@@ -1349,7 +1348,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -1369,8 +1368,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth);
}
@@ -1391,8 +1390,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth);
}
@@ -1413,8 +1412,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(source);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(source);
ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -1438,7 +1437,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default);
@@ -1459,7 +1458,7 @@ partial class GraphicsDeviceExtensions
public static UploadBuffer AllocateUploadBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, length, allocationMode);
}
@@ -1475,7 +1474,7 @@ partial class GraphicsDeviceExtensions
public static UploadTexture1D AllocateUploadTexture1D(this GraphicsDevice device, int width, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, allocationMode);
}
@@ -1492,7 +1491,7 @@ partial class GraphicsDeviceExtensions
public static UploadTexture2D AllocateUploadTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, allocationMode);
}
@@ -1510,7 +1509,7 @@ partial class GraphicsDeviceExtensions
public static UploadTexture3D AllocateUploadTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -1527,7 +1526,7 @@ partial class GraphicsDeviceExtensions
public static ReadBackBuffer AllocateReadBackBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, length, allocationMode);
}
@@ -1543,7 +1542,7 @@ partial class GraphicsDeviceExtensions
public static ReadBackTexture1D AllocateReadBackTexture1D(this GraphicsDevice device, int width, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, allocationMode);
}
@@ -1560,7 +1559,7 @@ partial class GraphicsDeviceExtensions
public static ReadBackTexture2D AllocateReadBackTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, allocationMode);
}
@@ -1578,7 +1577,7 @@ partial class GraphicsDeviceExtensions
public static ReadBackTexture3D AllocateReadBackTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -1595,8 +1594,8 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
- Guard.IsNotNull(filename);
+ default(ArgumentNullException).ThrowIfNull(device);
+ default(ArgumentNullException).ThrowIfNull(filename);
return device.LoadReadOnlyTexture2D(filename.AsSpan());
}
@@ -1613,7 +1612,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel
where TPixel : unmanaged
{
- Guard.IsNotNull(device);
+ default(ArgumentNullException).ThrowIfNull(device);
using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, filename);
@@ -1636,7 +1635,7 @@ partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel