gl-renderer: move extension lists away from log

Print all EGL and OpenGL extension lists into a new log scope
"gl-renderer" instead of the usual log.

These lists cluttered the log while they were very rarely actually
useful. Sometimes they might be interesting, so make them still
available through the new log scope.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 3 years ago
parent ccb0d4f7ce
commit 092115786e
  1. 1
      libweston/renderer-gl/gl-renderer-internal.h
  2. 26
      libweston/renderer-gl/gl-renderer.c

@ -115,6 +115,7 @@ struct gl_shader_config {
struct gl_renderer {
struct weston_renderer base;
struct weston_compositor *compositor;
struct weston_log_scope *renderer_scope;
bool fragment_shader_debug;
bool fan_debug;

@ -3248,20 +3248,25 @@ gl_renderer_log_extensions(struct gl_renderer *gr,
int l;
int len;
l = weston_log("%s:", name);
if (!weston_log_scope_is_enabled(gr->renderer_scope))
return;
l = weston_log_scope_printf(gr->renderer_scope, "%s:", name);
p = extensions;
while (*p) {
end = strchrnul(p, ' ');
len = end - p;
if (l + len > 78)
l = weston_log_continue("\n" STAMP_SPACE "%.*s",
len, p);
else
l += weston_log_continue(" %.*s", len, p);
if (l + len > 78) {
l = weston_log_scope_printf(gr->renderer_scope,
"\n %.*s", len, p);
} else {
l += weston_log_scope_printf(gr->renderer_scope,
" %.*s", len, p);
}
for (p = end; isspace(*p); p++)
;
}
weston_log_continue("\n");
weston_log_scope_printf(gr->renderer_scope, "\n");
}
static void
@ -3585,6 +3590,7 @@ gl_renderer_destroy(struct weston_compositor *ec)
weston_binding_destroy(gr->fan_binding);
weston_log_scope_destroy(gr->shader_scope);
weston_log_scope_destroy(gr->renderer_scope);
free(gr);
}
@ -3667,6 +3673,11 @@ gl_renderer_display_create(struct weston_compositor *ec,
wl_list_init(&gr->shader_list);
gr->platform = options->egl_platform;
gr->renderer_scope = weston_compositor_add_log_scope(ec, "gl-renderer",
"GL-renderer verbose messages\n", NULL, NULL, gr);
if (!gr->renderer_scope)
goto fail;
gr->shader_scope = gl_shader_scope_create(gr);
if (!gr->shader_scope)
goto fail;
@ -3798,6 +3809,7 @@ fail_terminate:
eglTerminate(gr->egl_display);
fail:
weston_log_scope_destroy(gr->shader_scope);
weston_log_scope_destroy(gr->renderer_scope);
free(gr);
ec->renderer = NULL;
return -1;

Loading…
Cancel
Save