diff options
author | wm4 <wm4@nowhere> | 2015-02-24 13:48:09 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-02-25 11:08:53 +0900 |
commit | 83be06c0add51071764daacff1429b61de6ef503 (patch) | |
tree | dcda016e2ef16e39108ce3af48a05f729fbc28a6 | |
parent | fd7077ade9d963b1f2823fed13e9e8e8ec341969 (diff) | |
download | mpv-83be06c0add51071764daacff1429b61de6ef503.tar.bz2 mpv-83be06c0add51071764daacff1429b61de6ef503.tar.xz |
vo_opengl: another GLES2 issue
GLES2 randomly does not support the transpose parameter in matrix
uniform calls. So we have to do this manually. Sure it was worth to
mutilate the standard just so all these shitty SoC vendors can safe 3
lines of code.
(Obviously trying to handle all of GLES2 to GL 4.x in a single codebase
was a mistake.)
(cherry picked from commit cc011415ffb10521260e486a41b56d0080bf2cd9)
-rw-r--r-- | video/out/gl_video.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index f43ad71858..1a00d2b292 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -506,6 +506,13 @@ static void draw_quad(struct gl_video *p, debug_check_gl(p, "after rendering"); } +static void transpose3x3(float r[3][3]) +{ + MPSWAP(float, r[0][1], r[1][0]); + MPSWAP(float, r[0][2], r[2][0]); + MPSWAP(float, r[1][2], r[2][1]); +} + static void update_uniforms(struct gl_video *p, GLuint program) { GL *gl = p->gl; @@ -551,7 +558,8 @@ static void update_uniforms(struct gl_video *p, GLuint program) } else { mp_get_yuv2rgb_coeffs(&cparams, &m); } - gl->UniformMatrix3fv(loc, 1, GL_TRUE, &m.m[0][0]); + transpose3x3(m.m); // GLES2 can not transpose in glUniformMatrix3fv + gl->UniformMatrix3fv(loc, 1, GL_FALSE, &m.m[0][0]); loc = gl->GetUniformLocation(program, "colormatrix_c"); gl->Uniform3f(loc, m.c[0], m.c[1], m.c[2]); } |