diff options
author | wm4 <wm4@nowhere> | 2013-06-01 19:58:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-03 00:05:07 +0200 |
commit | 66be276f69d95fd5aefbaef749dda8883d337d6d (patch) | |
tree | cd468955d07bf9d4d655c7a05490248dfdfb95f7 /video/out | |
parent | 87c549ffaecb675991c9aed5358466a62e151a83 (diff) |
gl_video: reduce output with -v, skip useless header parts
Originally, the header wasn't supposed to contain random compatibility
stuff, but now all that is printed with -v. Add a hack to skip it and
to reduce the noise.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/gl_video.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index f24163d13f..7c6ecd426e 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -632,12 +632,15 @@ static void bind_attrib_locs(GL *gl, GLuint program) gl->BindAttribLocation(program, VERTEX_ATTRIB_TEXCOORD, "vertex_texcoord"); } +#define PRELUDE_END "// -- prelude end\n" + static GLuint create_program(GL *gl, const char *name, const char *header, const char *vertex, const char *frag) { - mp_msg(MSGT_VO, MSGL_V, "[gl] compiling shader program '%s'\n", name); - mp_msg(MSGT_VO, MSGL_V, "[gl] header:\n"); - mp_log_source(MSGT_VO, MSGL_V, header); + mp_msg(MSGT_VO, MSGL_V, "[gl] compiling shader program '%s', header:\n", name); + const char *real_header = strstr(header, PRELUDE_END); + real_header = real_header ? real_header + strlen(PRELUDE_END) : header; + mp_log_source(MSGT_VO, MSGL_V, real_header); GLuint prog = gl->CreateProgram(); prog_create_shader(gl, prog, GL_VERTEX_SHADER, header, vertex); prog_create_shader(gl, prog, GL_FRAGMENT_SHADER, header, frag); @@ -703,8 +706,8 @@ static void compile_shaders(struct gl_video *p) char *shader_prelude = get_section(tmp, src, "prelude"); char *s_video = get_section(tmp, src, "frag_video"); - char *header = talloc_asprintf(tmp, "#version %d\n%s", gl->glsl_version, - shader_prelude); + char *header = talloc_asprintf(tmp, "#version %d\n%s%s", gl->glsl_version, + shader_prelude, PRELUDE_END); // Need to pass alpha through the whole chain. (Not needed for OSD shaders.) shader_def_opt(&header, "USE_ALPHA", p->opts.enable_alpha); |