<div dir="ltr">On 21 August 2013 09:07, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
NVIDIA (304.64 on GTX 260) passes this test.  AMD has not been tested.<br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
Cc: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
 tests/all.tests                                    |  1 +<br>
 .../spec/arb_transform_feedback2/CMakeLists.gl.txt |  1 +<br>
 .../spec/arb_transform_feedback2/gen-names-only.c  | 74 ++++++++++++++++++++++<br>
 3 files changed, 76 insertions(+)<br>
 create mode 100644 tests/spec/arb_transform_feedback2/gen-names-only.c<br>
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index 2777d17..0e942c5 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -2179,6 +2179,7 @@ arb_transform_feedback2 = Group()<br>
 spec['ARB_transform_feedback2'] = arb_transform_feedback2<br>
 arb_transform_feedback2['draw-auto'] = PlainExecTest(['arb_transform_feedback2-draw-auto', '-auto'])<br>
 arb_transform_feedback2['istranformfeedback'] = PlainExecTest(['arb_transform_feedback2-istransformfeedback', '-auto'])<br>
+arb_transform_feedback2['glGenTransformFeedbacks names only'] = concurrent_test('arb_transform_feedback2-gen-names-only')<br>
<br>
 arb_transform_feedback_instanced = Group()<br>
 spec['ARB_transform_feedback_instanced'] = arb_transform_feedback_instanced<br>
diff --git a/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt b/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt<br>
index c31b912..e230e1a 100644<br>
--- a/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt<br>
+++ b/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt<br>
@@ -10,6 +10,7 @@ link_libraries (<br>
 )<br>
<br>
 piglit_add_executable (arb_transform_feedback2-draw-auto draw-auto.c)<br>
+piglit_add_executable (arb_transform_feedback2-gen-names-only gen-names-only.c)<br>
 piglit_add_executable (arb_transform_feedback2-istransformfeedback istransformfeedback.c)<br>
<br>
 # vim: ft=cmake:<br>
diff --git a/tests/spec/arb_transform_feedback2/gen-names-only.c b/tests/spec/arb_transform_feedback2/gen-names-only.c<br>
new file mode 100644<br>
index 0000000..e3d84ad<br>
--- /dev/null<br>
+++ b/tests/spec/arb_transform_feedback2/gen-names-only.c<br>
@@ -0,0 +1,74 @@<br>
+/*<br>
+ * Copyright © 2012 Intel Corporation<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice (including the next<br>
+ * paragraph) shall be included in all copies or substantial portions of the<br>
+ * Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
+ * IN THE SOFTWARE.<br>
+ */<br>
+<br>
+/**<br>
+ * \file gen-names-only.c<br>
+ *<br>
+ * The ARB_transform_feedback2 spec says:<br>
+ *<br>
+ *     "BindTransformFeedback fails and an INVALID_OPERATION error is<br>
+ *     generated if <id> is not zero or a name returned from a previous<br>
+ *     call to GenTransformFeedbacks, or if such a name has since been<br>
+ *     deleted with DeleteTransformFeedbacks."<br>
+ */<br>
+<br>
+#include "piglit-util-gl-common.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
+       config.supports_gl_compat_version = 10;<br>
+       config.window_visual = PIGLIT_GL_VISUAL_RGB;<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       return PIGLIT_FAIL;<br>
+}<br>
+<br>
+void piglit_init(int argc, char **argv)<br>
+{<br>
+       GLuint id;<br>
+       bool pass = true;<br>
+<br>
+       piglit_require_transform_feedback();<br>
+       piglit_require_extension("GL_ARB_transform_feedback2");<br>
+<br>
+       glGenTransformFeedbacks(1, &id);<br>
+<br>
+       glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);<br>
+       pass = piglit_check_gl_error(0) && pass;<br>
+<br>
+       glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 47);<br>
+       pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;<br></blockquote><div><br></div><div>Nit pick: if glGenTransformFeedbacks happened to generate an id of 47, this test will fail.  How about instead doing this:<br>
<br></div><div>glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, id + 1);<br><br></div><div>(since id + 1 is guaranteed to be an invalid name).<br><br></div><div>Either way, the patch is:<br><br></div><div>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> <br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+       glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, id);<br>
+       pass = piglit_check_gl_error(0) && pass;<br>
+<br>
+       glDeleteTransformFeedbacks(1, &id);<br>
+       glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, id);<br>
+       pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;<br>
+<br>
+       piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);<br>
+}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>