diff --git a/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs index 3a521eb2..500b6a80 100644 --- a/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs +++ b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs @@ -9,35 +9,6 @@ namespace ComputeSharp.Tests.Extensions; /// public static class DeviceExtensions { - /// - /// The instance for the default discrete device. - /// - private static readonly GraphicsDevice? DiscreteDevice; - - /// - /// The instance for the WARP device. - /// - private static readonly GraphicsDevice WarpDevice; - - /// - /// Initializes and . - /// - static DeviceExtensions() - { - GraphicsDevice defaultDevice = Gpu.Default; - - if (defaultDevice.IsHardwareAccelerated) - { - DiscreteDevice = defaultDevice; - WarpDevice = Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(); - } - else - { - DiscreteDevice = null; - WarpDevice = defaultDevice; - } - } - /// /// Gets a instance matching a specified type. /// @@ -48,8 +19,8 @@ public static class DeviceExtensions { GraphicsDevice? device = type switch { - Device.Discrete => DiscreteDevice, - Device.Warp => WarpDevice, + Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), + Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), _ => ThrowHelper.ThrowArgumentException("Invalid device") };