Files
DroidDeck/tools/upscale/layer/shaders/lite_npu_unpack.comp
T
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

20 lines
835 B
Plaintext

#version 450
// Unpack Hexagon HTP v81 output (dense 960x540x16 uint8 = int8 ^ 0x80) ->
// AMD FSR 4.1.2 Lite scratch (+16684928 B = q[1042808], 962x542x16 int8 with zero halo) for K1 (0009.spv).
layout(local_size_x = 64) in;
layout(set = 0, binding = 0, std430) writeonly buffer ScratchBuf { uvec4 q[]; } scr;
layout(set = 0, binding = 1, std430) readonly buffer AhbBuf { uvec4 q[]; } ahb;
layout(push_constant) uniform PC { uint base_q; uint p1; uint p2; uint p3; } pc;
void main() {
uint p = gl_GlobalInvocationID.x;
if (p >= 521404u) return;
uint hx = p % 962u;
uint hy = p / 962u;
uvec4 v = uvec4(0u);
if (hx >= 1u && hx <= 960u && hy >= 1u && hy <= 540u) {
uint idx = (hy - 1u) * 960u + (hx - 1u);
v = ahb.q[pc.base_q + idx] ^ uvec4(0x80808080u);
}
scr.q[1042808u + p] = v;
}