Quiet dxgi sig failure stacktrace

This commit is contained in:
Raymond 2021-08-10 18:17:03 -04:00
parent f38629e36b
commit 2acee354b5

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.IO; using System.IO;
using System.Numerics; using System.Numerics;
@ -7,7 +8,6 @@ using System.Text;
using System.Threading; using System.Threading;
using Dalamud.Game; using Dalamud.Game;
using Dalamud.Game.ClientState;
using Dalamud.Game.ClientState.GamePad; using Dalamud.Game.ClientState.GamePad;
using Dalamud.Game.Internal.DXGI; using Dalamud.Game.Internal.DXGI;
using Dalamud.Hooking; using Dalamud.Hooking;
@ -71,10 +71,10 @@ namespace Dalamud.Interface.Internal
this.address = sigResolver; this.address = sigResolver;
} }
catch (Exception ex) catch (KeyNotFoundException)
{ {
// The SigScanner method fails on wine/proton since DXGI is not a real DLL. We fall back to vtable to detect our Present function address. // The SigScanner method fails on wine/proton since DXGI is not a real DLL. We fall back to vtable to detect our Present function address.
Log.Debug(ex, "Could not get SwapChain address via sig method, falling back to vtable..."); Log.Debug("Could not get SwapChain address via sig method, falling back to vtable");
var vtableResolver = new SwapChainVtableResolver(); var vtableResolver = new SwapChainVtableResolver();
vtableResolver.Setup(scanner); vtableResolver.Setup(scanner);
@ -93,7 +93,7 @@ namespace Dalamud.Interface.Internal
var fileName = new StringBuilder(255); var fileName = new StringBuilder(255);
_ = NativeFunctions.GetModuleFileNameW(rtss, fileName, fileName.Capacity); _ = NativeFunctions.GetModuleFileNameW(rtss, fileName, fileName.Capacity);
this.rtssPath = fileName.ToString(); this.rtssPath = fileName.ToString();
Log.Verbose("RTSS at {0}", this.rtssPath); Log.Verbose($"RTSS at {this.rtssPath}");
if (!NativeFunctions.FreeLibrary(rtss)) if (!NativeFunctions.FreeLibrary(rtss))
throw new Win32Exception(); throw new Win32Exception();
@ -581,8 +581,7 @@ namespace Dalamud.Interface.Internal
this.dalamud.DalamudUi.ToggleGamepadModeNotifierWindow(); this.dalamud.DalamudUi.ToggleGamepadModeNotifierWindow();
} }
if (gamepadEnabled if (gamepadEnabled && (ImGui.GetIO().ConfigFlags & ImGuiConfigFlags.NavEnableGamepad) > 0)
&& (ImGui.GetIO().ConfigFlags & ImGuiConfigFlags.NavEnableGamepad) > 0)
{ {
ImGui.GetIO().NavInputs[(int)ImGuiNavInput.Activate] = this.dalamud.ClientState.GamepadState.Raw(GamepadButtons.South); ImGui.GetIO().NavInputs[(int)ImGuiNavInput.Activate] = this.dalamud.ClientState.GamepadState.Raw(GamepadButtons.South);
ImGui.GetIO().NavInputs[(int)ImGuiNavInput.Cancel] = this.dalamud.ClientState.GamepadState.Raw(GamepadButtons.East); ImGui.GetIO().NavInputs[(int)ImGuiNavInput.Cancel] = this.dalamud.ClientState.GamepadState.Raw(GamepadButtons.East);