summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/utils.c
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2016-02-23 16:18:17 +0100
committerwm4 <wm4@nowhere>2016-02-23 20:58:15 +0100
commit2f562825e03148de470e14aff275faac17b1b0c1 (patch)
tree078b94f782a883ff7a71a89754ee2bd5c5a463bd /video/out/opengl/utils.c
parentf0794d0544395cf4ebde1e4e83e11350efd1f68b (diff)
downloadmpv-2f562825e03148de470e14aff275faac17b1b0c1.tar.bz2
mpv-2f562825e03148de470e14aff275faac17b1b0c1.tar.xz
vo_opengl: declare vec4 color inside fragment shader stub
Why was this done so stupidly, with so many complicated special cases, before? Declare it once so the shader bits don't have to figure out where and when to do so themselves.
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r--video/out/opengl/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c
index fd27aac3d0..7329240593 100644
--- a/video/out/opengl/utils.c
+++ b/video/out/opengl/utils.c
@@ -976,8 +976,9 @@ void gl_sc_gen_shader_and_reset(struct gl_shader_cache *sc)
ADD(frag, "// body\n");
}
ADD(frag, "void main() {\n");
- ADD(frag, "%s", sc->text);
// we require _all_ frag shaders to write to a "vec4 color"
+ ADD(frag, "vec4 color;\n");
+ ADD(frag, "%s", sc->text);
if (gl->glsl_version >= 130) {
ADD(frag, "out_color = color;\n");
} else {