summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/ra_gl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-07 16:44:15 +0200
committerwm4 <wm4@nowhere>2017-08-07 16:44:15 +0200
commit346ac1e09f89bfbaac6329c89435e3c1faff6e8e (patch)
tree6288a19c964e27937043399b93c2fc94a5873628 /video/out/opengl/ra_gl.c
parent46f7a4352e18b306d6cff7965c53150c5abcf20c (diff)
downloadmpv-346ac1e09f89bfbaac6329c89435e3c1faff6e8e.tar.bz2
mpv-346ac1e09f89bfbaac6329c89435e3c1faff6e8e.tar.xz
vo_opengl: simplify mirroring and fix it if glBlitFramebuffer is used
The vp_w/vp_h variables and parameters were not really used anymore (they were redundant with ra_tex w/h) - but vp_h was still used to identify whether rendering should be done mirrored. Simplify this by adding a fbodst struct (some bad naming), which contains the render target texture, and some parameters how it should be rendered to (for now only flipping). It would not be appropriate to make this a member of ra_tex, so it's a separate struct. Introduces a weird regression for the first frame rendered after interpolation is toggled at runtime, but seems to work otherwise. This is possibly due to the change that blit() now mirrors, instead of just copying. (This is also why ra_fns.blit is changed.) Fixes #4719.
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r--video/out/opengl/ra_gl.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c
index 3966afcebb..bc38a60e53 100644
--- a/video/out/opengl/ra_gl.c
+++ b/video/out/opengl/ra_gl.c
@@ -498,7 +498,7 @@ static void gl_clear(struct ra *ra, struct ra_tex *dst, float color[4],
}
static void gl_blit(struct ra *ra, struct ra_tex *dst, struct ra_tex *src,
- int dst_x, int dst_y, struct mp_rect *src_rc)
+ struct mp_rect *dst_rc, struct mp_rect *src_rc)
{
GL *gl = ra_gl_get(ra);
@@ -508,13 +508,10 @@ static void gl_blit(struct ra *ra, struct ra_tex *dst, struct ra_tex *src,
struct ra_tex_gl *src_gl = src->priv;
struct ra_tex_gl *dst_gl = dst->priv;
- int w = mp_rect_w(*src_rc);
- int h = mp_rect_h(*src_rc);
-
gl->BindFramebuffer(GL_READ_FRAMEBUFFER, src_gl->fbo);
gl->BindFramebuffer(GL_DRAW_FRAMEBUFFER, dst_gl->fbo);
gl->BlitFramebuffer(src_rc->x0, src_rc->y0, src_rc->x1, src_rc->y1,
- dst_x, dst_y, dst_x + w, dst_y + h,
+ dst_rc->x0, dst_rc->y0, dst_rc->x1, dst_rc->y1,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
gl->BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
gl->BindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);