[Piglit] [PATCH 01/14] dsa/utils: Add check_indexed_vao_param()

Laura Ekstrand laura at jlekstrand.net
Wed Apr 1 12:37:57 PDT 2015


LGTM, FWIW (I'm really tired today).


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

On Tue, Mar 31, 2015 at 10:26 AM, Fredrik Höglund <fredrik at kde.org> wrote:

> This function returns true if the given parameter matches the expected
> value, and false otherwise.
>
> An error message is printed if the parameter value doesn't match the
> expected value.
> ---
>  tests/spec/arb_direct_state_access/dsa-utils.c | 17 +++++++++++++++++
>  tests/spec/arb_direct_state_access/dsa-utils.h |  7 +++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/tests/spec/arb_direct_state_access/dsa-utils.c
> b/tests/spec/arb_direct_state_access/dsa-utils.c
> index ec7bb24..f065dbc 100644
> --- a/tests/spec/arb_direct_state_access/dsa-utils.c
> +++ b/tests/spec/arb_direct_state_access/dsa-utils.c
> @@ -77,3 +77,20 @@ dsa_texture_with_unit(GLuint unit)
>  {
>         glUniform1i(dsa_uniform, unit);
>  }
> +
> +bool
> +check_indexed_vao_param_(GLuint vao, GLuint index, GLuint param,
> +                         GLuint expected, const char *file, int line)
> +{
> +       GLuint value;
> +       glGetVertexArrayIndexediv(vao, index, param, (GLint *) &value);
> +
> +       if (value != expected) {
> +               fprintf(stderr, "%s[%u] was %u, expected %u (%s:%d)\n",
> +                       piglit_get_gl_enum_name(param),
> +                       index, value, expected, file, line);
> +               return false;
> +       }
> +
> +       return true;
> +}
> diff --git a/tests/spec/arb_direct_state_access/dsa-utils.h
> b/tests/spec/arb_direct_state_access/dsa-utils.h
> index 7bcf004..707a967 100644
> --- a/tests/spec/arb_direct_state_access/dsa-utils.h
> +++ b/tests/spec/arb_direct_state_access/dsa-utils.h
> @@ -59,6 +59,13 @@ void dsa_init_program(void);
>
>  void dsa_texture_with_unit(GLuint);
>
> +bool check_indexed_vao_param_(GLuint vao, GLuint index, GLuint param,
> +                              GLuint expected, const char *file, int
> line);
> +
> +#define check_indexed_vao_param(vao, index, param, expected) \
> +       check_indexed_vao_param_(vao, index, param, expected, \
> +                                __FILE__, __LINE__)
> +
>  #ifdef __cplusplus
>  } /* end extern "C" */
>  #endif
> --
> 2.1.4
>
> _______________________________________________
> 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/20150401/3322189d/attachment.html>


More information about the Piglit mailing list