Capture pre-NGX command signatures through early OptiScaler device discovery
This commit is contained in:
1 parent
e4c1c87b66
commit
19d859e43d
9 files changed
+124
-13
No files matched your search
@@ -0,0 +1,45 @@
|
||||
From 7ed1f1d66b430ba35a197fbd9880cd6a76af8f06 Mon Sep 17 00:00:00 2001
|
||||
From: Codex <codex@localhost>
|
||||
Date: Thu, 1 Oct 2026 16:45:01 +0300
|
||||
Subject: [PATCH] Install the external d4r command backend before NGX
|
||||
initialization
|
||||
|
||||
---
|
||||
OptiScaler/hooks/D3D12_Hooks.cpp | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/OptiScaler/hooks/D3D12_Hooks.cpp b/OptiScaler/hooks/D3D12_Hooks.cpp
|
||||
index 29c0bec..3b757be 100644
|
||||
--- a/OptiScaler/hooks/D3D12_Hooks.cpp
|
||||
+++ b/OptiScaler/hooks/D3D12_Hooks.cpp
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <proxies/IGDExt_Proxy.h>
|
||||
#include <proxies/Streamline_Proxy.h>
|
||||
#include <proxies/KernelBase_Proxy.h>
|
||||
+#include <proxies/NVNGX_Proxy.h>
|
||||
|
||||
#include <detours/detours.h>
|
||||
|
||||
@@ -2230,6 +2231,19 @@ static void HookToDevice(ID3D12Device* InDevice)
|
||||
if (Util::CheckForRealObject(__FUNCTION__, InDevice, (IUnknown**) &realDevice))
|
||||
pVTable = *(PVOID**) realDevice;
|
||||
|
||||
+ if (State::Instance().dlssExternalBackend)
|
||||
+ {
|
||||
+ // Capture command signatures/resources created before the game's NGX
|
||||
+ // Init. Install before adding OptiScaler's own method trampolines.
|
||||
+ using InstallCommandBackend = unsigned (*)(ID3D12Device*);
|
||||
+ auto install = reinterpret_cast<InstallCommandBackend>(KernelBaseProxy::GetProcAddress_()(
|
||||
+ NVNGXProxy::NVNGXModule(), "d4r_D3D12_InstallCommandBackend"));
|
||||
+ auto result = install ? install(realDevice ? realDevice : InDevice) : 0;
|
||||
+ LOG_INFO("External d4r command backend installed at device discovery: result={:X}", result);
|
||||
+ if (result != 1)
|
||||
+ LOG_ERROR("External d4r early command tracking failed; DLSS initialization must be checked");
|
||||
+ }
|
||||
+
|
||||
// hudless
|
||||
o_D3D12DeviceRelease = (PFN_Release) pVTable[2];
|
||||
o_CreateSampler = (PFN_CreateSampler) pVTable[22];
|
||||
--
|
||||
2.55.0.windows.5
|
||||
|
||||
@@ -16,6 +16,11 @@ selected external DLSS backend reports initialization/load errors instead of
|
||||
silently switching to FSR. The patch fixes the upstream loader's filesystem
|
||||
exception by making IsSubpath a lexical check, and retains a PDB for diagnosis.
|
||||
|
||||
`0002` installs the command backend at D3D12 device discovery, before NGX Init
|
||||
and before OptiScaler's own method hooks. Command signatures created during
|
||||
game startup therefore retain their public argument descriptions for replay.
|
||||
The standalone runner's `-EarlyIndirectProbe` exercises this startup order.
|
||||
|
||||
Build with Microsoft Build Tools 2022, v143 and Windows SDK 10.0.26100:
|
||||
|
||||
```powershell
|
||||
|
||||
Reference in new issue
Block a user