From a8ffa0d0ebca8e502c4dafb6ea5011e17c978b1a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 23 Dec 2014 02:46:44 +0100 Subject: vo_opengl: make use of newer OpenGL logging API GL_ARB_debug_output provides a logging callback, which can be used to diagnose problems etc. in case the driver supports it. It's enabled only if the vo_opengl "debug" suboption is set. --- video/out/gl_common.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'video/out/gl_common.c') diff --git a/video/out/gl_common.c b/video/out/gl_common.c index a94ad1fc75..cfae5cc39f 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -107,6 +107,7 @@ static const struct feature features[] = { {MPGL_CAP_TEX_RG, "RG textures"}, {MPGL_CAP_1ST_CLASS_ARRAYS, "1st class shader arrays"}, {MPGL_CAP_3D_TEX, "3D textures"}, + {MPGL_CAP_DEBUG, "debugging extensions"}, {MPGL_CAP_SW, "suspected software renderer"}, {0}, }; @@ -462,6 +463,16 @@ static const struct gl_functions gl_functions[] = { .extension = "GL_APPLE_rgb_422", .provides = MPGL_CAP_APPLE_RGB_422, }, + { + .ver_core = 430, + .extension = "GL_ARB_debug_output", + .provides = MPGL_CAP_DEBUG, + .functions = (const struct gl_function[]) { + // (only functions needed by us) + DEF_FN(DebugMessageCallback), + {0} + }, + }, }; #undef FN_OFFS @@ -972,6 +983,8 @@ MPGLContext *mpgl_init(struct vo *vo, const char *backend_name, goto cleanup; } + ctx->gl->debug_context = !!(vo_flags & VOFLAG_GL_DEBUG); + return ctx; cleanup: -- cgit v1.2.3