[Piglit] [PATCH 1/2] Add usage information to getteximage-targets
Emil Velikov
emil.l.velikov at gmail.com
Fri Apr 10 13:02:22 PDT 2015
Hi Anuj,
On 10 April 2015 at 18:41, Anuj Phogat <anuj.phogat at gmail.com> wrote:
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
> tests/texturing/getteximage-targets.c | 43 ++++++++++++++++++++++++++++-------
> 1 file changed, 35 insertions(+), 8 deletions(-)
>
> diff --git a/tests/texturing/getteximage-targets.c b/tests/texturing/getteximage-targets.c
> index 03bb4f8..0e1c3f1 100644
> --- a/tests/texturing/getteximage-targets.c
> +++ b/tests/texturing/getteximage-targets.c
> @@ -221,45 +221,69 @@ getTexImage(bool doPBO, GLenum target, GLubyte data[][IMAGE_SIZE],
> return pass;
> }
>
> +NORETURN void
> +print_usage_and_exit(char *prog_name)
> +{
> + printf("Usage: %s <target>\n"
> + " where <target> is one of:\n"
> + " 1D\n"
> + " 2D\n"
> + " 3D\n"
> + " RECT\n"
> + " CUBE\n"
> + " 1D_ARRAY\n"
> + " 2D_ARRAY\n"
> + " CUBE_ARRAY\n"
> + " S3TC\n",
> + prog_name);
> + piglit_report_result(PIGLIT_FAIL);
> +}
> +
> void
> piglit_init(int argc, char **argv)
> {
> int i;
> - GLenum target = GL_TEXTURE_2D;
> + GLenum target;
> bool pass = true;
> GLenum internalformat = GL_RGBA8;
> GLubyte data[18][IMAGE_SIZE];
> int tolerance = 0;
>
> + if (argc != 2)
> + print_usage_and_exit(argv[0]);
> +
Not sure if we want this. One can choose TEXTURE_2D with or without
S3TC. Our current all.py has a few such cases.
As a follow up we (most likely I'll go for it) can error out if one
opts for strange combinations such as $ gettexture-target 2D 3D
Cheers
Emil
More information about the Piglit
mailing list