On 21 August 2013 09:07, Ian Romanick <[email protected]> wrote: > From: Ian Romanick <[email protected]> > > NVIDIA (304.64 on GTX 260) passes this test. AMD has not been tested. > > Signed-off-by: Ian Romanick <[email protected]> > Cc: Kenneth Graunke <[email protected]> > --- > tests/all.tests | 1 + > .../spec/arb_transform_feedback2/CMakeLists.gl.txt | 1 + > .../spec/arb_transform_feedback2/gen-names-only.c | 74 > ++++++++++++++++++++++ > 3 files changed, 76 insertions(+) > create mode 100644 tests/spec/arb_transform_feedback2/gen-names-only.c > > diff --git a/tests/all.tests b/tests/all.tests > index 2777d17..0e942c5 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -2179,6 +2179,7 @@ arb_transform_feedback2 = Group() > spec['ARB_transform_feedback2'] = arb_transform_feedback2 > arb_transform_feedback2['draw-auto'] = > PlainExecTest(['arb_transform_feedback2-draw-auto', '-auto']) > arb_transform_feedback2['istranformfeedback'] = > PlainExecTest(['arb_transform_feedback2-istransformfeedback', '-auto']) > +arb_transform_feedback2['glGenTransformFeedbacks names only'] = > concurrent_test('arb_transform_feedback2-gen-names-only') > > arb_transform_feedback_instanced = Group() > spec['ARB_transform_feedback_instanced'] = > arb_transform_feedback_instanced > diff --git a/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt > b/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt > index c31b912..e230e1a 100644 > --- a/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt > +++ b/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt > @@ -10,6 +10,7 @@ link_libraries ( > ) > > piglit_add_executable (arb_transform_feedback2-draw-auto draw-auto.c) > +piglit_add_executable (arb_transform_feedback2-gen-names-only > gen-names-only.c) > piglit_add_executable (arb_transform_feedback2-istransformfeedback > istransformfeedback.c) > > # vim: ft=cmake: > diff --git a/tests/spec/arb_transform_feedback2/gen-names-only.c > b/tests/spec/arb_transform_feedback2/gen-names-only.c > new file mode 100644 > index 0000000..e3d84ad > --- /dev/null > +++ b/tests/spec/arb_transform_feedback2/gen-names-only.c > @@ -0,0 +1,74 @@ > +/* > + * Copyright © 2012 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. > + */ > + > +/** > + * \file gen-names-only.c > + * > + * The ARB_transform_feedback2 spec says: > + * > + * "BindTransformFeedback fails and an INVALID_OPERATION error is > + * generated if <id> is not zero or a name returned from a previous > + * call to GenTransformFeedbacks, or if such a name has since been > + * deleted with DeleteTransformFeedbacks." > + */ > + > +#include "piglit-util-gl-common.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + > + config.supports_gl_compat_version = 10; > + config.window_visual = PIGLIT_GL_VISUAL_RGB; > + > +PIGLIT_GL_TEST_CONFIG_END > + > +enum piglit_result > +piglit_display(void) > +{ > + return PIGLIT_FAIL; > +} > + > +void piglit_init(int argc, char **argv) > +{ > + GLuint id; > + bool pass = true; > + > + piglit_require_transform_feedback(); > + piglit_require_extension("GL_ARB_transform_feedback2"); > + > + glGenTransformFeedbacks(1, &id); > + > + glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); > + pass = piglit_check_gl_error(0) && pass; > + > + glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 47); > + pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass; >
Nit pick: if glGenTransformFeedbacks happened to generate an id of 47, this test will fail. How about instead doing this: glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, id + 1); (since id + 1 is guaranteed to be an invalid name). Either way, the patch is: Reviewed-by: Paul Berry <[email protected]> > + > + glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, id); > + pass = piglit_check_gl_error(0) && pass; > + > + glDeleteTransformFeedbacks(1, &id); > + glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, id); > + pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass; > + > + piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL); > +} > -- > 1.8.1.4 > > _______________________________________________ > Piglit mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/piglit >
_______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
