mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 21:15:43 +00:00
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.
44 lines
1.9 KiB
C
44 lines
1.9 KiB
C
// Built-in self-contained AMD FSR 4.0.2 INT8 + Qualcomm Hexagon HTP v81/v79 NPU pipeline.
|
|
// Uses bundled fsr4_v07_i8.wpack + fsr4_builtin_{pre,post_a,post_b}.spv + QAIRT libQnnHtpPrepare.so
|
|
// so ZERO external asset packs are required on the phone.
|
|
#pragma once
|
|
|
|
#include <vulkan/vulkan.h>
|
|
#include "fsr4_pipeline.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct WlFsr4Builtin WlFsr4Builtin;
|
|
|
|
WlFsr4Builtin *wl_fsr4_builtin_create(const WlVkDispatch *vk, const char *fsr4_dir, const char *power_mode);
|
|
void wl_fsr4_builtin_destroy(WlFsr4Builtin *b);
|
|
void wl_fsr4_builtin_reset(WlFsr4Builtin *b);
|
|
void wl_fsr4_builtin_release_sync_events(WlFsr4Builtin *b);
|
|
int wl_fsr4_builtin_is_ready(const WlFsr4Builtin *b);
|
|
int wl_fsr4_builtin_is_compiling(const WlFsr4Builtin *b);
|
|
int wl_fsr4_builtin_is_staging(const WlFsr4Builtin *b);
|
|
int wl_fsr4_builtin_state(const WlFsr4Builtin *b);
|
|
|
|
// Record one built-in FSR 4.0.2 Hexagon NPU frame into cb.
|
|
// npu_sync: 1 = low-latency same-frame wait (Sync), 0 = pipelined 1-frame (Async).
|
|
// Returns:
|
|
// 2 = Hexagon HTP NPU path recorded
|
|
// 1 = Still warming up / compiling (caller should run fallback)
|
|
// 0 = Failed / unavailable
|
|
int wl_fsr4_builtin_dispatch(WlFsr4Builtin *b, 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,
|
|
int npu_sync, float sharpness,
|
|
uint32_t *out_gpu_us,
|
|
uint32_t *out_htp_us, uint64_t *out_npu_dispatches,
|
|
const char **out_reason);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|