if (priv->egl_config_high_depth == NULL)
priv->egl_config_high_depth = priv->egl_config;
- GDK_DISPLAY_NOTE (self, OPENGL, {
+#ifdef G_ENABLE_DEBUG
+ if (GDK_DISPLAY_DEBUG_CHECK (self, OPENGL))
+ {
char *ext = describe_extensions (priv->egl_display);
char *std_cfg = describe_egl_config (priv->egl_display, priv->egl_config);
char *hd_cfg = describe_egl_config (priv->egl_display, priv->egl_config_high_depth);
- g_message ("EGL API version %d.%d found\n"
- " - Vendor: %s\n"
- " - Version: %s\n"
- " - Client APIs: %s\n"
- " - Extensions:\n"
- "\t%s\n"
- " - Selected fbconfig: %s\n"
- " high depth: %s",
- major, minor,
- eglQueryString (priv->egl_display, EGL_VENDOR),
- eglQueryString (priv->egl_display, EGL_VERSION),
- eglQueryString (priv->egl_display, EGL_CLIENT_APIS),
- ext, std_cfg,
- priv->egl_config_high_depth == priv->egl_config ? "none" : hd_cfg);
+ gdk_debug_message ("EGL API version %d.%d found\n"
+ " - Vendor: %s\n"
+ " - Version: %s\n"
+ " - Client APIs: %s\n"
+ " - Extensions:\n"
+ "\t%s\n"
+ " - Selected fbconfig: %s\n"
+ " high depth: %s",
+ major, minor,
+ eglQueryString (priv->egl_display, EGL_VENDOR),
+ eglQueryString (priv->egl_display, EGL_VERSION),
+ eglQueryString (priv->egl_display, EGL_CLIENT_APIS),
+ ext, std_cfg,
+ priv->egl_config_high_depth == priv->egl_config ? "none" : hd_cfg);
g_free (hd_cfg);
g_free (std_cfg);
g_free (ext);
- });
+ }
+#endif
gdk_profiler_end_mark (start_time, "init EGL", NULL);
if (eglGetCurrentContext () == priv->egl_context)
eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Destroying EGL context"));
+ GDK_DISPLAY_DEBUG (display, OPENGL, "Destroying EGL context");
eglDestroyContext (egl_display, priv->egl_context);
priv->egl_context = NULL;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
- GDK_DISPLAY_NOTE (display, OPENGL,
- g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
- major, minor,
- debug_bit ? "yes" : "no",
- forward_bit ? "yes" : "no",
- legacy ? "yes" : "no",
- api == GDK_GL_API_GLES ? "yes" : "no"));
+ GDK_DISPLAY_DEBUG (display, OPENGL,
+ "Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
+ major, minor,
+ debug_bit ? "yes" : "no",
+ forward_bit ? "yes" : "no",
+ legacy ? "yes" : "no",
+ api == GDK_GL_API_GLES ? "yes" : "no");
ctx = eglCreateContext (egl_display,
egl_config,
if (ctx == NULL)
return 0;
- GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
+ GDK_DISPLAY_DEBUG (display, OPENGL, "Created EGL context[%p]", ctx);
priv->egl_context = ctx;
gdk_gl_context_set_is_legacy (context, legacy);
priv->has_half_float = gdk_gl_context_check_version (context, 3, 0, 3, 0) ||
epoxy_has_gl_extension ("OES_vertex_half_float");
- GDK_DISPLAY_NOTE (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
- g_message ("%s version: %d.%d (%s)\n"
- "* GLSL version: %s\n"
- "* Extensions checked:\n"
- " - GL_KHR_debug: %s\n"
- " - GL_EXT_unpack_subimage: %s\n"
- " - OES_vertex_half_float: %s",
- gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
- priv->gl_version / 10, priv->gl_version % 10,
- priv->is_legacy ? "legacy" : "core",
- glGetString (GL_SHADING_LANGUAGE_VERSION),
- priv->has_khr_debug ? "yes" : "no",
- priv->has_unpack_subimage ? "yes" : "no",
- priv->has_half_float ? "yes" : "no"));
+ GDK_DISPLAY_DEBUG (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
+ "%s version: %d.%d (%s)\n"
+ "* GLSL version: %s\n"
+ "* Extensions checked:\n"
+ " - GL_KHR_debug: %s\n"
+ " - GL_EXT_unpack_subimage: %s\n"
+ " - OES_vertex_half_float: %s",
+ gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
+ priv->gl_version / 10, priv->gl_version % 10,
+ priv->is_legacy ? "legacy" : "core",
+ glGetString (GL_SHADING_LANGUAGE_VERSION),
+ priv->has_khr_debug ? "yes" : "no",
+ priv->has_unpack_subimage ? "yes" : "no",
+ priv->has_half_float ? "yes" : "no");
priv->extensions_checked = TRUE;
}
the_gl_backend_type = backend_type;
/* This is important!!!11eleven
* (But really: How do I print a message in 2 categories?) */
- GDK_NOTE (OPENGL, g_print ("Using OpenGL backend %s\n", gl_backend_names[the_gl_backend_type]));
- GDK_NOTE (MISC, g_message ("Using Opengl backend %s", gl_backend_names[the_gl_backend_type]));
+ GDK_DEBUG (OPENGL, "Using OpenGL backend %s", gl_backend_names[the_gl_backend_type]);
+ GDK_DEBUG (MISC, "Using OpenGL backend %s", gl_backend_names[the_gl_backend_type]);
}
g_assert (the_gl_backend_type == backend_type);
}
else
{
- GDK_DISPLAY_NOTE (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)),
- VULKAN, g_warning ("Vulkan swapchain doesn't do transparency. Using opaque swapchain instead."));
+ GDK_DISPLAY_DEBUG (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), VULKAN,
+ "Vulkan swapchain doesn't do transparency. Using opaque swapchain instead.");
composite_alpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
}
if (has_incremental_present)
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME);
- GDK_DISPLAY_NOTE (display, VULKAN, g_print ("Using Vulkan device %u, queue %u\n", i, j));
+ GDK_DISPLAY_DEBUG (display, VULKAN, "Using Vulkan device %u, queue %u", i, j);
if (GDK_VK_CHECK (vkCreateDevice, devices[i],
&(VkDeviceCreateInfo) {
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,