0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
wm4 2013-06-01 19:58:32 +02:00
parent 87c549ffae
commit 66be276f69

View File

@ -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);