summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-29 14:02:24 +0200
committerwm4 <wm4@nowhere>2016-08-29 14:02:24 +0200
commit3e0d4de98850cc2327b03db926ce0c2d28e2f103 (patch)
tree748f3ca65ad783367b8d4570ff31300619d8cc4f
parent251ecf6e4b3d4215450a977315afa85f1cb781ab (diff)
downloadmpv-3e0d4de98850cc2327b03db926ce0c2d28e2f103.tar.bz2
mpv-3e0d4de98850cc2327b03db926ce0c2d28e2f103.tar.xz
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.
-rw-r--r--video/out/opengl/video.c4
1 files changed, 4 insertions, 0 deletions
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);