diff options
author | wm4 <wm4@nowhere> | 2017-08-07 16:44:15 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-07 16:44:15 +0200 |
commit | 346ac1e09f89bfbaac6329c89435e3c1faff6e8e (patch) | |
tree | 6288a19c964e27937043399b93c2fc94a5873628 /video/out/opengl/utils.h | |
parent | 46f7a4352e18b306d6cff7965c53150c5abcf20c (diff) | |
download | mpv-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/utils.h')
-rw-r--r-- | video/out/opengl/utils.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/video/out/opengl/utils.h b/video/out/opengl/utils.h index 12d77efbf8..5f6efc9299 100644 --- a/video/out/opengl/utils.h +++ b/video/out/opengl/utils.h @@ -62,11 +62,18 @@ static inline bool gl_transform_eq(struct gl_transform a, struct gl_transform b) void gl_transform_trans(struct gl_transform t, struct gl_transform *x); +struct fbodst { + struct ra_tex *tex; + bool flip; // mirror vertically +}; + +void gl_transform_ortho_fbodst(struct gl_transform *t, struct fbodst fbo); + struct fbotex { struct ra *ra; struct ra_tex *tex; - int rw, rh; // real (texture) size, same as tex->params.w/h int lw, lh; // logical (configured) size, <= than texture size + struct fbodst fbo; }; void fbotex_uninit(struct fbotex *fbo); |