mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 20:24:16 +01:00
fix: ignore exceptions when getting video memory info
This commit is contained in:
parent
91ac86a12a
commit
42ebf4145b
1 changed files with 15 additions and 6 deletions
|
|
@ -417,13 +417,22 @@ internal class InterfaceManager : IDisposable, IServiceType
|
||||||
if (this.Device == null)
|
if (this.Device == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var dxgiDev = this.Device.QueryInterfaceOrNull<SharpDX.DXGI.Device>();
|
try
|
||||||
var dxgiAdapter = dxgiDev?.Adapter.QueryInterfaceOrNull<SharpDX.DXGI.Adapter4>();
|
{
|
||||||
if (dxgiAdapter == null)
|
var dxgiDev = this.Device.QueryInterfaceOrNull<SharpDX.DXGI.Device>();
|
||||||
return null;
|
var dxgiAdapter = dxgiDev?.Adapter.QueryInterfaceOrNull<SharpDX.DXGI.Adapter4>();
|
||||||
|
if (dxgiAdapter == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
var memInfo = dxgiAdapter.QueryVideoMemoryInfo(0, SharpDX.DXGI.MemorySegmentGroup.Local);
|
var memInfo = dxgiAdapter.QueryVideoMemoryInfo(0, SharpDX.DXGI.MemorySegmentGroup.Local);
|
||||||
return (memInfo.CurrentUsage, memInfo.CurrentReservation);
|
return (memInfo.CurrentUsage, memInfo.CurrentReservation);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ShowFontError(string path)
|
private static void ShowFontError(string path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue