Files
DroidDeck/tools/upscale/bridges/wl_streamline.h
T
The412Banner e5d7bddfdb upscale: DLSS frames reach the layer in Streamline/Unreal D3D12 games
Bright Memory: Infinite (Unreal Engine, D3D12, NVIDIA Streamline) now passed NGX's checks but no
frame reached the layer. Two causes, fixed here:

- The layer recognised the bridge's mailbox by size and the storage bit only, in a 128-entry table;
  the game's own 8 KB storage buffers filled it first, so the bridge's doorbells were ignored. It now
  matches the exact usage the bridges create them with (mailbox STORAGE|TRANSFER_DST, marker
  TRANSFER_DST), keeps 1024 entries and warns once if the table is ever full.
- Streamline (sl.interposer) wraps the devices and command lists it creates; vkd3d-proton and DXVK
  do not know the wrappers. wl_streamline.h asks a wrapper for StreamlineRetrieveBaseInterface
  (Streamline source/core/sl.interposer/d3d12/d3d12Device.cpp) and the interop calls retry on the
  wrapped object: device queries, BeginVkCommandBufferInterop/End, GetVulkanResourceInfo1.

DROIDDECK_UPSCALE_LOG=1 now also logs the NGX bridge's D3D12 attach and first evaluate (seam
ready, images found, command list accepted, dispatch result).
2026-12-05 02:40:10 -05:00

33 lines
1.4 KiB
C

// DroidDeck: NVIDIA Streamline (sl.interposer) wraps the D3D11/D3D12 devices and D3D12 command lists it creates
// (Unreal Engine games create their device through it). vkd3d-proton and DXVK do not know the wrappers, so their
// interop calls fail on them. QueryInterface(StreamlineRetrieveBaseInterface) on a wrapper returns the wrapped object,
// AddRef'd (Streamline source/core/sl.interposer/d3d12/d3d12Device.cpp); anything else answers E_NOINTERFACE.
#pragma once
#include <windows.h>
static const GUID WL_IID_StreamlineRetrieveBaseInterface = {
0xadec44e2, 0x61f0, 0x45c3, { 0xad, 0x9f, 0x1b, 0x37, 0x37, 0x92, 0x84, 0xff }
};
typedef struct {
HRESULT (__stdcall *QueryInterface)(void *This, const GUID *riid, void **ppv);
ULONG (__stdcall *AddRef)(void *This);
ULONG (__stdcall *Release)(void *This);
} WlUnknownVtbl;
typedef struct { const WlUnknownVtbl *lpVtbl; } WlUnknown;
/* The object a Streamline wrapper stands for, AddRef'd; NULL when obj is not a wrapper. */
static inline void *wl_sl_base(void *obj) {
WlUnknown *u = (WlUnknown *)obj;
void *base = NULL;
if (!u || !u->lpVtbl) return NULL;
if (u->lpVtbl->QueryInterface(obj, &WL_IID_StreamlineRetrieveBaseInterface, &base) != S_OK) return NULL;
return base;
}
static inline void wl_com_release(void *obj) {
WlUnknown *u = (WlUnknown *)obj;
if (u && u->lpVtbl) u->lpVtbl->Release(obj);
}