feat: always use vtable resolver

This commit is contained in:
goat 2021-09-15 01:45:09 +02:00
parent 31d8d45c72
commit c974a05178
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 4 additions and 22 deletions

View file

@ -9,6 +9,7 @@ namespace Dalamud.Game.Internal.DXGI
/// <summary>
/// The address resolver for native D3D11 methods to facilitate displaying the Dalamud UI.
/// </summary>
[Obsolete("This has been deprecated in favor of the VTable resolver.")]
public sealed class SwapChainSigResolver : BaseAddressResolver, ISwapChainAddressResolver
{
/// <inheritdoc/>

View file

@ -48,7 +48,7 @@ namespace Dalamud.Interface.Internal
private readonly Hook<SetCursorDelegate> setCursorHook;
private readonly ManualResetEvent fontBuildSignal;
private readonly ISwapChainAddressResolver address;
private readonly SwapChainVtableResolver address;
private RawDX11Scene? scene;
// can't access imgui IO before first present call
@ -66,27 +66,8 @@ namespace Dalamud.Interface.Internal
this.fontBuildSignal = new ManualResetEvent(false);
try
{
var sigResolver = new SwapChainSigResolver();
sigResolver.Setup(scanner);
Log.Verbose("Found SwapChain via signatures.");
this.address = sigResolver;
}
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.
Log.Debug("Could not get SwapChain address via sig method, falling back to vtable");
var vtableResolver = new SwapChainVtableResolver();
vtableResolver.Setup(scanner);
Log.Verbose("Found SwapChain via vtable.");
this.address = vtableResolver;
}
this.address = new SwapChainVtableResolver();
this.address.Setup(scanner);
try
{