[Piglit] [PATCH] gl-1.0-blend: print current blend state if probe fails

Laura Ekstrand laura at jlekstrand.net
Fri Feb 6 09:51:57 PST 2015


Looks good to me.

Reviewed-by: Laura Ekstrand <laura at jlekstrand.net>

On Thu, Feb 5, 2015 at 4:47 PM, Brian Paul <brianp at vmware.com> wrote:

> ---
>  tests/spec/gl-1.0/blend.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/gl-1.0/blend.c b/tests/spec/gl-1.0/blend.c
> index 9fe345c..065b8bb 100644
> --- a/tests/spec/gl-1.0/blend.c
> +++ b/tests/spec/gl-1.0/blend.c
> @@ -529,7 +529,7 @@ run_factor_set(GLenum src_factor_rgb, GLenum
> src_factor_a,
>                const GLfloat constant_color[4])
>  {
>         int i, j;
> -       bool pass = true;
> +       bool pass = true, p;
>
>         glDisable(GL_DITHER);
>         glClear(GL_COLOR_BUFFER_BIT);
> @@ -609,9 +609,25 @@ run_factor_set(GLenum src_factor_rgb, GLenum
> src_factor_a,
>          * computed image (``expected'') to see if any pixels are
>          * outside the expected tolerance range.
>          */
> -       pass &= piglit_probe_image_rgba(0, 0, img_width, img_height,
> +       p = piglit_probe_image_rgba(0, 0, img_width, img_height,
>                 exp_img.data);
> +       if (!p) {
> +               printf("  Blend src factors: %s, %s\n",
> +                      piglit_get_gl_enum_name(src_factor_rgb),
> +                      piglit_get_gl_enum_name(src_factor_a));
> +               printf("  Blend dst factors: %s, %s\n",
> +                      piglit_get_gl_enum_name(dst_factor_rgb),
> +                      piglit_get_gl_enum_name(dst_factor_a));
> +               printf("  Blend ops: %s, %s\n",
> +                      piglit_get_gl_enum_name(op_rgb),
> +                      piglit_get_gl_enum_name(op_a));
> +               printf("  Blend color: %.3f, %.3f, %.3f, %.3f\n",
> +                      constant_color[0], constant_color[1],
> +                      constant_color[2], constant_color[3]);
> +               fflush(stdout);
> +       }
>
> +       pass &= p;
>
>         return pass;
>  } /* run_factor_set */
> --
> 1.9.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150206/fa21be7f/attachment-0001.html>


More information about the Piglit mailing list