2 * Copyright © 2013 VMware, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 * Simply query and print various glGetString() values.
26 * This is helpful when running a complete piglit run since the
27 * results file will have all the pertinant info for the GL driver
30 * Note that the piglit framework tries to run glxinfo/wglinfo and
31 * put the output in the results file, but sometimes those programs
39 #include "piglit-util-gl.h"
42 PIGLIT_GL_TEST_CONFIG_BEGIN
43 config
.supports_gl_compat_version
= 10;
44 config
.window_visual
= PIGLIT_GL_VISUAL_RGB
;
45 PIGLIT_GL_TEST_CONFIG_END
56 piglit_init(int argc
, char **argv
)
58 const char *renderer
= (const char *) glGetString(GL_RENDERER
);
59 const char *version
= (const char *) glGetString(GL_VERSION
);
60 const char *vendor
= (const char *) glGetString(GL_VENDOR
);
62 printf("GL_RENDERER = %s\n", renderer
);
63 printf("GL_VERSION = %s\n", version
);
64 printf("GL_VENDOR = %s\n", vendor
);
66 if (version
[0] >= '2') {
67 printf("GL_SHADING_LANGUAGE_VERSION = %s\n", (const char *)
68 glGetString(GL_SHADING_LANGUAGE_VERSION
));
71 printf("Extensions:\n");
72 if (version
[0] >= '3') {
74 glGetIntegerv(GL_NUM_EXTENSIONS
, &numExt
);
75 for (i
= 0; i
< numExt
; i
++) {
76 printf("%s\n", (const char *)
77 glGetStringi(GL_EXTENSIONS
, i
));
81 const char *ext
= (const char *) glGetString(GL_EXTENSIONS
);
83 for (c
= ext
; *c
; c
++) {
91 piglit_report_result(PIGLIT_PASS
);