summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/utils.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-28 16:16:09 +0200
committerwm4 <wm4@nowhere>2016-03-28 16:16:09 +0200
commite5b5cc2a2f45a7f80ea56d381db2b5d7635077d4 (patch)
treee4b02e696a7c9efbee5a7aad65981fe9232af810 /video/out/opengl/utils.c
parentfb70819048eee417a4c666199ede35db820d51f5 (diff)
downloadmpv-e5b5cc2a2f45a7f80ea56d381db2b5d7635077d4.tar.bz2
mpv-e5b5cc2a2f45a7f80ea56d381db2b5d7635077d4.tar.xz
vo_opengl: fix row-major vs. column-major confusion
gl_transform_vec() assumed column-major, while everything else seemed to assumed row-major memory organization for gl_transform.m. Also, gl_transform_trans() seems to contain additional confusion. This didn't matter until now, as everything has been orthogonal, this the swapped matrix entries were always 0.
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r--video/out/opengl/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c
index 98ba098328..f88cd4374a 100644
--- a/video/out/opengl/utils.c
+++ b/video/out/opengl/utils.c
@@ -482,8 +482,8 @@ void gl_transform_trans(struct gl_transform t, struct gl_transform *x)
{
float x00 = x->m[0][0], x01 = x->m[0][1], x10 = x->m[1][0], x11 = x->m[1][1];
x->m[0][0] = t.m[0][0] * x00 + t.m[0][1] * x10;
- x->m[1][0] = t.m[0][0] * x01 + t.m[0][1] * x11;
- x->m[0][1] = t.m[1][0] * x00 + t.m[1][1] * x10;
+ x->m[1][0] = t.m[1][0] * x00 + t.m[1][1] * x10;
+ x->m[0][1] = t.m[0][0] * x01 + t.m[0][1] * x11;
x->m[1][1] = t.m[1][0] * x01 + t.m[1][1] * x11;
gl_transform_vec(t, &x->t[0], &x->t[1]);
}