gdk: Describe egl formats more precisely

Mention the presence of a depth of stencil buffer.

Related: #6542
This commit is contained in:
Matthias Clasen 2024-03-15 21:52:23 -04:00
parent 1922174c9f
commit 8334d21c87

View File

@ -1538,6 +1538,7 @@ describe_egl_config (EGLDisplay egl_display,
EGLConfig egl_config)
{
EGLint red, green, blue, alpha, type;
EGLint depth, stencil;
if (egl_config == NULL)
return g_strdup ("-");
@ -1556,7 +1557,15 @@ describe_egl_config (EGLDisplay egl_display,
else
type = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
return g_strdup_printf ("R%dG%dB%dA%d%s", red, green, blue, alpha, type == EGL_COLOR_COMPONENT_TYPE_FIXED_EXT ? "" : " float");
if (!eglGetConfigAttrib (egl_display, egl_config, EGL_DEPTH_SIZE, &depth))
depth = 0;
if (!eglGetConfigAttrib (egl_display, egl_config, EGL_STENCIL_SIZE, &stencil))
stencil = 0;
return g_strdup_printf ("R%dG%dB%dA%d%s%s%s", red, green, blue, alpha,
type == EGL_COLOR_COMPONENT_TYPE_FIXED_EXT ? "" : " float",
depth > 0 ? ", depth buffer" : "",
stencil > 0 ? ", stencil buffer" : "");
}
gpointer