]> git.sesse.net Git - nageru/commitdiff
Set the right texture sampler for the subsampling shader (used to work by accident).
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 16 Dec 2016 19:33:16 +0000 (20:33 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 16 Dec 2016 19:33:16 +0000 (20:33 +0100)
mixer.cpp
mixer.h

index 0a7ecc21a070012e65a55c8e9e51f6f436641244..44ef76da55ffdbeff924a86487532a43cc7cd921 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -231,6 +231,7 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
                2.0f, 0.0f
        };
        cbcr_vbo = generate_vbo(2, GL_FLOAT, sizeof(vertices), vertices);
+       cbcr_texture_sampler_uniform = glGetUniformLocation(cbcr_program_num, "cbcr_tex");
        cbcr_position_attribute_index = glGetAttribLocation(cbcr_program_num, "position");
        cbcr_texcoord_attribute_index = glGetAttribLocation(cbcr_program_num, "texcoord");
 
@@ -906,6 +907,8 @@ void Mixer::subsample_chroma(GLuint src_tex, GLuint dst_tex)
        float chroma_offset_0[] = { -0.5f / global_flags.width, 0.0f };
        set_uniform_vec2(cbcr_program_num, "foo", "chroma_offset_0", chroma_offset_0);
 
+       glUniform1i(cbcr_texture_sampler_uniform, 0);
+
        glBindBuffer(GL_ARRAY_BUFFER, cbcr_vbo);
        check_error();
 
diff --git a/mixer.h b/mixer.h
index 551e21790d9f71daacd89d1fc6a740baca0723a1..0de651915f6fe9aa0a3c268fd993121b9e3c3dbf 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -310,6 +310,7 @@ private:
        std::atomic<unsigned> master_clock_channel{0};
        std::unique_ptr<movit::EffectChain> display_chain;
        GLuint cbcr_program_num;  // Owned by <resource_pool>.
+       GLuint cbcr_texture_sampler_uniform;
        GLuint cbcr_vbo;  // Holds position and texcoord data.
        GLuint cbcr_position_attribute_index, cbcr_texcoord_attribute_index;
        std::unique_ptr<VideoEncoder> video_encoder;