fix: use QueryInterfaceOrNull instead to get DXGI device for vmem info

This commit is contained in:
goat 2023-01-23 23:59:52 +01:00
parent 997bb33e99
commit 0301b76e37
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -417,8 +417,8 @@ internal class InterfaceManager : IDisposable, IServiceType
if (this.Device == null)
return null;
var dxgiDev = this.Device.QueryInterface<SharpDX.DXGI.Device>();
var dxgiAdapter = dxgiDev.Adapter.QueryInterfaceOrNull<SharpDX.DXGI.Adapter4>();
var dxgiDev = this.Device.QueryInterfaceOrNull<SharpDX.DXGI.Device>();
var dxgiAdapter = dxgiDev?.Adapter.QueryInterfaceOrNull<SharpDX.DXGI.Adapter4>();
if (dxgiAdapter == null)
return null;