Added check to avoid disposing of default device

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-21 21:53:05 +01:00
1 親 aa55ac5043
コミット c2a1980596
3ファイル変更
+18 -1

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

+15
ファイルの表示
@@ -26,6 +26,21 @@ namespace ComputeSharp.Graphics.Helpers
return TryGetDefaultDevice(null, &dxgiDescription1);
}
/// <summary>
/// Gets the <see cref="Luid"/> of the default device.
/// </summary>
/// <returns>The <see cref="Luid"/> of the default device supporting at least DX12.0.</returns>
/// <remarks>This methods assumes that a default device is available.</remarks>
[Pure]
public static unsafe Luid GetDefaultDeviceLuid()
{
DXGI_ADAPTER_DESC1 dxgiDescription1;
_ = TryGetDefaultDevice(null, &dxgiDescription1);
return Luid.FromLUID(dxgiDescription1.AdapterLuid);
}
/// <summary>
/// Gets the default <see cref="GraphicsDevice"/> instance.
/// </summary>