[Piglit] [PATCH] ARB_copy_buffer/get: Check for ARB_copy_buffer earlier in the test.

Vinson Lee vlee at freedesktop.org
Sat Feb 11 01:05:17 PST 2012


Check for ARB_copy_buffer before using COPY_READ_BUFFER token.
COPY_READ_BUFFER is a new token added by the ARB_copy_buffer
specification. See
http://www.opengl.org/registry/specs/ARB/copy_buffer.txt.

Fixes GL_INVALID_ENUM error on Mac OS X.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_copy_buffer/get.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_copy_buffer/get.c b/tests/spec/arb_copy_buffer/get.c
index 0acd89f..eefce11 100644
--- a/tests/spec/arb_copy_buffer/get.c
+++ b/tests/spec/arb_copy_buffer/get.c
@@ -47,6 +47,8 @@ piglit_init(int argc, char **argv)
 
 	memset(get_bufs, 0xd0, sizeof(get_bufs));
 
+	piglit_require_extension("GL_ARB_copy_buffer");
+
 	glGetIntegerv(GL_COPY_READ_BUFFER, &get_bufs[0]);
 	glGetIntegerv(GL_COPY_WRITE_BUFFER, &get_bufs[1]);
 
@@ -57,8 +59,6 @@ piglit_init(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_require_extension("GL_ARB_copy_buffer");
-
 	glGenBuffers(2, bufs);
 	glBindBuffer(GL_COPY_READ_BUFFER, bufs[0]);
 	glBufferData(GL_COPY_READ_BUFFER, sizeof(data), data, GL_DYNAMIC_DRAW);
-- 
1.7.8.3



More information about the Piglit mailing list