From c40a81ddf415ecb3f6974bff25df5f80c09a847c Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 15 Jan 2021 11:57:02 +1100 Subject: [PATCH] [client] egl: remove no longer used yuv shader --- client/renderers/EGL/CMakeLists.txt | 1 - client/renderers/EGL/desktop.c | 15 ------ client/renderers/EGL/shader/desktop_yuv.frag | 53 -------------------- 3 files changed, 69 deletions(-) delete mode 100644 client/renderers/EGL/shader/desktop_yuv.frag diff --git a/client/renderers/EGL/CMakeLists.txt b/client/renderers/EGL/CMakeLists.txt index 12935671..bc32619a 100644 --- a/client/renderers/EGL/CMakeLists.txt +++ b/client/renderers/EGL/CMakeLists.txt @@ -16,7 +16,6 @@ make_object( EGL_SHADER shader/desktop.vert shader/desktop_rgb.frag - shader/desktop_yuv.frag shader/cursor.vert shader/cursor_rgb.frag shader/cursor_mono.frag diff --git a/client/renderers/EGL/desktop.c b/client/renderers/EGL/desktop.c index f5c4aeeb..86517a10 100644 --- a/client/renderers/EGL/desktop.c +++ b/client/renderers/EGL/desktop.c @@ -126,15 +126,6 @@ bool egl_desktop_init(EGL_Desktop ** desktop, EGLDisplay * display) return false; } - if (!egl_init_desktop_shader( - &(*desktop)->shader_yuv, - b_shader_desktop_vert , b_shader_desktop_vert_size, - b_shader_desktop_yuv_frag, b_shader_desktop_yuv_frag_size)) - { - DEBUG_ERROR("Failed to initialize the yuv desktop shader"); - return false; - } - if (!egl_model_init(&(*desktop)->model)) { DEBUG_ERROR("Failed to initialize the desktop model"); @@ -172,7 +163,6 @@ void egl_desktop_free(EGL_Desktop ** desktop) egl_texture_free(&(*desktop)->texture ); egl_shader_free (&(*desktop)->shader_generic.shader); - egl_shader_free (&(*desktop)->shader_yuv.shader ); egl_model_free (&(*desktop)->model ); app_release_keybind(&(*desktop)->kbNV); @@ -206,11 +196,6 @@ bool egl_desktop_setup(EGL_Desktop * desktop, const LG_RendererFormat format, bo desktop->shader = &desktop->shader_generic; break; - case FRAME_TYPE_YUV420: - pixFmt = EGL_PF_YUV420; - desktop->shader = &desktop->shader_yuv; - break; - default: DEBUG_ERROR("Unsupported frame format"); return false; diff --git a/client/renderers/EGL/shader/desktop_yuv.frag b/client/renderers/EGL/shader/desktop_yuv.frag deleted file mode 100644 index a0408670..00000000 --- a/client/renderers/EGL/shader/desktop_yuv.frag +++ /dev/null @@ -1,53 +0,0 @@ -#version 300 es - -in highp vec2 uv; -out highp vec4 color; - -uniform int nearest; -uniform highp vec2 size; - -uniform int nv; -uniform highp float nvGain; - -uniform sampler2D sampler1; -uniform sampler2D sampler2; -uniform sampler2D sampler3; - -void main() -{ - highp vec4 yuv; - if(nearest == 1) - { - yuv = vec4( - texture(sampler1, uv).r, - texture(sampler2, uv).r, - texture(sampler3, uv).r, - 1.0 - ); - } - else - { - highp ivec2 px = ivec2(uv * size); - yuv = vec4( - texelFetch(sampler1, px, 0).r, - texelFetch(sampler2, px, 0).r, - texelFetch(sampler3, px, 0).r, - 1.0 - ); - } - - highp mat4 yuv_to_rgb = mat4( - 1.0, 0.0 , 1.402, -0.701, - 1.0, -0.344, -0.714, 0.529, - 1.0, 1.772, 0.0 , -0.886, - 1.0, 1.0 , 1.0 , 1.0 - ); - - color = yuv * yuv_to_rgb; - if (nv == 1) - { - highp float lumi = 1.0 - (0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b); - color *= 1.0 + lumi; - color *= nvGain; - } -}