diff options
| author | suyambulingamrm <suyambu.rm@samsung.com> | 2014-06-04 18:58:44 +0530 |
|---|---|---|
| committer | suyambulingamrm <suyambu.rm@samsung.com> | 2014-06-05 09:39:01 +0530 |
| commit | 79930ddc7c5f111eb5489449b09d97afb28a0e7b (patch) | |
| tree | 86f7e40f3c2943c46c60a375dd64b8e1b9cf848a /src/caskbench.cpp | |
| parent | 5a3b5116b86d4089f2dae320387350a7e0c01083 (diff) | |
Issue #78. Command line options for listing gles-versions available and to set the gles-version.
Diffstat (limited to 'src/caskbench.cpp')
| -rw-r--r-- | src/caskbench.cpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/src/caskbench.cpp b/src/caskbench.cpp index 379d611..2243fe9 100644 --- a/src/caskbench.cpp +++ b/src/caskbench.cpp @@ -56,6 +56,8 @@ typedef struct _caskbench_options { int canvas_width; int canvas_height; int list_tests; + int list_gles_versions; + int gles_version; const char **tests; } caskbench_options_t; @@ -121,6 +123,17 @@ print_tests_available() } } +static void +print_gles_versions_available () +{ +#if HAVE_GLES2_H + printf("2\n"); +#endif +#if HAVE_GLES3_H + printf("3\n"); +#endif +} + void process_options(caskbench_options_t *opt, int argc, char *argv[]) { @@ -217,6 +230,14 @@ process_options(caskbench_options_t *opt, int argc, char *argv[]) {"list-tests", '\0', POPT_ARG_NONE, &opt->list_tests, 0, "List the tests available for execution", NULL}, +#if USE_EGL + {"list-gles-versions", '\0', POPT_ARG_NONE, &opt->list_gles_versions, 0, + "Lists available GLES versions", + NULL}, + {"gles-version", '\0', POPT_ARG_INT, &opt->gles_version, 0, + "Specify the GLES version to use", + NULL}, +#endif POPT_AUTOHELP {NULL} }; @@ -401,7 +422,33 @@ main (int argc, char *argv[]) print_tests_available(); exit(0); } - + if(opt.list_gles_versions) { + print_gles_versions_available(); + exit(0); + } + +#if HAVE_GLES3_H + config.egl_gles_version = 3; +#elif HAVE_GLES2_H + config.egl_gles_version = 2; +#endif + + if(opt.gles_version) { + if (opt.surface_type == NULL || (strncmp(opt.surface_type,"image",5)==0)) + errx(0, "gles-version is not usable with image backend"); + if (opt.gles_version < 2 || opt.gles_version > 3) + errx(0, "gles-version provided is invalid"); +#ifndef HAVE_GLES2_H + if (opt.gles_version == 2) + errx(0, "gles-version 2 is not supported in the hardware"); +#endif +#ifndef HAVE_GLES3_H + if (opt.gles_version == 3) + errx(0, "gles-version 3 is not supported in the hardware"); +#endif + config.egl_gles_version = opt.gles_version; + } + if (opt.output_file) { // start writing json to output file fp = fopen(opt.output_file, "w"); |