[Piglit] [PATCH 3/4] arb_internalformat_query2: fix TBO testing

Ilia Mirkin imirkin at alum.mit.edu
Sat Oct 21 18:16:19 UTC 2017


e.g. the format-components test doesn't seem like it should be doing
anything illegal. GL_TEXTURE_BUFFER is fine to pass into
glGetInternalformat*. IMHO it'd be better to fix the tests and/or mesa
than just disable TBO's in the tests.

On Sat, Oct 21, 2017 at 8:55 AM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This was never tested and it uses functions that are illegal with TBOs,
> like glGetTexParameteriv and glTexImage2DMultisample.
> ---
>  tests/spec/arb_internalformat_query2/common.h                         | 4 +++-
>  tests/spec/arb_internalformat_query2/format-components.c              | 2 +-
>  tests/spec/arb_internalformat_query2/generic-pname-checks.c           | 2 +-
>  .../spec/arb_internalformat_query2/image-format-compatibility-type.c  | 2 +-
>  4 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/tests/spec/arb_internalformat_query2/common.h b/tests/spec/arb_internalformat_query2/common.h
> index df68581..0e5e11f 100644
> --- a/tests/spec/arb_internalformat_query2/common.h
> +++ b/tests/spec/arb_internalformat_query2/common.h
> @@ -25,26 +25,28 @@
>
>  static const GLenum valid_targets[] = {
>          GL_TEXTURE_1D,
>          GL_TEXTURE_1D_ARRAY,
>          GL_TEXTURE_2D,
>          GL_TEXTURE_2D_ARRAY,
>          GL_TEXTURE_3D,
>          GL_TEXTURE_CUBE_MAP,
>          GL_TEXTURE_CUBE_MAP_ARRAY,
>          GL_TEXTURE_RECTANGLE,
> -        GL_TEXTURE_BUFFER,
>          GL_RENDERBUFFER,
>          GL_TEXTURE_2D_MULTISAMPLE,
>          GL_TEXTURE_2D_MULTISAMPLE_ARRAY,
> +       GL_TEXTURE_BUFFER,
>  };
>
> +#define NUM_TARGETS_EXCEPT_TBO (ARRAY_SIZE(valid_targets) - 1)
> +
>  static const GLenum invalid_targets[] = {
>          GL_FRAMEBUFFER,
>          GL_COLOR_ATTACHMENT0,
>          GL_COLOR_ATTACHMENT1,
>          GL_COLOR_ATTACHMENT2,
>          GL_COLOR_ATTACHMENT3,
>          GL_COLOR_ATTACHMENT4,
>          GL_COLOR_ATTACHMENT5,
>          GL_COLOR_ATTACHMENT6,
>          GL_COLOR_ATTACHMENT7,
> diff --git a/tests/spec/arb_internalformat_query2/format-components.c b/tests/spec/arb_internalformat_query2/format-components.c
> index a484e01..983091f 100644
> --- a/tests/spec/arb_internalformat_query2/format-components.c
> +++ b/tests/spec/arb_internalformat_query2/format-components.c
> @@ -244,21 +244,21 @@ check_format_components(void)
>          test_data *data = test_data_new(0, 1);
>          unsigned i;
>          int testing64;
>
>          for (i = 0; i < ARRAY_SIZE(pnames); i++) {
>                  bool pass = true;
>
>                  for (testing64 = 0; testing64 <= 1; testing64++) {
>                          test_data_set_testing64(data, testing64);
>
> -                        pass = try(valid_targets, ARRAY_SIZE(valid_targets),
> +                        pass = try(valid_targets, NUM_TARGETS_EXCEPT_TBO,
>                                     valid_internalformats, ARRAY_SIZE(valid_internalformats),
>                                     pnames[i], data)
>                                  && pass;
>                  }
>
>                  piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
>                                               "%s", piglit_get_gl_enum_name(pnames[i]));
>
>                  check_pass = check_pass && pass;
>          }
> diff --git a/tests/spec/arb_internalformat_query2/generic-pname-checks.c b/tests/spec/arb_internalformat_query2/generic-pname-checks.c
> index e521fac..feb953c 100644
> --- a/tests/spec/arb_internalformat_query2/generic-pname-checks.c
> +++ b/tests/spec/arb_internalformat_query2/generic-pname-checks.c
> @@ -255,21 +255,21 @@ check_basic(const GLenum *pnames, unsigned num_pnames,
>          test_data *data = test_data_new(0, 1);
>          unsigned i;
>          int testing64;
>
>          for (i = 0; i < num_pnames; i++) {
>                  bool pass = true;
>
>                  for (testing64 = 0; testing64 <= 1; testing64++) {
>                          test_data_set_testing64(data, testing64);
>
> -                        pass = try_basic(valid_targets, ARRAY_SIZE(valid_targets),
> +                        pass = try_basic(valid_targets, NUM_TARGETS_EXCEPT_TBO,
>                                           valid_internalformats, ARRAY_SIZE(valid_internalformats),
>                                           pnames[i],
>                                           possible_values, num_possible_values,
>                                           data)
>                                  && pass;
>                  }
>
>                  piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
>                                               "%s", piglit_get_gl_enum_name(pnames[i]));
>
> diff --git a/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c b/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c
> index 28bf292..af46c60 100644
> --- a/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c
> +++ b/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c
> @@ -138,21 +138,21 @@ try_local(const GLenum *targets, unsigned num_targets,
>  static bool
>  check_format_compatibility_type(void)
>  {
>          bool pass = true;
>          test_data *data = test_data_new(0, 1);
>          int testing64;
>
>          for (testing64 = 0; testing64 <= 1; testing64++) {
>                  test_data_set_testing64(data, testing64);
>
> -                pass = try_local(valid_targets, ARRAY_SIZE(valid_targets),
> +                pass = try_local(valid_targets, NUM_TARGETS_EXCEPT_TBO,
>                                   valid_internalformats, ARRAY_SIZE(valid_internalformats),
>                                   GL_IMAGE_FORMAT_COMPATIBILITY_TYPE,
>                                   data)
>                          && pass;
>          }
>
>          piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
>                                       "%s", piglit_get_gl_enum_name(GL_IMAGE_FORMAT_COMPATIBILITY_TYPE));
>
>          test_data_clear(&data);
> --
> 2.7.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list