Move GPU disposal tests to DeviceLost test project

このコミットが含まれているのは:
Sergio Pedri committed 2022-07-31 23:26:13 +02:00
1 親 2623754991
コミット 37823f366c
9ファイル変更
+47 -167

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

-27
ファイルの表示
@@ -124,33 +124,6 @@ public partial class BufferTests
_ = buffer.ToArray();
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(ConstantBuffer<>))]
[Resource(typeof(ReadOnlyBuffer<>))]
[Resource(typeof(ReadWriteBuffer<>))]
public void DisposeAfterDevice(Device device, Type bufferType)
{
GraphicsDevice? gpu = device switch
{
Device.Discrete => GraphicsDevice.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(),
Device.Warp => GraphicsDevice.QueryDevices(info => !info.IsHardwareAccelerated).First(),
_ => throw new ArgumentException(nameof(device))
};
if (gpu is null)
{
Assert.Inconclusive();
return;
}
Buffer<float> buffer = gpu.AllocateBuffer<float>(bufferType, 128);
gpu.Dispose();
buffer.Dispose();
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(ConstantBuffer<>))]
-10
ファイルの表示
@@ -28,16 +28,6 @@ public partial class InitializationTests
Assert.IsTrue(gpu.WavefrontSize != 0);
}
[TestMethod]
public void DisposeDefault()
{
using var before = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer<float>(128);
GraphicsDevice.GetDefault().Dispose();
using var after = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer<float>(128);
}
[TestMethod]
public void EnumerateDevices()
{
-26
ファイルの表示
@@ -86,32 +86,6 @@ public partial class Texture2DTests
_ = texture.ToArray();
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(ReadOnlyTexture2D<>))]
[Resource(typeof(ReadWriteTexture2D<>))]
public void DisposeAfterDevice(Device device, Type textureType)
{
GraphicsDevice? gpu = device switch
{
Device.Discrete => GraphicsDevice.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(),
Device.Warp => GraphicsDevice.QueryDevices(info => !info.IsHardwareAccelerated).First(),
_ => throw new ArgumentException(nameof(device))
};
if (gpu is null)
{
Assert.Inconclusive();
return;
}
Texture2D<float> texture = gpu.AllocateTexture2D<float>(textureType, 10, 10);
gpu.Dispose();
texture.Dispose();
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(ReadOnlyTexture2D<>))]
-26
ファイルの表示
@@ -105,32 +105,6 @@ public partial class Texture3DTests
_ = texture.ToArray();
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(ReadOnlyTexture3D<>))]
[Resource(typeof(ReadWriteTexture3D<>))]
public void DisposeAfterDevice(Device device, Type textureType)
{
GraphicsDevice? gpu = device switch
{
Device.Discrete => GraphicsDevice.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(),
Device.Warp => GraphicsDevice.QueryDevices(info => !info.IsHardwareAccelerated).First(),
_ => throw new ArgumentException(nameof(device))
};
if (gpu is null)
{
Assert.Inconclusive();
return;
}
Texture3D<float> texture = gpu.AllocateTexture3D<float>(textureType, 10, 10, 4);
gpu.Dispose();
texture.Dispose();
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(ReadOnlyTexture3D<>))]
-26
ファイルの表示
@@ -66,32 +66,6 @@ public partial class TransferBufferTests
_ = buffer.Span;
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(UploadBuffer<>))]
[Resource(typeof(ReadBackBuffer<>))]
public void DisposeAfterDevice(Device device, Type bufferType)
{
GraphicsDevice? gpu = device switch
{
Device.Discrete => GraphicsDevice.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(),
Device.Warp => GraphicsDevice.QueryDevices(info => !info.IsHardwareAccelerated).First(),
_ => throw new ArgumentException(nameof(device))
};
if (gpu is null)
{
Assert.Inconclusive();
return;
}
TransferBuffer<float> buffer = gpu.AllocateTransferBuffer<float>(bufferType, 128);
gpu.Dispose();
buffer.Dispose();
}
[CombinatorialTestMethod]
[AllDevices]
public void Allocate_UploadBuffer_CopyTo_Full(Device device)
-26
ファイルの表示
@@ -70,32 +70,6 @@ public partial class TransferTexture2DTests
_ = texture.View;
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(UploadTexture2D<>))]
[Resource(typeof(ReadBackTexture2D<>))]
public void DisposeAfterDevice(Device device, Type textureType)
{
GraphicsDevice? gpu = device switch
{
Device.Discrete => GraphicsDevice.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(),
Device.Warp => GraphicsDevice.QueryDevices(info => !info.IsHardwareAccelerated).First(),
_ => throw new ArgumentException(nameof(device))
};
if (gpu is null)
{
Assert.Inconclusive();
return;
}
TransferTexture2D<float> texture = gpu.AllocateTransferTexture2D<float>(textureType, 32, 32);
gpu.Dispose();
texture.Dispose();
}
[CombinatorialTestMethod]
[AllDevices]
public unsafe void Allocate_UploadTexture2D_Copy_Full(Device device)
-26
ファイルの表示
@@ -77,32 +77,6 @@ public partial class TransferTexture3DTests
_ = texture.View;
}
[CombinatorialTestMethod]
[AllDevices]
[Resource(typeof(UploadTexture3D<>))]
[Resource(typeof(ReadBackTexture3D<>))]
public void DisposeAfterDevice(Device device, Type textureType)
{
GraphicsDevice? gpu = device switch
{
Device.Discrete => GraphicsDevice.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(),
Device.Warp => GraphicsDevice.QueryDevices(info => !info.IsHardwareAccelerated).First(),
_ => throw new ArgumentException(nameof(device))
};
if (gpu is null)
{
Assert.Inconclusive();
return;
}
TransferTexture3D<float> texture = gpu.AllocateTransferTexture3D<float>(textureType, 32, 32, 16);
gpu.Dispose();
texture.Dispose();
}
[CombinatorialTestMethod]
[AllDevices]
public unsafe void Allocate_UploadTexture3D_Copy_Full(Device device)