[Piglit] [PATCH 02/14] dsa/utils: Add check_vbo_binding()

Laura Ekstrand laura at jlekstrand.net
Wed Apr 1 12:46:23 PDT 2015


LGTM.

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 VBO binding of the given index
> matches the expected values, and false otherwise.
>
> An error message is printed if the actual parameter values don't
> match the expected values.
> ---
>  tests/spec/arb_direct_state_access/dsa-utils.c | 19 +++++++++++++++++++
>  tests/spec/arb_direct_state_access/dsa-utils.h |  8 ++++++++
>  2 files changed, 27 insertions(+)
>
> diff --git a/tests/spec/arb_direct_state_access/dsa-utils.c
> b/tests/spec/arb_direct_state_access/dsa-utils.c
> index f065dbc..aaa1727 100644
> --- a/tests/spec/arb_direct_state_access/dsa-utils.c
> +++ b/tests/spec/arb_direct_state_access/dsa-utils.c
> @@ -94,3 +94,22 @@ check_indexed_vao_param_(GLuint vao, GLuint index,
> GLuint param,
>
>         return true;
>  }
> +
> +bool
> +check_vbo_binding_(GLuint vao, GLuint bindingindex, GLuint vbo,
> +                   GLintptr offset, GLsizeiptr stride,
> +                   const char *file, int line)
> +{
> +       bool pass = true;
> +
> +       pass = check_indexed_vao_param_(vao, bindingindex,
> +               GL_VERTEX_BINDING_BUFFER, vbo, file, line) && pass;
> +
> +       pass = check_indexed_vao_param_(vao, bindingindex,
> +               GL_VERTEX_BINDING_OFFSET, offset, file, line) && pass;
> +
> +       pass = check_indexed_vao_param_(vao, bindingindex,
> +               GL_VERTEX_BINDING_STRIDE, stride, file, line) && pass;
> +
> +       return pass;
> +}
> diff --git a/tests/spec/arb_direct_state_access/dsa-utils.h
> b/tests/spec/arb_direct_state_access/dsa-utils.h
> index 707a967..ed3a506 100644
> --- a/tests/spec/arb_direct_state_access/dsa-utils.h
> +++ b/tests/spec/arb_direct_state_access/dsa-utils.h
> @@ -66,6 +66,14 @@ bool check_indexed_vao_param_(GLuint vao, GLuint index,
> GLuint param,
>         check_indexed_vao_param_(vao, index, param, expected, \
>                                  __FILE__, __LINE__)
>
> +bool check_vbo_binding_(GLuint vao, GLuint bindingindex, GLuint vbo,
> +                        GLintptr offset, GLsizeiptr stride,
> +                        const char *file, int line);
> +
> +#define check_vbo_binding(vao, bindingindex, vbo, offset, stride) \
> +       check_vbo_binding_(vao, bindingindex, vbo, offset, stride, \
> +                          __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/b1e0a70e/attachment.html>


More information about the Piglit mailing list