Files
DroidDeck/tools/upscale/layer/sgsr2_gpu.h
T
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

36 lines
1.2 KiB
C

// Winlator Ludashi Native Vulkan Qualcomm Snapdragon GSR 2 (SGSR 2) 3-Pass Compute Backend
#pragma once
#include <vulkan/vulkan.h>
#include <stdint.h>
#include "fsr4_seam_proto.h"
#include "fsr4_pipeline.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct WlSgsr2Gpu WlSgsr2Gpu;
WlSgsr2Gpu *wl_sgsr2_gpu_create(const WlVkDispatch *vk, const char *fsr4_dir);
void wl_sgsr2_gpu_reset(WlSgsr2Gpu *g);
int wl_sgsr2_gpu_is_ready(const WlSgsr2Gpu *g);
// Returns: 2 = real SGSR 2 recorded, 0 = failed (caller falls back to FSR 3.1)
int wl_sgsr2_gpu_dispatch(WlSgsr2Gpu *g, VkCommandBuffer cb,
const WlFsr4FrameDesc *frame,
VkImage color_img, VkFormat color_fmt, uint32_t cw, uint32_t ch,
VkImage depth_img, VkFormat depth_fmt,
VkImage motion_img, VkFormat motion_fmt,
VkImage out_img, uint32_t ow, uint32_t oh,
float sharpness,
uint32_t *out_gpu_us,
uint64_t *out_dispatches,
const char **out_reason);
void wl_sgsr2_gpu_destroy(WlSgsr2Gpu *g);
#ifdef __cplusplus
}
#endif