From 398a554c5c7f50c88ba323426d1df325a3b79fc9 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 31 Jan 2016 12:18:01 +0100 Subject: [PATCH] Fix an issue where you needed to install a .vert file into a Movit directory. Reported by Martin Sandsmark. --- mixer.cpp | 21 ++++++++++++++++++++- vs-cbcr.130.vert | 23 ----------------------- 2 files changed, 20 insertions(+), 24 deletions(-) delete mode 100644 vs-cbcr.130.vert diff --git a/mixer.cpp b/mixer.cpp index 133fc28..70e4a9d 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -167,7 +167,26 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards) // Set up stuff for NV12 conversion. // Cb/Cr shader. - string cbcr_vert_shader = read_file("vs-cbcr.130.vert"); + string cbcr_vert_shader = + "#version 130 \n" + " \n" + "in vec2 position; \n" + "in vec2 texcoord; \n" + "out vec2 tc0; \n" + "uniform vec2 foo_chroma_offset_0; \n" + " \n" + "void main() \n" + "{ \n" + " // The result of glOrtho(0.0, 1.0, 0.0, 1.0, 0.0, 1.0) is: \n" + " // \n" + " // 2.000 0.000 0.000 -1.000 \n" + " // 0.000 2.000 0.000 -1.000 \n" + " // 0.000 0.000 -2.000 -1.000 \n" + " // 0.000 0.000 0.000 1.000 \n" + " gl_Position = vec4(2.0 * position.x - 1.0, 2.0 * position.y - 1.0, -1.0, 1.0); \n" + " vec2 flipped_tc = texcoord; \n" + " tc0 = flipped_tc + foo_chroma_offset_0; \n" + "} \n"; string cbcr_frag_shader = "#version 130 \n" "in vec2 tc0; \n" diff --git a/vs-cbcr.130.vert b/vs-cbcr.130.vert deleted file mode 100644 index 3c639ce..0000000 --- a/vs-cbcr.130.vert +++ /dev/null @@ -1,23 +0,0 @@ -#version 130 - -in vec2 position; -in vec2 texcoord; -out vec2 tc0; -//out vec2 tc1; -uniform vec2 foo_chroma_offset_0; -//uniform vec2 foo_chroma_offset_1; - -void main() -{ - // The result of glOrtho(0.0, 1.0, 0.0, 1.0, 0.0, 1.0) is: - // - // 2.000 0.000 0.000 -1.000 - // 0.000 2.000 0.000 -1.000 - // 0.000 0.000 -2.000 -1.000 - // 0.000 0.000 0.000 1.000 - gl_Position = vec4(2.0 * position.x - 1.0, 2.0 * position.y - 1.0, -1.0, 1.0); - vec2 flipped_tc = texcoord; -// flipped_tc.y = 1.0 - flipped_tc.y; - tc0 = flipped_tc + foo_chroma_offset_0; -// tc1 = flipped_tc + foo_chroma_offset_1; -} -- 2.39.2