From 883d3114138a8f9a03f778165de553b7cdb99bee Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 15 Nov 2015 18:30:54 +0100 Subject: vo_opengl: use glBlitFramebuffer to draw repeated frames In the display-sync, non-interpolation case, and if the display refresh rate is higher than the video framerate, we duplicate display frames by rendering exactly the same screen again. The redrawing is cached with a FBO to speed up the repeat. Use glBlitFramebuffer() instead of another shader pass. It should be faster. For some reason, post-process was run again on each display refresh. Stop doing this, which should also be slightly faster. The only disadvantage is that temporal dithering will be run only once per video frame, but I can live with this. One aspect is messy: clearing the background is done at the start on the target framebuffer, so to avoid clearing twice and duplicating the code, only copy the part of the framebuffer that contains the rendered video. (Which also gets slightly messy - needs to compensate for coordinate system flipping.) --- video/out/opengl/common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/out/opengl/common.h') diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h index d87be595ba..acae464643 100644 --- a/video/out/opengl/common.h +++ b/video/out/opengl/common.h @@ -234,6 +234,8 @@ struct GL { GLenum (GLAPIENTRY *CheckFramebufferStatus)(GLenum); void (GLAPIENTRY *FramebufferTexture2D)(GLenum, GLenum, GLenum, GLuint, GLint); + void (GLAPIENTRY *BlitFramebuffer)(GLint, GLint, GLint, GLint, GLint, GLint, + GLint, GLint, GLbitfield, GLenum); void (GLAPIENTRY *Uniform1f)(GLint, GLfloat); void (GLAPIENTRY *Uniform2f)(GLint, GLfloat, GLfloat); -- cgit v1.2.3