[Piglit] =?y?q?=5BPATCH=5D=20ext=5Ftransform=5Ffeedback-negative-no-program=3A=20New=20test=20to=20verify=20that=20begining=20transform=20feedback=20without=20glsl=20shader=20active=20causes=20an=20error?=

Shuang He shuang.he at intel.com
Fri Jan 6 19:58:51 PST 2012


Signed-off-by: Shuang He <shuang.he at intel.com>
---
 tests/all.tests                                    |    1 +
 .../spec/ext_transform_feedback/CMakeLists.gl.txt  |    1 +
 .../ext_transform_feedback/negative-no-shader.c    |   64 ++++++++++++++++++++
 3 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/ext_transform_feedback/negative-no-shader.c

diff --git a/tests/all.tests b/tests/all.tests
index 4e1c82f..6bd3242 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1398,6 +1398,7 @@ ext_transform_feedback['discard-clear'] = concurrent_test('ext_transform_feedbac
 ext_transform_feedback['discard-copypixels'] = concurrent_test('ext_transform_feedback-discard-copypixels')
 ext_transform_feedback['discard-drawarrays'] = concurrent_test('ext_transform_feedback-discard-drawarrays')
 ext_transform_feedback['discard-drawpixels'] = concurrent_test('ext_transform_feedback-discard-drawpixels')
+ext_transform_feedback['negative-no-shader'] = concurrent_test('ext_transform_feedback-negative-no-shader')
 ext_transform_feedback['position-readback-bufferbase'] = 		PlainExecTest(['ext_transform_feedback-position', '-auto'])
 ext_transform_feedback['position-readback-bufferbase-discard'] = 	PlainExecTest(['ext_transform_feedback-position', '-auto', 'discard'])
 ext_transform_feedback['position-readback-bufferoffset'] = 		PlainExecTest(['ext_transform_feedback-position', '-auto', 'offset'])
diff --git a/tests/spec/ext_transform_feedback/CMakeLists.gl.txt b/tests/spec/ext_transform_feedback/CMakeLists.gl.txt
index 2e337ec..220b4ad 100644
--- a/tests/spec/ext_transform_feedback/CMakeLists.gl.txt
+++ b/tests/spec/ext_transform_feedback/CMakeLists.gl.txt
@@ -25,5 +25,6 @@ add_executable (ext_transform_feedback-separate separate.c)
 add_executable (ext_transform_feedback-output-type output-type.c)
 add_executable (ext_transform_feedback-order order.c)
 add_executable (ext_transform_feedback-tessellation tessellation.c)
+add_executable (ext_transform_feedback-negative-no-shader negative-no-shader.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/ext_transform_feedback/negative-no-shader.c b/tests/spec/ext_transform_feedback/negative-no-shader.c
new file mode 100644
index 0000000..cd8a398
--- /dev/null
+++ b/tests/spec/ext_transform_feedback/negative-no-shader.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "piglit-util.h"
+
+/**
+ * @file negative-no-shader.c
+ *
+ * Tests verify that begining transform feedback without glsl shader active causes an error.
+ *
+ * From the EXT_transform_feedback spec:
+ *
+ *     "The error INVALID_OPERATION is generated by BeginTransformFeedback
+ *      if no vertex or geometry shader is not active"
+ */
+
+int piglit_width = 32;
+int piglit_height = 32;
+int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB | GLUT_ALPHA;
+
+enum piglit_result
+piglit_display(void)
+{
+	/* UNREACHED */
+	return PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+	GLuint buffer;
+
+	piglit_require_transform_feedback();
+
+	glGenBuffers(1, &buffer);
+	glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buffer);
+	glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 1024, NULL, GL_STREAM_COPY);
+	glBindBufferBaseEXT(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buffer);
+
+	glBeginTransformFeedbackEXT(GL_POINTS);
+
+	piglit_check_gl_error(GL_INVALID_OPERATION, PIGLIT_FAIL);
+	piglit_report_result(PIGLIT_PASS);
+}
-- 
1.7.3.2.432.gad1a9.dirty



More information about the Piglit mailing list