vo_opengl: error out gracefully when trying to use FBOs without FBO API

This can for example happen with vo_opengl_cb, if it is used with a GL
implementation that does not supports FBOs. (mpv itself should never
attempt to use FBOs if they're not available.)

Without this check it would trigger an assert() in our dummy
glBindFramebuffer wrapper.

Suspected cause of #3308, although it's still unlikely.
This commit is contained in:
wm4 2016-07-04 13:34:31 +02:00
parent 7cd1a3c766
commit f98e1b0b96
1 changed files with 5 additions and 0 deletions

View File

@ -2667,6 +2667,11 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
GL *gl = p->gl;
struct video_image *vimg = &p->image;
if (fbo && !(gl->mpgl_caps & MPGL_CAP_FB)) {
MP_FATAL(p, "Rendering to FBO requested, but no FBO extension found!\n");
return;
}
p->broken_frame = false;
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo);