Add Video Super Resolution#1567
Open
linckosz wants to merge 1 commit intomoonlight-stream:masterfrom
Open
Conversation
This commit introduces a high-quality upscaling pipeline for Android using the Snapdragon Game Super Resolution (SGSR) v1 algorithm. - Implement OpenGL ES 3.1 capability check to unlock VSR features. - Add a user preference (checkbox) to toggle between SGSR and standard rendering. - Introduce a Two-Pass rendering pipeline using Framebuffer Objects (FBO) to convert OES textures to standard 2D textures, optimizing shader performance. - Integrate a modified SGSR1 fragment shader with edge-direction logic tailored for mobile GPUs. - Ensure the Moonlight performance overlay remains visible post-processing. Ref: https://github.com/SnapdragonGameStudios/snapdragon-gsr/tree/main/sgsr/v1
This was referenced Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Video Super Resolution (VSR) for Moonlight Android
Video Super Resolution (VSR) brings to video what DLSS/FSR bring to real-time 3D rendering.
This PR introduces high-quality spatial upscaling on Android using a highly optimized two-pass OpenGL ES 3.1 pipeline powered by Snapdragon Game Super Resolution (SGSR).
Mobile devices, Android TVs, and Android-based gaming handhelds can greatly benefit from receiving a lower-resolution video stream while reconstructing a sharper final image locally on-device.
This approach significantly reduces bandwidth usage, lowers decoder workload, and minimizes latency, while preserving excellent visual quality at the device's native resolution.
Technical Overview
Due to Android hardware decoding constraints,
MediaCodecoutputs frames to asamplerExternalOEStexture, which is incompatible with standard 2D upscaling shaders.To address this limitation, this PR introduces
GlesPassthroughBridge, an efficient GPU-based two-pass pipeline:Pass 1 – Blit (OES → 2D):
The hardware-decoded
samplerExternalOEStexture is rendered into a standard 2D texture using a Framebuffer Object (FBO).Pass 2 – Upscaling & Sharpening:
The SGSR shader (
sgsr1_shader_mobile_edge_direction) is applied to the 2D texture, producing a sharpened and upscaled image rendered to the display.Performance & Optimizations
Mobile GPUs are extremely sensitive to overhead, so this implementation includes several aggressive optimizations:
Compile-Time Constant Folding
Stream resolution parameters are injected directly into GLSL via
#definemacros.This eliminates per-frame computations and allows the compiler to fully optimize resolution-dependent math.
Vertex-Level Precomputation
The vertex shader precomputes texture coordinates across the quad.
These values are interpolated by the GPU hardware, effectively providing per-fragment data at zero cost.
Zero Added VSync Latency
EGL VSync is explicitly disabled (
eglSwapInterval(eglDisplay, 0)) to avoid introducing additional frame latency in the streaming pipeline.Results
400% Zoom
Before

After

Original
Video Super Resolution
Tests
This implementation was tested on two different classes of Android devices to evaluate performance across GPU tiers:
📱 Mobile – Realme Note 60 (Unisoc T612 / Mali-G57)
Performance on mobile is excellent, with very smooth rendering and minimal latency overhead.
This demonstrates that mid-range mobile GPUs can handle SGSR upscaling efficiently in real-time.
📺 TV – Xiaomi TV F 32 (2026) (Cortex-A55 / Mali-G31 MP2)
On lower-end TV GPUs, the performance impact is significantly more pronounced.
Despite SGSR1 being one of the lightest and most optimized reconstruction upscalers available for mobile, entry-level GPUs such as the Mali-G31 struggle to sustain real-time performance without noticeable overhead.
These results highlight that while VSR is highly suitable for modern mobile GPUs, performance on low-end or TV-class hardware may vary and require further tuning or optional fallback strategies.
Other VSR Implementations
VSR is also available in other Moonlight ports:
Windows, macOS, Linux: Add Video Super Resolution for Windows x64 (AMD, Intel and NVIDIA), Windows ARM (Snapdragon), Linux and MacOS moonlight-qt#1557
iOS and tvOS: Video Super Resolution for Moonlight iOS/tvOS moonlight-ios#704
Xbox: Add Video Super Resolution for Xbox TheElixZammuto/moonlight-xbox#267