diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2016-05-27 22:56:56 +1000 |
---|---|---|
committer | James Ross-Gowan <rossymiles@gmail.com> | 2016-05-27 23:02:26 +1000 |
commit | 84fba1df21577280078ab1db339d36019a4e419a (patch) | |
tree | b60617342f99076745142d0b7d2998c3f5e60460 /video/out/opengl/utils.c | |
parent | ca87e623b5651d5c94274bdede86768a5562dd56 (diff) | |
download | mpv-84fba1df21577280078ab1db339d36019a4e419a.tar.bz2 mpv-84fba1df21577280078ab1db339d36019a4e419a.tar.xz |
vo_opengl: enable color management on GLES
This requires the GL_EXT_texture_norm16 extension and works in ANGLE.
A default precision had to be set for sampler3Ds, otherwise the shaders
would fail to compile.
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r-- | video/out/opengl/utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index 3d41f0693c..cfb6eec679 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -902,8 +902,12 @@ void gl_sc_gen_shader_and_reset(struct gl_shader_cache *sc) ADD(header, "#version %d%s\n", gl->glsl_version, gl->es >= 300 ? " es" : ""); for (int n = 0; n < sc->num_exts; n++) ADD(header, "#extension %s : enable\n", sc->exts[n]); - if (gl->es) + if (gl->es) { ADD(header, "precision mediump float;\n"); + ADD(header, "precision mediump sampler2D;\n"); + if (gl->mpgl_caps & MPGL_CAP_3D_TEX) + ADD(header, "precision mediump sampler3D;\n"); + } ADD_BSTR(header, sc->prelude_text); char *vert_in = gl->glsl_version >= 130 ? "in" : "attribute"; char *vert_out = gl->glsl_version >= 130 ? "out" : "varying"; |