Skip to content

Xbox Cloud Gaming app for PS5 Homebrew

C
981 B
Raw Blame
#version 450
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (C) 2026 RafaelNGP
// Anime4K's depth-to-space (bloc97, MIT, extern/anime4k): the network's last
// four channels are the luma detail of the 2x2 output pixels of each input
// pixel, added to the picture upscaled bilinearly. The output is exactly
// twice the input (1080p to the 2160p display).
layout(local_size_x = 8, local_size_y = 8) in;
layout(binding = 0, rgba16f) uniform readonly image2D lastLayer;
layout(binding = 1) uniform sampler2D picture;  // linear
layout(binding = 2, rgba8) uniform writeonly image2D upscaled;

void main() {
    ivec2 q = ivec2(gl_GlobalInvocationID.xy);
    ivec2 size = imageSize(upscaled);
    if (q.x >= size.x || q.y >= size.y) return;
    ivec2 sub = q & 1;
    float detail = imageLoad(lastLayer, q >> 1)[sub.y * 2 + sub.x];
    vec3 base = texture(picture, (vec2(q) + 0.5) / vec2(size)).rgb;
    imageStore(upscaled, q, vec4(clamp(base + detail, 0.0, 1.0), 1.0));
}