Commit Graph
19 Commits
Author SHA1 Message Date
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
The412Banner d47ed325fd upscale: DLSS signature fix on by default
DLSS games only work with the nvapi64.dll hooks that let NGX accept the bridge DLLs (without them
the DLSS sample stops at GetFeatureRequirements with PlatformError; with them it runs Full FSR 4.1
on the NPU in D3D11 and D3D12, Red Magic 12 Pro). DLSS mode now has the fix on unless the player
switches it off: the app stores "1" or "0" for DLSS games and reads a missing entry as on, and
droiddeck-game-env passes 1 unless the game stores 0. Upstream always installs the hooks.
2026-12-05 02:16:18 -05:00
The412Banner ffe46fe53b upscale: D3D11 DLSS gets the game's images from DXVK
extract_ngx_dx11_res() passed a zeroed VkImageCreateInfo to IDXGIVkInteropSurface::GetVulkanImageInfo;
DXVK returns E_INVALIDARG unless sType is VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO (src/d3d11/
d3d11_texture.cpp, master 06ecdaa2), so no colour/output image was found and every D3D11
EvaluateFeature returned NVSDK_NGX_Result_Fail (DLSS sample with -d3d11 on the Red Magic 12 Pro,
after DROIDDECK_UPSCALE_SIGFIX=1 got it past NGX's signature check). Upstream r5 has the same code.
2026-12-05 01:17:31 -05:00
The412Banner 4626cb309d upscale: bridges default to Full FSR 4.1 on the NPU; README after r5
wl_seam_parse_backend_env() fell back to the removed FSR 4.0 NPU id when no backend is set; it
now names Full FSR 4.1 NPU, as fsr4_0_npu does. The bridge README no longer says D3D11 NGX reports
DLSS unavailable (r5 routes it through DXVK's interop) and lists the r5 engine names.
2026-12-05 00:22:02 -05:00
The412Banner 7aa54ab9c7 upscale: hide VK_EXT_descriptor_buffer from games so Full FSR 4.1 shows the picture
Root cause of the black Full FSR 4.1 frame in D3D12 games on Turnip: vkd3d-proton uses its own
descriptor buffers in the command buffers the upscaler records into. Measured on the Red Magic 12
Pro (Adreno 850) with the XeSS DX12 sample: Full black in 9/9 shots, and still black with the direct
output write off and with the exposure pass off; with VKD3D_DISABLE_EXTENSIONS=VK_EXT_descriptor_buffer
the picture is there (5/6 shots coloured, the sixth caught the triangle off screen, as with the other
engines), with the direct write on.

The layer now hides the extension from the game (vkd3d then uses its classic descriptors) and still
enables it for itself; DROIDDECK_UPSCALE_APP_DESCRIPTOR_BUFFER=1 shows it again. The Lite fallback
now triggers only when the game enabled descriptor buffers anyway (Turnip), not for every D3D12
frame. The FULL_DIRECT_OUT / FULL_AUTO_EXPOSURE test switches are removed.
2026-12-04 20:43:28 -05:00
The412Banner 85bfb69306 upscale: test switches for Full FSR 4.1's D3D12 black frame
DROIDDECK_UPSCALE_FULL_DIRECT_OUT=0 makes Full write to its own image and copy into the game's,
as it does for the Vulkan sample (where the picture is right); D3D12 frames are the only ones
that take the direct write (log "Tier 1.1 active ... fmt=97"). DROIDDECK_UPSCALE_FULL_AUTO_EXPOSURE=0
skips the pass-00 exposure pass. Both default to the current behaviour.
2026-12-04 20:12:24 -05:00
The412Banner 83de9e38b4 upscale: Full FSR 4.1 falls back to Lite only for D3D12 games on Turnip
Measured on the Red Magic 12 Pro (Adreno 850, Turnip) with the r5 build: Full FSR 4.1 writes a
black frame in the XeSS DX12 sample (0 coloured pixels in 9 of 9 screenshots, GPU and NPU paths)
but shows the picture in the XeSS Vulkan sample, like Lite, SGSR 2, FSR 3 and XeSS. Upstream's
binding-11 change does not fix it, so the opt-in guard from the r5 port was wrong. The check now
sits at dispatch and looks at the frame's API: D3D12 frames on Turnip use FSR 4.1.2 Lite (NPU or
GPU, as chosen); DROIDDECK_UPSCALE_FULL_ON_TURNIP=1 runs Full anyway.
2026-12-04 19:49:22 -05:00
The412Banner 971b74b594 upscale: D3D11 NGX parameters use the shared capability table
The r5 merge kept DroidDeck's old D3D11 PopulateParameters line, which called the removed
"DLSS unavailable on D3D11" helper; upstream fills D3D11 like Vulkan and D3D12 now. nvngx.dll
failed to link. All six bridge DLLs build locally (mingw-w64 13.2) and match their exports.
Headers of the modified bridge files name 71c140d9.
2026-12-04 19:05:46 -05:00
The412Banner 1a621bcffa upscale: drop the Android-only properties header from the layer
The glibc (PRoot) build has no sys/system_properties.h; the r5 SoC check that needed it is
replaced by DROIDDECK_UPSCALE_NPU. Also check the pacer heartbeat write's result (gcc
-Wunused-result). Both layer builds (APK clang, build-glibc.sh gcc) build without warnings.
2026-12-04 18:56:38 -05:00
The412Banner 74ece6c854 upscale: port Winlator-NeuralScale r5 (non-root parts)
Layer and bridges updated from Winlator-NeuralScale 71c140d9 (michaelisomer-cyber, GPL-3.0):
- full FSR 4.1 on the NPU (S8 graph, U8 fallback), compiled on the device per HTP arch
- ghosting fix: blank far depth when a game sends none, binding 11 bound with 62
- FSR 4.1.2 Lite S8/U8 zero-copy graphs
- Snapdragon GSR 2 on the GPU (new engine sgsr2_gpu)
- D3D11 DLSS through DXVK's interop (nvngx D3D11 entry points)

Left out on purpose: upstream's root-only performance/thermal manager, GPU clock floor and
bypass charging. Kept from DroidDeck: NPU detection by the app (DROIDDECK_UPSCALE_NPU, any HTP
generation incl. the phone's own QNN libraries) instead of upstream's SoC list, DD env names and
log tags, Intel XeSS 3 (runtime still fetched from a0ab6b0f, upstream dropped it in cb3ae04e).

FSR 4.0 on the NPU is gone upstream; the engine id becomes fsr4_1_full_npu and saved
fsr4_0_npu choices map to it. The full-FSR-4-on-Turnip guard is now opt-in
(DROIDDECK_UPSCALE_FULL_OFF_ON_TURNIP=1), since upstream's binding-11 fix targets that black frame.
Data files re-pinned to 71c140d9 (81 core + 8 NPU, sha256 checked).
2026-12-04 18:52:36 -05:00
The412Banner c18aa23ac2 feat(upscale): run the NPU on the phone's own QNN runtime
Phones whose vendor offers the QNN HTP libraries to apps (public.libraries.txt)
now run the NPU engines on them, any HTP generation, with nothing downloaded:
the app finds the generation from the vendor's libQnnHtpV<NN>Stub.so and passes
DROIDDECK_UPSCALE_HTP_ARCH; the layer takes the bundled QNN files only for an
arch whose skel came with them, else loads the vendor libraries by name.

Red Magic 12 Pro (SM8975, HTP V85, no root), layer QNN code in a probe:
FSR 4.1.2 Lite INT8 graph compiled on the phone (2.0 s, cached 0.3 s),
1.2 ms per run at perf, 0 failures; arch found without HTP_ARCH.
2026-12-04 07:54:00 -05:00
The412Banner b9a535170e fix(upscale): FSR 4 Lite stands in for FSR 4 full on Turnip
The FSR 4.1.1 full path (descriptor buffers) runs on Turnip but writes a black frame (Elite, Adreno 830:
5 screenshots, no lit pixel, while the status said ok). FSR 4.1.2 Lite, on classic descriptors, works there,
so the full path now declines on VK_DRIVER_ID_MESA_TURNIP and the pipeline's own fallback runs Lite, with
reason full_black_on_turnip_lite_used in the status. DROIDDECK_UPSCALE_FULL_ON_TURNIP=1 runs it anyway.
2026-11-30 02:46:33 -05:00
The412Banner b6457b0cf7 fix(upscale): fixes from the first Elite test round
- Bridge DLLs: staged from an exact list (24 files) and only reported done when all of them are in
  place; the local copy is also read from the app's own external files folder, which needs no storage
  permission (Download/ alone could not be listed without it, so nothing was copied while the log said
  true). An installed add-on pack is staged again when the rootfs copy is gone.
- "Upscaler files" counts the bridge DLLs, not only the data files.
- FSR 4 / FSR 4 Lite: a render-sized D32 stand-in depth (cleared to the far plane) when the game sends
  none, as XeSS allows; both used to fall back to FSR 3.1 for such games.
- droiddeck-game-env writes the live switch file from the game's own settings at every launch, so the
  previous game's or the in-game menu's choice no longer wins at start.
- Intel's XeSS runtime goes into every upscaler game's prefix once downloaded (hard link where the file
  system allows), so XeSS 3 also works when picked in the in-game menu.
2026-11-30 02:22:54 -05:00
The412Banner 217817fa83 fix(upscale): read every export row whatever objdump prints above them
The check skipped two lines after the export table header, but older binutils
(CI's) print no column titles there, so the first export (ffxConfigure) was
never read.
2026-11-29 23:04:09 -05:00
The412Banner d78ff7ddc7 fix(upscale): no identical-code folding in the bridge DLLs
CI's mingw folded ffxConfigure into an identical stub and dropped its export
(amd_fidelityfx_vk.dll: missing ffxConfigure); every exported name keeps its
own body.
2026-11-29 22:58:33 -05:00
The412Banner f2309c8a09 merge: upscale bridge DLLs (tools/upscale/bridges, add-on pack 'upscale') from wip/upscale-bridges 2026-11-29 22:52:43 -05:00
The412Banner 491106ac3c feat(upscale): build the DLSS / FSR / XeSS bridge DLLs from source and ship them as the upscale pack
Ports the Windows x64 bridge DLLs of michaelisomer-cyber/Winlator-NeuralScale (a0ab6b0f,
GPL-3.0) to tools/upscale/bridges. They replace a game's nvngx, nvapi64, FidelityFX,
FSR 2/3 and XeSS DLLs inside Wine and hand each frame to the Android Vulkan layer
through the unchanged fsr4_seam_proto.h buffers.

- build.sh builds the 12 DLLs with MinGW-w64 GCC, deterministically, checks each
  export table against its .def and stamps them as Wine builtins (winebuild --builtin
  signature at 0x40), into x86_64-windows/ and aarch64-windows/.
- CI: recipe upscale-bridges into linuxfs/usr/local/lib/droiddeck-upscale/bridges,
  kept out of the APK and shipped as the upscale add-on pack, like dirt.
- D3D11 NGX now reports DLSS unavailable instead of succeeding and rendering nothing.
- The nvapi64 signature hooks run only with DROIDDECK_UPSCALE_SIGFIX=1, logging only
  with DROIDDECK_UPSCALE_LOG=1; DROIDDECK_UPSCALE_* variables are read before the
  fork's WINLATOR_FSR4_* names.
2026-11-29 22:51:53 -05:00
The412Banner b4210b5a67 upscale: build the upscaler layer as VK_LAYER_DROIDDECK_upscale
Port of the NeuralScale layer (previous commit) for DroidDeck:

- Layer VK_LAYER_DROIDDECK_upscale, library libVkLayer_droiddeck_upscale.so,
  implicit manifest template (DROIDDECK_UPSCALE=1 / DROIDDECK_UPSCALE_DISABLE=1).
- Settings read as DROIDDECK_UPSCALE_<KEY>, then WINLATOR_FSR4_<KEY>.
- No hardcoded com.winlator.cmod data dir; without a dir frames get the blit
  fallback.
- Compiled NPU graph caches go to <dir>/<htp arch>/ (v79/v81 from HTP_ARCH,
  the SoC properties or the mapped QNN stub) instead of <dir>/v81/.
- The arch stub is loaded from the QNN library search list first, so
  NATIVELIB_DIR is enough without LD_LIBRARY_PATH.
- driverID/driverName are only rewritten with GPU_SPOOF word "1";
  SPOOF_DLSS=1 alone reports RTX vendor/device IDs.
- APK build via app/src/main/cpp/CMakeLists.txt; glibc build for the PRoot
  guest (build-glibc.sh, DD_UPSCALE_NO_ANDROID: QNN stubs, stderr log) in
  the runtime recipe, installed to usr/local/lib/droiddeck-upscale-layer/.
- -Bsymbolic so the exported vkGetInstanceProcAddr is not interposed by a
  libvulkan in the global scope.
- Pack scripts take their paths as arguments.

Seam protocol, buffer sizes, magic values and backend IDs are unchanged.
2026-11-29 22:34:00 -05:00
The412Banner 7972c18e50 upscale: import the NeuralScale Vulkan upscaler layer sources unchanged
Verbatim copy of app/src/main/cpp/fsr4npu/ (C sources, headers, shaders,
weight pack scripts) from michaelisomer-cyber/Winlator-NeuralScale at
a0ab6b0f770e1a6786b4e68def46b4edb8baafd0 (GPL-3.0, fork of
StevenMXZ/Winlator-Ludashi). Not built yet; the DroidDeck port follows.
2026-11-29 22:18:41 -05:00