public void UsageAfterDispose(Device device, Type bufferType) { using TransferTexture3D <float> buffer = device.Get().AllocateTransferTexture3D <float>(bufferType, 32, 32, 16); buffer.Dispose(); _ = buffer.View; }
public void UsageAfterDispose(Device device, Type textureType) { using TransferTexture3D <float> texture = device.Get().AllocateTransferTexture3D <float>(textureType, 32, 32, 16); texture.Dispose(); _ = texture.View; }
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(); }