summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoe Hao Cheng <haochengho12907@gmail.com>2023-02-24 23:06:13 +0800
committerHoe Hao Cheng <haochengho12907@gmail.com>2023-03-03 21:08:59 +0800
commitaa62c6a70bfdf97aa131d8fb007099126e2ec839 (patch)
tree2bceec7907e8c132b708e78220dc25376b0754ea
parent34b9ec63db21b068a130744c525b65ffa3014641 (diff)
downloadmesa-demos-aa62c6a70bfdf97aa131d8fb007099126e2ec839.tar.gz
eglinfo: make PrintContextExtensions() return a string
This will be useful in the following patches. Also, this is consistent with the other Print functions. Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
-rw-r--r--src/egl/opengl/eglinfo.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c
index 9581f136..929f8e5f 100644
--- a/src/egl/opengl/eglinfo.c
+++ b/src/egl/opengl/eglinfo.c
@@ -247,10 +247,7 @@ PrintDeviceExtensions(EGLDeviceEXT d, EGLBoolean single_line)
}
-/* Note that this function has a different return type than the other Print*
- * functions.
- */
-static EGLBoolean
+static const char*
PrintContextExtensions(const char *api_name, EGLBoolean single_line)
{
printf("%s extensions:\n", api_name);
@@ -269,7 +266,7 @@ PrintContextExtensions(const char *api_name, EGLBoolean single_line)
print_extension_list(extensions, single_line);
- return 1;
+ return extensions;
}
@@ -392,7 +389,11 @@ doOneContext(EGLDisplay d,
printf("%s shading language version: %s\n", api_name,
glGetString(GL_SHADING_LANGUAGE_VERSION));
- if (!opts.brief && !PrintContextExtensions(api_name, opts.single_line))
+ const char *extensions = NULL;
+ if (!opts.brief)
+ extensions = PrintContextExtensions(api_name, opts.single_line);
+
+ if (!extensions)
return 1;
eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);