mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Use ESSL 1.0 for EGLRenderer shaders
We still ostensibly support GLES 2.0 GPUs.
This commit is contained in:
@@ -84,11 +84,9 @@
|
||||
<file alias="gamecontrollerdb.txt">SDL_GameControllerDB/gamecontrollerdb.txt</file>
|
||||
<file alias="ModeSeven.ttf">ModeSeven.ttf</file>
|
||||
<file alias="egl_nv12.frag">shaders/egl_nv12.frag</file>
|
||||
<file alias="egl_nv12.vert">shaders/egl_nv12.vert</file>
|
||||
<file alias="egl_opaque.frag">shaders/egl_opaque.frag</file>
|
||||
<file alias="egl_opaque.vert">shaders/egl_opaque.vert</file>
|
||||
<file alias="egl_overlay.frag">shaders/egl_overlay.frag</file>
|
||||
<file alias="egl_overlay.vert">shaders/egl_overlay.vert</file>
|
||||
<file alias="egl.vert">shaders/egl.vert</file>
|
||||
<file alias="d3d11_vertex.fxc">shaders/d3d11_vertex.fxc</file>
|
||||
<file alias="d3d11_overlay_pixel.fxc">shaders/d3d11_overlay_pixel.fxc</file>
|
||||
<file alias="d3d11_yuv420_pixel.fxc">shaders/d3d11_yuv420_pixel.fxc</file>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#version 300 es
|
||||
#extension GL_OES_EGL_image_external : require
|
||||
precision mediump float;
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec2 vTextCoord;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
uniform mat3 yuvmat;
|
||||
uniform vec3 offset;
|
||||
@@ -12,11 +10,11 @@ uniform samplerExternalOES plane1;
|
||||
uniform samplerExternalOES plane2;
|
||||
|
||||
void main() {
|
||||
vec3 YCbCr = vec3(
|
||||
texture2D(plane1, vTextCoord)[0],
|
||||
texture2D(plane2, vTextCoord + chromaOffset).xy
|
||||
);
|
||||
vec3 YCbCr = vec3(
|
||||
texture2D(plane1, vTexCoord)[0],
|
||||
texture2D(plane2, vTexCoord + chromaOffset).xy
|
||||
);
|
||||
|
||||
YCbCr -= offset;
|
||||
FragColor = vec4(clamp(yuvmat * YCbCr, 0.0, 1.0), 1.0f);
|
||||
YCbCr -= offset;
|
||||
gl_FragColor = vec4(clamp(yuvmat * YCbCr, 0.0, 1.0), 1.0f);
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#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);
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
#version 300 es
|
||||
#extension GL_OES_EGL_image_external : require
|
||||
precision mediump float;
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec2 vTextCoord;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
uniform samplerExternalOES uTexture;
|
||||
|
||||
void main() {
|
||||
FragColor = texture2D(uTexture, vTextCoord);
|
||||
gl_FragColor = texture2D(uTexture, vTexCoord);
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#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);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
precision mediump float;
|
||||
|
||||
uniform sampler2D uTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ bool EGLRenderer::compileShaders() {
|
||||
|
||||
// XXX: TODO: other formats
|
||||
if (m_EGLImagePixelFormat == AV_PIX_FMT_NV12 || m_EGLImagePixelFormat == AV_PIX_FMT_P010) {
|
||||
m_ShaderProgram = compileShader("egl_nv12.vert", "egl_nv12.frag");
|
||||
m_ShaderProgram = compileShader("egl.vert", "egl_nv12.frag");
|
||||
if (!m_ShaderProgram) {
|
||||
return false;
|
||||
}
|
||||
@@ -369,7 +369,7 @@ bool EGLRenderer::compileShaders() {
|
||||
glUseProgram(0);
|
||||
}
|
||||
else if (m_EGLImagePixelFormat == AV_PIX_FMT_DRM_PRIME) {
|
||||
m_ShaderProgram = compileShader("egl_opaque.vert", "egl_opaque.frag");
|
||||
m_ShaderProgram = compileShader("egl.vert", "egl_opaque.frag");
|
||||
if (!m_ShaderProgram) {
|
||||
return false;
|
||||
}
|
||||
@@ -389,7 +389,7 @@ bool EGLRenderer::compileShaders() {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_OverlayShaderProgram = compileShader("egl_overlay.vert", "egl_overlay.frag");
|
||||
m_OverlayShaderProgram = compileShader("egl.vert", "egl_overlay.frag");
|
||||
if (!m_OverlayShaderProgram) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user