From df65ac95baa8f1fa63fac89bd803368a3bf69e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Tue, 1 May 2018 15:58:16 +0300 Subject: vo_gpu/video: add improved logging when a user-specified FBO fails I don't know if we can just return from this function, so for now just adding this piece of logging. --- video/out/gpu/video.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index f3cc6ae315..a725f939f5 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -3524,19 +3524,30 @@ static void check_gl_features(struct gl_video *p) const char *user_fbo_fmts[] = {p->opts.fbo_format, 0}; const char **fbo_fmts = user_fbo_fmts[0] && strcmp(user_fbo_fmts[0], "auto") ? user_fbo_fmts : auto_fbo_fmts; + bool user_specified_fbo_fmt = fbo_fmts == user_fbo_fmts; + bool fbo_test_result = false; bool have_fbo = false; p->fbo_format = NULL; for (int n = 0; fbo_fmts[n]; n++) { const char *fmt = fbo_fmts[n]; const struct ra_format *f = ra_find_named_format(p->ra, fmt); - if (!f && fbo_fmts == user_fbo_fmts) + if (!f && user_specified_fbo_fmt) MP_WARN(p, "FBO format '%s' not found!\n", fmt); - if (f && f->renderable && f->linear_filter && test_fbo(p, f)) { + if (f && f->renderable && f->linear_filter && + (fbo_test_result = test_fbo(p, f))) { MP_VERBOSE(p, "Using FBO format %s.\n", f->name); have_fbo = true; p->fbo_format = f; break; } + + if (user_specified_fbo_fmt) { + MP_WARN(p, "User-specified FBO format '%s' failed to initialize! " + "(exists=%d, renderable=%d, linear_filter=%d, " + "fbo_test_result=%d)\n", + fmt, !!f, f ? f->renderable : 0, f ? f->linear_filter : 0, + fbo_test_result); + } } if (!have_fragcoord && p->opts.dither_depth >= 0 && -- cgit v1.2.3