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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to