summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/ra.h
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.h
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.h')
-rw-r--r--video/out/opengl/ra.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/opengl/ra.h b/video/out/opengl/ra.h
index e93061eb61..cf18b110a5 100644
--- a/video/out/opengl/ra.h
+++ b/video/out/opengl/ra.h
@@ -349,17 +349,17 @@ struct ra_fns {
// Copy a sub-rectangle from one texture to another. The source/dest region
// is always within the texture bounds. Areas outside the dest region are
- // preserved. The formats of the textures will be losely compatible (this
- // probably has to be defined strictly). The dst texture can be a swapchain
- // framebuffer, but src can not. Only 2D textures are supported.
+ // preserved. The formats of the textures must be losely compatible. The
+ // dst texture can be a swapchain framebuffer, but src can not. Only 2D
+ // textures are supported.
// Both textures must have tex->params.render_dst==true (even src, which is
// an odd GL requirement).
- // A rectangle with negative width or height means a flipped copy should be
- // done. Coordinates are always in pixels.
+ // Rectangle with negative width/height lead to flipping, different src/dst
+ // sizes lead to point scaling. Coordinates are always in pixels.
// Optional. Only available if RA_CAP_BLIT is set (if it's not set, the must
// not be called, even if it's non-NULL).
void (*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);
// Compile a shader and create a pipeline. This is a rare operation.
// The params pointer and anything it points to must stay valid until