diff options
author | Fabian Bieler <fabianbieler@fastmail.fm> | 2017-12-28 15:26:54 +0100 |
---|---|---|
committer | Fabian Bieler <fabianbieler@fastmail.fm> | 2018-01-03 22:40:52 +0100 |
commit | fb0a2e4d2f8157d8ef84f0af9fb4545645703cc8 (patch) | |
tree | d460554611c01521b5375ac58eee1bdd4799d61d | |
parent | d088898cbfbaf2ede1b5a8b72b35ca5a9e652a2b (diff) |
fbo-depth: 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.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/fbo/fbo-depth.c b/tests/fbo/fbo-depth.c index 9d496c432..1294ef6e2 100644 --- a/tests/fbo/fbo-depth.c +++ b/tests/fbo/fbo-depth.c @@ -52,19 +52,16 @@ enum { }; int test = CLEAR; -#define F(name) #name, name - struct format { - const char *name; GLenum iformat; const char *extension; } formats[] = { - {F(GL_DEPTH_COMPONENT16), "GL_ARB_depth_texture"}, - {F(GL_DEPTH_COMPONENT24), "GL_ARB_depth_texture"}, - {F(GL_DEPTH_COMPONENT32), "GL_ARB_depth_texture"}, - {F(GL_DEPTH24_STENCIL8), "GL_EXT_packed_depth_stencil"}, - {F(GL_DEPTH_COMPONENT32F), "GL_ARB_depth_buffer_float"}, - {F(GL_DEPTH32F_STENCIL8), "GL_ARB_depth_buffer_float"} + {GL_DEPTH_COMPONENT16, "GL_ARB_depth_texture"}, + {GL_DEPTH_COMPONENT24, "GL_ARB_depth_texture"}, + {GL_DEPTH_COMPONENT32, "GL_ARB_depth_texture"}, + {GL_DEPTH24_STENCIL8, "GL_EXT_packed_depth_stencil"}, + {GL_DEPTH_COMPONENT32F, "GL_ARB_depth_buffer_float"}, + {GL_DEPTH32F_STENCIL8, "GL_ARB_depth_buffer_float"} }; struct format f; @@ -345,18 +342,20 @@ void piglit_init(int argc, char **argv) test = BLIT; continue; } + 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) { if (formats[i].extension) piglit_require_extension(formats[i].extension); f = formats[i]; - printf("Testing %s.\n", f.name); + printf("Testing %s.\n", + piglit_get_gl_enum_name(f.iformat)); break; } } } - if (!f.name) { + if (!f.iformat) { printf("Not enough parameters.\n"); piglit_report_result(PIGLIT_SKIP); } |