[Piglit] [PATCH 5/9] fbo-formats: add texture_stencil8 support

Anuj Phogat anuj.phogat at gmail.com
Fri Apr 10 09:38:50 PDT 2015


On Mon, Apr 6, 2015 at 8:39 PM, Dave Airlie <airlied at gmail.com> wrote:

> From: Dave Airlie <airlied at redhat.com>
>
> Make sure to disable stencil textures everywhere we disable depth ones.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  tests/fbo/fbo-alphatest-formats.c      |  1 +
>  tests/fbo/fbo-blending-formats.c       |  3 ++-
>  tests/fbo/fbo-clear-formats.c          |  7 +++++--
>  tests/fbo/fbo-colormask-formats.c      |  3 ++-
>  tests/fbo/fbo-formats.h                | 11 +++++++++++
>  tests/fbo/fbo-generatemipmap-formats.c |  6 +++---
>  tests/texturing/getteximage-formats.c  |  1 +
>  7 files changed, 25 insertions(+), 7 deletions(-)
>
> diff --git a/tests/fbo/fbo-alphatest-formats.c
> b/tests/fbo/fbo-alphatest-formats.c
> index cb07f1d..c96245c 100644
> --- a/tests/fbo/fbo-alphatest-formats.c
> +++ b/tests/fbo/fbo-alphatest-formats.c
> @@ -76,6 +76,7 @@ static enum piglit_result test_format(const struct
> format_desc *format)
>
>          if (format->base_internal_format == GL_DEPTH_COMPONENT ||
>              format->base_internal_format == GL_DEPTH_STENCIL ||
> +            format->base_internal_format == GL_STENCIL_INDEX ||
>             format->base_internal_format == GL_ALPHA)
>                 return PIGLIT_SKIP;
>
> diff --git a/tests/fbo/fbo-blending-formats.c
> b/tests/fbo/fbo-blending-formats.c
> index 4632944..5eb3d8e 100644
> --- a/tests/fbo/fbo-blending-formats.c
> +++ b/tests/fbo/fbo-blending-formats.c
> @@ -131,7 +131,8 @@ static enum piglit_result test_format(const struct
> format_desc *format)
>                         dst5[3]*(1-src5[3]) + src5[3]*src5[3]};
>
>          if (format->base_internal_format == GL_DEPTH_COMPONENT ||
> -            format->base_internal_format == GL_DEPTH_STENCIL)
> +            format->base_internal_format == GL_DEPTH_STENCIL ||
> +            format->base_internal_format == GL_STENCIL_INDEX)
>                 return PIGLIT_SKIP;
>
>         glGenFramebuffersEXT(1, &fb);
> diff --git a/tests/fbo/fbo-clear-formats.c b/tests/fbo/fbo-clear-formats.c
> index e4413bb..61fb162 100644
> --- a/tests/fbo/fbo-clear-formats.c
> +++ b/tests/fbo/fbo-clear-formats.c
> @@ -273,7 +273,7 @@ create_tex(GLenum internalformat, GLenum baseformat)
>                 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL,
> level);
>                 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL,
> level);
>
> -               if (clear_stencil) {
> +               if (clear_stencil || baseformat == GL_STENCIL_INDEX) {
>                         if (!do_stencil_clear(format, tex, level, dim)) {
>                                 glDeleteTextures(1, &tex);
>                                 return 0;
> @@ -522,7 +522,10 @@ test_format(const struct format_desc *format)
>
>         printf("Testing %s", format->name);
>
> -       if (clear_stencil && format->base_internal_format !=
> GL_DEPTH_STENCIL) {
> +       if (format->base_internal_format == GL_STENCIL_INDEX)
> +               clear_stencil = true;
> +
> +       if (clear_stencil && format->base_internal_format !=
> GL_DEPTH_STENCIL && format->base_internal_format != GL_STENCIL_INDEX) {
>
Break the condition in to two lines.

>                 printf(" - no stencil.\n");
>                 return PIGLIT_SKIP;
>         }
> diff --git a/tests/fbo/fbo-colormask-formats.c
> b/tests/fbo/fbo-colormask-formats.c
> index 71e6bff..4227ed0 100644
> --- a/tests/fbo/fbo-colormask-formats.c
> +++ b/tests/fbo/fbo-colormask-formats.c
> @@ -59,7 +59,8 @@ static enum piglit_result test_format(const struct
> format_desc *format)
>         float defaults[] = {-1, -1, -1, -1};
>
>         if (format->base_internal_format == GL_DEPTH_COMPONENT ||
> -           format->base_internal_format == GL_DEPTH_STENCIL)
> +           format->base_internal_format == GL_DEPTH_STENCIL ||
> +           format->base_internal_format == GL_STENCIL_INDEX)
>                 return PIGLIT_SKIP;
>
>         glGenFramebuffersEXT(1, &fb);
> diff --git a/tests/fbo/fbo-formats.h b/tests/fbo/fbo-formats.h
> index 2d44105..655d149 100644
> --- a/tests/fbo/fbo-formats.h
> +++ b/tests/fbo/fbo-formats.h
> @@ -310,6 +310,10 @@ static const struct format_desc
> arb_es2_compatibility[] = {
>         FORMAT(GL_RGB565, GL_RGB)
>  };
>
> +static const struct format_desc arb_texture_stencil8[] = {
> +       FORMAT(GL_STENCIL_INDEX8, GL_STENCIL_INDEX)
> +};
> +
>  struct test_desc {
>         const struct format_desc *format;
>         unsigned num_formats;
> @@ -499,6 +503,13 @@ static const struct test_desc test_sets[] = {
>                 GL_FLOAT,
>                 {"GL_ARB_texture_compression_bptc"}
>         },
> +       {
> +               arb_texture_stencil8,
> +               ARRAY_SIZE(arb_texture_stencil8),
> +               "GL_ARB_texture_stencil8",
> +               GL_UNSIGNED_BYTE,
> +               {"GL_ARB_texture_stencil8"}
> +       },
>  };
>
>  static GLboolean
> diff --git a/tests/fbo/fbo-generatemipmap-formats.c
> b/tests/fbo/fbo-generatemipmap-formats.c
> index f054453..f5dd0b3 100644
> --- a/tests/fbo/fbo-generatemipmap-formats.c
> +++ b/tests/fbo/fbo-generatemipmap-formats.c
> @@ -488,7 +488,7 @@ piglit_display(void)
>                         /* Skip testing textures with depth-stencil
> internal
>                          * formats as they are not allowed in
> glGenerateMipmap.
>                          */
> -                       if (format.base_internal_format ==
> GL_DEPTH_STENCIL)
> +                       if (format.base_internal_format ==
> GL_DEPTH_STENCIL || format.base_internal_format == GL_STENCIL_INDEX)
>
Same here.

>                                 continue;
>
>                         pass = test_format(&format,
> @@ -498,7 +498,7 @@ piglit_display(void)
>                         set_npot(GL_TRUE);
>                         for (i = 0; i < test_sets[test_index].num_formats;
> i++) {
>                                 format = test_sets[test_index].format[i];
> -                               if (format.base_internal_format ==
> GL_DEPTH_STENCIL)
> +                               if (format.base_internal_format ==
> GL_DEPTH_STENCIL || format.base_internal_format == GL_STENCIL_INDEX)
>
and here.

>                                         continue;
>
>                                 pass = test_format(&format,
> @@ -508,7 +508,7 @@ piglit_display(void)
>                 }
>         } else {
>                 format = test_sets[test_index].format[format_index];
> -               if (format.base_internal_format != GL_DEPTH_STENCIL)
> +               if (format.base_internal_format != GL_DEPTH_STENCIL &&
> format.base_internal_format != GL_STENCIL_INDEX)
>
and here.

>                         pass = test_format(&format,
>                                            test_sets[test_index].basetype);
>         }
> diff --git a/tests/texturing/getteximage-formats.c
> b/tests/texturing/getteximage-formats.c
> index 1fbbdfd..715d5df 100644
> --- a/tests/texturing/getteximage-formats.c
> +++ b/tests/texturing/getteximage-formats.c
> @@ -455,6 +455,7 @@ supported_format_set(const struct test_desc *set)
>
>         if (set->format == ext_texture_integer ||
>                  set->format == ext_packed_depth_stencil ||
> +                set->format == arb_texture_stencil8 ||
>                  set->format == arb_texture_rg_int ||
>                  set->format == arb_depth_texture ||
>                  set->format == arb_depth_buffer_float) {
> --
> 2.1.0
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


With above comments fixed, patch is:
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150410/dff4693f/attachment-0001.html>


More information about the Piglit mailing list