summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Bieler <fabianbieler@fastmail.fm>2017-12-28 15:19:18 +0100
committerFabian Bieler <fabianbieler@fastmail.fm>2018-01-03 22:40:52 +0100
commit4dd96134e5e5b1c9554a91849b5dd825e7bd265d (patch)
treed4af1058a7d8cc39b3a4e9e2ff3d7e5e759ceb65
parentfb0a2e4d2f8157d8ef84f0af9fb4545645703cc8 (diff)
fbo-depth-tex1d: Remove GLenum stringification macros.
Replace GLenum stringification macros with calls to piglit_get_gl_enum_name. Also replace string comparison between command line argument and GLenum name with call to piglit_get_gl_enum_from_name and integer comparision. Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/fbo/fbo-depth-tex1d.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/fbo/fbo-depth-tex1d.c b/tests/fbo/fbo-depth-tex1d.c
index 513f1956b..e3a238074 100644
--- a/tests/fbo/fbo-depth-tex1d.c
+++ b/tests/fbo/fbo-depth-tex1d.c
@@ -45,29 +45,26 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
-#define F(name) #name, name
-
struct format {
- const char *name;
GLuint iformat, format, type;
const char *extension;
} formats[] = {
- {F(GL_DEPTH_COMPONENT16), GL_DEPTH_COMPONENT, GL_FLOAT,
+ {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_FLOAT,
"GL_ARB_depth_texture"},
- {F(GL_DEPTH_COMPONENT24), GL_DEPTH_COMPONENT, GL_FLOAT,
+ {GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_FLOAT,
"GL_ARB_depth_texture"},
- {F(GL_DEPTH_COMPONENT32), GL_DEPTH_COMPONENT, GL_FLOAT,
+ {GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_FLOAT,
"GL_ARB_depth_texture"},
- {F(GL_DEPTH24_STENCIL8), GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8_EXT,
+ {GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8_EXT,
"GL_EXT_packed_depth_stencil"},
- {F(GL_DEPTH_COMPONENT32F), GL_DEPTH_COMPONENT, GL_FLOAT,
+ {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT,
"GL_ARB_depth_buffer_float"},
- {F(GL_DEPTH32F_STENCIL8), GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV,
+ {GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV,
"GL_ARB_depth_buffer_float"}
};
@@ -215,8 +212,9 @@ void piglit_init(int argc, char **argv)
piglit_require_extension("GL_ARB_depth_texture");
for (p = 1; p < argc; p++) {
+ const GLenum arg = piglit_get_gl_enum_from_name(argv[p]);
for (i = 0; i < sizeof(formats)/sizeof(*formats); i++) {
- if (!strcmp(argv[p], formats[i].name)) {
+ if (arg == formats[i].iformat) {
piglit_require_extension(formats[i].extension);
f = formats[i];
return;
@@ -224,7 +222,7 @@ void piglit_init(int argc, char **argv)
}
}
- if (!f.name) {
+ if (!f.iformat) {
printf("Not enough parameters.\n");
piglit_report_result(PIGLIT_SKIP);
}