mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-16 21:51:17 +00:00
Introduce a new FFMPEG frontend renderer: EGLRenderer
Right now this renderer works on X11 & Wayland with VAAPI as a backend. Some rendering latency benchmarks on my `i7-10510U` (with `intel-media-driver` 20.1.1 which cause a *huge* regression with the SDL_Renderer): | | X11 | Wayland | | Before | 6.78ms | 22.50ms | | EGLRenderer | 0.76ms | 00.77ms | Signed-off-by: Antoine Damhet <antoine.damhet@lse.epita.fr>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#version 300 es
|
||||
#extension GL_OES_EGL_image_external : require
|
||||
precision mediump float;
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec2 vTextCoord;
|
||||
|
||||
uniform mat3 yuvmat;
|
||||
uniform vec3 offset;
|
||||
uniform samplerExternalOES plane1;
|
||||
uniform samplerExternalOES plane2;
|
||||
|
||||
void main() {
|
||||
vec3 YCbCr = vec3(
|
||||
texture2D(plane1, vTextCoord)[0],
|
||||
texture2D(plane2, vTextCoord).xy
|
||||
);
|
||||
|
||||
YCbCr -= offset;
|
||||
FragColor = vec4(clamp(yuvmat * YCbCr, 0.0, 1.0), 1.0f);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#version 300 es
|
||||
|
||||
layout (location = 0) in vec2 aPosition; // 2D: X,Y
|
||||
layout (location = 1) in vec2 aTexCoord;
|
||||
out vec2 vTextCoord;
|
||||
|
||||
void main() {
|
||||
vTextCoord = aTexCoord;
|
||||
gl_Position = vec4(aPosition, 0, 1);
|
||||
}
|
||||
Reference in New Issue
Block a user