X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=chroma_subsampler.cpp;h=d064bc7c1d821d29bf9de86fc0194de0cfddba78;hb=92cca212dad5e4b968c052d8200a534473929674;hp=04fd5945f0f3b80ae3fc1c5edc0201f432377283;hpb=ff8f778bde4b477263088abc4755094d5bad32ce;p=nageru diff --git a/chroma_subsampler.cpp b/chroma_subsampler.cpp index 04fd594..d064bc7 100644 --- a/chroma_subsampler.cpp +++ b/chroma_subsampler.cpp @@ -3,11 +3,13 @@ #include #include +#include "embedded_files.h" + #define BUFFER_OFFSET(i) ((char *)nullptr + (i)) using namespace std; -string read_file(const string &filename); +string read_file(const string &filename, const unsigned char *start = nullptr, const size_t size = 0); GLuint compile_shader(const string &shader_src, GLenum type); GLuint link_program(GLuint vs_obj, GLuint fs_obj); void bind_sampler(GLuint program, GLint location, GLuint texture_unit, GLuint tex, GLuint sampler); @@ -69,8 +71,8 @@ ChromaSubsampler::ChromaSubsampler() // // See also http://www.poynton.com/PDFs/Merging_RGB_and_422.pdf, pages 6–7. - cbcr_vs_obj = compile_shader(read_file("chroma_subsample.vert"), GL_VERTEX_SHADER); - cbcr_fs_obj = compile_shader(read_file("chroma_subsample.frag"), GL_FRAGMENT_SHADER); + cbcr_vs_obj = compile_shader(read_file("chroma_subsample.vert", _binary_chroma_subsample_vert_data, _binary_chroma_subsample_vert_size), GL_VERTEX_SHADER); + cbcr_fs_obj = compile_shader(read_file("chroma_subsample.frag", _binary_chroma_subsample_frag_data, _binary_chroma_subsample_frag_size), GL_FRAGMENT_SHADER); cbcr_program = link_program(cbcr_vs_obj, cbcr_fs_obj); // Set up the VAO containing all the required position data.