diff options
author | wm4 <wm4@nowhere> | 2017-03-20 13:31:28 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-03-20 13:31:28 +0100 |
commit | 8fb9cc253457a58c39013906643e8dc92171adbe (patch) | |
tree | cd78041d0ea61c580c628d15eb90d5ae2433b8b8 /video/out/vo_opengl.c | |
parent | 03fe50651baeb506ca8b6fb2b597598a096be2f6 (diff) | |
download | mpv-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/vo_opengl.c')
-rw-r--r-- | video/out/vo_opengl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index a1b9f6a75b..88c23fae32 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -128,7 +128,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) p->vsync_fences[p->num_vsync_fences++] = fence; } - gl_video_render_frame(p->renderer, frame, gl->main_fb); + gl_video_render_frame(p->renderer, frame, p->glctx->main_fb); if (p->opts.use_glFinish) gl->Finish(); @@ -270,8 +270,8 @@ static int control(struct vo *vo, uint32_t request, void *data) return VO_NOTIMPL; } case VOCTRL_SCREENSHOT_WIN: { - struct mp_image *screen = - gl_read_window_contents(p->gl, vo->dwidth, vo->dheight); + struct mp_image *screen = gl_read_fbo_contents(p->gl, p->glctx->main_fb, + vo->dwidth, vo->dheight); if (!screen) break; // redirect to backend // set image parameters according to the display, if possible |