mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14: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)
|
||||
return null;
|
||||
|
||||
var dxgiDev = this.Device.QueryInterfaceOrNull<SharpDX.DXGI.Device>();
|
||||
var dxgiAdapter = dxgiDev?.Adapter.QueryInterfaceOrNull<SharpDX.DXGI.Adapter4>();
|
||||
if (dxgiAdapter == null)
|
||||
return null;
|
||||
try
|
||||
{
|
||||
var dxgiDev = this.Device.QueryInterfaceOrNull<SharpDX.DXGI.Device>();
|
||||
var dxgiAdapter = dxgiDev?.Adapter.QueryInterfaceOrNull<SharpDX.DXGI.Adapter4>();
|
||||
if (dxgiAdapter == null)
|
||||
return null;
|
||||
|
||||
var memInfo = dxgiAdapter.QueryVideoMemoryInfo(0, SharpDX.DXGI.MemorySegmentGroup.Local);
|
||||
return (memInfo.CurrentUsage, memInfo.CurrentReservation);
|
||||
var memInfo = dxgiAdapter.QueryVideoMemoryInfo(0, SharpDX.DXGI.MemorySegmentGroup.Local);
|
||||
return (memInfo.CurrentUsage, memInfo.CurrentReservation);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void ShowFontError(string path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue