From 3e0d4de98850cc2327b03db926ce0c2d28e2f103 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 29 Aug 2016 14:02:24 +0200 Subject: vo_opengl: explicitly check for GL errors around framebuffer depth check It seems like many GL implementations (including Mesa) choke on this, while others are fine. We still think that this use of the GL API is allowed by the standard (at least in the Mesa case), so to reduce confusion, explicitly check the "controversial" calls, and use an appropriate error message. --- video/out/opengl/video.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 901e208cab..8e419a1bd5 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -3153,6 +3153,8 @@ static void init_gl(struct gl_video *p) if ((gl->es >= 300 || gl->version) && (gl->mpgl_caps & MPGL_CAP_FB)) { gl->BindFramebuffer(GL_FRAMEBUFFER, gl->main_fb); + debug_check_gl(p, "before retrieving framebuffer depth"); + GLenum obj = gl->version ? GL_BACK_LEFT : GL_BACK; if (gl->main_fb) obj = GL_COLOR_ATTACHMENT0; @@ -3166,6 +3168,8 @@ static void init_gl(struct gl_video *p) gl->GetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, obj, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, &depth_b); + debug_check_gl(p, "retrieving framebuffer depth"); + MP_VERBOSE(p, "Reported display depth: R=%d, G=%d, B=%d\n", depth_r, depth_g, depth_b); -- cgit v1.2.3