summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Höglund <fredrik@kde.org>2015-03-22 13:23:31 +0100
committerFredrik Höglund <fredrik@kde.org>2015-04-02 13:54:13 +0200
commitd5d70ba946c2794c1478f1b73d928aa1453d9462 (patch)
tree8a94dc487dad763c8917f337029b26864edff6b3
parent9a01bbd30c916e6ab284aaa4073365880c78685b (diff)
dsa/utils: Add check_vbo_binding()
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. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
-rw-r--r--tests/spec/arb_direct_state_access/dsa-utils.c19
-rw-r--r--tests/spec/arb_direct_state_access/dsa-utils.h8
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/spec/arb_direct_state_access/dsa-utils.c b/tests/spec/arb_direct_state_access/dsa-utils.c
index f065dbc54..aaa172720 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 707a9674c..ed3a50695 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