summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/context.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-03-20 13:31:28 +0100
committerwm4 <wm4@nowhere>2017-03-20 13:31:28 +0100
commit8fb9cc253457a58c39013906643e8dc92171adbe (patch)
treecd78041d0ea61c580c628d15eb90d5ae2433b8b8 /video/out/opengl/context.h
parent03fe50651baeb506ca8b6fb2b597598a096be2f6 (diff)
downloadmpv-8fb9cc253457a58c39013906643e8dc92171adbe.tar.bz2
mpv-8fb9cc253457a58c39013906643e8dc92171adbe.tar.xz
vo_opengl: read framebuffer depth from actual FBO used for rendering
In some cases, such as when using the libmpv opengl-cb API, or with certain vo_opengl backends, the main framebuffer is never accessed. Instead, rendering is done to a FBO that acts as back buffer. This meant an incorrect/broken bit depth could be used for dithering. Change it to read the framebuffer depth lazily on the first render call. Also move the main FBO field out of the GL struct to MPGLContext, because the renderer's init function does not need to access it anymore.
Diffstat (limited to 'video/out/opengl/context.h')
-rw-r--r--video/out/opengl/context.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/opengl/context.h b/video/out/opengl/context.h
index 92b9da0432..7eabbd4886 100644
--- a/video/out/opengl/context.h
+++ b/video/out/opengl/context.h
@@ -88,6 +88,9 @@ typedef struct MPGLContext {
// Flip the rendered image vertically. This is useful for dxinterop.
bool flip_v;
+ // framebuffer to render to (normally 0)
+ GLuint main_fb;
+
// For free use by the mpgl_driver.
void *priv;
} MPGLContext;