Leverage [CallerArgumentExpression] to remove nameof(...) uses

このコミットが含まれているのは:
Sergio Pedri committed 2022-01-29 18:37:33 +01:00
1 親 d0e1df9d04
コミット 6ff4b3103c
33ファイル変更
+512 -512

検索条件に一致するファイルはありません

+1 -1
ファイルの表示
@@ -32,7 +32,7 @@ public sealed class MainViewModel : ObservableObject
/// </summary>
public MainViewModel(IAnalyticsService analyticsService)
{
Guard.IsNotNull(analyticsService, nameof(analyticsService));
Guard.IsNotNull(analyticsService);
this.analyticsService = analyticsService;
this.isVerticalSyncEnabled = true;
+2 -2
ファイルの表示
@@ -20,8 +20,8 @@ public static class AssemblyExtensions
/// <returns>The contents of the specified file.</returns>
public static bool TryReadAllTextFromManifestFile(this Assembly assembly, string filename, out string? text)
{
Guard.IsNotNull(assembly, nameof(assembly));
Guard.IsNotNull(filename, nameof(filename));
Guard.IsNotNull(assembly);
Guard.IsNotNull(filename);
try
{
+1 -1
ファイルの表示
@@ -29,7 +29,7 @@ partial class SwapChainManager<TOwner>
{
ThrowIfDisposed();
Guard.IsNotNull(shaderRunner, nameof(shaderRunner));
Guard.IsNotNull(shaderRunner);
using (await this.setupSemaphore.LockAsync())
{
+2 -2
ファイルの表示
@@ -40,7 +40,7 @@ public sealed class ShaderRunner<T> : IShaderRunner
/// <param name="shaderFactory">The <see cref="Func{T1,TResult}"/> instance used to create shaders to run.</param>
public ShaderRunner(Func<TimeSpan, T> shaderFactory)
{
Guard.IsNotNull(shaderFactory, nameof(shaderFactory));
Guard.IsNotNull(shaderFactory);
this.shaderFactory = shaderFactory;
}
@@ -51,7 +51,7 @@ public sealed class ShaderRunner<T> : IShaderRunner
/// <param name="shaderFactory">The <see cref="Func{T1,T2,TResult}"/> instance used to create shaders to run.</param>
public ShaderRunner(Func<TimeSpan, object?, T> shaderFactory)
{
Guard.IsNotNull(shaderFactory, nameof(shaderFactory));
Guard.IsNotNull(shaderFactory);
this.statefulShaderFactory = shaderFactory;
}
+23 -23
ファイルの表示
@@ -22,7 +22,7 @@ public static class BufferExtensions
public static T[] ToArray<T>(this Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
return source.ToArray(0, source.Length);
}
@@ -38,8 +38,8 @@ public static class BufferExtensions
public static T[] ToArray<T>(this Buffer<T> source, int offset, int count)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsGreaterThanOrEqualTo(count, 0, nameof(count));
Guard.IsNotNull(source);
Guard.IsGreaterThanOrEqualTo(count, 0);
T[] data = GC.AllocateUninitializedArray<T>(count);
@@ -57,8 +57,8 @@ public static class BufferExtensions
public static void CopyTo<T>(this Buffer<T> source, T[] destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(), 0);
}
@@ -75,8 +75,8 @@ public static class BufferExtensions
public static void CopyTo<T>(this Buffer<T> source, T[] destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
Span<T> span = destination.AsSpan(destinationOffset, count);
@@ -92,7 +92,7 @@ public static class BufferExtensions
public static void CopyTo<T>(this Buffer<T> source, Span<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
source.CopyTo(destination, 0);
}
@@ -107,7 +107,7 @@ public static class BufferExtensions
public static void CopyTo<T>(this Buffer<T> source, Span<T> destination, int sourceOffset)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
source.CopyTo(ref MemoryMarshal.GetReference(destination), sourceOffset, destination.Length);
}
@@ -121,8 +121,8 @@ public static class BufferExtensions
public static void CopyTo<T>(this Buffer<T> source, Buffer<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, 0, 0, source.Length);
}
@@ -139,8 +139,8 @@ public static class BufferExtensions
public static void CopyTo<T>(this Buffer<T> source, Buffer<T> destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
@@ -154,8 +154,8 @@ public static class BufferExtensions
public static void CopyFrom<T>(this Buffer<T> destination, T[] source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(), 0);
}
@@ -172,8 +172,8 @@ public static class BufferExtensions
public static void CopyFrom<T>(this Buffer<T> destination, T[] source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
ReadOnlySpan<T> span = source.AsSpan(sourceOffset, count);
@@ -189,7 +189,7 @@ public static class BufferExtensions
public static void CopyFrom<T>(this Buffer<T> destination, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
destination.CopyFrom(source, 0);
}
@@ -204,7 +204,7 @@ public static class BufferExtensions
public static void CopyFrom<T>(this Buffer<T> destination, ReadOnlySpan<T> source, int destinationOffset)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
destination.CopyFrom(ref MemoryMarshal.GetReference(source), destinationOffset, source.Length);
}
@@ -218,8 +218,8 @@ public static class BufferExtensions
public static void CopyFrom<T>(this Buffer<T> destination, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, source.Length);
}
@@ -236,8 +236,8 @@ public static class BufferExtensions
public static void CopyFrom<T>(this Buffer<T> destination, Buffer<T> source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
+9 -9
ファイルの表示
@@ -18,7 +18,7 @@ public static partial class GraphicsDeviceExtensions
public static void For<T>(this GraphicsDevice device, int x, in T shader)
where T : struct, IComputeShader
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -36,7 +36,7 @@ public static partial class GraphicsDeviceExtensions
public static void For<T>(this GraphicsDevice device, int x, int y, in T shader)
where T : struct, IComputeShader
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -55,7 +55,7 @@ public static partial class GraphicsDeviceExtensions
public static void For<T>(this GraphicsDevice device, int x, int y, int z, in T shader)
where T : struct, IComputeShader
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -77,7 +77,7 @@ public static partial class GraphicsDeviceExtensions
public static void For<T>(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, nameof(device));
Guard.IsNotNull(device);
using ComputeContext context = device.CreateComputeContext();
@@ -95,8 +95,8 @@ public static partial class GraphicsDeviceExtensions
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(device);
Guard.IsNotNull(texture);
using ComputeContext context = device.CreateComputeContext();
@@ -115,8 +115,8 @@ public static partial class GraphicsDeviceExtensions
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(device);
Guard.IsNotNull(texture);
using ComputeContext context = device.CreateComputeContext();
@@ -148,7 +148,7 @@ public static partial class GraphicsDeviceExtensions
/// </remarks>
public static ComputeContext CreateComputeContext(this GraphicsDevice device)
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
device.ThrowIfDisposed();
+106 -106
ファイルの表示
@@ -20,7 +20,7 @@ public static partial class GraphicsDeviceExtensions
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, length, allocationMode);
}
@@ -35,8 +35,8 @@ public static partial class GraphicsDeviceExtensions
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, T[] source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateConstantBuffer<T>(source.AsSpan());
}
@@ -51,7 +51,7 @@ public static partial class GraphicsDeviceExtensions
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ConstantBuffer<T> buffer = new(device, source.Length, AllocationMode.Default);
@@ -70,8 +70,8 @@ public static partial class GraphicsDeviceExtensions
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ConstantBuffer<T> constantBuffer = new(device, source.Length, AllocationMode.Default);
@@ -91,7 +91,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, length, allocationMode);
}
@@ -106,8 +106,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, T[] source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyBuffer<T>(source.AsSpan());
}
@@ -122,7 +122,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadOnlyBuffer<T> buffer = new(device, source.Length, AllocationMode.Default);
@@ -141,8 +141,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadOnlyBuffer<T> readWriteBuffer = new(device, source.Length, AllocationMode.Default);
@@ -163,7 +163,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, allocationMode);
}
@@ -180,8 +180,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, T[] source, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture2D<T>(source.AsSpan(), width, height);
}
@@ -199,8 +199,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture2D<T>(source.AsSpan(offset), width, height);
}
@@ -215,8 +215,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, T[,] source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadOnlyTexture2D<T> texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -237,7 +237,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadOnlyTexture2D<T> texture = new(device, width, height, AllocationMode.Default);
@@ -260,7 +260,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, allocationMode);
}
@@ -279,8 +279,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture2D<T, TPixel>(source.AsSpan(), width, height);
}
@@ -300,8 +300,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture2D<T, TPixel>(source.AsSpan(offset), width, height);
}
@@ -318,8 +318,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadOnlyTexture2D<T, TPixel> texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -342,7 +342,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadOnlyTexture2D<T, TPixel> texture = new(device, width, height, AllocationMode.Default);
@@ -364,7 +364,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -382,8 +382,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, T[] source, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture3D<T>(source.AsSpan(), width, height, depth);
}
@@ -402,8 +402,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture3D<T>(source.AsSpan(offset), width, height, depth);
}
@@ -422,8 +422,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, T[,,] source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadOnlyTexture3D<T> texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -445,7 +445,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadOnlyTexture3D<T> texture = new(device, width, height, depth, AllocationMode.Default);
@@ -469,7 +469,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -489,8 +489,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture3D<T, TPixel>(source.AsSpan(), width, height, depth);
}
@@ -511,8 +511,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadOnlyTexture3D<T, TPixel>(source.AsSpan(offset), width, height, depth);
}
@@ -533,8 +533,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadOnlyTexture3D<T, TPixel> texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -558,7 +558,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadOnlyTexture3D<T, TPixel> texture = new(device, width, height, depth, AllocationMode.Default);
@@ -578,7 +578,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, length, allocationMode);
}
@@ -593,8 +593,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, T[] source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteBuffer<T>(source.AsSpan());
}
@@ -609,7 +609,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadWriteBuffer<T> buffer = new(device, source.Length, AllocationMode.Default);
@@ -628,8 +628,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadWriteBuffer<T> readWriteBuffer = new(device, source.Length, AllocationMode.Default);
@@ -650,7 +650,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, allocationMode);
}
@@ -667,8 +667,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, T[] source, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture2D<T>(source.AsSpan(), width, height);
}
@@ -686,8 +686,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture2D<T>(source.AsSpan(offset), width, height);
}
@@ -702,8 +702,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, T[,] source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadWriteTexture2D<T> texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -724,7 +724,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadWriteTexture2D<T> texture = new(device, width, height, AllocationMode.Default);
@@ -747,7 +747,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, allocationMode);
}
@@ -766,8 +766,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture2D<T, TPixel>(source.AsSpan(), width, height);
}
@@ -787,8 +787,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture2D<T, TPixel>(source.AsSpan(offset), width, height);
}
@@ -805,8 +805,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadWriteTexture2D<T, TPixel> texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -829,7 +829,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadWriteTexture2D<T, TPixel> texture = new(device, width, height, AllocationMode.Default);
@@ -851,7 +851,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -869,8 +869,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, T[] source, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture3D<T>(source.AsSpan(), width, height, depth);
}
@@ -889,8 +889,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture3D<T>(source.AsSpan(offset), width, height, depth);
}
@@ -909,8 +909,8 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, T[,,] source)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadWriteTexture3D<T> texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -932,7 +932,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadWriteTexture3D<T> texture = new(device, width, height, depth, AllocationMode.Default);
@@ -956,7 +956,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -976,8 +976,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture3D<T, TPixel>(source.AsSpan(), width, height, depth);
}
@@ -998,8 +998,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
return device.AllocateReadWriteTexture3D<T, TPixel>(source.AsSpan(offset), width, height, depth);
}
@@ -1020,8 +1020,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(device);
Guard.IsNotNull(source);
ReadWriteTexture3D<T, TPixel> texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default);
@@ -1045,7 +1045,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
ReadWriteTexture3D<T, TPixel> texture = new(device, width, height, depth, AllocationMode.Default);
@@ -1065,7 +1065,7 @@ public static partial class GraphicsDeviceExtensions
public static UploadBuffer<T> AllocateUploadBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, length, allocationMode);
}
@@ -1082,7 +1082,7 @@ public static partial class GraphicsDeviceExtensions
public static UploadTexture2D<T> AllocateUploadTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, allocationMode);
}
@@ -1100,7 +1100,7 @@ public static partial class GraphicsDeviceExtensions
public static UploadTexture3D<T> AllocateUploadTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -1116,7 +1116,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadBackBuffer<T> AllocateReadBackBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, length, allocationMode);
}
@@ -1133,7 +1133,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadBackTexture2D<T> AllocateReadBackTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, allocationMode);
}
@@ -1151,7 +1151,7 @@ public static partial class GraphicsDeviceExtensions
public static ReadBackTexture3D<T> AllocateReadBackTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return new(device, width, height, depth, allocationMode);
}
@@ -1168,8 +1168,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(filename, nameof(filename));
Guard.IsNotNull(device);
Guard.IsNotNull(filename);
return device.LoadReadOnlyTexture2D<T, TPixel>(filename.AsSpan());
}
@@ -1186,7 +1186,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
using UploadTexture2D<T> upload = WICHelper.Instance.LoadTexture<T>(device, filename);
@@ -1209,7 +1209,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
using UploadTexture2D<T> upload = WICHelper.Instance.LoadTexture<T>(device, span);
@@ -1232,8 +1232,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(stream, nameof(stream));
Guard.IsNotNull(device);
Guard.IsNotNull(stream);
using UploadTexture2D<T> upload = WICHelper.Instance.LoadTexture<T>(device, stream);
@@ -1256,8 +1256,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(filename, nameof(filename));
Guard.IsNotNull(device);
Guard.IsNotNull(filename);
return device.LoadReadWriteTexture2D<T, TPixel>(filename.AsSpan());
}
@@ -1274,7 +1274,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
using UploadTexture2D<T> upload = WICHelper.Instance.LoadTexture<T>(device, filename);
@@ -1297,7 +1297,7 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
using UploadTexture2D<T> upload = WICHelper.Instance.LoadTexture<T>(device, span);
@@ -1320,8 +1320,8 @@ public static partial class GraphicsDeviceExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(stream, nameof(stream));
Guard.IsNotNull(device);
Guard.IsNotNull(stream);
using UploadTexture2D<T> upload = WICHelper.Instance.LoadTexture<T>(device, stream);
@@ -1342,8 +1342,8 @@ public static partial class GraphicsDeviceExtensions
public static UploadTexture2D<T> LoadUploadTexture2D<T>(this GraphicsDevice device, string filename)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(filename, nameof(filename));
Guard.IsNotNull(device);
Guard.IsNotNull(filename);
return device.LoadUploadTexture2D<T>(filename.AsSpan());
}
@@ -1358,7 +1358,7 @@ public static partial class GraphicsDeviceExtensions
public static UploadTexture2D<T> LoadUploadTexture2D<T>(this GraphicsDevice device, ReadOnlySpan<char> filename)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return WICHelper.Instance.LoadTexture<T>(device, filename);
}
@@ -1373,7 +1373,7 @@ public static partial class GraphicsDeviceExtensions
public static UploadTexture2D<T> LoadUploadTexture2D<T>(this GraphicsDevice device, ReadOnlySpan<byte> span)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(device);
return WICHelper.Instance.LoadTexture<T>(device, span);
}
@@ -1388,8 +1388,8 @@ public static partial class GraphicsDeviceExtensions
public static UploadTexture2D<T> LoadUploadTexture2D<T>(this GraphicsDevice device, Stream stream)
where T : unmanaged
{
Guard.IsNotNull(device, nameof(device));
Guard.IsNotNull(stream, nameof(stream));
Guard.IsNotNull(device);
Guard.IsNotNull(stream);
return WICHelper.Instance.LoadTexture<T>(device, stream);
}
+4 -4
ファイルの表示
@@ -17,8 +17,8 @@ public static class ReadBackBufferExtensions
public static void CopyFrom<T>(this ReadBackBuffer<T> destination, StructuredBuffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, source.Length);
}
@@ -35,8 +35,8 @@ public static class ReadBackBufferExtensions
public static void CopyFrom<T>(this ReadBackBuffer<T> destination, StructuredBuffer<T> source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
+13 -13
ファイルの表示
@@ -21,8 +21,8 @@ public static class ReadBackTexture2DExtensions
public static void CopyFrom<T>(this ReadBackTexture2D<T> destination, Texture2D<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, 0, 0, source.Width, source.Height);
}
@@ -40,8 +40,8 @@ public static class ReadBackTexture2DExtensions
public static void CopyFrom<T>(this ReadBackTexture2D<T> destination, Texture2D<T> source, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, 0, 0, width, height);
}
@@ -61,8 +61,8 @@ public static class ReadBackTexture2DExtensions
public static void CopyFrom<T>(this ReadBackTexture2D<T> destination, Texture2D<T> source, int sourceOffsetX, int sourceOffsetY, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, destinationOffsetX, destinationOffsetY, width, height);
}
@@ -76,8 +76,8 @@ public static class ReadBackTexture2DExtensions
public static void Save<T>(this ReadBackTexture2D<T> texture, string filename)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(filename, nameof(filename));
Guard.IsNotNull(texture);
Guard.IsNotNull(filename);
WICHelper.Instance.SaveTexture(texture.View, filename.AsSpan());
}
@@ -91,7 +91,7 @@ public static class ReadBackTexture2DExtensions
public static void Save<T>(this ReadBackTexture2D<T> texture, ReadOnlySpan<char> filename)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
WICHelper.Instance.SaveTexture(texture.View, filename);
}
@@ -106,8 +106,8 @@ public static class ReadBackTexture2DExtensions
public static void Save<T>(this ReadBackTexture2D<T> texture, Stream stream, ImageFormat format)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(stream, nameof(stream));
Guard.IsNotNull(texture);
Guard.IsNotNull(stream);
WICHelper.Instance.SaveTexture(texture.View, stream, format);
}
@@ -122,8 +122,8 @@ public static class ReadBackTexture2DExtensions
public static void Save<T>(this ReadBackTexture2D<T> texture, IBufferWriter<byte> writer, ImageFormat format)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(writer, nameof(writer));
Guard.IsNotNull(texture);
Guard.IsNotNull(writer);
WICHelper.Instance.SaveTexture(texture.View, writer, format);
}
+6 -6
ファイルの表示
@@ -17,8 +17,8 @@ public static class ReadBackTexture3DExtensions
public static void CopyFrom<T>(this ReadBackTexture3D<T> destination, Texture3D<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, 0, 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -38,8 +38,8 @@ public static class ReadBackTexture3DExtensions
public static void CopyFrom<T>(this ReadBackTexture3D<T> destination, Texture3D<T> source, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, 0, 0, 0, width, height, depth);
}
@@ -62,8 +62,8 @@ public static class ReadBackTexture3DExtensions
public static void CopyFrom<T>(this ReadBackTexture3D<T> destination, Texture3D<T> source, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
+5 -5
ファイルの表示
@@ -29,7 +29,7 @@ public static class ReadWriteTexture2DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture2D<float> AsReadOnly(this ReadWriteTexture2D<float> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -55,7 +55,7 @@ public static class ReadWriteTexture2DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture2D<Float2> AsReadOnly(this ReadWriteTexture2D<Float2> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -81,7 +81,7 @@ public static class ReadWriteTexture2DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture2D<Float3> AsReadOnly(this ReadWriteTexture2D<Float3> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -107,7 +107,7 @@ public static class ReadWriteTexture2DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture2D<Float4> AsReadOnly(this ReadWriteTexture2D<Float4> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -137,7 +137,7 @@ public static class ReadWriteTexture2DExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
+5 -5
ファイルの表示
@@ -29,7 +29,7 @@ public static class ReadWriteTexture3DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture3D<float> AsReadOnly(this ReadWriteTexture3D<float> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -55,7 +55,7 @@ public static class ReadWriteTexture3DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture3D<Float2> AsReadOnly(this ReadWriteTexture3D<Float2> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -81,7 +81,7 @@ public static class ReadWriteTexture3DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture3D<Float3> AsReadOnly(this ReadWriteTexture3D<Float3> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -107,7 +107,7 @@ public static class ReadWriteTexture3DExtensions
/// <exception cref="InvalidOperationException">Thrown if the current instance is not in a readonly state.</exception>
public static IReadOnlyTexture3D<Float4> AsReadOnly(this ReadWriteTexture3D<Float4> texture)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
@@ -137,7 +137,7 @@ public static class ReadWriteTexture3DExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
return texture.AsReadOnly();
}
+8 -8
ファイルの表示
@@ -17,8 +17,8 @@ public static class StructuredBufferExtensions
public static void CopyTo<T>(this StructuredBuffer<T> source, ReadBackBuffer<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, 0, 0, source.Length);
}
@@ -35,8 +35,8 @@ public static class StructuredBufferExtensions
public static void CopyTo<T>(this StructuredBuffer<T> source, ReadBackBuffer<T> destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
@@ -50,8 +50,8 @@ public static class StructuredBufferExtensions
public static void CopyFrom<T>(this StructuredBuffer<T> destination, UploadBuffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, source.Length);
}
@@ -68,8 +68,8 @@ public static class StructuredBufferExtensions
public static void CopyFrom<T>(this StructuredBuffer<T> destination, UploadBuffer<T> source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
+67 -67
ファイルの表示
@@ -22,7 +22,7 @@ public static class Texture2DExtensions
public static T[,] ToArray<T>(this Texture2D<T> source)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
T[,] data = new T[source.Height, source.Width];
@@ -44,9 +44,9 @@ public static class Texture2DExtensions
public static unsafe T[,] ToArray<T>(this Texture2D<T> source, int x, int y, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsGreaterThanOrEqualTo(width, 0, nameof(width));
Guard.IsGreaterThanOrEqualTo(height, 0, nameof(height));
Guard.IsNotNull(source);
Guard.IsGreaterThanOrEqualTo(width, 0);
Guard.IsGreaterThanOrEqualTo(height, 0);
T[,] data = new T[height, width];
@@ -67,8 +67,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, T[,] destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
Guard.IsEqualTo(destination.GetLength(0), source.Height, nameof(destination));
Guard.IsEqualTo(destination.GetLength(1), source.Width, nameof(destination));
@@ -84,8 +84,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, T[] destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(), 0, 0, source.Width, source.Height);
}
@@ -102,8 +102,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, T[] destination, Range x, Range y)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(), x, y);
}
@@ -122,8 +122,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, T[] destination, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(), sourceOffsetX, sourceOffsetY, width, height);
}
@@ -138,8 +138,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, T[] destination, int destinationOffset)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(destinationOffset), 0, 0, source.Width, source.Height);
}
@@ -157,8 +157,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, T[] destination, int destinationOffset, Range x, Range y)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(destinationOffset), x, y);
}
@@ -178,8 +178,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, T[] destination, int destinationOffset, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(destinationOffset), sourceOffsetX, sourceOffsetY, width, height);
}
@@ -194,7 +194,7 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, Span<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, source.Width, source.Height);
}
@@ -211,7 +211,7 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, Span<T> destination, Range x, Range y)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
var (offsetX, width) = x.GetOffsetAndLength(source.Width);
var (offsetY, height) = y.GetOffsetAndLength(source.Height);
@@ -233,7 +233,7 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, Span<T> destination, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
source.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, sourceOffsetX, sourceOffsetY, width, height);
}
@@ -247,8 +247,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, Texture2D<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, 0, 0, 0, 0, source.Width, source.Height);
}
@@ -266,8 +266,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, Texture2D<T> destination, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, 0, 0, width, height);
}
@@ -287,8 +287,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, Texture2D<T> destination, int sourceOffsetX, int sourceOffsetY, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, destinationOffsetX, destinationOffsetY, width, height);
}
@@ -302,8 +302,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, ReadBackTexture2D<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, 0, 0, 0, 0, source.Width, source.Height);
}
@@ -321,8 +321,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, ReadBackTexture2D<T> destination, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, 0, 0, width, height);
}
@@ -342,8 +342,8 @@ public static class Texture2DExtensions
public static void CopyTo<T>(this Texture2D<T> source, ReadBackTexture2D<T> destination, int sourceOffsetX, int sourceOffsetY, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, destinationOffsetX, destinationOffsetY, width, height);
}
@@ -357,8 +357,8 @@ public static class Texture2DExtensions
public static unsafe void CopyFrom<T>(this Texture2D<T> destination, T[,] source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
Guard.IsEqualTo(source.GetLength(0), destination.Height, nameof(source));
Guard.IsEqualTo(source.GetLength(1), destination.Width, nameof(source));
@@ -374,8 +374,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, T[] source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(), 0, 0, destination.Width, destination.Height);
}
@@ -392,8 +392,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, T[] source, Range x, Range y)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(), x, y);
}
@@ -412,8 +412,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, T[] source, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(), destinationOffsetX, destinationOffsetY, width, height);
}
@@ -431,8 +431,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, T[] source, int sourceOffset, Range x, Range y)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(sourceOffset), x, y);
}
@@ -452,8 +452,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, T[] source, int sourceOffset, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(sourceOffset), destinationOffsetX, destinationOffsetY, width, height);
}
@@ -468,7 +468,7 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
destination.CopyFrom(source, 0, 0, destination.Width, destination.Height);
}
@@ -485,7 +485,7 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, ReadOnlySpan<T> source, Range x, Range y)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
var (offsetX, width) = x.GetOffsetAndLength(destination.Width);
var (offsetY, height) = y.GetOffsetAndLength(destination.Height);
@@ -507,7 +507,7 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, ReadOnlySpan<T> source, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
destination.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, destinationOffsetX, destinationOffsetY, width, height);
}
@@ -521,8 +521,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, Texture2D<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source, 0, 0, 0, 0, source.Width, source.Height);
}
@@ -540,8 +540,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, Texture2D<T> source, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, 0, 0, width, height);
}
@@ -561,8 +561,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, Texture2D<T> source, int sourceOffsetX, int sourceOffsetY, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, destinationOffsetX, destinationOffsetY, width, height);
}
@@ -576,8 +576,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, UploadTexture2D<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, 0, 0, source.Width, source.Height);
}
@@ -595,8 +595,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, UploadTexture2D<T> source, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, 0, 0, width, height);
}
@@ -616,8 +616,8 @@ public static class Texture2DExtensions
public static void CopyFrom<T>(this Texture2D<T> destination, UploadTexture2D<T> source, int sourceOffsetX, int sourceOffsetY, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, destinationOffsetX, destinationOffsetY, width, height);
}
@@ -631,8 +631,8 @@ public static class Texture2DExtensions
public static void Save<T>(this Texture2D<T> texture, string filename)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(filename, nameof(filename));
Guard.IsNotNull(texture);
Guard.IsNotNull(filename);
texture.Save(filename.AsSpan());
}
@@ -646,7 +646,7 @@ public static class Texture2DExtensions
public static void Save<T>(this Texture2D<T> texture, ReadOnlySpan<char> filename)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
using ReadBackTexture2D<T> readback = texture.GraphicsDevice.AllocateReadBackTexture2D<T>(texture.Width, texture.Height);
@@ -665,8 +665,8 @@ public static class Texture2DExtensions
public static void Save<T>(this Texture2D<T> texture, Stream stream, ImageFormat format)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(stream, nameof(stream));
Guard.IsNotNull(texture);
Guard.IsNotNull(stream);
using ReadBackTexture2D<T> readback = texture.GraphicsDevice.AllocateReadBackTexture2D<T>(texture.Width, texture.Height);
@@ -685,8 +685,8 @@ public static class Texture2DExtensions
public static void Save<T>(this Texture2D<T> texture, IBufferWriter<byte> writer, ImageFormat format)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(writer, nameof(writer));
Guard.IsNotNull(texture);
Guard.IsNotNull(writer);
using ReadBackTexture2D<T> readback = texture.GraphicsDevice.AllocateReadBackTexture2D<T>(texture.Width, texture.Height);
+55 -55
ファイルの表示
@@ -24,7 +24,7 @@ public static class Texture3DExtensions
public static T[,,] ToArray<T>(this Texture3D<T> source)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
T[,,] data = new T[source.Depth, source.Height, source.Width];
@@ -48,10 +48,10 @@ public static class Texture3DExtensions
public static unsafe T[,,] ToArray<T>(this Texture3D<T> source, int x, int y, int z, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsGreaterThanOrEqualTo(width, 0, nameof(width));
Guard.IsGreaterThanOrEqualTo(height, 0, nameof(height));
Guard.IsGreaterThanOrEqualTo(depth, 0, nameof(depth));
Guard.IsNotNull(source);
Guard.IsGreaterThanOrEqualTo(width, 0);
Guard.IsGreaterThanOrEqualTo(height, 0);
Guard.IsGreaterThanOrEqualTo(depth, 0);
T[,,] data = new T[depth, height, width];
@@ -76,8 +76,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, T[,,] destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
Guard.IsEqualTo(destination.GetLength(0), source.Depth, nameof(destination));
Guard.IsEqualTo(destination.GetLength(1), source.Height, nameof(destination));
Guard.IsEqualTo(destination.GetLength(2), source.Width, nameof(destination));
@@ -95,8 +95,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, T[] destination, int destinationOffset)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(destinationOffset), 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -115,8 +115,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, T[] destination, int destinationOffset, Range x, Range y, Range z)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(destinationOffset), x, y, z);
}
@@ -138,8 +138,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, T[] destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int destinationOffset, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination.AsSpan(destinationOffset), sourceOffsetX, sourceOffsetY, sourceOffsetZ, width, height, depth);
}
@@ -153,7 +153,7 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, Span<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -171,7 +171,7 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, Span<T> destination, Range x, Range y, Range z)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
var (offsetX, width) = x.GetOffsetAndLength(source.Width);
var (offsetY, height) = y.GetOffsetAndLength(source.Height);
@@ -196,7 +196,7 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, Span<T> destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(source);
source.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, sourceOffsetX, sourceOffsetY, sourceOffsetZ, width, height, depth);
}
@@ -210,8 +210,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, Texture3D<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, 0, 0, 0, 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -231,8 +231,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, Texture3D<T> destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, 0, 0, 0, width, height, depth);
}
@@ -255,8 +255,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, Texture3D<T> destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
@@ -270,8 +270,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, ReadBackTexture3D<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, 0, 0, 0, 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -291,8 +291,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, ReadBackTexture3D<T> destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, 0, 0, 0, width, height, depth);
}
@@ -315,8 +315,8 @@ public static class Texture3DExtensions
public static void CopyTo<T>(this Texture3D<T> source, ReadBackTexture3D<T> destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
@@ -334,8 +334,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, T[,,] source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
Guard.IsEqualTo(source.GetLength(0), destination.Depth, nameof(source));
Guard.IsEqualTo(source.GetLength(1), destination.Height, nameof(source));
Guard.IsEqualTo(source.GetLength(2), destination.Width, nameof(source));
@@ -352,8 +352,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, T[] source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(), 0, 0, 0, destination.Width, destination.Height, destination.Depth);
}
@@ -371,8 +371,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, T[] source, Range x, Range y, Range z)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(), x, y, z);
}
@@ -393,8 +393,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, T[] source, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(), destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
@@ -413,8 +413,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, T[] source, int sourceOffset, Range x, Range y, Range z)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(sourceOffset), x, y, z);
}
@@ -436,8 +436,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, T[] source, int sourceOffset, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source.AsSpan(sourceOffset), destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
@@ -452,7 +452,7 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
destination.CopyFrom(source, 0, 0, 0, destination.Width, destination.Height, destination.Depth);
}
@@ -470,7 +470,7 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, ReadOnlySpan<T> source, Range x, Range y, Range z)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
var (offsetX, width) = x.GetOffsetAndLength(destination.Width);
var (offsetY, height) = y.GetOffsetAndLength(destination.Height);
@@ -495,7 +495,7 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, ReadOnlySpan<T> source, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(destination);
destination.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
@@ -509,8 +509,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, Texture3D<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, 0, 0, 0, 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -530,8 +530,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, Texture3D<T> source, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, 0, 0, 0, width, height, depth);
}
@@ -554,8 +554,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, Texture3D<T> source, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
source.CopyTo(destination, sourceOffsetX, sourceOffsetY, sourceOffsetZ, destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
@@ -569,8 +569,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, UploadTexture3D<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source, 0, 0, 0, 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -590,8 +590,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, UploadTexture3D<T> source, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, sourceOffsetZ, 0, 0, 0, width, height, depth);
}
@@ -614,8 +614,8 @@ public static class Texture3DExtensions
public static void CopyFrom<T>(this Texture3D<T> destination, UploadTexture3D<T> source, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination);
Guard.IsNotNull(source);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, sourceOffsetZ, destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
+4 -4
ファイルの表示
@@ -17,8 +17,8 @@ public static class UploadBufferExtensions
public static void CopyTo<T>(this UploadBuffer<T> source, StructuredBuffer<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, 0, 0, source.Length);
}
@@ -35,8 +35,8 @@ public static class UploadBufferExtensions
public static void CopyTo<T>(this UploadBuffer<T> source, StructuredBuffer<T> destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, sourceOffset, destinationOffset, count);
}
+12 -12
ファイルの表示
@@ -20,8 +20,8 @@ public static class UploadTexture2DExtensions
public static void CopyTo<T>(this UploadTexture2D<T> source, Texture2D<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, 0, 0, 0, 0, source.Width, source.Height);
}
@@ -39,8 +39,8 @@ public static class UploadTexture2DExtensions
public static void CopyTo<T>(this UploadTexture2D<T> source, Texture2D<T> destination, int sourceOffsetX, int sourceOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, 0, 0, width, height);
}
@@ -60,8 +60,8 @@ public static class UploadTexture2DExtensions
public static void CopyTo<T>(this UploadTexture2D<T> source, Texture2D<T> destination, int sourceOffsetX, int sourceOffsetY, int destinationOffsetX, int destinationOffsetY, int width, int height)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, destinationOffsetX, destinationOffsetY, width, height);
}
@@ -75,8 +75,8 @@ public static class UploadTexture2DExtensions
public static void Load<T>(this UploadTexture2D<T> texture, string filename)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(filename, nameof(filename));
Guard.IsNotNull(texture);
Guard.IsNotNull(filename);
texture. Load(filename.AsSpan());
}
@@ -90,7 +90,7 @@ public static class UploadTexture2DExtensions
public static void Load<T>(this UploadTexture2D<T> texture, ReadOnlySpan<char> filename)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
WICHelper.Instance.LoadTexture(texture.View, filename);
}
@@ -105,7 +105,7 @@ public static class UploadTexture2DExtensions
public static void Load<T>(this UploadTexture2D<T> texture, ReadOnlySpan<byte> span)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
WICHelper.Instance.LoadTexture(texture.View, span);
}
@@ -119,8 +119,8 @@ public static class UploadTexture2DExtensions
public static void Load<T>(this UploadTexture2D<T> texture, Stream stream)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(stream, nameof(stream));
Guard.IsNotNull(texture);
Guard.IsNotNull(stream);
WICHelper.Instance.LoadTexture(texture.View, stream);
}
+6 -6
ファイルの表示
@@ -17,8 +17,8 @@ public static class UploadTexture3DExtensions
public static void CopyTo<T>(this UploadTexture3D<T> source, Texture3D<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, 0, 0, 0, 0, 0, 0, source.Width, source.Height, source.Depth);
}
@@ -38,8 +38,8 @@ public static class UploadTexture3DExtensions
public static void CopyTo<T>(this UploadTexture3D<T> source, Texture3D<T> destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, sourceOffsetZ, 0, 0, 0, width, height, depth);
}
@@ -62,8 +62,8 @@ public static class UploadTexture3DExtensions
public static void CopyTo<T>(this UploadTexture3D<T> source, Texture3D<T> destination, int sourceOffsetX, int sourceOffsetY, int sourceOffsetZ, int destinationOffsetX, int destinationOffsetY, int destinationOffsetZ, int width, int height, int depth)
where T : unmanaged
{
Guard.IsNotNull(source, nameof(source));
Guard.IsNotNull(destination, nameof(destination));
Guard.IsNotNull(source);
Guard.IsNotNull(destination);
destination.CopyFrom(source, sourceOffsetX, sourceOffsetY, sourceOffsetZ, destinationOffsetX, destinationOffsetY, destinationOffsetZ, width, height, depth);
}
+1 -1
ファイルの表示
@@ -47,7 +47,7 @@ partial class GraphicsDevice
/// </remarks>
public static IEnumerable<GraphicsDevice> QueryDevices(Predicate<GraphicsDeviceInfo> predicate)
{
Guard.IsNotNull(predicate, nameof(predicate));
Guard.IsNotNull(predicate);
return new DeviceHelper.DeviceQuery(predicate);
}
+11 -11
ファイルの表示
@@ -62,7 +62,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(Buffer<T> buffer, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(buffer, nameof(buffer));
Guard.IsNotNull(buffer);
buffer.ThrowIfDisposed();
buffer.ThrowIfDeviceMismatch(device);
@@ -83,7 +83,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(ReadOnlyTexture2D<T> texture, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
texture.ThrowIfDisposed();
texture.ThrowIfDeviceMismatch(device);
@@ -104,7 +104,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(ReadWriteTexture2D<T> texture, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
texture.ThrowIfDisposed();
texture.ThrowIfDeviceMismatch(device);
@@ -125,7 +125,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(IReadOnlyTexture2D<T> texture, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
if (texture is IGraphicsResource resource)
{
@@ -148,7 +148,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadOnlyNormalizedTexture2D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
if (texture is IGraphicsResource resource)
{
@@ -171,7 +171,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadWriteNormalizedTexture2D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
if (texture is IGraphicsResource resource)
{
@@ -194,7 +194,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(ReadOnlyTexture3D<T> texture, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
texture.ThrowIfDisposed();
texture.ThrowIfDeviceMismatch(device);
@@ -215,7 +215,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(ReadWriteTexture3D<T> texture, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
texture.ThrowIfDisposed();
texture.ThrowIfDeviceMismatch(device);
@@ -236,7 +236,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(IReadOnlyTexture3D<T> texture, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
if (texture is IGraphicsResource resource)
{
@@ -259,7 +259,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadOnlyNormalizedTexture3D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
if (texture is IGraphicsResource resource)
{
@@ -282,7 +282,7 @@ public static class GraphicsResourceHelper
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<TPixel>(IReadWriteNormalizedTexture3D<TPixel> texture, GraphicsDevice device)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
if (texture is IGraphicsResource resource)
{
+2 -2
ファイルの表示
@@ -68,12 +68,12 @@ public unsafe abstract class Buffer<T> : NativeObject, IGraphicsResource
if (resourceType == ResourceType.Constant)
{
Guard.IsBetweenOrEqualTo(length, 1, D3D12.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length));
Guard.IsBetweenOrEqualTo(length, 1, D3D12.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT);
}
else
{
// The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue
Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / elementSizeInBytes) & ~255, nameof(length));
Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / elementSizeInBytes) & ~255);
}
if (TypeInfo<T>.IsDoubleOrContainsDoubles &&
+16 -16
ファイルの表示
@@ -36,8 +36,8 @@ public abstract class StructuredBuffer<T> : Buffer<T>
ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(count, 0, Length, nameof(count));
Guard.IsInRange(sourceOffset, 0, Length, nameof(sourceOffset));
Guard.IsBetweenOrEqualTo(count, 0, Length);
Guard.IsInRange(sourceOffset, 0, Length);
Guard.IsLessThanOrEqualTo(sourceOffset + count, Length, nameof(sourceOffset));
if (GraphicsDevice.IsCacheCoherentUMA)
@@ -110,11 +110,11 @@ public abstract class StructuredBuffer<T> : Buffer<T>
destination.ThrowIfDeviceMismatch(GraphicsDevice);
destination.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(count, 0, Length, nameof(count));
Guard.IsBetweenOrEqualTo(count, 0, destination.Length, nameof(count));
Guard.IsInRange(sourceOffset, 0, Length, nameof(sourceOffset));
Guard.IsBetweenOrEqualTo(count, 0, Length);
Guard.IsBetweenOrEqualTo(count, 0, destination.Length);
Guard.IsInRange(sourceOffset, 0, Length);
Guard.IsLessThanOrEqualTo(sourceOffset + count, Length, nameof(sourceOffset));
Guard.IsInRange(destinationOffset, 0, destination.Length, nameof(destinationOffset));
Guard.IsInRange(destinationOffset, 0, destination.Length);
Guard.IsLessThanOrEqualTo(destinationOffset + count, destination.Length, nameof(destinationOffset));
if (!destination.IsPaddingPresent)
@@ -154,11 +154,11 @@ public abstract class StructuredBuffer<T> : Buffer<T>
destination.ThrowIfDeviceMismatch(GraphicsDevice);
destination.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(count, 0, Length, nameof(count));
Guard.IsBetweenOrEqualTo(count, 0, destination.Length, nameof(count));
Guard.IsInRange(sourceOffset, 0, Length, nameof(sourceOffset));
Guard.IsBetweenOrEqualTo(count, 0, Length);
Guard.IsBetweenOrEqualTo(count, 0, destination.Length);
Guard.IsInRange(sourceOffset, 0, Length);
Guard.IsLessThanOrEqualTo(sourceOffset + count, Length, nameof(sourceOffset));
Guard.IsInRange(destinationOffset, 0, destination.Length, nameof(destinationOffset));
Guard.IsInRange(destinationOffset, 0, destination.Length);
Guard.IsLessThanOrEqualTo(destinationOffset + count, destination.Length, nameof(destinationOffset));
if (GraphicsDevice.IsCacheCoherentUMA)
@@ -194,8 +194,8 @@ public abstract class StructuredBuffer<T> : Buffer<T>
ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(length, 0, Length, nameof(length));
Guard.IsInRange(offset, 0, Length, nameof(offset));
Guard.IsBetweenOrEqualTo(length, 0, Length);
Guard.IsInRange(offset, 0, Length);
Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(offset));
if (GraphicsDevice.IsCacheCoherentUMA)
@@ -272,11 +272,11 @@ public abstract class StructuredBuffer<T> : Buffer<T>
source.ThrowIfDeviceMismatch(GraphicsDevice);
source.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(count, 0, Length, nameof(count));
Guard.IsBetweenOrEqualTo(count, 0, source.Length, nameof(count));
Guard.IsInRange(sourceOffset, 0, source.Length, nameof(sourceOffset));
Guard.IsBetweenOrEqualTo(count, 0, Length);
Guard.IsBetweenOrEqualTo(count, 0, source.Length);
Guard.IsInRange(sourceOffset, 0, source.Length);
Guard.IsLessThanOrEqualTo(sourceOffset + count, source.Length, nameof(sourceOffset));
Guard.IsInRange(destinationOffset, 0, Length, nameof(destinationOffset));
Guard.IsInRange(destinationOffset, 0, Length);
Guard.IsLessThanOrEqualTo(destinationOffset + count, Length, nameof(destinationOffset));
if (GraphicsDevice.IsCacheCoherentUMA)
+36 -36
ファイルの表示
@@ -74,8 +74,8 @@ public unsafe abstract class Texture2D<T> : NativeObject, IGraphicsResource, Gra
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION);
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION);
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
{
@@ -172,13 +172,13 @@ public unsafe abstract class Texture2D<T> : NativeObject, IGraphicsResource, Gra
ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, Height, nameof(sourceOffsetY));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsInRange(sourceOffsetX, 0, Width);
Guard.IsInRange(sourceOffsetY, 0, Height);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsLessThanOrEqualTo(sourceOffsetX + width, Width, nameof(sourceOffsetX));
Guard.IsLessThanOrEqualTo(sourceOffsetY + height, Height, nameof(sourceOffsetY));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height);
GraphicsDevice.D3D12Device->GetCopyableFootprint(
DXGIFormatHelper.GetForType<T>(),
@@ -264,14 +264,14 @@ public unsafe abstract class Texture2D<T> : NativeObject, IGraphicsResource, Gra
destination.ThrowIfDeviceMismatch(GraphicsDevice);
destination.ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, Height, nameof(sourceOffsetY));
Guard.IsInRange(destinationOffsetX, 0, destination.Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, destination.Height, nameof(destinationOffsetY));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height));
Guard.IsInRange(sourceOffsetX, 0, Width);
Guard.IsInRange(sourceOffsetY, 0, Height);
Guard.IsInRange(destinationOffsetX, 0, destination.Width);
Guard.IsInRange(destinationOffsetY, 0, destination.Height);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(width, 1, destination.Width);
Guard.IsBetweenOrEqualTo(height, 1, destination.Height);
Guard.IsBetweenOrEqualTo(destinationOffsetX + width, 1, destination.Width, nameof(destinationOffsetX));
Guard.IsBetweenOrEqualTo(destinationOffsetY + height, 1, destination.Height, nameof(destinationOffsetY));
Guard.IsLessThanOrEqualTo(sourceOffsetX + width, Width, nameof(sourceOffsetX));
@@ -332,14 +332,14 @@ public unsafe abstract class Texture2D<T> : NativeObject, IGraphicsResource, Gra
destination.ThrowIfDeviceMismatch(GraphicsDevice);
destination.ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, Height, nameof(sourceOffsetY));
Guard.IsInRange(destinationOffsetX, 0, destination.Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, destination.Height, nameof(destinationOffsetY));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height));
Guard.IsInRange(sourceOffsetX, 0, Width);
Guard.IsInRange(sourceOffsetY, 0, Height);
Guard.IsInRange(destinationOffsetX, 0, destination.Width);
Guard.IsInRange(destinationOffsetY, 0, destination.Height);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(width, 1, destination.Width);
Guard.IsBetweenOrEqualTo(height, 1, destination.Height);
Guard.IsBetweenOrEqualTo(destinationOffsetX + width, 1, destination.Width, nameof(destinationOffsetX));
Guard.IsBetweenOrEqualTo(destinationOffsetY + height, 1, destination.Height, nameof(destinationOffsetY));
Guard.IsLessThanOrEqualTo(sourceOffsetX + width, Width, nameof(sourceOffsetX));
@@ -392,13 +392,13 @@ public unsafe abstract class Texture2D<T> : NativeObject, IGraphicsResource, Gra
ThrowIfDisposed();
Guard.IsInRange(destinationOffsetX, 0, Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, Height, nameof(destinationOffsetY));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsInRange(destinationOffsetX, 0, Width);
Guard.IsInRange(destinationOffsetY, 0, Height);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsLessThanOrEqualTo(destinationOffsetX + width, Width, nameof(destinationOffsetX));
Guard.IsLessThanOrEqualTo(destinationOffsetY + height, Height, nameof(destinationOffsetY));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height);
GraphicsDevice.D3D12Device->GetCopyableFootprint(
DXGIFormatHelper.GetForType<T>(),
@@ -482,14 +482,14 @@ public unsafe abstract class Texture2D<T> : NativeObject, IGraphicsResource, Gra
source.ThrowIfDeviceMismatch(GraphicsDevice);
source.ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, source.Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, source.Height, nameof(sourceOffsetY));
Guard.IsInRange(destinationOffsetX, 0, Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, Height, nameof(destinationOffsetY));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height));
Guard.IsInRange(sourceOffsetX, 0, source.Width);
Guard.IsInRange(sourceOffsetY, 0, source.Height);
Guard.IsInRange(destinationOffsetX, 0, Width);
Guard.IsInRange(destinationOffsetY, 0, Height);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(width, 1, source.Width);
Guard.IsBetweenOrEqualTo(height, 1, source.Height);
Guard.IsLessThanOrEqualTo(sourceOffsetX + width, source.Width, nameof(sourceOffsetX));
Guard.IsLessThanOrEqualTo(sourceOffsetY + height, source.Height, nameof(sourceOffsetY));
Guard.IsLessThanOrEqualTo(destinationOffsetX + width, Width, nameof(destinationOffsetX));
+53 -53
ファイルの表示
@@ -75,9 +75,9 @@ public unsafe abstract class Texture3D<T> : NativeObject, IGraphicsResource, Gra
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION);
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION);
Guard.IsBetweenOrEqualTo(depth, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION);
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
{
@@ -184,16 +184,16 @@ public unsafe abstract class Texture3D<T> : NativeObject, IGraphicsResource, Gra
ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, Height, nameof(sourceOffsetY));
Guard.IsInRange(sourceOffsetZ, 0, Depth, nameof(sourceOffsetZ));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth));
Guard.IsInRange(sourceOffsetX, 0, Width);
Guard.IsInRange(sourceOffsetY, 0, Height);
Guard.IsInRange(sourceOffsetZ, 0, Depth);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(depth, 1, Depth);
Guard.IsLessThanOrEqualTo(sourceOffsetX + width, Width, nameof(sourceOffsetX));
Guard.IsLessThanOrEqualTo(sourceOffsetY + height, Height, nameof(sourceOffsetY));
Guard.IsLessThanOrEqualTo(sourceOffsetZ + depth, Depth, nameof(sourceOffsetZ));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth);
GraphicsDevice.D3D12Device->GetCopyableFootprint(
DXGIFormatHelper.GetForType<T>(),
@@ -285,18 +285,18 @@ public unsafe abstract class Texture3D<T> : NativeObject, IGraphicsResource, Gra
destination.ThrowIfDeviceMismatch(GraphicsDevice);
destination.ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, Height, nameof(sourceOffsetY));
Guard.IsInRange(sourceOffsetZ, 0, Depth, nameof(sourceOffsetZ));
Guard.IsInRange(destinationOffsetX, 0, destination.Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, destination.Height, nameof(destinationOffsetY));
Guard.IsInRange(destinationOffsetZ, 0, destination.Depth, nameof(destinationOffsetZ));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, destination.Depth, nameof(depth));
Guard.IsInRange(sourceOffsetX, 0, Width);
Guard.IsInRange(sourceOffsetY, 0, Height);
Guard.IsInRange(sourceOffsetZ, 0, Depth);
Guard.IsInRange(destinationOffsetX, 0, destination.Width);
Guard.IsInRange(destinationOffsetY, 0, destination.Height);
Guard.IsInRange(destinationOffsetZ, 0, destination.Depth);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(depth, 1, Depth);
Guard.IsBetweenOrEqualTo(width, 1, destination.Width);
Guard.IsBetweenOrEqualTo(height, 1, destination.Height);
Guard.IsBetweenOrEqualTo(depth, 1, destination.Depth);
Guard.IsBetweenOrEqualTo(destinationOffsetX + width, 1, destination.Width, nameof(destinationOffsetX));
Guard.IsBetweenOrEqualTo(destinationOffsetY + height, 1, destination.Height, nameof(destinationOffsetY));
Guard.IsBetweenOrEqualTo(destinationOffsetZ + depth, 1, destination.Depth, nameof(destinationOffsetZ));
@@ -362,18 +362,18 @@ public unsafe abstract class Texture3D<T> : NativeObject, IGraphicsResource, Gra
destination.ThrowIfDeviceMismatch(GraphicsDevice);
destination.ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, Height, nameof(sourceOffsetY));
Guard.IsInRange(sourceOffsetZ, 0, Depth, nameof(sourceOffsetZ));
Guard.IsInRange(destinationOffsetX, 0, destination.Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, destination.Height, nameof(destinationOffsetY));
Guard.IsInRange(destinationOffsetZ, 0, destination.Depth, nameof(destinationOffsetZ));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, destination.Depth, nameof(depth));
Guard.IsInRange(sourceOffsetX, 0, Width);
Guard.IsInRange(sourceOffsetY, 0, Height);
Guard.IsInRange(sourceOffsetZ, 0, Depth);
Guard.IsInRange(destinationOffsetX, 0, destination.Width);
Guard.IsInRange(destinationOffsetY, 0, destination.Height);
Guard.IsInRange(destinationOffsetZ, 0, destination.Depth);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(depth, 1, Depth);
Guard.IsBetweenOrEqualTo(width, 1, destination.Width);
Guard.IsBetweenOrEqualTo(height, 1, destination.Height);
Guard.IsBetweenOrEqualTo(depth, 1, destination.Depth);
Guard.IsBetweenOrEqualTo(destinationOffsetX + width, 1, destination.Width, nameof(destinationOffsetX));
Guard.IsBetweenOrEqualTo(destinationOffsetY + height, 1, destination.Height, nameof(destinationOffsetY));
Guard.IsBetweenOrEqualTo(destinationOffsetZ + depth, 1, destination.Depth, nameof(destinationOffsetZ));
@@ -430,16 +430,16 @@ public unsafe abstract class Texture3D<T> : NativeObject, IGraphicsResource, Gra
ThrowIfDisposed();
Guard.IsInRange(destinationOffsetX, 0, Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, Height, nameof(destinationOffsetY));
Guard.IsInRange(destinationOffsetZ, 0, Depth, nameof(destinationOffsetZ));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth));
Guard.IsInRange(destinationOffsetX, 0, Width);
Guard.IsInRange(destinationOffsetY, 0, Height);
Guard.IsInRange(destinationOffsetZ, 0, Depth);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(depth, 1, Depth);
Guard.IsLessThanOrEqualTo(destinationOffsetX + width, Width, nameof(destinationOffsetX));
Guard.IsLessThanOrEqualTo(destinationOffsetY + height, Height, nameof(destinationOffsetY));
Guard.IsLessThanOrEqualTo(destinationOffsetZ + depth, Depth, nameof(destinationOffsetZ));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size));
Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth);
GraphicsDevice.D3D12Device->GetCopyableFootprint(
DXGIFormatHelper.GetForType<T>(),
@@ -529,18 +529,18 @@ public unsafe abstract class Texture3D<T> : NativeObject, IGraphicsResource, Gra
source.ThrowIfDeviceMismatch(GraphicsDevice);
source.ThrowIfDisposed();
Guard.IsInRange(sourceOffsetX, 0, source.Width, nameof(sourceOffsetX));
Guard.IsInRange(sourceOffsetY, 0, source.Height, nameof(sourceOffsetY));
Guard.IsInRange(sourceOffsetZ, 0, source.Depth, nameof(sourceOffsetZ));
Guard.IsInRange(destinationOffsetX, 0, Width, nameof(destinationOffsetX));
Guard.IsInRange(destinationOffsetY, 0, Height, nameof(destinationOffsetY));
Guard.IsInRange(destinationOffsetZ, 0, Depth, nameof(destinationOffsetZ));
Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, source.Depth, nameof(depth));
Guard.IsInRange(sourceOffsetX, 0, source.Width);
Guard.IsInRange(sourceOffsetY, 0, source.Height);
Guard.IsInRange(sourceOffsetZ, 0, source.Depth);
Guard.IsInRange(destinationOffsetX, 0, Width);
Guard.IsInRange(destinationOffsetY, 0, Height);
Guard.IsInRange(destinationOffsetZ, 0, Depth);
Guard.IsBetweenOrEqualTo(width, 1, Width);
Guard.IsBetweenOrEqualTo(height, 1, Height);
Guard.IsBetweenOrEqualTo(depth, 1, Depth);
Guard.IsBetweenOrEqualTo(width, 1, source.Width);
Guard.IsBetweenOrEqualTo(height, 1, source.Height);
Guard.IsBetweenOrEqualTo(depth, 1, source.Depth);
Guard.IsLessThanOrEqualTo(sourceOffsetX + width, source.Width, nameof(sourceOffsetX));
Guard.IsLessThanOrEqualTo(sourceOffsetY + height, source.Height, nameof(sourceOffsetY));
Guard.IsLessThanOrEqualTo(sourceOffsetZ + depth, source.Depth, nameof(sourceOffsetZ));
+2 -2
ファイルの表示
@@ -47,7 +47,7 @@ public abstract unsafe class TransferBuffer<T> : NativeObject, IGraphicsResource
device.ThrowIfDisposed();
// The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue
Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / (uint)sizeof(T)) & ~255, nameof(length));
Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / (uint)sizeof(T)) & ~255);
GraphicsDevice = device;
Length = length;
@@ -170,7 +170,7 @@ public abstract unsafe class TransferBuffer<T> : NativeObject, IGraphicsResource
/// <inheritdoc/>
public override MemoryHandle Pin(int elementIndex = 0)
{
Guard.IsEqualTo(elementIndex, 0, nameof(elementIndex));
Guard.IsEqualTo(elementIndex, 0);
this.buffer.ThrowIfDisposed();
+2 -2
ファイルの表示
@@ -52,8 +52,8 @@ public unsafe abstract class TransferTexture2D<T> : NativeObject, IGraphicsResou
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION);
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION);
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE2D))
{
+3 -3
ファイルの表示
@@ -53,9 +53,9 @@ public unsafe abstract class TransferTexture3D<T> : NativeObject, IGraphicsResou
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION);
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION);
Guard.IsBetweenOrEqualTo(depth, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION);
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE3D))
{
+8 -8
ファイルの表示
@@ -61,8 +61,8 @@ public sealed class ConstantBuffer<T> : Buffer<T>
ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(length, 0, Length, nameof(length));
Guard.IsInRange(offset, 0, Length, nameof(offset));
Guard.IsBetweenOrEqualTo(length, 0, Length);
Guard.IsInRange(offset, 0, Length);
Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(offset));
using ID3D12ResourceMap resource = D3D12Resource->Map();
@@ -90,11 +90,11 @@ public sealed class ConstantBuffer<T> : Buffer<T>
destination.ThrowIfDeviceMismatch(GraphicsDevice);
destination.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(length, 0, Length, nameof(length));
Guard.IsBetweenOrEqualTo(length, 0, destination.Length, nameof(length));
Guard.IsInRange(sourceOffset, 0, Length, nameof(sourceOffset));
Guard.IsBetweenOrEqualTo(length, 0, Length);
Guard.IsBetweenOrEqualTo(length, 0, destination.Length);
Guard.IsInRange(sourceOffset, 0, Length);
Guard.IsLessThanOrEqualTo(sourceOffset + length, Length, nameof(sourceOffset));
Guard.IsInRange(destinationOffset, 0, destination.Length, nameof(destinationOffset));
Guard.IsInRange(destinationOffset, 0, destination.Length);
Guard.IsLessThanOrEqualTo(destinationOffset + length, destination.Length, nameof(destinationOffset));
if (destination is ConstantBuffer<T> buffer)
@@ -121,8 +121,8 @@ public sealed class ConstantBuffer<T> : Buffer<T>
ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(length, 0, Length, nameof(length));
Guard.IsInRange(offset, 0, Length, nameof(offset));
Guard.IsBetweenOrEqualTo(length, 0, Length);
Guard.IsInRange(offset, 0, Length);
Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(offset));
using ID3D12ResourceMap resource = D3D12Resource->Map();
+4 -4
ファイルの表示
@@ -127,8 +127,8 @@ public readonly unsafe ref partial struct TextureView2D<T>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
Guard.IsInRange(x, 0, this.width, nameof(x));
Guard.IsInRange(y, 0, this.height, nameof(y));
Guard.IsInRange(x, 0, this.width);
Guard.IsInRange(y, 0, this.height);
return ref *((T*)((byte*)this.pointer + (y * this.strideInBytes)) + x);
}
@@ -177,7 +177,7 @@ public readonly unsafe ref partial struct TextureView2D<T>
}
else
{
Guard.HasSizeGreaterThanOrEqualTo(destination, Length, nameof(destination));
Guard.HasSizeGreaterThanOrEqualTo(destination, Length);
for (int y = 0, j = 0; y < this.height; y++, j += this.width)
{
@@ -297,7 +297,7 @@ public readonly unsafe ref partial struct TextureView2D<T>
/// <returns>The resulting row <see cref="Span{T}"/>.</returns>
public Span<T> GetRowSpan(int y)
{
Guard.IsInRange(y, 0, this.height, nameof(y));
Guard.IsInRange(y, 0, this.height);
return new((byte*)this.pointer + (y * this.strideInBytes), this.width);
}
+6 -6
ファイルの表示
@@ -152,9 +152,9 @@ public readonly unsafe ref partial struct TextureView3D<T>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
Guard.IsInRange(x, 0, this.width, nameof(x));
Guard.IsInRange(y, 0, this.height, nameof(y));
Guard.IsInRange(z, 0, this.depth, nameof(z));
Guard.IsInRange(x, 0, this.width);
Guard.IsInRange(y, 0, this.height);
Guard.IsInRange(z, 0, this.depth);
return ref *((T*)((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes)) + x);
}
@@ -336,8 +336,8 @@ public readonly unsafe ref partial struct TextureView3D<T>
/// <returns>The resulting row <see cref="Span{T}"/>.</returns>
public Span<T> GetRowSpan(int y, int z)
{
Guard.IsInRange(y, 0, this.height, nameof(y));
Guard.IsInRange(z, 0, this.depth, nameof(z));
Guard.IsInRange(y, 0, this.height);
Guard.IsInRange(z, 0, this.depth);
return new((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes), this.width);
}
@@ -350,7 +350,7 @@ public readonly unsafe ref partial struct TextureView3D<T>
/// <returns>The resulting row <see cref="TextureView2D{T}"/>.</returns>
public TextureView2D<T> GetDepthView(int z)
{
Guard.IsInRange(z, 0, this.depth, nameof(z));
Guard.IsInRange(z, 0, this.depth);
return new(
(T*)((byte*)this.pointer + (z * this.height * this.strideInBytes)),
+8 -8
ファイルの表示
@@ -191,19 +191,19 @@ public struct ComputeContext : IDisposable, IAsyncDisposable
{
ThrowInvalidOperationExceptionIfDeviceIsNull();
Guard.IsGreaterThan(x, 0, nameof(x));
Guard.IsGreaterThan(y, 0, nameof(y));
Guard.IsGreaterThan(z, 0, nameof(z));
Guard.IsBetweenOrEqualTo(threadsX, 1, 1024, nameof(threadsX));
Guard.IsBetweenOrEqualTo(threadsY, 1, 1024, nameof(threadsY));
Guard.IsBetweenOrEqualTo(threadsZ, 1, 64, nameof(threadsZ));
Guard.IsGreaterThan(x, 0);
Guard.IsGreaterThan(y, 0);
Guard.IsGreaterThan(z, 0);
Guard.IsBetweenOrEqualTo(threadsX, 1, 1024);
Guard.IsBetweenOrEqualTo(threadsY, 1, 1024);
Guard.IsBetweenOrEqualTo(threadsZ, 1, 64);
Guard.IsLessThanOrEqualTo(threadsX * threadsY * threadsZ, 1024, "threadsXYZ");
int groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1);
int groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1);
int groupsZ = Math.DivRem(z, threadsZ, out int modZ) + (modZ == 0 ? 0 : 1);
Guard.IsBetweenOrEqualTo(groupsX, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsX, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION);
Guard.IsBetweenOrEqualTo(groupsY, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsZ, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
@@ -241,7 +241,7 @@ public struct ComputeContext : IDisposable, IAsyncDisposable
int groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1);
int groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1);
Guard.IsBetweenOrEqualTo(groupsX, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsX, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION);
Guard.IsBetweenOrEqualTo(groupsY, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
PipelineData pipelineData = PipelineDataLoader<T>.GetPipelineData(this.device, threadsX, threadsY, threadsZ, ref shader);
+1 -1
ファイルの表示
@@ -34,7 +34,7 @@ internal readonly unsafe struct ShaderDispatchMetadataLoader : IDispatchMetadata
/// <inheritdoc/>
public unsafe void LoadMetadataHandle(ReadOnlySpan<byte> serializedMetadata, ReadOnlySpan<ResourceDescriptor> resourceDescriptors, out IntPtr result)
{
Guard.HasSizeEqualTo(serializedMetadata, 5, nameof(serializedMetadata));
Guard.HasSizeEqualTo(serializedMetadata, 5);
fixed (IntPtr* p = &result)
{
+30 -30
ファイルの表示
@@ -22,7 +22,7 @@ public static class ComputeContextExtensions
public static unsafe void Barrier<T>(this in ComputeContext context, ReadWriteBuffer<T> buffer)
where T : unmanaged
{
Guard.IsNotNull(buffer, nameof(buffer));
Guard.IsNotNull(buffer);
context.Barrier(buffer.ValidateAndGetID3D12Resource(context.GraphicsDevice));
}
@@ -36,7 +36,7 @@ public static class ComputeContextExtensions
public static unsafe void Barrier<T>(this in ComputeContext context, ReadWriteTexture2D<T> texture)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Barrier(texture.ValidateAndGetID3D12Resource(context.GraphicsDevice));
}
@@ -50,7 +50,7 @@ public static class ComputeContextExtensions
public static unsafe void Barrier<T>(this in ComputeContext context, ReadWriteTexture3D<T> texture)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Barrier(texture.ValidateAndGetID3D12Resource(context.GraphicsDevice));
}
@@ -66,7 +66,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Barrier(texture.ValidateAndGetID3D12Resource(context.GraphicsDevice));
}
@@ -82,7 +82,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Barrier(texture.ValidateAndGetID3D12Resource(context.GraphicsDevice));
}
@@ -96,7 +96,7 @@ public static class ComputeContextExtensions
public static unsafe void Barrier<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Barrier(((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetID3D12Resource(context.GraphicsDevice));
}
@@ -110,7 +110,7 @@ public static class ComputeContextExtensions
public static unsafe void Barrier<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture3D<TPixel> texture)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Barrier(((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetID3D12Resource(context.GraphicsDevice));
}
@@ -124,7 +124,7 @@ public static class ComputeContextExtensions
public static unsafe void Clear<T>(this in ComputeContext context, ReadWriteBuffer<T> buffer)
where T : unmanaged
{
Guard.IsNotNull(buffer, nameof(buffer));
Guard.IsNotNull(buffer);
var handles = buffer.ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice);
@@ -140,7 +140,7 @@ public static class ComputeContextExtensions
public static unsafe void Clear<T>(this in ComputeContext context, ReadWriteTexture2D<T> texture)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = texture.ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out bool isNormalized);
@@ -156,7 +156,7 @@ public static class ComputeContextExtensions
public static unsafe void Clear<T>(this in ComputeContext context, ReadWriteTexture3D<T> texture)
where T : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = texture.ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out bool isNormalized);
@@ -174,7 +174,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = texture.ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -192,7 +192,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = texture.ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -208,7 +208,7 @@ public static class ComputeContextExtensions
public static unsafe void Clear<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -224,7 +224,7 @@ public static class ComputeContextExtensions
public static unsafe void Clear<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture3D<TPixel> texture)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -243,7 +243,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = texture.ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -262,7 +262,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = texture.ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -279,7 +279,7 @@ public static class ComputeContextExtensions
public static unsafe void Fill<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture2D<TPixel> texture, TPixel value)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -300,7 +300,7 @@ public static class ComputeContextExtensions
public static unsafe void Fill<TPixel>(this in ComputeContext context, IReadWriteNormalizedTexture3D<TPixel> texture, TPixel value)
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var handles = ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuAndCpuDescriptorHandlesForClear(context.GraphicsDevice, out _);
@@ -382,7 +382,7 @@ public static class ComputeContextExtensions
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Run(texture, ref Unsafe.AsRef(default(T)));
}
@@ -399,7 +399,7 @@ public static class ComputeContextExtensions
where T : struct, IPixelShader<TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
context.Run(texture, ref Unsafe.AsRef(in shader));
}
@@ -412,7 +412,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture2D<float> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -427,7 +427,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture2D<Float2> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -442,7 +442,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture2D<Float3> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -457,7 +457,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture2D<Float4> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -476,7 +476,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -491,7 +491,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture3D<float> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -506,7 +506,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture3D<Float2> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -521,7 +521,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture3D<Float3> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -536,7 +536,7 @@ public static class ComputeContextExtensions
/// <param name="resourceState">The state to transition the input resource to.</param>
public static unsafe void Transition(this in ComputeContext context, ReadWriteTexture3D<Float4> texture, ResourceState resourceState)
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);
@@ -555,7 +555,7 @@ public static class ComputeContextExtensions
where T : unmanaged, IPixel<T, TPixel>
where TPixel : unmanaged
{
Guard.IsNotNull(texture, nameof(texture));
Guard.IsNotNull(texture);
var states = texture.ValidateAndGetID3D12ResourceAndTransitionStates(context.GraphicsDevice, resourceState, out ID3D12Resource* d3D12Resource);