[Piglit] [PATCH 4/4] stencil-twoside: use ATI syntax for StencilOpSeparate too

Marek Olšák maraeo at gmail.com
Mon Aug 16 13:21:46 PDT 2010


On Mon, Aug 16, 2010 at 2:46 PM, Luca Barbieri <luca at luca-barbieri.com>wrote:

> If OpenGL 2 is not supported, GLEW doesn't set the pointer for the
> GL2 syntax function, leading to a segfault.
> ---
>  tests/general/stencil-twoside.c |   30 ++++++++++++++++++++----------
>  1 files changed, 20 insertions(+), 10 deletions(-)
>
> diff --git a/tests/general/stencil-twoside.c
> b/tests/general/stencil-twoside.c
> index a85f338..d32dde0 100644
> --- a/tests/general/stencil-twoside.c
> +++ b/tests/general/stencil-twoside.c
> @@ -80,12 +80,14 @@ piglit_display(void)
>        if (use20syntax) {
>                glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
>                glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
> +               glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
>        }
>        else {
>                glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP,
> GL_INCR);
> +               glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
>        }
> -       glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
> -       glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
>
>        glColor3f(0.9, 0.9, 0.9);
>        for (i = 0 ; i < (max_stencil + 5) ; i++) {
> @@ -102,12 +104,14 @@ piglit_display(void)
>        if (use20syntax) {
>                glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
>                glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
> +               glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
>        }
>        else {
>                glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP,
> GL_DECR);
> +               glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
>        }
> -       glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
> -       glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
>
>        glColor3f(0.9, 0.9, 0.9);
>        for (i = 0 ; i < (max_stencil + 5) ; i++) {
> @@ -124,12 +128,14 @@ piglit_display(void)
>        if (use20syntax) {
>                glStencilFuncSeparate(GL_FRONT, GL_NEVER, 0, ~0);
>                glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
> +               glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
>        }
>        else {
>                glStencilFuncSeparateATI(GL_NEVER, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP,
> GL_DECR);
> +               glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
>        }
> -       glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
> -       glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
>
>        glColor3f(0.9, 0.9, 0.9);
>        for (i = 0 ; i < (max_stencil + 5) ; i++) {
> @@ -148,12 +154,14 @@ piglit_display(void)
>        if (use20syntax) {
>                glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
>                glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
> +               glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
>        }
>        else {
>                glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
> +               glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP,
> GL_INCR);
> +               glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
>        }
> -       glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
> -       glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
>
>        glColor3f(0.9, 0.9, 0.9);
>        for (i = 0 ; i < (max_stencil + 5) ; i++) {
> @@ -172,12 +180,14 @@ piglit_display(void)
>                if (use20syntax) {
>                        glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
>                        glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
> +                       glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP,
> GL_KEEP);
> +                       glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP,
> GL_INCR_WRAP);
>                }
>                else {
>                        glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0,
> ~0);
> +                       glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP,
> GL_KEEP);
> +                       glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP,
> GL_INCR_WRAP);
>                }
> -               glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP);
> -               glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP,
> GL_INCR_WRAP);
>
>                glColor3f(0.9, 0.9, 0.9);
>                for (i = 0 ; i < (max_stencil + 5) ; i++) {
> --
> 1.7.0.4
>

Nice catch. Pushed, thanks.

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20100816/009831ea/attachment.htm>


More information about the Piglit mailing list