diff options
author | Laura Ekstrand <laura@jlekstrand.net> | 2015-01-20 14:30:59 -0800 |
---|---|---|
committer | Laura Ekstrand <laura@jlekstrand.net> | 2015-03-09 16:20:43 -0700 |
commit | 3a531046f3cfe688995b2a460a0cbda01d053089 (patch) | |
tree | b2a873fd3da30e35bf37c9ea77ec02c9e9e15cf0 | |
parent | f75f6c92f38cf3a95d30401ba3765aa4aa303886 (diff) |
arb_direct_state_access: Testing GetNamedBufferPointerv.
-rw-r--r-- | tests/spec/arb_direct_state_access/getnamedbufferparameter.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/spec/arb_direct_state_access/getnamedbufferparameter.c b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c index 82bbfe219..45fc021cb 100644 --- a/tests/spec/arb_direct_state_access/getnamedbufferparameter.c +++ b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c @@ -22,8 +22,9 @@ */ /** - * Adapted to test glGetNamedBufferParameteri[64]v by Laura Ekstrand - * <laura@jlekstrand.net>. + * Adapted to test glGetNamedBufferParameteri[64]v and + * glGetNamedBufferPointerv by Laura Ekstrand <laura@jlekstrand.net>, January + * 2015. */ #include "piglit-util-gl.h" @@ -110,6 +111,7 @@ piglit_display(void) bool pass = true; GLuint bufname; GLint64 data = -2; + void *dataptr = NULL; GLint dataint = -2; int stuff[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; @@ -167,13 +169,19 @@ piglit_display(void) /* Is it mapped? */ glGetNamedBufferParameteri64v(bufname, GL_BUFFER_MAPPED, &data); - if (data != GL_TRUE) - { + if (data != GL_TRUE) { printf("GL_BUFFER_MAPPED: expected GL_TRUE, got GL_FALSE.\n"); pass = false; } pass = piglit_check_gl_error(GL_NO_ERROR) && pass; + /* Check the pointer. */ + glGetNamedBufferPointerv(bufname, GL_BUFFER_MAP_POINTER, &dataptr); + if (!dataptr) { + printf("GL_BUFFER_MAP_POINTER: Got NULL.\n"); + pass = false; + } + pass = piglit_check_gl_error(GL_NO_ERROR) && pass; /* What is the offset? */ glGetNamedBufferParameteri64v(bufname, GL_BUFFER_MAP_OFFSET, |